Module: Mesa Branch: main Commit: 8ff96efcfde15d5e8b83ce3b0b95a73254e98b69 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ff96efcfde15d5e8b83ce3b0b95a73254e98b69
Author: Mike Blumenkrantz <[email protected]> Date: Wed Feb 9 16:13:29 2022 -0500 zink: always set VkPipelineMultisampleStateCreateInfo::pSampleMask by initializing this on context creation, we can ensure that the correct value is always here cc: mesa-stable fixes: dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_only dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_sample_coverage dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_sample_coverage_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_only dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_sample_coverage dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_sample_coverage_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_only dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_sample_coverage dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_sample_coverage_and_alpha_to_coverage dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_only Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14974> --- src/gallium/drivers/zink/zink_context.c | 1 + src/gallium/drivers/zink/zink_pipeline.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 56ca890c395..8ba6fcbdea4 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -4092,6 +4092,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) ctx->base.set_patch_vertices = zink_set_patch_vertices; ctx->base.set_sample_mask = zink_set_sample_mask; + ctx->gfx_pipeline_state.sample_mask = UINT32_MAX; ctx->base.clear = zink_clear; ctx->base.clear_texture = zink_clear_texture; diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index b4f5d3a4383..0fceb9ebaaa 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -132,7 +132,13 @@ zink_create_gfx_pipeline(struct zink_screen *screen, warn_missing_feature("alphaToOne"); ms_state.alphaToOneEnable = state->blend_state->alpha_to_one; } - ms_state.pSampleMask = state->sample_mask ? &state->sample_mask : NULL; + /* "If pSampleMask is NULL, it is treated as if the mask has all bits set to 1." + * - Chapter 27. Rasterization + * + * thus it never makes sense to leave this as NULL since gallium will provide correct + * data here as long as sample_mask is initialized on context creation + */ + ms_state.pSampleMask = &state->sample_mask; if (hw_rast_state->force_persample_interp) { ms_state.sampleShadingEnable = VK_TRUE; ms_state.minSampleShading = 1.0;
