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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Oct 23 09:57:28 CDT 2015


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Oct 23 02:38:15 2015 +0200

d3d11: Implement d3d11_immediate_context_GSSetShader().

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 b8d1340..e8f66e3 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -257,6 +257,7 @@ struct d3d_geometry_shader
 
 HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
         struct d3d_geometry_shader **shader) DECLSPEC_HIDDEN;
+struct d3d_geometry_shader *unsafe_impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface) DECLSPEC_HIDDEN;
 struct d3d_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) DECLSPEC_HIDDEN;
 
 /* ID3D11PixelShader, ID3D10PixelShader */
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 5650e1d..337b42a 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -284,8 +284,18 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetConstantBuffers(ID3D1
 static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShader(ID3D11DeviceContext *iface,
         ID3D11GeometryShader *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 d3d_geometry_shader *gs = unsafe_impl_from_ID3D11GeometryShader(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_geometry_shader(device->wined3d_device, gs ? gs->wined3d_shader : NULL);
+    wined3d_mutex_unlock();
 }
 
 static void STDMETHODCALLTYPE d3d11_immediate_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface,
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index 37ca7aa..c645b0b 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -749,6 +749,15 @@ HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_c
     return S_OK;
 }
 
+struct d3d_geometry_shader *unsafe_impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface)
+{
+    if (!iface)
+        return NULL;
+    assert(iface->lpVtbl == &d3d11_geometry_shader_vtbl);
+
+    return impl_from_ID3D11GeometryShader(iface);
+}
+
 struct d3d_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface)
 {
     if (!iface)




More information about the wine-cvs mailing list