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

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

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index d0e9ebb..7f835e8 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -49,6 +49,7 @@ enum deferred_cmd
 
     DEFERRED_CSSETSHADERRESOURCES,      /* res_info */
     DEFERRED_DSSETSHADERRESOURCES,      /* res_info */
+    DEFERRED_GSSETSHADERRESOURCES,      /* res_info */
     DEFERRED_PSSETSHADERRESOURCES,      /* res_info */
 
     DEFERRED_DSSETSAMPLERS,             /* samplers_info */
@@ -269,7 +270,8 @@ static struct deferred_call *add_deferred_call(struct d3d11_deferred_context *co
     return call;
 }
 
-/* for DEFERRED_CSSETSHADERRESOURCES, DEFERRED_DSSETSHADERRESOURCES and DEFERRED_PSSETSHADERRESOURCES */
+/* for DEFERRED_CSSETSHADERRESOURCES, DEFERRED_DSSETSHADERRESOURCES, DEFERRED_GSSETSHADERRESOURCES,
+ * and DEFERRED_PSSETSHADERRESOURCES */
 static void add_deferred_set_shader_resources(struct d3d11_deferred_context *context, enum deferred_cmd cmd,
         UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
 {
@@ -438,6 +440,7 @@ static void free_deferred_calls(struct list *commands)
             }
             case DEFERRED_CSSETSHADERRESOURCES:
             case DEFERRED_DSSETSHADERRESOURCES:
+            case DEFERRED_GSSETSHADERRESOURCES:
             case DEFERRED_PSSETSHADERRESOURCES:
             {
                 for (i = 0; i < call->res_info.num_views; i++)
@@ -625,6 +628,12 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                     call->res_info.num_views, call->res_info.views);
                 break;
             }
+            case DEFERRED_GSSETSHADERRESOURCES:
+            {
+                ID3D11DeviceContext1_GSSetShaderResources(iface, call->res_info.start_slot,
+                    call->res_info.num_views, call->res_info.views);
+                break;
+            }
             case DEFERRED_PSSETSHADERRESOURCES:
             {
                 ID3D11DeviceContext1_PSSetShaderResources(iface, call->res_info.start_slot,
@@ -4209,7 +4218,12 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_SetPredication(ID3D11Device
 static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface,
         UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
 {
-    FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
+    struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
+
+    TRACE("iface %p, start_slot %u, view_count %u, views %p.\n",
+            iface, start_slot, view_count, views);
+
+    add_deferred_set_shader_resources(context, DEFERRED_GSSETSHADERRESOURCES, start_slot, view_count, views);
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetSamplers(ID3D11DeviceContext *iface,
-- 
1.9.1

