nir: Use var->data.mode instead of deref->mode in a few cases

We already have the variable so we know the mode exactly.  Just use that
instead of the deref mode.  If these paths ever have to handle variable
pointers (not likely since they're OpenGL-specific), we can fix them to
handle crazy deref modes then.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
This commit is contained in:
Jason Ekstrand
2020-10-30 12:30:09 -05:00
committed by Marge Bot
parent 5664713d7b
commit bb5d5029b7
7 changed files with 12 additions and 11 deletions

View File

@@ -634,8 +634,8 @@ nir_lower_io_block(nir_block *block,
nir_ssa_def *offset;
nir_ssa_def *vertex_index = NULL;
unsigned component_offset = var->data.location_frac;
bool bindless_type_size = mode == nir_var_shader_in ||
mode == nir_var_shader_out ||
bool bindless_type_size = var->data.mode == nir_var_shader_in ||
var->data.mode == nir_var_shader_out ||
var->data.bindless;
if (nir_deref_instr_is_known_out_of_bounds(deref)) {