Commit c084de14 by Corentin Wallez Committed by Commit Bot

ProgramD3D: only broadcast when the GL_EXT_draw_buffers is enabled

The behavior is undefined in GL ES when multiple attachments are used with gl_FragColor but WebGL clarifies that: - If the extension is enabled, broadcast happens - If the extension isn't enabled, only the first attachment is written BUG=angleproject:2048 Change-Id: I6d85ba91df77d42fb8863a03f1faa006cd7817bf Reviewed-on: https://chromium-review.googlesource.com/523809Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 0492d447
...@@ -331,7 +331,8 @@ int ProgramD3DMetadata::getRendererMajorShaderModel() const ...@@ -331,7 +331,8 @@ int ProgramD3DMetadata::getRendererMajorShaderModel() const
bool ProgramD3DMetadata::usesBroadcast(const gl::ContextState &data) const bool ProgramD3DMetadata::usesBroadcast(const gl::ContextState &data) const
{ {
return (mFragmentShader->usesFragColor() && data.getClientMajorVersion() < 3); return (mFragmentShader->usesFragColor() && mFragmentShader->usesMultipleRenderTargets() &&
data.getClientMajorVersion() < 3);
} }
bool ProgramD3DMetadata::usesFragDepth() const bool ProgramD3DMetadata::usesFragDepth() const
......
...@@ -2610,9 +2610,11 @@ TEST_P(WebGL2CompatibilityTest, VertexShaderAttributeTypeMissmatch) ...@@ -2610,9 +2610,11 @@ TEST_P(WebGL2CompatibilityTest, VertexShaderAttributeTypeMissmatch)
// Tests the WebGL removal of undefined behavior when attachments aren't written to. // Tests the WebGL removal of undefined behavior when attachments aren't written to.
TEST_P(WebGLCompatibilityTest, DrawBuffers) TEST_P(WebGLCompatibilityTest, DrawBuffers)
{ {
if (IsD3D9() || IsD3D11()) // TODO(cwallez) AMD incorrectly write black to the first render target when the HLSL pixel
// shader doesn't write anything to the ouput.
if (IsD3D11() && IsAMD())
{ {
std::cout << "Test skipped on " << GetParam() << std::endl; std::cout << "Test skipped on AMD " << GetParam() << std::endl;
return; return;
} }
......
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