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

wined3d: Fix condition for FIXME() about unsupported depth slices.

parent 70961361
...@@ -169,8 +169,8 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target ...@@ -169,8 +169,8 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target
const struct wined3d_view_desc *desc, struct wined3d_texture *texture, const struct wined3d_view_desc *desc, struct wined3d_texture *texture,
const struct wined3d_format *view_format) const struct wined3d_format *view_format)
{ {
unsigned int level_idx, layer_idx, layer_count;
const struct wined3d_gl_info *gl_info; const struct wined3d_gl_info *gl_info;
unsigned int layer_idx, layer_count;
struct wined3d_context *context; struct wined3d_context *context;
GLuint texture_name; GLuint texture_name;
...@@ -189,20 +189,21 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target ...@@ -189,20 +189,21 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target
wined3d_texture_prepare_texture(texture, context, FALSE); wined3d_texture_prepare_texture(texture, context, FALSE);
texture_name = wined3d_texture_get_texture_name(texture, context, FALSE); texture_name = wined3d_texture_get_texture_name(texture, context, FALSE);
level_idx = desc->u.texture.level_idx;
layer_idx = desc->u.texture.layer_idx; layer_idx = desc->u.texture.layer_idx;
layer_count = desc->u.texture.layer_count; layer_count = desc->u.texture.layer_count;
if (view_target == GL_TEXTURE_3D && (layer_idx || layer_count != 1)) if (view_target == GL_TEXTURE_3D)
{ {
FIXME("Depth slice (%u-%u) not supported.\n", layer_idx, layer_count); if (layer_idx || layer_count != wined3d_texture_get_level_depth(texture, level_idx))
FIXME("Depth slice (%u-%u) not supported.\n", layer_idx, layer_count);
layer_idx = 0; layer_idx = 0;
layer_count = 1; layer_count = 1;
} }
gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); gl_info->gl_ops.gl.p_glGenTextures(1, &view->name);
GL_EXTCALL(glTextureView(view->name, view->target, texture_name, view_format->glInternal, GL_EXTCALL(glTextureView(view->name, view->target, texture_name, view_format->glInternal,
desc->u.texture.level_idx, desc->u.texture.level_count, level_idx, desc->u.texture.level_count, layer_idx, layer_count));
layer_idx, layer_count)); checkGLcall("create texture view");
checkGLcall("Create texture view");
if (is_stencil_view_format(view_format)) if (is_stencil_view_format(view_format))
{ {
...@@ -218,7 +219,7 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target ...@@ -218,7 +219,7 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target
context_bind_texture(context, view->target, view->name); context_bind_texture(context, view->target, view->name);
gl_info->gl_ops.gl.p_glTexParameteriv(view->target, GL_TEXTURE_SWIZZLE_RGBA, swizzle); gl_info->gl_ops.gl.p_glTexParameteriv(view->target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
gl_info->gl_ops.gl.p_glTexParameteri(view->target, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX); gl_info->gl_ops.gl.p_glTexParameteri(view->target, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX);
checkGLcall("Initialize stencil view"); checkGLcall("initialize stencil view");
context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING); context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING);
context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING);
......
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