Fix CONSTANT_ALPHA and ONE_MINUS_CONSTANT_ALPHA blend modes in the D3D11 path.

TRAC #23124 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2252 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent c194d530
...@@ -676,7 +676,23 @@ void Renderer11::setBlendState(const gl::BlendState &blendState, const gl::Color ...@@ -676,7 +676,23 @@ void Renderer11::setBlendState(const gl::BlendState &blendState, const gl::Color
"blend state."); "blend state.");
} }
const float blendColors[] = { blendColor.red, blendColor.green, blendColor.blue, blendColor.alpha }; float blendColors[4] = {0.0f};
if (blendState.sourceBlendRGB != GL_CONSTANT_ALPHA && blendState.sourceBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA &&
blendState.destBlendRGB != GL_CONSTANT_ALPHA && blendState.destBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA)
{
blendColors[0] = blendColor.red;
blendColors[1] = blendColor.green;
blendColors[2] = blendColor.blue;
blendColors[3] = blendColor.alpha;
}
else
{
blendColors[0] = blendColor.alpha;
blendColors[1] = blendColor.alpha;
blendColors[2] = blendColor.alpha;
blendColors[3] = blendColor.alpha;
}
mDeviceContext->OMSetBlendState(dxBlendState, blendColors, sampleMask); mDeviceContext->OMSetBlendState(dxBlendState, blendColors, sampleMask);
mCurBlendState = blendState; mCurBlendState = blendState;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment