[Mesa-dev] [PATCH] draw-robustness: Test robustness for out-of-bounds vertex fetches.

Eric Anholt eric at anholt.net
Thu Mar 31 13:38:56 PDT 2011


On Thu, 31 Mar 2011 14:46:32 +0100, jfonseca at vmware.com wrote:
> From: José Fonseca <jfonseca at vmware.com>
> 
> Not added to the standard test lists given that ARB_vertex_buffer_object
> allows program termination out-of-bounds vertex buffer object fetches
> occur.
> ---
>  tests/general/CMakeLists.gl.txt |    1 +
>  tests/general/draw-robustness.c |  201 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 202 insertions(+), 0 deletions(-)
>  create mode 100644 tests/general/draw-robustness.c
> 
> diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
> index bbe6507..d373e35 100644
> --- a/tests/general/CMakeLists.gl.txt
> +++ b/tests/general/CMakeLists.gl.txt
> @@ -36,6 +36,7 @@ ENDIF (UNIX)
>  add_executable (draw-elements-vs-inputs draw-elements-vs-inputs.c)
>  add_executable (draw-instanced draw-instanced.c)
>  add_executable (draw-instanced-divisor draw-instanced-divisor.c)
> +add_executable (draw-robustness draw-robustness.c)
>  add_executable (draw-vertices draw-vertices.c)
>  add_executable (draw-vertices-half-float draw-vertices-half-float.c)
>  add_executable (fog-modes fog-modes.c)
> diff --git a/tests/general/draw-robustness.c b/tests/general/draw-robustness.c
> new file mode 100644
> index 0000000..a13f568
> --- /dev/null
> +++ b/tests/general/draw-robustness.c
> @@ -0,0 +1,201 @@
> +/*
> + * Copyright (C) 2011 VMware, Inc.
> + * Copyright (C) 2010 Marek Olšák <maraeo at gmail.com>
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + * Authors:
> + *   Jose Fonseca <jfonseca at vmware.com>
> + *   Based on code from Marek Olšák <maraeo at gmail.com>
> + */
> +
> +/* Test whether out-of-bounds vertex buffer object cause termination.
> + *
> + * Note that the original ARB_vertex_buffer_object extension explicitly states
> + * program termination is allowed when out-of-bounds vertex buffer object
> + * fetches occur.  The ARB_robustness extension does provides an enbale to
> + * guarantee that out-of-bounds buffer object accesses by the GPU will have
> + * deterministic behavior and preclude application instability or termination
> + * due to an incorrect buffer access.  But regardless of ARB_robustness
> + * extension support it is a good idea not to crash.  For example,  viewperf
> + * doesn't properly detect NV_primitive_restart and emits 0xffffffff indices
> + * which can result in crashes.
> + *
> + * TODO:
> + * - test out-of-bound index buffer object access
> + * - test more vertex/element formats
> + * - test non-aligned offsets
> + * - provide a command line option to actually enable ARB_robustness
> + */

Instead of a single draw-robustness test to (eventually) test all these
things, a draw-robustness-* collection of tests for each would be way
more useful.
-------------- 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/mesa-dev/attachments/20110331/a04250e6/attachment.pgp>


More information about the mesa-dev mailing list