[Piglit] [PATCH 1/2] gl-3.0: Add test for invalid drawbuffer parameter to glClearBuffer

Ian Romanick idr at freedesktop.org
Wed Nov 2 13:14:22 PDT 2011


On 11/01/2011 03:27 PM, Eric Anholt wrote:
> On Tue,  1 Nov 2011 15:00:46 -0700, "Ian Romanick"<idr at freedesktop.org>  wrote:
>> From: Ian Romanick<ian.d.romanick at intel.com>
>>
>> Signed-off-by: Ian Romanick<ian.d.romanick at intel.com>
>> ---
>>   tests/all.tests                                    |    4 +
>>   tests/spec/CMakeLists.txt                          |    1 +
>>   tests/spec/gl-3.0/CMakeLists.txt                   |    2 +
>>   tests/spec/gl-3.0/api/CMakeLists.gl.txt            |   17 ++
>>   tests/spec/gl-3.0/api/CMakeLists.txt               |    1 +
>>   .../gl-3.0/api/clearbuffer-invalid-drawbuffer.c    |  226 ++++++++++++++++++++
>>   6 files changed, 251 insertions(+), 0 deletions(-)
>>   create mode 100644 tests/spec/gl-3.0/CMakeLists.txt
>>   create mode 100644 tests/spec/gl-3.0/api/CMakeLists.gl.txt
>>   create mode 100644 tests/spec/gl-3.0/api/CMakeLists.txt
>>   create mode 100644 tests/spec/gl-3.0/api/clearbuffer-invalid-drawbuffer.c
>>
>> diff --git a/tests/all.tests b/tests/all.tests
>> index 987e3b6..74d47ee 100644
>> --- a/tests/all.tests
>> +++ b/tests/all.tests
>> @@ -782,6 +782,10 @@ add_concurrent_test(gl20, 'vertex-program-two-side front2')
>>   add_concurrent_test(gl20, 'vertex-program-two-side back2')
>>   add_concurrent_test(gl20, 'vertex-program-two-side')
>>
>> +gl30 = Group()
>> +spec['!OpenGL 3.0'] = gl30
>> +add_concurrent_test(gl20, 'clearbuffer-invalid-drawbuffer')
>
> itym "gl30"?

Yeah, I noticed that about 5 minutes after sending the tests out.

>> +	/* Table 2.3, "Summary of GL errors" on page 17 (page 33) of the
>> +	 * OpenGL 3.0 spec says:
>> +	 *
>> +	 *     "Error         Description                    Offending command
>> +	 *                                                   ignored?
>> +	 *     ...
>> +	 *     INVALID_VALUE  Numeric argument out of range  Yes"
>> +	 *
>> +	 * For all of the tests involving an invalid value passed to the
>> +	 * drawbuffer argument, we expect an error of GL_INVALID_VALUE.
>> +	 */
>> +
>> +	/* Page 263 (page 279 of the PDF) of the OpenGL 3.0 spec says:
>> +	 *
>> +	 *     "If buffer is DEPTH, drawbuffer must be zero, and value points
>> +	 *     to the single depth value to clear the depth buffer to."
>> +	 *
>> +	 */
>
> I can't find the text "if the buffer is depth" or "drawbuffer must be"
> in the GL 3.0 spec from 2008-08-11.  Particularly, I'm not following
> what "drawbuffer must be zero" means.
>
> Oh, wow.  This apparently was fixed since the initial 3.0 spec, which is
> mentioned in the 3.1 spec, but the fixed 3.0 spec isn't linked from
> http://www.opengl.org/documentation/specs/.  Awesome.

Supposedly http://www.opengl.org/documentation/specs/ is going to die in 
a fire.  It's always out of date, and it just duplicates data at 
http://www.opengl.org/registry/.

>> +	/* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says:
>> +	 *
>> +	 *     "ClearBuffer generates an INVALID VALUE error if buffer is
>> +	 *     COLOR and drawbuffer is less than zero, or greater than the
>> +	 *     value of MAX DRAW BUFFERS minus one; or if buffer is DEPTH,
>> +	 *     STENCIL, or DEPTH STENCIL and drawbuffer is not zero."
>> +	 */
>
> This text is more clear about depth/stencil than the two citations
> above.

Do you think just quoting this bit of text and omitting the others is 
sufficient?


More information about the Piglit mailing list