From ac4e13da593e8d6fcd868e95414eb6395fb28e44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 24 Jan 2017 04:21:47 +0100
Subject: [PATCH] d3d11: Implement CSSetConstantBuffers for deferred contexts.

---
 dlls/d3d11/device.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index e54ccaf..8fee8cd 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -52,6 +52,7 @@ enum deferred_cmd
     DEFERRED_DSSETSAMPLERS,             /* samplers_info */
     DEFERRED_PSSETSAMPLERS,             /* samplers_info */
 
+    DEFERRED_CSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_DSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_HSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_PSSETCONSTANTBUFFERS,      /* constant_buffers_info */
@@ -266,7 +267,7 @@ static void add_deferred_set_samplers(struct d3d11_deferred_context *context, en
     }
 }
 
-/* for DEFERRED_DSSETCONSTANTBUFFERS, DEFERRED_HSSETCONSTANTBUFFERS,
+/* for DEFERRED_CSSETCONSTANTBUFFERS. DEFERRED_DSSETCONSTANTBUFFERS, 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)
@@ -405,6 +406,7 @@ static void free_deferred_calls(struct list *commands)
                 }
                 break;
             }
+            case DEFERRED_CSSETCONSTANTBUFFERS:
             case DEFERRED_DSSETCONSTANTBUFFERS:
             case DEFERRED_HSSETCONSTANTBUFFERS:
             case DEFERRED_PSSETCONSTANTBUFFERS:
@@ -552,6 +554,12 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->samplers_info.num_samplers, call->samplers_info.samplers);
                 break;
             }
+            case DEFERRED_CSSETCONSTANTBUFFERS:
+            {
+                ID3D11DeviceContext1_CSSetConstantBuffers(iface, call->constant_buffers_info.start_slot,
+                        call->constant_buffers_info.num_buffers, call->constant_buffers_info.buffers);
+                break;
+            }
             case DEFERRED_DSSETCONSTANTBUFFERS:
             {
                 ID3D11DeviceContext1_DSSetConstantBuffers(iface, call->constant_buffers_info.start_slot,
@@ -4451,8 +4459,12 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetSamplers(ID3D11DeviceC
 static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetConstantBuffers(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_CSSETCONSTANTBUFFERS, start_slot, buffer_count, buffers);
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_VSGetConstantBuffers(ID3D11DeviceContext *iface,
-- 
1.9.1

