Commit d368779b authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Synchronize shader memory accesses after each draw call.

parent 0131d4e6
...@@ -3396,6 +3396,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context, ...@@ -3396,6 +3396,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
struct gl_texture *gl_texture; struct gl_texture *gl_texture;
unsigned int i; unsigned int i;
context->uses_uavs = 0;
if (!(shader = state->shader[WINED3D_SHADER_TYPE_PIXEL])) if (!(shader = state->shader[WINED3D_SHADER_TYPE_PIXEL]))
return; return;
...@@ -3416,6 +3418,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context, ...@@ -3416,6 +3418,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
continue; continue;
} }
context->uses_uavs = 1;
texture = texture_from_resource(view->resource); texture = texture_from_resource(view->resource);
wined3d_texture_load(texture, context, FALSE); wined3d_texture_load(texture, context, FALSE);
wined3d_unordered_access_view_invalidate_location(view, ~WINED3D_LOCATION_TEXTURE_RGB); wined3d_unordered_access_view_invalidate_location(view, ~WINED3D_LOCATION_TEXTURE_RGB);
......
...@@ -578,6 +578,12 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s ...@@ -578,6 +578,12 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
draw_primitive_arrays(context, state, idx_data, idx_size, base_vertex_idx, draw_primitive_arrays(context, state, idx_data, idx_size, base_vertex_idx,
start_idx, index_count, start_instance, instance_count); start_idx, index_count, start_instance, instance_count);
if (context->uses_uavs)
{
GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
checkGLcall("glMemoryBarrier");
}
if (ib_query) if (ib_query)
wined3d_event_query_issue(ib_query, device); wined3d_event_query_issue(ib_query, device);
for (i = 0; i < context->num_buffer_queries; ++i) for (i = 0; i < context->num_buffer_queries; ++i)
......
...@@ -1505,8 +1505,9 @@ struct wined3d_context ...@@ -1505,8 +1505,9 @@ struct wined3d_context
DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */ DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */
DWORD update_shader_resource_bindings : 1; DWORD update_shader_resource_bindings : 1;
DWORD update_unordered_access_view_bindings : 1; DWORD update_unordered_access_view_bindings : 1;
DWORD uses_uavs : 1;
DWORD destroy_delayed : 1; DWORD destroy_delayed : 1;
DWORD padding : 12; DWORD padding : 11;
DWORD last_swizzle_map; /* MAX_ATTRIBS, 16 */ DWORD last_swizzle_map; /* MAX_ATTRIBS, 16 */
DWORD shader_update_mask; DWORD shader_update_mask;
DWORD constant_update_mask; DWORD constant_update_mask;
......
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