WineD3D: D3DRS_BLENDFACTOR should not influence glBlend(TRUE/FALSE)
Stefan Dösinger
stefandoesinger at gmx.at
Mon Dec 25 11:46:59 CST 2006
I copied that incorrectly from the old 'logic', and it doesn't make
any sense in the way it is now, it renders WINED3DRS_BLENDENABLE useless
-------------- next part --------------
From 09c0efc479a026ab05ec871a807ad451bd9a1254 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Stefan_D=C3=B6singer?= <stefan at imac.local>
Date: Mon, 25 Dec 2006 18:43:10 +0100
Subject: [PATCH] WineD3D: WINED3DRS_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 0d10dd1..9dfcbd3 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);
@@ -2043,7 +2044,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 },
--
1.4.2.4
More information about the wine-patches
mailing list