diff options
author | Kenneth Graunke <[email protected]> | 2019-01-03 16:12:20 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-01-07 14:25:04 -0800 |
commit | c69f9297cfb6a1f29579fefd3b969d7ad78ec869 (patch) | |
tree | 5046b6dfcf06a95f4969be47c5a211d89ad786ad /src/compiler | |
parent | be6cee51c06dc72ac159bd75b4201c61952515bd (diff) |
nir: Fix gl_nir_lower_samplers_as_deref's structure type handling.
We recurse to remove structures, and at each step, re-modify the
resulting type for our link in the deref chain. For arrays, the
result of recursion is the new underlying type - so we wrap it with
the array dimensionality again. For structs, we want to simply use
the new underlying type, skipping the struct altogether.
The correct way to do this is to do nothing at all. Previously, we
had reset type to next->type, which is the /old/ field type, not the
new field type we obtained by recursing. This undid our recursive work.
Fixes about 338 tests with nested structs, such as:
dEQP-GLES2.functional.uniform_api.value.initial.get_uniform.nested_structs_arrays.sampler2D_samplerCube_fragment
Note that currently only radeonsi uses this pass, and NIR support is
disabled there by default, so the breakage was likely not seen by most
people. The next commit uses this pass for more drivers, so this fix
prevents regressions from that change.
Reviewed-by: Ian Romanick <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/gl_nir_lower_samplers_as_deref.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c index 9ff5708f503..0c12dea3e90 100644 --- a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c +++ b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c @@ -109,9 +109,6 @@ remove_struct_derefs_prep(nir_deref_instr **p, char **name, glsl_get_struct_elem_name(cur->type, next->strct.index)); remove_struct_derefs_prep(&p[1], name, location, type); - - /* skip over the struct type: */ - *type = next->type; break; } |