Module: wine
Branch: master
Commit: c808748bcf03379c27e908ff8fae8b28d931de64
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c808748bcf03379c27e908ff8…
Author: Józef Kucia <jkucia(a)codeweavers.com>
Date: Wed Feb 22 13:19:28 2017 +0100
wined3d: Do not read rev_tex_unit_mapping for texture units >= MAX_COMBINED_SAMPLERS.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/wined3d/texture.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 037682d..e05d96a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -806,8 +806,6 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb)
{
- DWORD active_sampler;
-
/* We don't need a specific texture unit, but after binding the texture
* the current unit is dirty. Read the unit back instead of switching to
* 0, this avoids messing around with the state manager's GL states. The
@@ -817,9 +815,12 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
* called from sampler() in state.c. This means we can't touch anything
* other than whatever happens to be the currently active texture, or we
* would risk marking already applied sampler states dirty again. */
- active_sampler = context->rev_tex_unit_map[context->active_texture];
- if (active_sampler != WINED3D_UNMAPPED_STAGE)
- context_invalidate_state(context, STATE_SAMPLER(active_sampler));
+ if (context->active_texture < MAX_COMBINED_SAMPLERS)
+ {
+ DWORD active_sampler = context->rev_tex_unit_map[context->active_texture];
+ if (active_sampler != WINED3D_UNMAPPED_STAGE)
+ context_invalidate_state(context, STATE_SAMPLER(active_sampler));
+ }
/* FIXME: Ideally we'd only do this when touching a binding that's used by
* a shader. */
context_invalidate_state(context, STATE_SHADER_RESOURCE_BINDING);
Module: wine
Branch: master
Commit: f5de7186aa5669982227acde39cc0324fa69e8e6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f5de7186aa5669982227acde3…
Author: Józef Kucia <jkucia(a)codeweavers.com>
Date: Wed Feb 22 13:19:27 2017 +0100
wined3d: Do not try to invalidate compute states for freshly created contexts.
The context_invalidate_state() function doesn't handle compute states
properly.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/wined3d/context.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index a58a905..67daded 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1828,11 +1828,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
ret->d3d_info = d3d_info;
ret->state_table = device->StateTable;
- /* Mark all states dirty to force a proper initialization of the states
- * on the first use of the context. */
+ /* Mark all states dirty to force a proper initialization of the states on
+ * the first use of the context. Compute states do not need initialization. */
for (state = 0; state <= STATE_HIGHEST; ++state)
{
- if (ret->state_table[state].representative)
+ if (ret->state_table[state].representative && !STATE_IS_COMPUTE(state))
context_invalidate_state(ret, state);
}