mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-15 22:58:05 +02:00
radv: fix amount of sample shading with required sample shaded inputs
The Vulkan spec says: If a fragment shader entry point statically uses an input variable decorated with a BuiltIn of SampleId or SamplePosition, sample shading is enabled and a value of 1.0 is used instead of minSampleShading. If a fragment shader entry point statically uses an input variable decorated with Sample, sample shading may be enabled and a value of 1.0 will be used instead of minSampleShading if it is. This means we have to overwrite the command buffer state entirely. Cc: mesa-stable Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41482>
This commit is contained in:
parent
2d0e368937
commit
e7a035df65
1 changed files with 7 additions and 1 deletions
|
|
@ -1998,13 +1998,19 @@ radv_is_sample_shading_enabled(struct radv_cmd_buffer *cmd_buffer, float *min_sa
|
|||
if (min_sample_shading)
|
||||
*min_sample_shading = 1.0f;
|
||||
|
||||
/* If the PS requires sample shading for inputs,
|
||||
* min_sample_shading is overwritten to 1.0.
|
||||
*/
|
||||
if (ps && ps->info.ps.uses_sample_shading)
|
||||
return true;
|
||||
|
||||
if (cmd_buffer->state.ms.sample_shading_enable) {
|
||||
if (min_sample_shading)
|
||||
*min_sample_shading = cmd_buffer->state.ms.min_sample_shading;
|
||||
return true;
|
||||
}
|
||||
|
||||
return ps ? ps->info.ps.uses_sample_shading : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE unsigned
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue