radv/ac: add const_index to fetch index for gs inputs
authorDave Airlie <airlied@redhat.com>
Wed, 1 Feb 2017 00:43:36 +0000 (10:43 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 1 Feb 2017 22:25:04 +0000 (08:25 +1000)
This fixes clip distance fetches as they are single item loads
with a const_index like float[1].

Fixes:
dEQP-VK.clipping.user_defined.*.vert_geom.[0-6]

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 67c5c0618c6a79e7fdb1377645efc1f0fcecfe09..8075eda41006b1029270a1b81822994c6f49a236 100644 (file)
@@ -2316,7 +2316,7 @@ load_gs_input(struct nir_to_llvm_context *ctx,
                param = shader_io_get_unique_index(instr->variables[0]->var->data.location);
                args[0] = ctx->esgs_ring;
                args[1] = vtx_offset;
-               args[2] = LLVMConstInt(ctx->i32, (param * 4 + i) * 256, false);
+               args[2] = LLVMConstInt(ctx->i32, (param * 4 + i + const_index) * 256, false);
                args[3] = ctx->i32zero;
                args[4] = ctx->i32one; /* OFFEN */
                args[5] = ctx->i32zero; /* IDXEN */