[PATCH 1/5] wined3d: Fix sRGB clears with no support for ARB_framebuffer_sRGB.

Matteo Bruni mbruni at codeweavers.com
Fri Jan 27 12:52:52 CST 2017


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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7898527..84d33bf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -346,7 +346,10 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
             wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding);
         }
 
-        if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, state, fb))
+        if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB]
+                && ((!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
+                && fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE)
+                || state->render_states[WINED3D_RS_SRGBWRITEENABLE]))
         {
             if (rt_count > 1)
                 WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB "
-- 
2.10.2




More information about the wine-patches mailing list