radv: adjust the cull dist mask in scan_shader_output_decl()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 30 Aug 2018 08:30:54 +0000 (10:30 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 31 Aug 2018 15:34:41 +0000 (17:34 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_nir_to_llvm.c

index 0c7b238e108470bd24d0a7a7051af5d0ab8a1671..069fb53b6888ed4ed46dd0f315ac0ccca173a34b 100644 (file)
@@ -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));