From f175b236655ac690ebc0e2698754fade1047d251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 6 Nov 2015 18:38:10 +0100 Subject: [PATCH] d3d11: Implement d3d11_immediate_context_PSSetSamplers(). 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 | 15 ++++++++++++++- dlls/d3d11/state.c | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 2ac6129e185..c6802491d9d 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -352,6 +352,7 @@ struct d3d_sampler_state HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device, const D3D11_SAMPLER_DESC *desc) DECLSPEC_HIDDEN; +struct d3d_sampler_state *unsafe_impl_from_ID3D11SamplerState(ID3D11SamplerState *iface) DECLSPEC_HIDDEN; struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN; /* ID3D11Query, ID3D10Query */ diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 566cd16e416..c44ec4a3f2f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -164,8 +164,21 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetSamplers(ID3D11DeviceContext *iface, UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) { - FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D11SamplerState(samplers[i]); + + wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i, + sampler ? sampler->wined3d_sampler : NULL); + } + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetShader(ID3D11DeviceContext *iface, diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index b412ed63274..3ec9b1f62f1 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -1221,6 +1221,15 @@ HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_devic return S_OK; } +struct d3d_sampler_state *unsafe_impl_from_ID3D11SamplerState(ID3D11SamplerState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_sampler_state_vtbl); + + return impl_from_ID3D11SamplerState(iface); +} + struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) { if (!iface)