[PATCH 3/4] wined3d: Improve post-pixelshader blending test.

Matteo Bruni mbruni at codeweavers.com
Mon Aug 13 13:20:47 CDT 2012


---
 dlls/wined3d/utils.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 1ddbe60..9b11789 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1071,7 +1071,8 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
     if (status == GL_FRAMEBUFFER_COMPLETE && ((format->flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)
             || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING))
             && format->id != WINED3DFMT_NULL && format->id != WINED3DFMT_P8_UINT
-            && format->glFormat != GL_LUMINANCE && format->glFormat != GL_LUMINANCE_ALPHA)
+            && format->glFormat != GL_LUMINANCE && format->glFormat != GL_LUMINANCE_ALPHA
+            && (format->red_mask || format->alpha_mask))
     {
         GLuint rb, tex2;
         DWORD readback[16 * 16], color;
@@ -1100,6 +1101,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
         }
         else
         {
+            gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
             gl_info->gl_ops.gl.p_glViewport(0, 0, 16, 16);
             gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING);
             gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
@@ -1121,6 +1123,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
             gl_info->gl_ops.gl.p_glVertex3f(1.0f, 1.0f, 0.0f);
             gl_info->gl_ops.gl.p_glEnd();
 
+            gl_info->gl_ops.gl.p_glEnable(GL_BLEND);
             /* Draw a half-transparent red quad */
             gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP);
             gl_info->gl_ops.gl.p_glColor4ub(0xff, 0x00, 0x00, 0x80);
@@ -1133,6 +1136,7 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
             gl_info->gl_ops.gl.p_glVertex3f(1.0f, 1.0f, 0.0f);
             gl_info->gl_ops.gl.p_glEnd();
 
+            gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
             gl_info->gl_ops.gl.p_glGenTextures(1, &tex2);
             gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex2);
 
@@ -1144,8 +1148,8 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
             a = color >> 24;
             r = (color & 0x00ff0000) >> 16;
 
-            if (format->red_mask && (r < 0x7b || r > 0x84))
-            match = FALSE;
+            if (format->red_mask && (r < 0x78 || r > 0x88))
+                match = FALSE;
             /* If the alpha component is more than 1 bit */
             else if ((format->alpha_mask & (format->alpha_mask - 1)) && (a < 0x9f || a > 0xdf))
                 match = FALSE;
-- 
1.7.8.6




More information about the wine-patches mailing list