[Piglit] [PATCH] gs: Test corner case for triangle strip ordering with primitive restart.
Paul Berry
stereotype441 at gmail.com
Sat Aug 31 17:41:33 PDT 2013
On 30 August 2013 01:20, Pohjolainen, Topi <topi.pohjolainen at intel.com>wrote:
> On Wed, Aug 28, 2013 at 12:12:40PM -0700, Paul Berry wrote:
> > Verified using the NVIDIA proprietary driver for linux.
> > ---
> > tests/all.tests | 6 +
> > .../glsl-1.50/execution/geometry/CMakeLists.gl.txt | 1 +
> > .../tri-strip-ordering-with-prim-restart.c | 311
> +++++++++++++++++++++
> > 3 files changed, 318 insertions(+)
> > create mode 100644
> tests/spec/glsl-1.50/execution/geometry/tri-strip-ordering-with-prim-restart.c
> >
> > diff --git a/tests/all.tests b/tests/all.tests
> > index 7ab841e..3ee7cd2 100644
> > --- a/tests/all.tests
> > +++ b/tests/all.tests
> > @@ -955,6 +955,12 @@ for prim_type in ['GL_POINTS', 'GL_LINE_LOOP',
> 'GL_LINE_STRIP', 'GL_LINES',
> > 'glsl-1.50-geometry-primitive-types {0}'.format(
> > prim_type))
> >
> > +for prim_type in ['GL_TRIANGLE_STRIP', 'GL_TRIANGLE_STRIP_ADJACENCY']:
> > + for restart_index in ['ffs', 'other']:
> > + add_concurrent_test(spec['glsl-1.50'],
> > +
> 'glsl-1.50-geometry-tri-strip-ordering-with-prim-restart {0} {1}'.format(
> > + prim_type, restart_index))
> > +
> > spec['glsl-3.30'] = Group()
> > import_glsl_parser_tests(spec['glsl-3.30'],
> > os.path.join(testsDir, 'spec', 'glsl-3.30'),
> > diff --git a/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> b/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> > index 202fcd2..a504412 100644
> > --- a/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> > +++ b/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> > @@ -12,3 +12,4 @@ ${OPENGL_glu_LIBRARY}
> >
> > piglit_add_executable (glsl-1.50-geometry-end-primitive end-primitive.c)
> > piglit_add_executable (glsl-1.50-geometry-primitive-types
> primitive-types.c)
> > +piglit_add_executable
> (glsl-1.50-geometry-tri-strip-ordering-with-prim-restart
> tri-strip-ordering-with-prim-restart.c)
> > diff --git
> a/tests/spec/glsl-1.50/execution/geometry/tri-strip-ordering-with-prim-restart.c
> b/tests/spec/glsl-1.50/execution/geometry/tri-strip-ordering-with-prim-restart.c
> > new file mode 100644
> > index 0000000..90f6860
> > --- /dev/null
> > +++
> b/tests/spec/glsl-1.50/execution/geometry/tri-strip-ordering-with-prim-restart.c
> > @@ -0,0 +1,311 @@
> > +/*
> > + * Copyright © 2013 Intel Corporation
> > + *
> > + * 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.
> > + */
> > +
> > +/**
> > + * \file tri-strip-ordering-with-prim-restart.c
> > + *
> > + * Check a subtle corner case that affects the i965/gen7 mesa driver:
> > + * when the primitive type is either GL_TRIANGLE_STRIP or
> > + * GL_TRIANGLE_STRIP_ADJACENCY, the hardware delivers the vertices of
> > + * odd numbered triangles to the geometry shader in the wrong order,
> > + * so the driver must emit workaround code to re-order them. This
> > + * test verifies that the workaround code functions correctly in the
> > + * presence of primitive restart, since the presence of primitive
> > + * restart can make a triangle "odd numbered" in relation to the
> > + * current strip even if it is "even numbered" as measured by
> > + * gl_PrimitiveIDIn.
> > + *
> > + * This test works by issuing a single draw call and using primitive
> > + * restart to split it into a pair of 3-triangle strips (this ensures
> > + * that triangles in the first strip have the same parity in relation
> > + * to the strip as they have when measured by gl_PrimitiveIDIn;
> > + * triangles in the second strip hav opposite parity in relation to
> > + * the strip from what they have when measured by gl_PrimitiveIDIn).
> > + * The vertex IDs of all vertices are collected using transform
> > + * feedback, and checked it C to make sure it matches the expected
> ^
> Just checking if this was supposed to be "checked in C" instead?
>
Oops. Yes, thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130831/15123bfc/attachment.html>
More information about the Piglit
mailing list