r600: handle geometry dynamic input array index
authorDave Airlie <airlied@redhat.com>
Mon, 7 Dec 2015 05:38:00 +0000 (05:38 +0000)
committerDave Airlie <airlied@redhat.com>
Wed, 9 Dec 2015 05:07:53 +0000 (15:07 +1000)
This fixes:
glsl-1.50/execution/geometry/dynamic_input_array_index.shader_test
my profanity.

We need to load the AR register with the value from the index reg

Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index daf22fc1e2f4b759accca7a72ce7350ce9165768..3c65610a788a2fc4e3444275edff3e6009848221 100644 (file)
@@ -1488,8 +1488,17 @@ static int fetch_gs_input(struct r600_shader_ctx *ctx, struct tgsi_full_src_regi
                int treg[3];
                struct r600_bytecode_alu alu;
                int r, i;
-
-               /* you have got to be shitting me -
+               unsigned addr_reg;
+               addr_reg = get_address_file_reg(ctx, src->DimIndirect.Index);
+               if (src->DimIndirect.Index > 0) {
+                       r = single_alu_op2(ctx, ALU_OP1_MOV,
+                                          ctx->bc->ar_reg, 0,
+                                          addr_reg, 0,
+                                          0, 0);
+                       if (r)
+                               return r;
+               }
+               /*
                   we have to put the R0.x/y/w into Rt.x Rt+1.x Rt+2.x then index reg from Rt.
                   at least this is what fglrx seems to do. */
                for (i = 0; i < 3; i++) {