Bind renderbuffers as soon as they are generated.
Like textures, renderbuffers don't become real objects until they are
bound. If the renderbuffer is never bound before being attached to a
framebuffer, it would generate an INVALID_OPERATION.
Fixes:
* conformance/textures/tex-input-validation.html
* conformance/renderbuffers/renderbuffer-initialization.html
BUG=angleproject:886
Change-Id: I639b9e2d9ae694dce29f20ed5f95077ae02d471e
Reviewed-on: https://chromium-review.googlesource.com/273533
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/gl/RenderbufferGL.cpp b/src/libANGLE/renderer/gl/RenderbufferGL.cpp
index d1a2aa7..358da74 100644
--- a/src/libANGLE/renderer/gl/RenderbufferGL.cpp
+++ b/src/libANGLE/renderer/gl/RenderbufferGL.cpp
@@ -26,6 +26,7 @@
mRenderbufferID(0)
{
mFunctions->genRenderbuffers(1, &mRenderbufferID);
+ mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mRenderbufferID);
}
RenderbufferGL::~RenderbufferGL()