WineD3D: add separate alpha blend support 3/3

Stefan Dösinger stefandoesinger at
Sat Feb 16 14:38:00 CST 2008

Am Samstag, 16. Februar 2008 17:29:31 schrieb Roderick Colenbrander:
> Hi,
> This patch adds support for separate alpha blend one of the last
> unimplemented D3D9 features.
Here are a few suggestions:

*) Setting WINED3DPMISCCAPS_SEPARATEALPHABLEND in directx.c should only be 
done if the extension is supported

*) after the "GL_LINE_SMOOTH needs GL_BLEND to work, according to the", 
WINED3DRS_SEPARATEALPHABLENDENABLE should probably be removed from the if 
block. I don't think that blending should be enabled if the 
WINED3DRS_ALPHABLENDENABLE is off. A test would be helpful for certainty.

*) The code translating the separate blending settings could be moved into the 
if(stateblock->renderState[WINED3DRS_SEPARATEALPHABLENDENABLE]) block. That 
way they are only executed if they're needed(The compiler may take care of 
that though)

*) The separate blend states should be grouped with the alpha states, ie, set 
the representative to STATE_RENDER(WINED3DRS_ALPHABLENDENABLE) instead of 
cause any rendering problems because the whole alpha blend states are set 
every time, but grouping them will improve performance. (e.g., if 
alphablendenable and separatealphaenable are changed state_blend is only 
executed once, not twice)

*) The blendop is currently not reapplied if 
WINED3DRS_SEPARATEALPHABLENDENABLE is changed. One solution is to group the 
blendops with alphablend and move the code from state_blendop to state_blend. 
A better way is to make this a one-way dependency from state_alpha to 
state_blend. Compare STATE_RENDER(WINED3DRS_LIGHTING) and STATE_VDECL for a 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : 

More information about the wine-devel mailing list