On 08/22/2017 12:54 PM, Timothy Arceri wrote:
On 22/08/17 20:34, Samuel Pitoiset wrote:
We want the type of the field, not of the struct.

This fixes a regression in the following piglit test:
arb_bindless_texture/compiler/images/arrays-of-struct.frag

This is the second time this test is broken, please run piglit
with assertions enabled next time.

Well we should probably be catching this with a test rather then relying on an assert. Anyway thanks for catching and fixing it :)

Yeah, probably something like that. :)


Please remove the above sentence before committing. In case your not aware you can use --annotate when sending and put this sort of thing under the --- below rather than the commit message.

Reviewed-by: Timothy Arceri <[email protected]>


Fixes: 49d9286a3f ("glsl: stop copying struct and interface member names")
Signed-off-by: Samuel Pitoiset <[email protected]>
---
  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9688400ed4..2f84d2c046 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3796,12 +3796,10 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type **type,
     switch (ir->ir_type) {
     case ir_type_dereference_record: {
        ir_dereference_record *deref_record = ir->as_dereference_record();
-
-      *type = deref_record->type;
-
-      const glsl_type *struct_type =
-         deref_record->record->type->without_array();
+      const glsl_type *struct_type = deref_record->record->type;
        int fild_idx = deref_record->field_idx;
+
+      *type = struct_type->fields.structure[fild_idx].type->without_array();
        *memory_coherent =
           struct_type->fields.structure[fild_idx].memory_coherent;
        *memory_volatile =

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to