Matteo Bruni : wined3d: Don' t require a separate sRGB GL texture if the format doesn' t support sRGB reads.

Alexandre Julliard julliard at winehq.org
Mon Feb 27 15:12:07 CST 2017


Module: wine
Branch: master
Commit: ce77ef4ea0d38c9fe21584bbc777249f65092a57
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ce77ef4ea0d38c9fe21584bbc777249f65092a57

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Feb 24 19:37:24 2017 +0100

wined3d: Don't require a separate sRGB GL texture if the format doesn't support sRGB reads.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/wined3d_private.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7950011..4ccef50 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3914,11 +3914,11 @@ static inline void context_apply_state(struct wined3d_context *context,
 static inline BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *context,
         const struct wined3d_texture *texture)
 {
-    unsigned int flags = texture->resource.format_flags;
+    unsigned int flags = texture->resource.format_flags
+            & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE);
 
     return (!context->gl_info->supported[EXT_TEXTURE_SRGB_DECODE]
-            || (flags & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE))
-            != (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE))
+            || (flags && flags != (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE)))
             && context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL;
 }
 




More information about the wine-cvs mailing list