=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Implement d3d11_immediate_context_CSSetShader().

Alexandre Julliard julliard at winehq.org
Wed Jan 25 13:18:52 CST 2017


Module: wine
Branch: master
Commit: bffc232d736b5574f54b63e050f241a41ce9c920
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bffc232d736b5574f54b63e050f241a41ce9c920

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Jan 25 11:17:59 2017 +0100

d3d11: Implement d3d11_immediate_context_CSSetShader().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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)




More information about the wine-cvs mailing list