i965/fs: Allow array dereference of HW_REG.
authorChris Forbes <chrisf@ijw.co.nz>
Wed, 4 Jun 2014 09:06:31 +0000 (21:06 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 4 Jun 2014 18:53:43 +0000 (06:53 +1200)
When dereferencing an element of gl_SampleMaskIn[], the source register
here will be a HW_REG rather than a VGRF because the payload slot is
now exposed directly.

Fixes an assertion failure in the Piglit test:

   tests/spec/arb_gpu_shader5/execution/samplemaskin-basic

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 04b9f21b84fe56da86af83d9edeb27a51e0cef3a..0b4fbb7b00a80b0693cbc68fe4f17714910713ea 100644 (file)
@@ -189,7 +189,7 @@ fs_visitor::visit(ir_dereference_array *ir)
    src.type = brw_type_for_base_type(ir->type);
 
    if (constant_index) {
-      assert(src.file == UNIFORM || src.file == GRF);
+      assert(src.file == UNIFORM || src.file == GRF || src.file == HW_REG);
       src.reg_offset += constant_index->value.i[0] * element_size;
    } else {
       /* Variable index array dereference.  We attach the variable index