wined3d: Handle 2D array textures in context_dump_fbo_attachment().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b5dad41e36
commit
0f1729c5f4
|
@ -219,6 +219,20 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
|
||||||
static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, GLenum target,
|
static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, GLenum target,
|
||||||
GLenum attachment)
|
GLenum attachment)
|
||||||
{
|
{
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
GLenum target;
|
||||||
|
GLenum binding;
|
||||||
|
const char *str;
|
||||||
|
enum wined3d_gl_extension extension;
|
||||||
|
}
|
||||||
|
texture_type[] =
|
||||||
|
{
|
||||||
|
{GL_TEXTURE_2D, GL_TEXTURE_BINDING_2D, "2d", WINED3D_GL_EXT_NONE},
|
||||||
|
{GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_BINDING_RECTANGLE_ARB, "rectangle", ARB_TEXTURE_RECTANGLE},
|
||||||
|
{GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BINDING_2D_ARRAY, "2d-array", EXT_TEXTURE_ARRAY},
|
||||||
|
};
|
||||||
|
|
||||||
GLint type, name, samples, width, height, old_texture, level, face, fmt, tex_target;
|
GLint type, name, samples, width, height, old_texture, level, face, fmt, tex_target;
|
||||||
|
|
||||||
gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment,
|
gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment,
|
||||||
|
@ -262,30 +276,31 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl_info->gl_ops.gl.p_glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_texture);
|
unsigned int i;
|
||||||
|
|
||||||
|
tex_type_str = NULL;
|
||||||
|
for (i = 0; i < sizeof(texture_type) / sizeof(*texture_type); ++i)
|
||||||
|
{
|
||||||
|
if (!gl_info->supported[texture_type[i].extension])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
gl_info->gl_ops.gl.p_glGetIntegerv(texture_type[i].binding, &old_texture);
|
||||||
while (gl_info->gl_ops.gl.p_glGetError());
|
while (gl_info->gl_ops.gl.p_glGetError());
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, name);
|
glBindTexture(texture_type[i].target, name);
|
||||||
if (!gl_info->gl_ops.gl.p_glGetError())
|
if (!gl_info->gl_ops.gl.p_glGetError())
|
||||||
{
|
{
|
||||||
tex_target = GL_TEXTURE_2D;
|
tex_target = texture_type[i].target;
|
||||||
tex_type_str = "2d";
|
tex_type_str = texture_type[i].str;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
glBindTexture(texture_type[i].target, old_texture);
|
||||||
|
}
|
||||||
|
if (!tex_type_str)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, old_texture);
|
|
||||||
gl_info->gl_ops.gl.p_glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_texture);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, name);
|
|
||||||
if (gl_info->gl_ops.gl.p_glGetError())
|
|
||||||
{
|
|
||||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, old_texture);
|
|
||||||
FIXME("Cannot find type of texture %d.\n", name);
|
FIXME("Cannot find type of texture %d.\n", name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tex_target = GL_TEXTURE_RECTANGLE_ARB;
|
|
||||||
tex_type_str = "rectangle";
|
|
||||||
}
|
|
||||||
|
|
||||||
glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt);
|
glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt);
|
||||||
glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width);
|
glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width);
|
||||||
|
@ -296,13 +311,16 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
|
||||||
tex_type_str, name, width, height, fmt);
|
tex_type_str, name, width, height, fmt);
|
||||||
|
|
||||||
glBindTexture(tex_target, old_texture);
|
glBindTexture(tex_target, old_texture);
|
||||||
|
checkGLcall("Guess texture type");
|
||||||
}
|
}
|
||||||
else if (type == GL_NONE)
|
else if (type == GL_NONE)
|
||||||
{
|
{
|
||||||
FIXME("\t%s: NONE.\n", debug_fboattachment(attachment));
|
FIXME(" %s: NONE.\n", debug_fboattachment(attachment));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ERR("\t%s: Unknown attachment %#x.\n", debug_fboattachment(attachment), type);
|
{
|
||||||
|
ERR(" %s: Unknown attachment %#x.\n", debug_fboattachment(attachment), type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
|
|
Loading…
Reference in New Issue