Fix D3D11 render target blending issues

The alpha source and destination blend values were always being set to
one and zero, when they should have been set to the same as the color
values.  This caused the alpha of the source texture to always overwrite
the alpha of the destination texture, rather than apply the blend
function upon it.  Needless to say that it seriously screwed up the
render target if you rendered something with alpha on it.

Thanks to paibox for pointing this issue out and yelling at me to fix
it.  I apologize for not getting to this sooner.
master
jp9000 2014-08-11 17:40:35 -07:00
parent f75a1ebf63
commit a8d4774eef
1 changed files with 4 additions and 2 deletions

View File

@ -274,12 +274,14 @@ ID3D11BlendState *gs_device::AddBlendState()
bd.RenderTarget[i].BlendEnable = blendState.blendEnabled;
bd.RenderTarget[i].BlendOp = D3D11_BLEND_OP_ADD;
bd.RenderTarget[i].BlendOpAlpha = D3D11_BLEND_OP_ADD;
bd.RenderTarget[i].SrcBlendAlpha = D3D11_BLEND_ONE;
bd.RenderTarget[i].DestBlendAlpha = D3D11_BLEND_ZERO;
bd.RenderTarget[i].SrcBlend =
ConvertGSBlendType(blendState.srcFactor);
bd.RenderTarget[i].DestBlend =
ConvertGSBlendType(blendState.destFactor);
bd.RenderTarget[i].SrcBlendAlpha =
bd.RenderTarget[i].SrcBlend;
bd.RenderTarget[i].DestBlendAlpha =
bd.RenderTarget[i].DestBlend;
bd.RenderTarget[i].RenderTargetWriteMask =
D3D11_COLOR_WRITE_ENABLE_ALL;
}