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

Alexandre Julliard julliard at wine.codeweavers.com
Tue Nov 10 10:36:21 CST 2015


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Nov 10 01:32:46 2015 +0100

d3d11: Implement d3d11_immediate_context_SetPredication().

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/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,




More information about the wine-cvs mailing list