Module: wine Branch: master Commit: 83dadaee0210298525ef0db6349495870116beee URL: http://source.winehq.org/git/wine.git/?a=commit;h=83dadaee0210298525ef0db634...
Author: Józef Kucia jkucia@codeweavers.com Date: Wed Feb 1 11:26:22 2017 +0100
wined3d: Do not acquire compute pipeline resources for draws.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/cs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 8acfe31..de8ad66 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -416,7 +416,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * cs->ops->submit(cs); }
-static void acquire_shader_resources(const struct wined3d_state *state) +static void acquire_shader_resources(const struct wined3d_state *state, unsigned int shader_mask) { struct wined3d_shader_sampler_map_entry *entry; struct wined3d_shader_resource_view *view; @@ -425,6 +425,9 @@ static void acquire_shader_resources(const struct wined3d_state *state)
for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { + if (!(shader_mask & (1u << i))) + continue; + if (!(shader = state->shader[i])) continue;
@@ -446,7 +449,7 @@ static void acquire_shader_resources(const struct wined3d_state *state) } }
-static void release_shader_resources(const struct wined3d_state *state) +static void release_shader_resources(const struct wined3d_state *state, unsigned int shader_mask) { struct wined3d_shader_sampler_map_entry *entry; struct wined3d_shader_resource_view *view; @@ -455,6 +458,9 @@ static void release_shader_resources(const struct wined3d_state *state)
for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { + if (!(shader_mask & (1u << i))) + continue; + if (!(shader = state->shader[i])) continue;
@@ -511,7 +517,7 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) } if (state->fb->depth_stencil) wined3d_resource_release(state->fb->depth_stencil->resource); - release_shader_resources(state); + release_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE)); }
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, @@ -549,7 +555,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } if (state->fb->depth_stencil) wined3d_resource_acquire(state->fb->depth_stencil->resource); - acquire_shader_resources(state); + acquire_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
cs->ops->submit(cs); }