Commit adb857b2 by Austin Kinross Committed by Geoff Lang

Fix MultipleDrawBuffers sample when GL_OES_texture_npot isn't active

If the GL_OES_texture_npot extension isn't active, then setting GL_TEXTURE_WRAP_S/T to GL_REPEAT for a NPOT texture results in black rendering. This is specified in Section 3.8.2 of the OpenGL ES 2.0 specification. Setting GL_TEXTURE_WRAP_S/T to GL_CLAMP_TO_EDGE is valid even if the NPOT extension isn't active. Change-Id: Ibd553620995df32138bf8153d1036fd05d386d90 Reviewed-on: https://chromium-review.googlesource.com/306302Tested-by: 's avatarAustin Kinross <aukinros@microsoft.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent d2c52e3b
...@@ -83,8 +83,8 @@ class MultipleDrawBuffersSample : public SampleApplication ...@@ -83,8 +83,8 @@ class MultipleDrawBuffersSample : public SampleApplication
// Create textures for the four color attachments // Create textures for the four color attachments
glBindTexture(GL_TEXTURE_2D, mFramebufferTextures[i]); glBindTexture(GL_TEXTURE_2D, mFramebufferTextures[i]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, getWindow()->getWidth(), getWindow()->getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, getWindow()->getWidth(), getWindow()->getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glFramebufferTexture2D(GL_FRAMEBUFFER, glFramebufferTexture2D(GL_FRAMEBUFFER,
......
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