=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Factor out release_shader_resources() function.
Alexandre Julliard
julliard at winehq.org
Wed Feb 1 15:26:07 CST 2017
Module: wine
Branch: master
Commit: 12058f66cf0010bab3640191afcade4313bf717f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=12058f66cf0010bab3640191afcade4313bf717f
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Wed Feb 1 11:26:21 2017 +0100
wined3d: Factor out release_shader_resources() function.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/cs.c | 55 +++++++++++++++++++++++++++++++------------------------
1 file changed, 31 insertions(+), 24 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e9d04f4..8acfe31 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -446,15 +446,42 @@ static void acquire_shader_resources(const struct wined3d_state *state)
}
}
-static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
+static void release_shader_resources(const struct wined3d_state *state)
{
- struct wined3d_state *state = &cs->device->state;
struct wined3d_shader_sampler_map_entry *entry;
struct wined3d_shader_resource_view *view;
- const struct wined3d_cs_draw *op = data;
struct wined3d_shader *shader;
unsigned int i, j;
+ for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
+ {
+ if (!(shader = state->shader[i]))
+ continue;
+
+ for (j = 0; j < WINED3D_MAX_CBS; ++j)
+ {
+ if (state->cb[i][j])
+ wined3d_resource_release(&state->cb[i][j]->resource);
+ }
+
+ for (j = 0; j < shader->reg_maps.sampler_map.count; ++j)
+ {
+ entry = &shader->reg_maps.sampler_map.entries[j];
+
+ if (!(view = state->shader_resource_view[i][entry->resource_idx]))
+ continue;
+
+ wined3d_resource_release(view->resource);
+ }
+ }
+}
+
+static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
+{
+ struct wined3d_state *state = &cs->device->state;
+ const struct wined3d_cs_draw *op = data;
+ unsigned int i;
+
if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]
&& state->load_base_vertex_index != op->base_vertex_idx)
{
@@ -484,27 +511,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);
- for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
- {
- if (!(shader = state->shader[i]))
- continue;
-
- for (j = 0; j < WINED3D_MAX_CBS; ++j)
- {
- if (state->cb[i][j])
- wined3d_resource_release(&state->cb[i][j]->resource);
- }
-
- for (j = 0; j < shader->reg_maps.sampler_map.count; ++j)
- {
- entry = &shader->reg_maps.sampler_map.entries[j];
-
- if (!(view = state->shader_resource_view[i][entry->resource_idx]))
- continue;
-
- wined3d_resource_release(view->resource);
- }
- }
+ release_shader_resources(state);
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx,
More information about the wine-cvs
mailing list