Commit 74f19445 authored by Maarten Lankhorst's avatar Maarten Lankhorst

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: default avatarMaarten Lankhorst <>
parent 49d26a27
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment