Commit 9fc87331 by Brandon Jones Committed by Commit Bot

Fix Bug in Intel Workaround

Fixes an incorrect assert that is hit when trying to find a program output when none are present. It is valid to not have an output, so we should not check for an output when there are none. Bug:angleproject:2283 Change-Id: Ia640482870c6ee589a933b989272177760237e3b Reviewed-on: https://chromium-review.googlesource.com/825957 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 9c8e1a36
......@@ -377,7 +377,7 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const gl:
// drivers < 4815. The rendering samples always pass neglecting discard statements in pixel
// shader. We add a dummy texture as render target in such case.
if (mRenderer->getWorkarounds().addDummyTextureNoRenderTarget &&
colorAttachmentsForRender.empty())
colorAttachmentsForRender.empty() && activeProgramOutputs.any())
{
static_assert(static_cast<size_t>(activeProgramOutputs.size()) <= 32,
"Size of active program outputs should less or equal than 32.");
......
......@@ -7,6 +7,7 @@
// Various tests related for Frambuffers.
//
#include "platform/WorkaroundsD3D.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
......@@ -779,3 +780,39 @@ TEST_P(FramebufferTest_ES31, RenderingLimitToDefaultFBOSizeWithNoAttachments)
}
ANGLE_INSTANTIATE_TEST(FramebufferTest_ES31, ES31_D3D11(), ES31_OPENGL(), ES31_OPENGLES());
class AddDummyTextureNoRenderTargetTest : public ANGLETest
{
public:
AddDummyTextureNoRenderTargetTest()
{
setWindowWidth(512);
setWindowHeight(512);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
}
void overrideWorkaroundsD3D(WorkaroundsD3D *workarounds) override
{
workarounds->addDummyTextureNoRenderTarget = true;
}
};
// Test to verify workaround succeeds when no program outputs exist http://anglebug.com/2283
TEST_P(AddDummyTextureNoRenderTargetTest, NoProgramOutputWorkaround)
{
const std::string &vShader = "void main() {}";
const std::string &fShader = "void main() {}";
ANGLE_GL_PROGRAM(drawProgram, vShader, fShader);
glUseProgram(drawProgram);
glDrawArrays(GL_TRIANGLES, 0, 6);
ASSERT_GL_NO_ERROR();
}
ANGLE_INSTANTIATE_TEST(AddDummyTextureNoRenderTargetTest, ES2_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