[PATCH 08/11] d3d11: Implement d3d11_immediate_context_SetPredication().

Józef Kucia jkucia at codeweavers.com
Mon Nov 9 18:32:46 CST 2015


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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 1e96fb3..66640a2 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 474943b..873e17d 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 71408cf..8321593 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,
-- 
2.4.10




More information about the wine-patches mailing list