Commit 2ec65dc8 by Antoine Labour Committed by Commit Bot

Handle GL_READ_BUFFER being GL_NONE in getReadAttachment()

Change-Id: If3883de8f49a3fb33ecc598ba0b86c658cd3f0ca Reviewed-on: https://chromium-review.googlesource.com/415565Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 47c0e048
......@@ -96,6 +96,10 @@ const FramebufferAttachment *FramebufferState::getAttachment(GLenum attachment)
const FramebufferAttachment *FramebufferState::getReadAttachment() const
{
if (mReadBufferState == GL_NONE)
{
return nullptr;
}
ASSERT(mReadBufferState == GL_BACK || (mReadBufferState >= GL_COLOR_ATTACHMENT0 && mReadBufferState <= GL_COLOR_ATTACHMENT15));
size_t readIndex = (mReadBufferState == GL_BACK ? 0 : static_cast<size_t>(mReadBufferState - GL_COLOR_ATTACHMENT0));
ASSERT(readIndex < mColorAttachments.size());
......
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