From 8daf9a65f6c1a2465cfc6d74f5a49d67297562e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 10 Nov 2015 01:32:46 +0100 Subject: [PATCH] d3d11: Implement d3d11_immediate_context_SetPredication(). 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/async.c | 8 ++++++++ dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/device.c | 11 ++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index 1e96fb3516b..66640a269a8 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -163,6 +163,14 @@ static const struct ID3D11QueryVtbl d3d11_query_vtbl = d3d11_query_GetDesc, }; +struct d3d_query *unsafe_impl_from_ID3D11Query(ID3D11Query *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_query_vtbl); + return CONTAINING_RECORD(iface, struct d3d_query, ID3D11Query_iface); +} + /* ID3D10Query methods */ static inline struct d3d_query *impl_from_ID3D10Query(ID3D10Query *iface) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 474943b2178..873e17d46d1 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -372,6 +372,7 @@ struct d3d_query HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate, struct d3d_query **query) DECLSPEC_HIDDEN; +struct d3d_query *unsafe_impl_from_ID3D11Query(ID3D11Query *iface) DECLSPEC_HIDDEN; struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; /* ID3D11DeviceContext - immediate context */ diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 71408cf53f1..83215932689 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -483,7 +483,16 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetData(ID3D11DeviceCon static void STDMETHODCALLTYPE d3d11_immediate_context_SetPredication(ID3D11DeviceContext *iface, ID3D11Predicate *predicate, BOOL value) { - FIXME("iface %p, predicate %p, value %#x stub!\n", iface, predicate, value); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_query *query; + + TRACE("iface %p, predicate %p, value %#x.\n", iface, predicate, value); + + query = unsafe_impl_from_ID3D11Query((ID3D11Query *)predicate); + + wined3d_mutex_lock(); + wined3d_device_set_predication(device->wined3d_device, query ? query->wined3d_query : NULL, value); + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShaderResources(ID3D11DeviceContext *iface,