From 9a1f120b818e4368554b751ee02749220dfa8e4e Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Fri, 7 Jul 2017 11:04:41 +0300
Subject: [PATCH] d3d11: Implement GSSetConstantBuffers for deferred contexts.

---
 dlls/d3d11/device.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 64480f4..87c2466 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -55,6 +55,7 @@ enum deferred_cmd
 
     DEFERRED_CSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_DSSETCONSTANTBUFFERS,      /* constant_buffers_info */
+    DEFERRED_GSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_HSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_PSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_VSSETCONSTANTBUFFERS,      /* constant_buffers_info */
@@ -309,8 +310,8 @@ static void add_deferred_set_samplers(struct d3d11_deferred_context *context, en
     }
 }
 
-/* for DEFERRED_CSSETCONSTANTBUFFERS. DEFERRED_DSSETCONSTANTBUFFERS, DEFERRED_HSSETCONSTANTBUFFERS,
- * DEFERRED_PSSETCONSTANTBUFFERS and DEFERRED_VSSETCONSTANTBUFFERS */
+/* for DEFERRED_CSSETCONSTANTBUFFERS. DEFERRED_DSSETCONSTANTBUFFERS, DEFERRED_GSSETCONSTANTBUFFERS,
+ * DEFERRED_HSSETCONSTANTBUFFERS, DEFERRED_PSSETCONSTANTBUFFERS and DEFERRED_VSSETCONSTANTBUFFERS */
 static void add_deferred_set_constant_buffers(struct d3d11_deferred_context *context, enum deferred_cmd cmd,
         UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
 {
@@ -456,6 +457,7 @@ static void free_deferred_calls(struct list *commands)
             }
             case DEFERRED_CSSETCONSTANTBUFFERS:
             case DEFERRED_DSSETCONSTANTBUFFERS:
+            case DEFERRED_GSSETCONSTANTBUFFERS:
             case DEFERRED_HSSETCONSTANTBUFFERS:
             case DEFERRED_PSSETCONSTANTBUFFERS:
             case DEFERRED_VSSETCONSTANTBUFFERS:
@@ -645,6 +647,12 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->constant_buffers_info.num_buffers, call->constant_buffers_info.buffers);
                 break;
             }
+            case DEFERRED_GSSETCONSTANTBUFFERS:
+            {
+                ID3D11DeviceContext1_GSSetConstantBuffers(iface, call->constant_buffers_info.start_slot,
+                        call->constant_buffers_info.num_buffers, call->constant_buffers_info.buffers);
+                break;
+            }
             case DEFERRED_HSSETCONSTANTBUFFERS:
             {
                 ID3D11DeviceContext1_HSSetConstantBuffers(iface, call->constant_buffers_info.start_slot,
@@ -4110,8 +4118,12 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceC
 static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface,
         UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
 {
-    FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+    struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
+
+    TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n",
             iface, start_slot, buffer_count, buffers);
+
+    add_deferred_set_constant_buffers(context, DEFERRED_GSSETCONSTANTBUFFERS, start_slot, buffer_count, buffers);
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceContext *iface,
-- 
1.9.1

