summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_shader_info.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-08-29 22:13:52 +0200
committerSamuel Pitoiset <[email protected]>2018-08-31 17:34:36 +0200
commit6f47df312943b05653efc0494551ebf8c3903d43 (patch)
tree71c4194090d4b74b54d4c2002bb6e233f4e0f9d9 /src/amd/vulkan/radv_shader_info.c
parent54a9622dd5fdee7d18c05d968c97c4dd4fa9c83c (diff)
radv: fix passing clip/cull distances from VS to PS
CTS doesn't test input clip/cull distances for the fragment shader stage, which explains why this was totally broken. I wrote a simple test locally that works now. This fixes a crash with GTA V and DXVK. Note that we are exporting unused parameters from the vertex shader now, but this can't be optimized easily because we don't keep the fragment shader info... Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107477 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_shader_info.c')
-rw-r--r--src/amd/vulkan/radv_shader_info.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c
index 8026cca46c8..a45c847c46c 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -341,6 +341,7 @@ static void
gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
struct radv_shader_info *info)
{
+ unsigned attrib_count = glsl_count_attribute_slots(var->type, false);
const struct glsl_type *type = glsl_without_array(var->type);
int idx = var->data.location;
@@ -354,6 +355,9 @@ gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
case VARYING_SLOT_LAYER:
info->ps.layer_input = true;
break;
+ case VARYING_SLOT_CLIP_DIST0:
+ info->ps.num_input_clips_culls = attrib_count;
+ break;
default:
break;
}