freedreno/ir3: fix constlen in case of load_uniform_indirect
authorRob Clark <robclark@freedesktop.org>
Wed, 24 Jun 2015 22:57:22 +0000 (18:57 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 30 Jun 2015 16:13:44 +0000 (12:13 -0400)
We can't rely on what we get from the assembler if we have indirect
addressing of constant file, since the assembler doesn't know the array
index.  This got lost in the transition to NIR.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c

index 48b1d8f3606a5a528c4ec3dda5c8464751b28fc7..53b8a6fb1010fbc9fc9cd3217c843ec77f018843 100644 (file)
@@ -1372,6 +1372,11 @@ emit_intrinisic(struct ir3_compile *ctx, nir_intrinsic_instr *intr)
                        dst[i] = create_uniform_indirect(ctx, n,
                                        get_addr(ctx, src[0]));
                }
+               /* NOTE: if relative addressing is used, we set constlen in
+                * the compiler (to worst-case value) since we don't know in
+                * the assembler what the max addr reg value can be:
+                */
+               ctx->so->constlen = ctx->s->num_uniforms;
                break;
        case nir_intrinsic_load_ubo:
        case nir_intrinsic_load_ubo_indirect: