Commit 197cdcc9 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Use ARB_internalformat_query2 for the other texture format caps too.

parent 6fa87980
......@@ -1407,6 +1407,32 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
format->height_scale.numerator = 1;
format->height_scale.denominator = 1;
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2])
{
query_format_flag(gl_info, format, format->glInternal, GL_VERTEX_TEXTURE,
WINED3DFMT_FLAG_VTF, "vertex texture usage");
query_format_flag(gl_info, format, format->glInternal, GL_FILTER,
WINED3DFMT_FLAG_FILTERING, "filtering");
if (format->glGammaInternal != format->glInternal)
{
query_format_flag(gl_info, format, format->glGammaInternal, GL_SRGB_READ,
WINED3DFMT_FLAG_SRGB_READ, "sRGB read");
if (srgb_write)
query_format_flag(gl_info, format, format->glGammaInternal, GL_SRGB_WRITE,
WINED3DFMT_FLAG_SRGB_WRITE, "sRGB write");
else
format->flags &= ~WINED3DFMT_FLAG_SRGB_WRITE;
if (!(format->flags & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE)))
format->glGammaInternal = format->glInternal;
else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
format->glInternal = format->glGammaInternal;
}
}
else
{
if (!gl_info->limits.vertex_samplers)
format->flags &= ~WINED3DFMT_FLAG_VTF;
......@@ -1431,6 +1457,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
if ((format->flags & WINED3DFMT_FLAG_SRGB_WRITE) && !srgb_write)
format->flags &= ~WINED3DFMT_FLAG_SRGB_WRITE;
}
/* Texture conversion stuff */
format->convert = format_texture_info[i].convert;
......@@ -1563,6 +1590,10 @@ static void init_format_filter_info(struct wined3d_gl_info *gl_info, enum wined3
};
BOOL filtered;
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2])
/* This was already handled by init_format_texture_info(). */
return;
if(wined3d_settings.offscreen_rendering_mode != ORM_FBO)
{
WARN("No FBO support, or no FBO ORM, guessing filter info from GL caps\n");
......
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