=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d: Implement D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED.

Alexandre Julliard julliard at winehq.org
Mon Dec 3 15:24:00 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Dec  3 11:31:31 2018 +0100

vkd3d: Implement D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED.

Signed-off-by: Józef Kucia <jkucia 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 | 59 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 44 insertions(+), 15 deletions(-)

diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 2e6357a..937c7e3 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -2251,6 +2251,34 @@ static bool d3d12_command_list_begin_render_pass(struct d3d12_command_list *list
     return true;
 }
 
+static void d3d12_command_list_check_index_buffer_strip_cut_value(struct d3d12_command_list *list)
+{
+    struct d3d12_graphics_pipeline_state *graphics = &list->state->u.graphics;
+
+    /* In Vulkan, the strip cut value is derived from the index buffer format. */
+    switch (graphics->index_buffer_strip_cut_value)
+    {
+        case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF:
+            if (list->index_buffer_format != DXGI_FORMAT_R16_UINT)
+            {
+                FIXME("Strip cut value 0xffff is not supported with index buffer format %#x.\n",
+                        list->index_buffer_format);
+            }
+            break;
+
+        case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF:
+            if (list->index_buffer_format != DXGI_FORMAT_R32_UINT)
+            {
+                FIXME("Strip cut value 0xffffffff is not supported with index buffer format %#x.\n",
+                        list->index_buffer_format);
+            }
+            break;
+
+        default:
+            break;
+    }
+}
+
 static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCommandList *iface,
         UINT vertex_count_per_instance, UINT instance_count, UINT start_vertex_location,
         UINT start_instance_location)
@@ -2287,27 +2315,15 @@ static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12Grap
             iface, index_count_per_instance, instance_count, start_vertex_location,
             base_vertex_location, start_instance_location);
 
-    vk_procs = &list->device->vk_procs;
-
     if (!d3d12_command_list_begin_render_pass(list))
     {
         WARN("Failed to begin render pass, ignoring draw call.\n");
         return;
     }
 
-    switch (list->state->u.graphics.index_buffer_strip_cut_value)
-    {
-        case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF:
-            if (list->index_buffer_format != DXGI_FORMAT_R16_UINT)
-                FIXME("Strip cut value 0xffff is not supported with index buffer format %#x.\n", list->index_buffer_format);
-            break;
-        case D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF:
-            if (list->index_buffer_format != DXGI_FORMAT_R32_UINT)
-                FIXME("Strip cut value 0xffffffff is not supported with index buffer format %#x.\n", list->index_buffer_format);
-            break;
-        default:
-            break;
-    }
+    vk_procs = &list->device->vk_procs;
+
+    d3d12_command_list_check_index_buffer_strip_cut_value(list);
 
     VK_CALL(vkCmdDrawIndexed(list->vk_command_buffer, index_count_per_instance,
             instance_count, start_vertex_location, base_vertex_location, start_instance_location));
@@ -4113,6 +4129,19 @@ static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsC
                         arg_buffer_offset, max_command_count, signature_desc->ByteStride));
                 break;
 
+            case D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED:
+                if (!d3d12_command_list_begin_render_pass(list))
+                {
+                    WARN("Failed to begin render pass, ignoring draw.\n");
+                    break;
+                }
+
+                d3d12_command_list_check_index_buffer_strip_cut_value(list);
+
+                VK_CALL(vkCmdDrawIndexedIndirect(list->vk_command_buffer, arg_impl->u.vk_buffer,
+                        arg_buffer_offset, max_command_count, signature_desc->ByteStride));
+                break;
+
             case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH:
                 if (max_command_count != 1)
                     FIXME("Ignoring command count %u.\n", max_command_count);




More information about the wine-cvs mailing list