Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- 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 a7baff857d0..ab2543e52eb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2117,8 +2117,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;