[Mesa-dev] [PATCH] gallium glsl: Fix crash with piglit fs-deref-literal-array-of-structs.shader_test

Maarten Lankhorst maarten.lankhorst at canonical.com
Mon Apr 7 04:18:09 PDT 2014


op 03-04-14 18:19, Marek Olšák schreef:
> Acked-by: Marek Olšák <marek.olsak at amd.com>
>
Nacked by self btw, the alternative fix below doesn't break other testcases. The original fix did..

No idea why it is legal to move a constant struct/array here, but it appears to pass all tests...
---

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index c3e36ec..18351a8 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -632,7 +632,10 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
          		 st_src_reg src0, st_src_reg src1)
  {
     int type = GLSL_TYPE_FLOAT;
-
+
+   if (op == TGSI_OPCODE_MOV)
+       return op;
+
     assert(src0.type != GLSL_TYPE_ARRAY);
     assert(src0.type != GLSL_TYPE_STRUCT);
     assert(src1.type != GLSL_TYPE_ARRAY);



More information about the mesa-dev mailing list