[Piglit] [PATCH 6/6] Add geometry testing to code-generated tests.

Ken Phillis Jr kphillisjr at gmail.com
Fri Feb 22 00:01:57 PST 2013


Just a quick question, Which versions of glsl is this test supposed to cover?

Based on the coding techniques it looks like it covers strictly nvidia based
glsl that is not always up to spec.

GLSL 1.20 to GLSL 3.30: Just reading the specs on this do not allow
statements like: ( Also, there is no clear example showing this )
variable.length

However, there is the length function that does exist can be of use, so
the following type of call is good:
variable.length()

See:  section 4.1.9 ( Arrays ) for how to handle this on GLSL 1.20 to 3.30.

NOTE: variable.length  is valid under CG, so this clearly seems to be nvidia
based driver behavior tests.

GLSL 1.10: there is no length function for arrays. So the only available
option is to use the following on geometry shader tests since it is a
constant defined at link time.
 gl_VerticesIn.

On Thu, Feb 14, 2013 at 10:50 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> This patch adds geometry shader variants to the code-generated
> built-in function tests produced by gen_builtin_uniform_tests.py and
> gen_constant_array_size_tests.py.
> ---
>  generated_tests/gen_builtin_uniform_tests.py     | 127 ++++++++++++++++++++---
>  generated_tests/gen_constant_array_size_tests.py |  42 +++++++-
>  2 files changed, 153 insertions(+), 16 deletions(-)
>
> diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
> index 323985f..dc59b18 100644
> --- a/generated_tests/gen_builtin_uniform_tests.py
> +++ b/generated_tests/gen_builtin_uniform_tests.py

Just quickly removing a lot of excess patch. The only change needed is below.

> +       return self.make_test_shader(
> +           additional_declarations,
> +           '  vec4 tmp_color;\n',
> +           'tmp_color',
> +           '  for (int i = 0; i < gl_PositionIn.length; i++) {\n'
> +           '    gl_Position = gl_PositionIn[i];\n'
> +           '    color = tmp_color;\n'
> +           '    EmitVertex();\n'
> +           '  }\n')
> +


More information about the Piglit mailing list