From 207460a669131fc04d9aec1575080b7fb1e820a9 Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Fri, 7 Jul 2017 11:15:31 +0300
Subject: [PATCH] d3d11: Implement CSSetSamplers 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 dfafdcd..7e5f191 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -54,6 +54,7 @@ enum deferred_cmd
     DEFERRED_PSSETSHADERRESOURCES,      /* res_info */
     DEFERRED_VSSETSHADERRESOURCES,      /* res_info */
 
+    DEFERRED_CSSETSAMPLERS,             /* samplers_info */
     DEFERRED_DSSETSAMPLERS,             /* samplers_info */
     DEFERRED_PSSETSAMPLERS,             /* samplers_info */
 
@@ -294,7 +295,7 @@ static void add_deferred_set_shader_resources(struct d3d11_deferred_context *con
     }
 }
 
-/* for DEFERRED_DSSETSAMPLERS and DEFERRED_PSSETSAMPLERS */
+/* for DEFERRED_CSSETSAMPLERS, DEFERRED_DSSETSAMPLERS and DEFERRED_PSSETSAMPLERS */
 static void add_deferred_set_samplers(struct d3d11_deferred_context *context, enum deferred_cmd cmd,
         UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
 {
@@ -454,6 +455,7 @@ static void free_deferred_calls(struct list *commands)
                 }
                 break;
             }
+            case DEFERRED_CSSETSAMPLERS:
             case DEFERRED_DSSETSAMPLERS:
             case DEFERRED_PSSETSAMPLERS:
             {
@@ -656,6 +658,12 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->res_info.num_views, call->res_info.views);
                 break;
             }
+            case DEFERRED_CSSETSAMPLERS:
+            {
+                ID3D11DeviceContext1_CSSetSamplers(iface, call->samplers_info.start_slot,
+                        call->samplers_info.num_samplers, call->samplers_info.samplers);
+                break;
+            }
             case DEFERRED_DSSETSAMPLERS:
             {
                 ID3D11DeviceContext1_DSSetSamplers(iface, call->samplers_info.start_slot,
@@ -4700,8 +4708,12 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetShader(ID3D11DeviceCon
 static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetSamplers(ID3D11DeviceContext *iface,
         UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
 {
-    FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+    struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
+
+    TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
             iface, start_slot, sampler_count, samplers);
+
+    add_deferred_set_samplers(context, DEFERRED_CSSETSAMPLERS, start_slot, sampler_count, samplers);
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetConstantBuffers(ID3D11DeviceContext *iface,
-- 
1.9.1

