Commit c174db3a by Jamie Madill Committed by Commit Bot

D3D11: Apply a non-null blendstate in masked depth clear.

In https://chromium-review.googlesource.com/c/453888/, we changed how blendstates were applied in masked clears. This change would apply a null blendstate when all color channels were disabled, but this seems to have an issue on Intel Cherry View drivers. Work around this issue by restoring the prior functionality of making a simple masked blend state. Also clean up some of the code style in the Clear11 class. BUG=chromium:730126 Change-Id: I9a4044201b2f07e9483525513a59e19bb2a8bcd3 Reviewed-on: https://chromium-review.googlesource.com/533684Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent dbcced8e
...@@ -69,7 +69,7 @@ d3d11::BlendStateKey RenderStateCache::GetBlendStateKey(const gl::Framebuffer *f ...@@ -69,7 +69,7 @@ d3d11::BlendStateKey RenderStateCache::GetBlendStateKey(const gl::Framebuffer *f
} }
key.rtvMasks[i] = key.rtvMasks[i] =
(gl_d3d11::GetColorMask(attachment->getFormat().info)) & blendStateMask; (gl_d3d11::GetColorMask(*attachment->getFormat().info)) & blendStateMask;
} }
else else
{ {
......
...@@ -1700,26 +1700,10 @@ D3D11_QUERY ConvertQueryType(GLenum queryType) ...@@ -1700,26 +1700,10 @@ D3D11_QUERY ConvertQueryType(GLenum queryType)
} }
// Get the D3D11 write mask covering all color channels of a given format // Get the D3D11 write mask covering all color channels of a given format
UINT8 GetColorMask(const gl::InternalFormat *formatInfo) UINT8 GetColorMask(const gl::InternalFormat &format)
{ {
UINT8 mask = 0; return ConvertColorMask(format.redBits > 0, format.greenBits > 0, format.blueBits > 0,
if (formatInfo->redBits > 0) format.alphaBits > 0);
{
mask |= D3D11_COLOR_WRITE_ENABLE_RED;
}
if (formatInfo->greenBits > 0)
{
mask |= D3D11_COLOR_WRITE_ENABLE_GREEN;
}
if (formatInfo->blueBits > 0)
{
mask |= D3D11_COLOR_WRITE_ENABLE_BLUE;
}
if (formatInfo->alphaBits > 0)
{
mask |= D3D11_COLOR_WRITE_ENABLE_ALPHA;
}
return mask;
} }
} // namespace gl_d3d11 } // namespace gl_d3d11
......
...@@ -56,7 +56,7 @@ UINT ConvertMaxAnisotropy(float maxAnisotropy, D3D_FEATURE_LEVEL featureLevel); ...@@ -56,7 +56,7 @@ UINT ConvertMaxAnisotropy(float maxAnisotropy, D3D_FEATURE_LEVEL featureLevel);
D3D11_QUERY ConvertQueryType(GLenum queryType); D3D11_QUERY ConvertQueryType(GLenum queryType);
UINT8 GetColorMask(const gl::InternalFormat *formatInfo); UINT8 GetColorMask(const gl::InternalFormat &formatInfo);
} // namespace gl_d3d11 } // namespace gl_d3d11
......
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