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

Eric Anholt eric at anholt.net
Tue Nov 1 15:27:40 PDT 2011


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"?

> +	/* 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.

> +	/* 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20111101/6bd54e12/attachment-0001.pgp>


More information about the Piglit mailing list