Mesa (master): gallium glsl: Fix crash with piglit fs-deref-literal-array-of-structs.shader_test
Maarten Lankhorst
mlankhorst at kemper.freedesktop.org
Thu Apr 17 08:35:57 UTC 2014
Module: Mesa
Branch: master
Commit: 74f19445cc5b75302ce40be48787db877680ae5e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=74f19445cc5b75302ce40be48787db877680ae5e
Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date: Thu Apr 17 10:34:10 2014 +0200
gallium glsl: Fix crash with piglit fs-deref-literal-array-of-structs.shader_test
This allows the following shader code to work without a weird crash:
struct Foo {
int value[1];
};
int actual_value = Foo[2](Foo(int[1](100)), Foo(int[1](200)))[i].value[0];
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index edd0aa7..15b5279 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-commit
mailing list