Implement dual source blending to avoid unneeded alpha pass.

this implementation does not work in windows xp (sorry no support for dual source blending there).
this should improve speed on older hardware or in newer hardware using super sampling.
disable partial fix for 4x supersampling as I'm interested in knowing the original issue with the implementation to fix it correctly.
remove the deprecation label from the plugin while I'm working on it.
This commit is contained in:
Rodolfo Bogado
2013-03-28 20:08:51 -03:00
parent fb28349056
commit 40d919b352
5 changed files with 92 additions and 44 deletions

View File

@ -848,8 +848,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
// single pass
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
{
// Colors will be blended against the alpha from ocol1...
WRITE(p, "\tocol1 = prev;\n");
if(ApiType & API_D3D9)
{
//Colors will be blended against the color from ocol1 in D3D 9...
//ALPHA must be 0 or the shader will not compile( direct3d9 ex resriction)
WRITE(p, "\tocol1 = float4(prev.a, prev.a, prev.a, 0.0f);\n");
}
else
{
// Colors will be blended against the alpha from ocol1...
WRITE(p, "\tocol1 = prev;\n");
}
// ...and the alpha from ocol0 will be written to the framebuffer.
WRITE(p, "\tocol0.a = " I_ALPHA"[0].a;\n");
}