Module: wine Branch: master Commit: 17542e9f5254e2475f356a7b7ede31eefad06fa7 URL: https://gitlab.winehq.org/wine/wine/-/commit/17542e9f5254e2475f356a7b7ede31e...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu Mar 9 18:55:26 2023 -0600
wined3d: Invalidate all sampler slots to which a texture is bound in texture_resource_unload().
---
dlls/wined3d/texture.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 1f4c4b80d3c..3dfecc949d1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3509,6 +3509,7 @@ static void texture_resource_unload(struct wined3d_resource *resource) { struct wined3d_texture *texture = texture_from_resource(resource); struct wined3d_device *device = resource->device; + const struct wined3d_state *state = &device->cs->state; unsigned int location = resource->map_binding; struct wined3d_context *context; unsigned int sub_count, i; @@ -3553,8 +3554,13 @@ static void texture_resource_unload(struct wined3d_resource *resource) context_release(context);
wined3d_texture_force_reload(texture); - if (texture->resource.bind_count) - device_invalidate_state(device, STATE_SAMPLER(texture->sampler)); + + for (i = 0; i < ARRAY_SIZE(state->textures); ++i) + { + if (state->textures[i] == texture) + device_invalidate_state(device, STATE_SAMPLER(i)); + } + wined3d_texture_set_dirty(texture);
resource_unload(&texture->resource);