[PATCH 6/7] d3d11: Implement d3d11_immediate_context_CSSetShader().

Józef Kucia jkucia at codeweavers.com
Wed Jan 25 04:17:59 CST 2017


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d11/d3d11_private.h |  1 +
 dlls/d3d11/device.c        | 12 +++++++++++-
 dlls/d3d11/shader.c        |  9 +++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index 52c43d6..53be0f8 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -350,6 +350,7 @@ struct d3d11_compute_shader
 
 HRESULT d3d11_compute_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
         struct d3d11_compute_shader **shader) DECLSPEC_HIDDEN;
+struct d3d11_compute_shader *unsafe_impl_from_ID3D11ComputeShader(ID3D11ComputeShader *iface) DECLSPEC_HIDDEN;
 
 HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
 void shader_free_signature(struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 777146d..cf1bdfe 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -1205,8 +1205,18 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetUnorderedAccessViews(
 static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetShader(ID3D11DeviceContext *iface,
         ID3D11ComputeShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
 {
-    FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n",
+    struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
+    struct d3d11_compute_shader *cs = unsafe_impl_from_ID3D11ComputeShader(shader);
+
+    TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n",
             iface, shader, class_instances, class_instance_count);
+
+    if (class_instances)
+        FIXME("Dynamic linking is not implemented yet.\n");
+
+    wined3d_mutex_lock();
+    wined3d_device_set_compute_shader(device->wined3d_device, cs ? cs->wined3d_shader : NULL);
+    wined3d_mutex_unlock();
 }
 
 static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetSamplers(ID3D11DeviceContext *iface,
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index 1da1293..99af31b 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -1749,6 +1749,15 @@ HRESULT d3d11_compute_shader_create(struct d3d_device *device, const void *byte_
     return S_OK;
 }
 
+struct d3d11_compute_shader *unsafe_impl_from_ID3D11ComputeShader(ID3D11ComputeShader *iface)
+{
+    if (!iface)
+        return NULL;
+    assert(iface->lpVtbl == &d3d11_compute_shader_vtbl);
+
+    return impl_from_ID3D11ComputeShader(iface);
+}
+
 /* ID3D11ClassLinkage methods */
 
 static inline struct d3d11_class_linkage *impl_from_ID3D11ClassLinkage(ID3D11ClassLinkage *iface)
-- 
2.10.2




More information about the wine-patches mailing list