Henri Verbeet : wined3d: Set the WINED3DPBLENDCAPS_SRCALPHASAT destination blend cap when ARB_blend_func_extended is supported.

Alexandre Julliard julliard at winehq.org
Tue Apr 15 14:50:33 CDT 2014


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 15 09:15:20 2014 +0200

wined3d: Set the WINED3DPBLENDCAPS_SRCALPHASAT destination blend cap when ARB_blend_func_extended is supported.

---

 dlls/wined3d/directx.c    |   12 ++++++------
 dlls/wined3d/wined3d_gl.h |    4 ++++
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 132dad1..f3331bf 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -93,6 +93,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
     {"GL_APPLE_ycbcr_422",                  APPLE_YCBCR_422               },
 
     /* ARB */
+    {"GL_ARB_blend_func_extended",          ARB_BLEND_FUNC_EXTENDED       },
     {"GL_ARB_color_buffer_float",           ARB_COLOR_BUFFER_FLOAT        },
     {"GL_ARB_debug_output",                 ARB_DEBUG_OUTPUT              },
     {"GL_ARB_depth_buffer_float",           ARB_DEPTH_BUFFER_FLOAT        },
@@ -4239,6 +4240,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
                       WINED3DPCMPCAPS_NEVER        |
                       WINED3DPCMPCAPS_NOTEQUAL;
 
+    /* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA
+     * are legacy settings for srcblend only. */
     caps->SrcBlendCaps  =  WINED3DPBLENDCAPS_BOTHINVSRCALPHA |
                            WINED3DPBLENDCAPS_BOTHSRCALPHA    |
                            WINED3DPBLENDCAPS_DESTALPHA       |
@@ -4263,12 +4266,9 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
                            WINED3DPBLENDCAPS_SRCALPHA        |
                            WINED3DPBLENDCAPS_SRCCOLOR        |
                            WINED3DPBLENDCAPS_ZERO;
-    /* NOTE: WINED3DPBLENDCAPS_SRCALPHASAT is not supported as dest blend factor,
-     * according to the glBlendFunc manpage
-     *
-     * WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA are
-     * legacy settings for srcblend only
-     */
+
+    if (gl_info->supported[ARB_BLEND_FUNC_EXTENDED])
+        caps->DestBlendCaps |= WINED3DPBLENDCAPS_SRCALPHASAT;
 
     if (gl_info->supported[EXT_BLEND_COLOR])
     {
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index b357bb1..7331592 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -43,6 +43,7 @@ enum wined3d_gl_extension
     APPLE_FLUSH_BUFFER_RANGE,
     APPLE_YCBCR_422,
     /* ARB */
+    ARB_BLEND_FUNC_EXTENDED,
     ARB_COLOR_BUFFER_FLOAT,
     ARB_DEBUG_OUTPUT,
     ARB_DEPTH_BUFFER_FLOAT,
@@ -180,6 +181,9 @@ enum wined3d_gl_extension
     /* GL_APPLE_flush_buffer_range */ \
     USE_GL_FUNC(glBufferParameteriAPPLE) \
     USE_GL_FUNC(glFlushMappedBufferRangeAPPLE) \
+    /* GL_ARB_blend_func_extended */ \
+    USE_GL_FUNC(glBindFragDataLocationIndexed) \
+    USE_GL_FUNC(glGetFragDataIndex) \
     /* GL_ARB_color_buffer_float */ \
     USE_GL_FUNC(glClampColorARB) \
     /* GL_ARB_debug_output */ \




More information about the wine-cvs mailing list