[PATCH] wined3d: Set proper GL internal format for sRGB formats.

Matteo Bruni mbruni at codeweavers.com
Thu Jan 10 17:25:12 CST 2019


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 9fc3444d6ed8ad0e124a77d2faf1e2cc6639f40f (it's a partial revert,
in fact).

It might help with bug 46212.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
 dlls/wined3d/utils.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index f8da256b07e..dd70d3fc2d5 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -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;
             }
-- 
2.19.2




More information about the wine-devel mailing list