Henri Verbeet : wined3d: Reference the stream output bo in context_load_stream_output_buffers().

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:36 CST 2020


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Dec  1 20:56:05 2020 +0330

wined3d: Reference the stream output bo in context_load_stream_output_buffers().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context.c         | 15 ---------------
 dlls/wined3d/context_gl.c      | 21 ++++++++++++++++++++-
 dlls/wined3d/wined3d_private.h |  2 --
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index b52df0bd11e..2dd4780b8ad 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -455,18 +455,3 @@ void context_load_unordered_access_resources(struct wined3d_context *context,
         context->uses_uavs = 1;
     }
 }
-
-void context_load_stream_output_buffers(struct wined3d_context *context, const struct wined3d_state *state)
-{
-    unsigned int i;
-
-    for (i = 0; i < ARRAY_SIZE(state->stream_output); ++i)
-    {
-        struct wined3d_buffer *buffer;
-        if (!(buffer = state->stream_output[i].buffer))
-            continue;
-
-        wined3d_buffer_load(buffer, context, state);
-        wined3d_buffer_invalidate_location(buffer, ~WINED3D_LOCATION_BUFFER);
-    }
-}
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index d0c2f707ed0..13e4fa69ea7 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -3684,6 +3684,25 @@ static void wined3d_context_gl_bind_unordered_access_views(struct wined3d_contex
     checkGLcall("Bind unordered access views");
 }
 
+static void context_gl_load_stream_output_buffers(struct wined3d_context_gl *context_gl,
+        const struct wined3d_state *state)
+{
+    unsigned int i;
+
+    for (i = 0; i < ARRAY_SIZE(state->stream_output); ++i)
+    {
+        struct wined3d_buffer_gl *buffer_gl;
+
+        if (!state->stream_output[i].buffer)
+            continue;
+
+        buffer_gl = wined3d_buffer_gl(state->stream_output[i].buffer);
+        wined3d_buffer_load(&buffer_gl->b, &context_gl->c, state);
+        wined3d_buffer_invalidate_location(&buffer_gl->b, ~WINED3D_LOCATION_BUFFER);
+        wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
+    }
+}
+
 /* Context activation is done by the caller. */
 static BOOL context_apply_draw_state(struct wined3d_context *context,
         const struct wined3d_device *device, const struct wined3d_state *state, BOOL indexed)
@@ -3716,7 +3735,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
     context_load_shader_resources(context, state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
     context_load_unordered_access_resources(context, state->shader[WINED3D_SHADER_TYPE_PIXEL],
             state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]);
-    context_load_stream_output_buffers(context, state);
+    context_gl_load_stream_output_buffers(context_gl, state);
     /* TODO: Right now the dependency on the vertex shader is necessary
      * since wined3d_stream_info_from_declaration() depends on the reg_maps of
      * the current VS but maybe it's possible to relax the coupling in some
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 52efe685d71..f2dedf45a68 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2151,8 +2151,6 @@ void wined3d_context_cleanup(struct wined3d_context *context) DECLSPEC_HIDDEN;
 void wined3d_context_init(struct wined3d_context *context, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
 void context_load_shader_resources(struct wined3d_context *context,
         const struct wined3d_state *state, unsigned int shader_mask) DECLSPEC_HIDDEN;
-void context_load_stream_output_buffers(struct wined3d_context *context,
-        const struct wined3d_state *state) DECLSPEC_HIDDEN;
 void context_load_unordered_access_resources(struct wined3d_context *context,
         const struct wined3d_shader *shader, struct wined3d_unordered_access_view * const *views) DECLSPEC_HIDDEN;
 void context_preload_textures(struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list