[PATCH 1/7] wined3d: Properly check if sRGB writes should be enabled in context_apply_clear_state().

Henri Verbeet hverbeet at codeweavers.com
Thu Mar 17 10:30:01 CDT 2016


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>
---
 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);
-- 
2.1.4




More information about the wine-patches mailing list