nir/opt_access: don't ignore infer_non_readable

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Fixes: d7d0b4445a ("nir/opt_access: infer writeonly")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3959
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8018>
This commit is contained in:
Rhys Perry 2020-12-09 22:45:35 +00:00 committed by Marge Bot
parent fe669ff4a0
commit b548512813
1 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ process_variable(struct access_state *state, nir_variable *var)
access |= ACCESS_NON_WRITEABLE;
}
if (!(access & ACCESS_NON_READABLE)) {
if (state->infer_non_readable && !(access & ACCESS_NON_READABLE)) {
if (is_buffer ? !state->buffers_read : !state->images_read)
access |= ACCESS_NON_READABLE;
else if ((access & ACCESS_RESTRICT) && !_mesa_set_search(state->vars_read, var))
@ -230,7 +230,7 @@ update_access(struct access_state *state, nir_intrinsic_instr *instr, bool is_im
if (is_memory_readonly)
access |= ACCESS_NON_WRITEABLE;
if (is_memory_writeonly)
if (state->infer_non_readable && is_memory_writeonly)
access |= ACCESS_NON_READABLE;
if (!(access & ACCESS_VOLATILE) && is_memory_readonly)
access |= ACCESS_CAN_REORDER;