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

wined3d: Avoid guessing texture target if OpenGL 4.5 is available.

parent 1726d312
...@@ -289,39 +289,62 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G ...@@ -289,39 +289,62 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
unsigned int i; unsigned int i;
tex_type_str = NULL; tex_type_str = NULL;
for (i = 0; i < ARRAY_SIZE(texture_type); ++i) if (gl_info->gl_ops.ext.p_glGetTextureParameteriv)
{ {
if (!gl_info->supported[texture_type[i].extension]) GL_EXTCALL(glGetTextureParameteriv(name, GL_TEXTURE_TARGET, &tex_target));
continue;
gl_info->gl_ops.gl.p_glGetIntegerv(texture_type[i].binding, &old_texture); for (i = 0; i < ARRAY_SIZE(texture_type); ++i)
while (gl_info->gl_ops.gl.p_glGetError());
gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, name);
if (!gl_info->gl_ops.gl.p_glGetError())
{ {
tex_target = texture_type[i].target; if (texture_type[i].target == tex_target)
tex_type_str = texture_type[i].str; {
break; tex_type_str = texture_type[i].str;
break;
}
} }
gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, old_texture); if (i == ARRAY_SIZE(texture_type))
tex_type_str = wine_dbg_sprintf("%#x", tex_target);
GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt));
GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_WIDTH, &width));
GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_HEIGHT, &height));
} }
if (!tex_type_str) else
{ {
FIXME("Cannot find type of texture %d.\n", name); for (i = 0; i < ARRAY_SIZE(texture_type); ++i)
return; {
} 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());
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, name);
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width); if (!gl_info->gl_ops.gl.p_glGetError())
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_HEIGHT, &height); {
tex_target = texture_type[i].target;
tex_type_str = texture_type[i].str;
break;
}
gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, old_texture);
}
if (!tex_type_str)
{
FIXME("Cannot find type of texture %d.\n", name);
return;
}
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt);
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width);
gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_HEIGHT, &height);
gl_info->gl_ops.gl.p_glBindTexture(tex_target, old_texture);
}
} }
FIXME(" %s: %s texture %d, %dx%d, format %#x.\n", debug_fboattachment(attachment), FIXME(" %s: %s texture %d, %dx%d, format %#x.\n", debug_fboattachment(attachment),
tex_type_str, name, width, height, fmt); tex_type_str, name, width, height, fmt);
gl_info->gl_ops.gl.p_glBindTexture(tex_target, old_texture); checkGLcall("guess texture type");
checkGLcall("Guess texture type");
} }
else if (type == GL_NONE) else if (type == GL_NONE)
{ {
......
...@@ -3270,6 +3270,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) ...@@ -3270,6 +3270,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */ USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */
USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */ USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */
USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */ USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */
USE_GL_FUNC(glGetTextureLevelParameteriv) /* OpenGL 4.5 */
USE_GL_FUNC(glGetTextureParameteriv) /* OpenGL 4.5 */
USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */ USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */
USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */ USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */
USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */ USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */
......
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