diff options
author | Samuel Pitoiset <[email protected]> | 2018-08-29 22:13:52 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-08-31 17:34:36 +0200 |
commit | 6f47df312943b05653efc0494551ebf8c3903d43 (patch) | |
tree | 71c4194090d4b74b54d4c2002bb6e233f4e0f9d9 /src/amd/vulkan/radv_pipeline.c | |
parent | 54a9622dd5fdee7d18c05d968c97c4dd4fa9c83c (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_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index e63c481d1e7..13477231a4f 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3052,6 +3052,23 @@ radv_pipeline_generate_ps_inputs(struct radeon_cmdbuf *cs, ps_offset++; } + if (ps->info.info.ps.num_input_clips_culls) { + unsigned vs_offset; + + vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST0]; + if (vs_offset != AC_EXP_PARAM_UNDEFINED) { + ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true); + ++ps_offset; + } + + vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST1]; + if (vs_offset != AC_EXP_PARAM_UNDEFINED && + ps->info.info.ps.num_input_clips_culls > 4) { + ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true); + ++ps_offset; + } + } + for (unsigned i = 0; i < 32 && (1u << i) <= ps->info.fs.input_mask; ++i) { unsigned vs_offset; bool flat_shade; |