From 9fd40c39a1e0aa31779433c7e9d36aeade1ed91b Mon Sep 17 00:00:00 2001
From: Johannes Specht <jojos_band@gmx.net>
Date: Thu, 31 Aug 2017 20:40:30 +0200
Subject: [PATCH] d3d11: Implement DrawAuto for deferred contexts.

---
 dlls/d3d11/device.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 4241b5a..57149f5 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -79,6 +79,7 @@ enum deferred_cmd
     DEFERRED_DRAW,                      /* draw_info */
     DEFERRED_DRAWINDEXED,               /* draw_indexed_info */
     DEFERRED_DRAWINDEXEDINSTANCED,      /* draw_indexed_inst_info */
+    DEFERRED_DRAWAUTO,
 
     DEFERRED_MAP,                       /* map_info */
     DEFERRED_DISPATCH,                  /* dispatch_info */
@@ -588,6 +589,10 @@ static void free_deferred_calls(struct list *commands)
             {
                 break; /* nothing to do */
             }
+            case DEFERRED_DRAWAUTO:
+            {
+                break; /* nothing to do */
+            }
             case DEFERRED_MAP:
             {
                 ID3D11Resource_Release(call->map_info.resource);
@@ -899,6 +904,11 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->draw_indexed_inst_info.base_vertex, call->draw_indexed_inst_info.start_instance);
                 break;
             }
+            case DEFERRED_DRAWAUTO:
+            {
+                ID3D11DeviceContext1_DrawAuto(iface);
+                break;
+            }
             case DEFERRED_MAP:
             {
                 D3D11_MAPPED_SUBRESOURCE mapped;
@@ -4556,7 +4566,15 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_SOSetTargets(ID3D11DeviceCo
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_DrawAuto(ID3D11DeviceContext *iface)
 {
-    FIXME("iface %p stub!\n", iface);
+    struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
+    struct deferred_call *call;
+
+    TRACE("iface %p.\n", iface);
+
+    if (!(call = add_deferred_call(context, 0)))
+        return;
+
+    call->cmd = DEFERRED_DRAWAUTO;
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexedInstancedIndirect(ID3D11DeviceContext *iface,
-- 
1.9.1

