Conor McCarthy : vkd3d: Handle D3D_PRIMITIVE_TOPOLOGY_UNDEFINED.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 15:11:21 CDT 2021


Module: vkd3d
Branch: master
Commit: 471b8e2206a9ee8fc57af36e181f96049282ddb8
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=471b8e2206a9ee8fc57af36e181f96049282ddb8

Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date:   Sat Sep  4 00:58:56 2021 +1000

vkd3d: Handle D3D_PRIMITIVE_TOPOLOGY_UNDEFINED.

Bundles need to set an undefined topology to match D3D12 behaviour.

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d/command.c | 6 ------
 libs/vkd3d/state.c   | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 46c0c3a..9f4a414 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -3660,12 +3660,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12Gr
 
     TRACE("iface %p, topology %#x.\n", iface, topology);
 
-    if (topology == D3D_PRIMITIVE_TOPOLOGY_UNDEFINED)
-    {
-        WARN("Ignoring D3D_PRIMITIVE_TOPOLOGY_UNDEFINED.\n");
-        return;
-    }
-
     if (list->primitive_topology == topology)
         return;
 
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index 58463e5..4eccf1e 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -2754,6 +2754,8 @@ static enum VkPrimitiveTopology vk_topology_from_d3d12_topology(D3D12_PRIMITIVE_
         case D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST:
         case D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST:
             return VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
+        case D3D_PRIMITIVE_TOPOLOGY_UNDEFINED:
+            return VK_PRIMITIVE_TOPOLOGY_MAX_ENUM;
         default:
             FIXME("Unhandled primitive topology %#x.\n", topology);
             return VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
@@ -2938,6 +2940,12 @@ VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_sta
     ia_desc.topology = vk_topology_from_d3d12_topology(topology);
     ia_desc.primitiveRestartEnable = !!graphics->index_buffer_strip_cut_value;
 
+    if (ia_desc.topology == VK_PRIMITIVE_TOPOLOGY_MAX_ENUM)
+    {
+        WARN("Primitive topology is undefined.\n");
+        return VK_NULL_HANDLE;
+    }
+
     tessellation_info.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
     tessellation_info.pNext = NULL;
     tessellation_info.flags = 0;




More information about the wine-cvs mailing list