From: Kenneth Graunke <[email protected]>

In the OpenGL 3.3 specification, this changed from INVALID_VALUE to
INVALID_OPERATION.

According to Ian Romanick, the GL specification provides the guidance
that INVALID_VALUE should be generated for "Numeric argument out of
range".  Since FALSE is in range for a boolean, INVALID_VALUE is not
appropriate, and the change to INVALID_OPERATION was meant as a
correction.

See:
http://lists.freedesktop.org/archives/mesa-dev/2013-July/042509.html

Most implementations support 3.3, so they likely follow the new code.

Signed-off-by: Kenneth Graunke <[email protected]>
Cc: Ian Romanick <[email protected]>
Cc: Fredrik Höglund <[email protected]>
Cc: Corey Richardson <[email protected]>
---
 tests/spec/arb_vertex_array_bgra/api-errors.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/tests/spec/arb_vertex_array_bgra/api-errors.c 
b/tests/spec/arb_vertex_array_bgra/api-errors.c
index 7100a78..9db9ca9 100644
--- a/tests/spec/arb_vertex_array_bgra/api-errors.c
+++ b/tests/spec/arb_vertex_array_bgra/api-errors.c
@@ -35,17 +35,11 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 PIGLIT_GL_TEST_CONFIG_END
 
 void
-check_invalid_value()
-{
-       if (!piglit_check_gl_error(GL_INVALID_VALUE))
-               piglit_report_result(PIGLIT_FAIL);
-}
-
-void
 piglit_init(int argc, char **argv)
 {
        static GLuint uints[4] = { 255, 0, 0, 127 };
        static GLubyte ubytes[4] = { 255, 0, 0, 127 };
+       bool pass = true;
 
        piglit_require_gl_version(20);
        piglit_require_extension("GL_ARB_vertex_array_bgra");
@@ -56,7 +50,7 @@ piglit_init(int argc, char **argv)
         */
        glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_FALSE,
                              4 * sizeof(GLubyte), ubytes);
-       check_invalid_value();
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
        /* From the GL_ARB_vertex_array_bgra specification:
         * "The error INVALID_VALUE is generated when ColorPointer,
@@ -64,17 +58,17 @@ piglit_init(int argc, char **argv)
         *  set to BGRA and type is not UNSIGNED_BYTE."
         */
        glColorPointer(GL_BGRA, GL_UNSIGNED_INT, 4 * sizeof(GLuint), NULL);
-       check_invalid_value();
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
        glSecondaryColorPointer(GL_BGRA, GL_UNSIGNED_INT,
                                4 * sizeof(GLuint), NULL);
-       check_invalid_value();
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
        glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_INT, GL_TRUE,
                              4 * sizeof(GLuint), uints);
-       check_invalid_value();
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
-       piglit_report_result(PIGLIT_PASS);
+       piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
 
 enum piglit_result
-- 
1.8.3.2

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to