wined3d: Set proper GL internal format for sRGB formats.

The idea was to defer that part to check_fbo_compat() for the FBO ORM
but, it turns out, there are formats like DXTn that aren't generally
FBO-attachable but still support sRGB.

Fixes 9fc3444d6e (it's a partial revert,
in fact).

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2019-01-11 00:25:12 +01:00 committed by Alexandre Julliard
parent 35bdd1bb15
commit 41e35425a8

View file

@ -3053,8 +3053,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
if (!(format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D]
& (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE)))
format->srgb_internal = format->internal;
else if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
format->internal = format->srgb_internal;
}
}
@ -3076,8 +3075,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
format->srgb_internal = format->internal;
format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE);
}
else if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
{
format->internal = format->srgb_internal;
}