From ae628cd9b5dcb81d43dbae1c7db76844658556a8 Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Fri, 7 Jul 2017 11:23:51 +0300
Subject: [PATCH] d3d11: Implement VSSetSamplers 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 2d03464..178cd7f 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -59,6 +59,7 @@ enum deferred_cmd
     DEFERRED_GSSETSAMPLERS,             /* samplers_info */
     DEFERRED_HSSETSAMPLERS,             /* samplers_info */
     DEFERRED_PSSETSAMPLERS,             /* samplers_info */
+    DEFERRED_VSSETSAMPLERS,             /* samplers_info */
 
     DEFERRED_CSSETCONSTANTBUFFERS,      /* constant_buffers_info */
     DEFERRED_DSSETCONSTANTBUFFERS,      /* constant_buffers_info */
@@ -298,7 +299,7 @@ static void add_deferred_set_shader_resources(struct d3d11_deferred_context *con
 }
 
 /* for DEFERRED_CSSETSAMPLERS, DEFERRED_DSSETSAMPLERS, DEFERRED_GSSETSAMPLERS,
- * DEFERRED_HSSETSAMPLERS and DEFERRED_PSSETSAMPLERS */
+ * DEFERRED_HSSETSAMPLERS, DEFERRED_PSSETSAMPLERS and DEFERRED_VSSETSAMPLERS */
 static void add_deferred_set_samplers(struct d3d11_deferred_context *context, enum deferred_cmd cmd,
         UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
 {
@@ -463,6 +464,7 @@ static void free_deferred_calls(struct list *commands)
             case DEFERRED_GSSETSAMPLERS:
             case DEFERRED_HSSETSAMPLERS:
             case DEFERRED_PSSETSAMPLERS:
+            case DEFERRED_VSSETSAMPLERS:
             {
                 for (i = 0; i < call->samplers_info.num_samplers; i++)
                 {
@@ -693,6 +695,12 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->samplers_info.num_samplers, call->samplers_info.samplers);
                 break;
             }
+            case DEFERRED_VSSETSAMPLERS:
+            {
+                ID3D11DeviceContext1_VSSetSamplers(iface, call->samplers_info.start_slot,
+                        call->samplers_info.num_samplers, call->samplers_info.samplers);
+                break;
+            }
             case DEFERRED_CSSETCONSTANTBUFFERS:
             {
                 ID3D11DeviceContext1_CSSetConstantBuffers(iface, call->constant_buffers_info.start_slot,
@@ -4230,8 +4238,12 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11
 static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(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_VSSETSAMPLERS, start_slot, sampler_count, samplers);
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface,
-- 
1.9.1

