[PATCH 1/6] wined3d: Don't require a separate sRGB GL texture if the format doesn't support sRGB reads.

Matteo Bruni mbruni at codeweavers.com
Fri Feb 24 12:37:24 CST 2017


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This should avoid messages like:

fixme:d3d:surface_load_texture Unimplemented copy from
WINED3D_LOCATION_TEXTURE_RGB for depth/stencil buffers.
err:d3d:wined3d_texture_load Failed to load location (srgb 0x1).

Fixes commit 69006a7cc6c43256501f3d6c0a370ced2b2c53fa.

 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;
 }
 
-- 
2.10.2




More information about the wine-patches mailing list