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

wined3d: Invalidate texture locations while binding UAVs.

parent 35a6ca53
......@@ -3418,6 +3418,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
texture = texture_from_resource(view->resource);
wined3d_texture_load(texture, context, FALSE);
wined3d_unordered_access_view_invalidate_location(view, ~WINED3D_LOCATION_TEXTURE_RGB);
gl_texture = wined3d_texture_get_gl_texture(texture, FALSE);
GL_EXTCALL(glBindImageTexture(i, gl_texture->name, view->level_idx, GL_TRUE, 0, GL_READ_WRITE,
view->format->glInternal));
......
......@@ -504,6 +504,27 @@ void * CDECL wined3d_unordered_access_view_get_parent(const struct wined3d_unord
return view->parent;
}
void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_access_view *view,
DWORD location)
{
struct wined3d_resource *resource = view->resource;
struct wined3d_texture *texture;
unsigned int sub_resource_idx;
unsigned int i;
if (resource->type == WINED3D_RTYPE_BUFFER || resource->type == WINED3D_RTYPE_TEXTURE_3D)
{
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type));
return;
}
texture = texture_from_resource(resource);
sub_resource_idx = view->layer_idx * texture->level_count + view->level_idx;
for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
wined3d_texture_invalidate_location(texture, sub_resource_idx, location);
}
static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_access_view *view,
const struct wined3d_unordered_access_view_desc *desc, struct wined3d_resource *resource,
void *parent, const struct wined3d_parent_ops *parent_ops)
......@@ -544,6 +565,8 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces
desc->u.texture.layer_idx, desc->u.texture.layer_count);
}
view->layer_idx = desc->u.texture.layer_idx;
view->layer_count = desc->u.texture.layer_count;
view->level_idx = desc->u.texture.level_idx;
}
wined3d_resource_incref(view->resource = resource);
......
......@@ -3263,9 +3263,14 @@ struct wined3d_unordered_access_view
const struct wined3d_format *format;
unsigned int layer_idx;
unsigned int layer_count;
unsigned int level_idx;
};
void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_access_view *view,
DWORD location) DECLSPEC_HIDDEN;
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain,
......
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