[Piglit] [PATCH] Remove BindBufferRange out-of-range tests.

Paul Berry stereotype441 at gmail.com
Thu Feb 7 18:35:54 PST 2013


In the documentation for BindBufferRange, OpenGL specs from 3.0
through 4.1 contain this language:

    "The error INVALID_VALUE is generated if size is less than or
    equal to zero or if offset + size is greater than the value of
    BUFFER_SIZE."

This text was dropped from OpenGL 4.2, and it does not appear in the
GLES 3.0 spec.

Presumably the reason for the change is because come clients change
the size of the buffer after calling BindBufferRange.  Implementations
shouldn't generate an error at the time of the BindBufferRange call
just because the old size of the buffer was too small, when the buffer
is about to be resized.

Since this is a deliberate relaxation of error conditions in order to
allow clients to work, it seems sensible to allow implementations to
apply this change even if the GL version is less than 4.2.  This patch
eliminates the checks that would have required the error condition to
be flagged.

See associated Mesa patch:

    mesa: Don't check (offset + size <= bufObj->Size) in BindBufferRange.
---
 .../arb_uniform_buffer_object/negative-bindbufferrange-range.c    | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tests/spec/arb_uniform_buffer_object/negative-bindbufferrange-range.c b/tests/spec/arb_uniform_buffer_object/negative-bindbufferrange-range.c
index 2aa33ce..5408fbb 100644
--- a/tests/spec/arb_uniform_buffer_object/negative-bindbufferrange-range.c
+++ b/tests/spec/arb_uniform_buffer_object/negative-bindbufferrange-range.c
@@ -75,14 +75,6 @@ piglit_init(int argc, char **argv)
 	if (!piglit_check_gl_error(GL_INVALID_VALUE))
 		pass = false;
 
-	glBindBufferRange(GL_UNIFORM_BUFFER, index, bo, 0, size + 1);
-	if (!piglit_check_gl_error(GL_INVALID_VALUE))
-		pass = false;
-
-	glBindBufferRange(GL_UNIFORM_BUFFER, index, bo, 1, size);
-	if (!piglit_check_gl_error(GL_INVALID_VALUE))
-		pass = false;
-
 	glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &alignment);
 	for (i = 1; i < alignment; i++) {
 		glBindBufferRange(GL_UNIFORM_BUFFER, index, bo, i, 4);
-- 
1.8.1.2



More information about the Piglit mailing list