zink: track min_samples state for per sample shading

Vulkan pipeline state sampleShadingEnable and minSampleShading are directly related to GL_SAMPLE_SHADING_ARB.
Track min_samples provided by st and include it in pipeline state.
This was seen as failures in cts cases where per sample shading along with sample interpolation qualifiers are tested:
dEQP-GL45-ES31.functional.shaders.multisample_interpolation.sample_qualifier.*

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18314>
This commit is contained in:
SoroushIMG
2022-08-27 01:08:46 +01:00
committed by Marge Bot
parent 55e99a22f3
commit 359713d174
4 changed files with 21 additions and 3 deletions

View File

@@ -142,6 +142,9 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
if (hw_rast_state->force_persample_interp) {
ms_state.sampleShadingEnable = VK_TRUE;
ms_state.minSampleShading = 1.0;
} else if (state->min_samples > 0) {
ms_state.sampleShadingEnable = VK_TRUE;
ms_state.minSampleShading = (float)(state->rast_samples + 1) / (state->min_samples + 1);
}
VkPipelineViewportStateCreateInfo viewport_state = {0};
@@ -457,6 +460,9 @@ zink_create_gfx_pipeline_output(struct zink_screen *screen, struct zink_gfx_pipe
if (state->force_persample_interp) {
ms_state.sampleShadingEnable = VK_TRUE;
ms_state.minSampleShading = 1.0;
} else if (state->min_samples > 0) {
ms_state.sampleShadingEnable = VK_TRUE;
ms_state.minSampleShading = (float)(state->rast_samples + 1) / (state->min_samples + 1);
}
VkDynamicState dynamicStateEnables[30] = {