[PATCH 5/5] wined3d: Set the correct patch vertex count for the Vulkan adapter.

Henri Verbeet hverbeet at codeweavers.com
Wed May 20 08:42:32 CDT 2020


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/context_vk.c      | 13 +++++++++++++
 dlls/wined3d/wined3d_private.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 8ab0f6366ca..97d05f1dc88 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -1427,6 +1427,9 @@ static int wined3d_graphics_pipeline_vk_compare(const void *key, const struct wi
     if (a->ia_desc.primitiveRestartEnable != b->ia_desc.primitiveRestartEnable)
         return a->ia_desc.primitiveRestartEnable - b->ia_desc.primitiveRestartEnable;
 
+    if (a->ts_desc.patchControlPoints != b->ts_desc.patchControlPoints)
+        return a->ts_desc.patchControlPoints - b->ts_desc.patchControlPoints;
+
     if ((ret = memcmp(&a->viewport, &b->viewport, sizeof(a->viewport))))
         return ret;
 
@@ -1496,6 +1499,8 @@ static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context
 
     key->ia_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
 
+    key->ts_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
+
     key->vp_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
     key->vp_desc.viewportCount = 1;
     key->vp_desc.pViewports = &key->viewport;
@@ -1526,6 +1531,7 @@ static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context
     key->pipeline_desc.pStages = key->stages;
     key->pipeline_desc.pVertexInputState = &key->input_desc;
     key->pipeline_desc.pInputAssemblyState = &key->ia_desc;
+    key->pipeline_desc.pTessellationState = &key->ts_desc;
     key->pipeline_desc.pViewportState = &key->vp_desc;
     key->pipeline_desc.pRasterizationState = &key->rs_desc;
     key->pipeline_desc.pMultisampleState = &key->ms_desc;
@@ -1751,6 +1757,13 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
         update = true;
     }
 
+    if (key->ts_desc.patchControlPoints != state->patch_vertex_count)
+    {
+        key->ts_desc.patchControlPoints = state->patch_vertex_count;
+
+        update = true;
+    }
+
     if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_VIEWPORT)
             || wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SCISSORRECT)
             || wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_RASTERIZER))
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3450633b618..ab5df330e76 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2331,6 +2331,7 @@ struct wined3d_graphics_pipeline_key_vk
 
     VkPipelineVertexInputStateCreateInfo input_desc;
     VkPipelineInputAssemblyStateCreateInfo ia_desc;
+    VkPipelineTessellationStateCreateInfo ts_desc;
     VkPipelineViewportStateCreateInfo vp_desc;
     VkPipelineRasterizationStateCreateInfo rs_desc;
     VkPipelineMultisampleStateCreateInfo ms_desc;
-- 
2.20.1




More information about the wine-devel mailing list