Commit 2dcfd128 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Create texture views for unordered access views.

parent b76f3993
......@@ -3406,8 +3406,9 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
struct wined3d_unordered_access_view *view;
struct wined3d_texture *texture;
struct wined3d_shader *shader;
struct gl_texture *gl_texture;
GLuint texture_name;
unsigned int i;
GLint level;
context->uses_uavs = 0;
......@@ -3438,8 +3439,18 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
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,
if (view->gl_view.name)
{
texture_name = view->gl_view.name;
level = 0;
}
else
{
texture_name = wined3d_texture_get_gl_texture(texture, FALSE)->name;
level = view->level_idx;
}
GL_EXTCALL(glBindImageTexture(i, texture_name, level, GL_TRUE, 0, GL_READ_WRITE,
view->format->glInternal));
}
checkGLcall("Bind unordered access views");
......
......@@ -610,8 +610,8 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces
if (desc->u.texture.layer_idx || desc->u.texture.layer_count != depth_or_layer_count)
{
FIXME("Unordered access view unsupported yet (layers %u-%u).\n",
desc->u.texture.layer_idx, desc->u.texture.layer_count);
create_texture_view(&view->gl_view, get_texture_view_target(desc, texture),
desc, texture, view->format);
}
view->layer_idx = desc->u.texture.layer_idx;
......
......@@ -3321,7 +3321,7 @@ struct wined3d_unordered_access_view
const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format;
struct wined3d_gl_view gl_view;
unsigned int layer_idx;
unsigned int layer_count;
unsigned int level_idx;
......
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