[Mesa-dev] [PATCH 20/25] radv/ac: add clip support for tess eval shader.

Dave Airlie airlied at gmail.com
Thu Mar 30 08:01:10 UTC 2017


From: Dave Airlie <airlied at redhat.com>

As this may be the last shader to emit clip distances.

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

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 8f7273e..7340475 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4320,6 +4320,7 @@ handle_shader_output_decl(struct nir_to_llvm_context *ctx,
 
 	mask_attribs = ((1ull << attrib_count) - 1) << idx;
 	if (ctx->stage == MESA_SHADER_VERTEX ||
+	    ctx->stage == MESA_SHADER_TESS_EVAL ||
 	    ctx->stage == MESA_SHADER_GEOMETRY) {
 		if (idx == VARYING_SLOT_CLIP_DIST0) {
 			int length = ctx->num_output_clips + ctx->num_output_culls;
@@ -4327,6 +4328,10 @@ handle_shader_output_decl(struct nir_to_llvm_context *ctx,
 				ctx->shader_info->vs.outinfo.clip_dist_mask = (1 << ctx->num_output_clips) - 1;
 				ctx->shader_info->vs.outinfo.cull_dist_mask = (1 << ctx->num_output_culls) - 1;
 			}
+			if (ctx->stage == MESA_SHADER_TESS_EVAL) {
+				ctx->shader_info->tes.outinfo.clip_dist_mask = (1 << ctx->num_output_clips) - 1;
+				ctx->shader_info->tes.outinfo.cull_dist_mask = (1 << ctx->num_output_culls) - 1;
+			}
 
 			if (length > 4)
 				attrib_count = 2;
-- 
2.9.3



More information about the mesa-dev mailing list