From 639693de865886f27a25535eb32bf058bb29e3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Thu, 24 Jan 2019 15:09:24 +0100 Subject: [PATCH] vkd3d: Do not ignore SampleMask in D3D12_GRAPHICS_PIPELINE_STATE_DESC. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/state.c | 10 +++++++--- libs/vkd3d/vkd3d_private.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index eb7c8be3..6daeab76 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2429,9 +2429,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s rs_stream_desc_from_d3d12(&graphics->rs_stream_desc, &graphics->rs_desc, so_desc, vk_info); - if (desc->SampleMask != ~0u) - FIXME("Ignoring sample mask %#x.\n", desc->SampleMask); - graphics->ms_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; graphics->ms_desc.pNext = NULL; graphics->ms_desc.flags = 0; @@ -2439,6 +2436,13 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s graphics->ms_desc.sampleShadingEnable = VK_FALSE; graphics->ms_desc.minSampleShading = 0.0f; graphics->ms_desc.pSampleMask = NULL; + if (desc->SampleMask != ~0u) + { + assert(DIV_ROUND_UP(sample_count, 32) < ARRAY_SIZE(graphics->sample_mask)); + graphics->sample_mask[0] = desc->SampleMask; + graphics->sample_mask[1] = 0xffffffffu; + graphics->ms_desc.pSampleMask = graphics->sample_mask; + } graphics->ms_desc.alphaToCoverageEnable = desc->BlendState.AlphaToCoverageEnable; graphics->ms_desc.alphaToOneEnable = VK_FALSE; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index c4b0a4c0..6b35dc0f 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -617,6 +617,7 @@ struct d3d12_graphics_pipeline_state VkPipelineMultisampleStateCreateInfo ms_desc; VkPipelineDepthStencilStateCreateInfo ds_desc; + VkSampleMask sample_mask[2]; VkPipelineRasterizationStateStreamCreateInfoEXT rs_stream_desc; const struct d3d12_root_signature *root_signature;