From 595a5de39048781a82ff423c34cc4d0545045906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Thu, 20 Apr 2017 11:04:14 +0200 Subject: [PATCH] d3d11: Implement d3d11_immediate_context_HSSetShader(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 10709c4e0df..b5b26782817 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -293,6 +293,7 @@ struct d3d11_hull_shader HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, struct d3d11_hull_shader **shader) DECLSPEC_HIDDEN; +struct d3d11_hull_shader *unsafe_impl_from_ID3D11HullShader(ID3D11HullShader *iface) DECLSPEC_HIDDEN; /* ID3D11DomainShader */ struct d3d11_domain_shader diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index e6702fc5f57..6f71d4dd21d 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1135,8 +1135,18 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShader(ID3D11DeviceContext *iface, ID3D11HullShader *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_hull_shader *hs = unsafe_impl_from_ID3D11HullShader(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_hull_shader(device->wined3d_device, hs ? hs->wined3d_shader : NULL); + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetSamplers(ID3D11DeviceContext *iface, diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index 420a47dbd27..7531586e4f9 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -788,6 +788,15 @@ HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_cod return S_OK; } +struct d3d11_hull_shader *unsafe_impl_from_ID3D11HullShader(ID3D11HullShader *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_hull_shader_vtbl); + + return impl_from_ID3D11HullShader(iface); +} + /* ID3D11DomainShader methods */ static inline struct d3d11_domain_shader *impl_from_ID3D11DomainShader(ID3D11DomainShader *iface)