Commit 19dd51b0 by Geoff Lang Committed by Commit Bot

GL: Expose PBO extensions

Ensure WebGLCompatibilityTest.EnablePixelBufferObjectExtensions functions in surfaceless mode by creating a framebuffer to do the test glReadPixels from. BUG=angleproject:4079 Change-Id: I109b3cdeb85625a6a97832ecf8130d53a4074af9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1893058Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent f8b5a4c8
......@@ -1108,6 +1108,11 @@ void GenerateCaps(const FunctionsGL *functions,
extensions->readFormatBGRA = functions->isAtLeastGL(gl::Version(1, 2)) ||
functions->hasGLExtension("GL_EXT_bgra") ||
functions->hasGLESExtension("GL_EXT_read_format_bgra");
extensions->pixelBufferObject = functions->isAtLeastGL(gl::Version(2, 1)) ||
functions->isAtLeastGLES(gl::Version(3, 0)) ||
functions->hasGLExtension("GL_ARB_pixel_buffer_object") ||
functions->hasGLExtension("GL_EXT_pixel_buffer_object") ||
functions->hasGLESExtension("GL_NV_pixel_buffer_object");
extensions->mapBuffer = functions->isAtLeastGL(gl::Version(1, 5)) ||
functions->isAtLeastGLES(gl::Version(3, 0)) ||
functions->hasGLESExtension("GL_OES_mapbuffer");
......
......@@ -584,6 +584,17 @@ TEST_P(WebGLCompatibilityTest, EnablePixelBufferObjectExtensions)
glRequestExtensionANGLE("GL_NV_pixel_buffer_object");
EXPECT_GL_NO_ERROR();
// Create a framebuffer to read from
GLRenderbuffer renderbuffer;
glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 1, 1);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
renderbuffer);
EXPECT_GL_NO_ERROR();
glBindBuffer(GL_PIXEL_PACK_BUFFER, buffer);
EXPECT_GL_NO_ERROR();
......
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