radv: set use_prim_id for tess shaders correctly.
authorDave Airlie <airlied@redhat.com>
Tue, 20 Jun 2017 03:59:33 +0000 (13:59 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 25 Jun 2017 22:45:14 +0000 (08:45 +1000)
Just noticed in passing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 49117d21bd2c987a6be8d63d4b89ec6cd24d680d..4d9c070dabe94cee25923dfbef1378aba9193331 100644 (file)
@@ -3869,11 +3869,13 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx,
        case nir_intrinsic_load_primitive_id:
                if (ctx->stage == MESA_SHADER_GEOMETRY)
                        result = ctx->gs_prim_id;
-               else if (ctx->stage == MESA_SHADER_TESS_CTRL)
+               else if (ctx->stage == MESA_SHADER_TESS_CTRL) {
+                       ctx->shader_info->tcs.uses_prim_id = true;
                        result = ctx->tcs_patch_id;
-               else if (ctx->stage == MESA_SHADER_TESS_EVAL)
+               } else if (ctx->stage == MESA_SHADER_TESS_EVAL) {
+                       ctx->shader_info->tcs.uses_prim_id = true;
                        result = ctx->tes_patch_id;
-               else
+               else
                        fprintf(stderr, "Unknown primitive id intrinsic: %d", ctx->stage);
                break;
        case nir_intrinsic_load_sample_id: