Henri Verbeet : wined3d: Properly check if sRGB writes should be enabled in context_apply_clear_state ().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 18 08:33:03 CDT 2016


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Mar 17 16:30:01 2016 +0100

wined3d: Properly check if sRGB writes should be enabled in context_apply_clear_state().

In particular, while enabling sRGB writes is harmless for framebuffers that
are not sRGB capable, the default framebuffer may be sRGB capable regardless
of the associated wined3d format.

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

---

 dlls/wined3d/context.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 37c0fe0..e372eaa 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2606,10 +2606,9 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
      * performance incredibly. */
     gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
     gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST);
-    if (gl_info->supported[ARB_FRAMEBUFFER_SRGB])
+    if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB])
     {
-        if (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
-                || device->state.render_states[WINED3D_RS_SRGBWRITEENABLE])
+        if (needs_srgb_write(context, &device->state, fb))
             gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
         else
             gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);




More information about the wine-cvs mailing list