[Mesa-dev] [PATCH 1/4] radv: set use_prim_id for tess shaders correctly.

Dave Airlie airlied at gmail.com
Tue Jun 20 04:38:04 UTC 2017


From: Dave Airlie <airlied at redhat.com>

Just noticed in passing.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/common/ac_nir_to_llvm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 49117d2..4d9c070 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -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:
-- 
2.9.4



More information about the mesa-dev mailing list