Zebediah Figura : wined3d: Introduce wined3d_device_context_set_predication().

Alexandre Julliard julliard at winehq.org
Mon Mar 22 17:15:52 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Mar 18 23:16:38 2021 -0500

wined3d: Introduce wined3d_device_context_set_predication().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/device.c     | 36 ++++++++++++++++++++++--------------
 dlls/wined3d/wined3d.spec |  1 +
 include/wine/wined3d.h    |  2 ++
 3 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4c914f6adc1..5ff11f15b13 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2404,6 +2404,27 @@ HRESULT CDECL wined3d_device_context_set_depth_stencil_view(struct wined3d_devic
     return WINED3D_OK;
 }
 
+void CDECL wined3d_device_context_set_predication(struct wined3d_device_context *context,
+        struct wined3d_query *predicate, BOOL value)
+{
+    struct wined3d_state *state = context->state;
+    struct wined3d_query *prev;
+
+    TRACE("context %p, predicate %p, value %#x.\n", context, predicate, value);
+
+    prev = state->predicate;
+    if (predicate)
+    {
+        FIXME("Predicated rendering not implemented.\n");
+        wined3d_query_incref(predicate);
+    }
+    state->predicate = predicate;
+    state->predicate_value = value;
+    wined3d_device_context_emit_set_predication(context, predicate, value);
+    if (prev)
+        wined3d_query_decref(prev);
+}
+
 void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader)
 {
     TRACE("device %p, shader %p.\n", device, shader);
@@ -4386,22 +4407,9 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
 void CDECL wined3d_device_set_predication(struct wined3d_device *device,
         struct wined3d_query *predicate, BOOL value)
 {
-    struct wined3d_state *state = device->cs->c.state;
-    struct wined3d_query *prev;
-
     TRACE("device %p, predicate %p, value %#x.\n", device, predicate, value);
 
-    prev = state->predicate;
-    if (predicate)
-    {
-        FIXME("Predicated rendering not implemented.\n");
-        wined3d_query_incref(predicate);
-    }
-    state->predicate = predicate;
-    state->predicate_value = value;
-    wined3d_device_context_emit_set_predication(&device->cs->c, predicate, value);
-    if (prev)
-        wined3d_query_decref(prev);
+    wined3d_device_context_set_predication(&device->cs->c, predicate, value);
 }
 
 struct wined3d_query * CDECL wined3d_device_get_predication(struct wined3d_device *device, BOOL *value)
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index ae4244bcbfd..762cbd97f7c 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -170,6 +170,7 @@
 @ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr)
 @ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long)
 @ cdecl wined3d_device_context_set_depth_stencil_view(ptr ptr)
+@ cdecl wined3d_device_context_set_predication(ptr ptr long)
 @ cdecl wined3d_device_context_set_rasterizer_state(ptr ptr)
 @ cdecl wined3d_device_context_set_rendertarget_view(ptr long ptr long)
 @ cdecl wined3d_device_context_set_sampler(ptr long long ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 60625eda5c5..82cce3d0251 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2563,6 +2563,8 @@ void __cdecl wined3d_device_context_set_depth_stencil_state(struct wined3d_devic
         struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref);
 HRESULT __cdecl wined3d_device_context_set_depth_stencil_view(struct wined3d_device_context *context,
         struct wined3d_rendertarget_view *view);
+void __cdecl wined3d_device_context_set_predication(struct wined3d_device_context *context,
+        struct wined3d_query *predicate, BOOL value);
 void __cdecl wined3d_device_context_set_rasterizer_state(struct wined3d_device_context *context,
         struct wined3d_rasterizer_state *rasterizer_state);
 HRESULT __cdecl wined3d_device_context_set_rendertarget_view(struct wined3d_device_context *context,




More information about the wine-cvs mailing list