Commit 5aca1939 by Jamie Madill Committed by Commit Bot

Framebuffer: Fix enabled draw buffers bitset.

This would start off the zeroth element as enabled even if there was no attachment. If we remove the extra set, then we no longer have to check if the attachment is valid when iterating over the enabled bitset. BUG=angleproject:2107 Change-Id: I679f66156ced09d42add9e302ac974166713e0d5 Reviewed-on: https://chromium-review.googlesource.com/581884Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9603a956
...@@ -201,7 +201,6 @@ FramebufferState::FramebufferState(const Caps &caps) ...@@ -201,7 +201,6 @@ FramebufferState::FramebufferState(const Caps &caps)
{ {
ASSERT(mDrawBufferStates.size() > 0); ASSERT(mDrawBufferStates.size() > 0);
mDrawBufferStates[0] = GL_COLOR_ATTACHMENT0_EXT; mDrawBufferStates[0] = GL_COLOR_ATTACHMENT0_EXT;
mEnabledDrawBuffers.set(0);
} }
FramebufferState::~FramebufferState() FramebufferState::~FramebufferState()
...@@ -1430,11 +1429,12 @@ bool Framebuffer::formsRenderingFeedbackLoopWith(const State &state) const ...@@ -1430,11 +1429,12 @@ bool Framebuffer::formsRenderingFeedbackLoopWith(const State &state) const
// The bitset will skip inactive draw buffers. // The bitset will skip inactive draw buffers.
for (size_t drawIndex : mState.mEnabledDrawBuffers) for (size_t drawIndex : mState.mEnabledDrawBuffers)
{ {
const FramebufferAttachment *attachment = getDrawBuffer(drawIndex); const FramebufferAttachment &attachment = mState.mColorAttachments[drawIndex];
if (attachment && attachment->type() == GL_TEXTURE) ASSERT(attachment.isAttached());
if (attachment.type() == GL_TEXTURE)
{ {
// Validate the feedback loop. // Validate the feedback loop.
if (program->samplesFromTexture(state, attachment->id())) if (program->samplesFromTexture(state, attachment.id()))
{ {
return true; return true;
} }
......
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