Henri Verbeet : wined3d: Implement primitive restart for the Vulkan adapter.

Alexandre Julliard julliard at winehq.org
Wed May 20 15:35:39 CDT 2020


Module: wine
Branch: master
Commit: 99f4f16b9263bb6144ea53e7a170345dc2815129
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=99f4f16b9263bb6144ea53e7a170345dc2815129

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed May 20 18:30:31 2020 +0430

wined3d: Implement primitive restart for the Vulkan adapter.

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

---

 dlls/wined3d/context_vk.c      |  2 ++
 dlls/wined3d/wined3d_private.h | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 0600cdfcec..8ab0f6366c 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -1745,6 +1745,8 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
     if (key->ia_desc.topology != vk_topology)
     {
         key->ia_desc.topology = vk_topology;
+        key->ia_desc.primitiveRestartEnable = !(d3d_info->wined3d_creation_flags & WINED3D_NO_PRIMITIVE_RESTART)
+                && !wined3d_primitive_type_is_list(state->primitive_type);
 
         update = true;
     }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9f40a33132..3450633b61 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5949,6 +5949,16 @@ static inline VkImageAspectFlags vk_aspect_mask_from_format(const struct wined3d
     return mask;
 }
 
+static inline bool wined3d_primitive_type_is_list(enum wined3d_primitive_type t)
+{
+    return t == WINED3D_PT_POINTLIST
+            || t == WINED3D_PT_LINELIST
+            || t == WINED3D_PT_TRIANGLELIST
+            || t == WINED3D_PT_LINELIST_ADJ
+            || t == WINED3D_PT_TRIANGLELIST_ADJ
+            || t == WINED3D_PT_PATCH;
+}
+
 /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
 #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
 




More information about the wine-cvs mailing list