Stefan Dösinger : wined3d: D3DRS_BLENDFACTOR should not influence glBlend(TRUE/FALSE).

Alexandre Julliard julliard at wine.codeweavers.com
Tue Dec 26 06:49:16 CST 2006


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

Author: Stefan Dösinger <stefandoesinger at gmx.at>
Date:   Mon Dec 25 18:46:59 2006 +0100

wined3d: D3DRS_BLENDFACTOR should not influence glBlend(TRUE/FALSE).

---

 dlls/wined3d/state.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 6bf101c..27fd9f4 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -208,14 +208,11 @@ static void state_ambient(DWORD state, I
 static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock) {
     int srcBlend = GL_ZERO;
     int dstBlend = GL_ZERO;
-    float col[4];
 
     /* GL_LINE_SMOOTH needs GL_BLEND to work, according to the red book, and special blending params */
-    /* TODO: Is enabling blending really affected by the blendfactor??? */
     if (stateblock->renderState[WINED3DRS_ALPHABLENDENABLE]      ||
         stateblock->renderState[WINED3DRS_EDGEANTIALIAS]         ||
-        stateblock->renderState[WINED3DRS_ANTIALIASEDLINEENABLE] ||
-        stateblock->renderState[WINED3DRS_BLENDFACTOR] != 0xFFFFFFFF) {
+        stateblock->renderState[WINED3DRS_ANTIALIASEDLINEENABLE]) {
         glEnable(GL_BLEND);
         checkGLcall("glEnable GL_BLEND");
     } else {
@@ -303,6 +300,10 @@ static void state_blend(DWORD state, IWi
     /* TODO: Remove when state management done */
     stateblock->wineD3DDevice->dstBlend = dstBlend;
     stateblock->wineD3DDevice->srcBlend = srcBlend;
+}
+
+static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+    float col[4];
 
     TRACE("Setting BlendFactor to %d\n", stateblock->renderState[WINED3DRS_BLENDFACTOR]);
     D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_BLENDFACTOR], col);
@@ -1961,7 +1962,7 @@ const struct StateEntry StateTable[] =
     { /*190, WINED3DRS_COLORWRITEENABLE1            */      STATE_RENDER(WINED3DRS_COLORWRITEENABLE),           state_colorwrite    },
     { /*191, WINED3DRS_COLORWRITEENABLE2            */      STATE_RENDER(WINED3DRS_COLORWRITEENABLE),           state_colorwrite    },
     { /*192, WINED3DRS_COLORWRITEENABLE3            */      STATE_RENDER(WINED3DRS_COLORWRITEENABLE),           state_colorwrite    },
-    { /*193, WINED3DRS_BLENDFACTOR                  */      STATE_RENDER(WINED3DRS_ALPHABLENDENABLE),           state_blend         },
+    { /*193, WINED3DRS_BLENDFACTOR                  */      STATE_RENDER(WINED3DRS_BLENDFACTOR),                state_blendfactor   },
     { /*194, WINED3DRS_SRGBWRITEENABLE              */      STATE_RENDER(WINED3DRS_SRGBWRITEENABLE),            state_srgbwrite     },
     { /*195, WINED3DRS_DEPTHBIAS                    */      STATE_RENDER(WINED3DRS_DEPTHBIAS),                  state_depthbias     },
     { /*196, undefined                              */      0,                                                  state_undefined     },




More information about the wine-cvs mailing list