From b76f39936f8ae3da33c29424477ca0ba817822c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 9 Dec 2016 11:30:44 +0100 Subject: [PATCH] wined3d: Do not try to create texture views for depth slices. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/view.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 237122dad76..27ee9d20192 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -65,6 +65,7 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target const struct wined3d_format *view_format) { const struct wined3d_gl_info *gl_info; + unsigned int layer_idx, layer_count; struct wined3d_context *context; struct gl_texture *gl_texture; @@ -83,10 +84,19 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target wined3d_texture_prepare_texture(texture, context, FALSE); gl_texture = wined3d_texture_get_gl_texture(texture, FALSE); + layer_idx = desc->u.texture.layer_idx; + layer_count = desc->u.texture.layer_count; + if (view_target == GL_TEXTURE_3D && (layer_idx || layer_count != 1)) + { + FIXME("Depth slice (%u-%u) not supported.\n", layer_idx, layer_count); + layer_idx = 0; + layer_count = 1; + } + gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); GL_EXTCALL(glTextureView(view->name, view->target, gl_texture->name, view_format->glInternal, desc->u.texture.level_idx, desc->u.texture.level_count, - desc->u.texture.layer_idx, desc->u.texture.layer_count)); + layer_idx, layer_count)); checkGLcall("Create texture view"); if (is_stencil_view_format(view_format))