From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d/state.c | 17 ++++++++++++++++- libs/vkd3d/vkd3d_private.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 1fefb6149cff..03d8ef35ffd2 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2233,6 +2233,21 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s graphics->attribute_count = j; vkd3d_shader_free_shader_signature(&input_signature);
+ switch (desc->IBStripCutValue) + { + case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED: + graphics->primitive_restart_enable = VK_FALSE; + break; + case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF: + case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF: + graphics->primitive_restart_enable = VK_TRUE; + break; + default: + WARN("Invalid index buffer strip cut value %#x.\n", desc->IBStripCutValue); + hr = E_INVALIDARG; + goto fail; + } + sub_pass_desc.flags = 0; sub_pass_desc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; sub_pass_desc.inputAttachmentCount = 0; @@ -2491,7 +2506,7 @@ VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_sta ia_desc.pNext = NULL; ia_desc.flags = 0; ia_desc.topology = topology; - ia_desc.primitiveRestartEnable = VK_FALSE; + ia_desc.primitiveRestartEnable = graphics->primitive_restart_enable;
blend_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; blend_desc.pNext = NULL; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 2fc31da08a96..f97755925888 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -531,6 +531,7 @@ struct d3d12_graphics_pipeline_state size_t attachment_count, rt_idx; VkRenderPass render_pass;
+ VkBool32 primitive_restart_enable; struct VkPipelineRasterizationStateCreateInfo rs_desc; struct VkPipelineMultisampleStateCreateInfo ms_desc; struct VkPipelineDepthStencilStateCreateInfo ds_desc;