summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-04-21 12:46:22 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-05-09 16:24:48 +0200
commitc8e072500ac64e85ae4a43331bcc431a8fe364b9 (patch)
treec17fac0fb5494f6f8bbad13568a6314a45ec58de
parentdb62e27e148e3db6e4f401caadc9c5bbdc17796a (diff)
util: fix regression with ubyte probing
clearbuffer-mixed-format regressed, because GL_RED_BITS doesn't have anything to do with the read buffer.
-rw-r--r--tests/util/piglit-util-gl.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index b288a67b0..ca544e8a5 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1063,12 +1063,25 @@ piglit_read_pixels_float(GLint x, GLint y, GLsizei width, GLsizei height,
static bool
piglit_can_probe_ubyte()
{
- int r,g,b,a;
+ int r,g,b,a,read;
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
- glGetIntegerv(GL_ALPHA_BITS, &a);
+ if (!piglit_is_extension_supported("GL_ARB_framebuffer_object"))
+ return false;
+
+ glGetIntegerv(GL_READ_BUFFER, &read);
+ if (read == GL_FRONT)
+ read = GL_FRONT_LEFT;
+ if (read == GL_BACK)
+ read = GL_BACK_LEFT;
+
+ glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, read,
+ GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &r);
+ glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, read,
+ GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, &g);
+ glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, read,
+ GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, &b);
+ glGetFramebufferAttachmentParameteriv(GL_READ_FRAMEBUFFER, read,
+ GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &a);
/* it could be LUMINANCE32F, etc. */
if (!r && !g && !b && !a)