Commit 56f1ce6b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 587174be
......@@ -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);
}
}
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment