From a6a6441c758299d8a0d17289e4bdb78980ac5f5a Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 30 Aug 2018 10:30:54 +0200 Subject: radv: adjust the cull dist mask in scan_shader_output_decl() Signed-off-by: Samuel Pitoiset Reviewed-by: Dave Airlie --- src/amd/vulkan/radv_nir_to_llvm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index 0c7b238e108..069fb53b688 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -2248,10 +2248,12 @@ scan_shader_output_decl(struct radv_shader_context *ctx, if (stage == MESA_SHADER_VERTEX) { ctx->shader_info->vs.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1; ctx->shader_info->vs.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1; + ctx->shader_info->vs.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size; } if (stage == MESA_SHADER_TESS_EVAL) { ctx->shader_info->tes.outinfo.clip_dist_mask = (1 << shader->info.clip_distance_array_size) - 1; ctx->shader_info->tes.outinfo.cull_dist_mask = (1 << shader->info.cull_distance_array_size) - 1; + ctx->shader_info->tes.outinfo.cull_dist_mask <<= shader->info.clip_distance_array_size; } if (length > 4) @@ -2496,9 +2498,6 @@ handle_vs_outputs_post(struct radv_shader_context *ctx, length = util_last_bit(output_usage_mask); - if (outinfo->cull_dist_mask) - outinfo->cull_dist_mask <<= ctx->num_output_clips; - i = VARYING_SLOT_CLIP_DIST0; for (j = 0; j < length; j++) slots[j] = ac_to_float(&ctx->ac, radv_load_output(ctx, i, j)); -- cgit v1.2.3