<div dir="ltr">On 22 February 2013 00:01, Ken Phillis Jr <span dir="ltr"><<a href="mailto:kphillisjr@gmail.com" target="_blank">kphillisjr@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just a quick question, Which versions of glsl is this test supposed to cover?<br>
<br>
Based on the coding techniques it looks like it covers strictly nvidia based<br>
glsl that is not always up to spec.<br>
<br>
GLSL 1.20 to GLSL 3.30: Just reading the specs on this do not allow<br>
statements like: ( Also, there is no clear example showing this )<br>
variable.length<br>
<br>
However, there is the length function that does exist can be of use, so<br>
the following type of call is good:<br>
variable.length()<br>
<br>
See:  section 4.1.9 ( Arrays ) for how to handle this on GLSL 1.20 to 3.30.<br>
<br>
NOTE: variable.length  is valid under CG, so this clearly seems to be nvidia<br>
based driver behavior tests.<br>
<br>
GLSL 1.10: there is no length function for arrays. So the only available<br>
option is to use the following on geometry shader tests since it is a<br>
constant defined at link time.<br>
 gl_VerticesIn.<br></blockquote><div><br></div><div>This was simply an oversight--my intention was for each test to be compliant with ARB_geometry_shader4 and the version of GLSL corresponding to the subdirectory the test is placed in.  I only had an nVidia system available for validating the tests, and since it accepts the non-standard syntax, I didn't notice my mistake.</div>

<div><br></div><div>Since this patch has already landed in Piglit, I will make a follow-up patch that changes the test to use gl_VerticesIn, as you suggest.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><br>
On Thu, Feb 14, 2013 at 10:50 AM, Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>> wrote:<br>
> This patch adds geometry shader variants to the code-generated<br>
> built-in function tests produced by gen_builtin_uniform_tests.py and<br>
> gen_constant_array_size_tests.py.<br>
> ---<br>
>  generated_tests/gen_builtin_uniform_tests.py     | 127 ++++++++++++++++++++---<br>
>  generated_tests/gen_constant_array_size_tests.py |  42 +++++++-<br>
>  2 files changed, 153 insertions(+), 16 deletions(-)<br>
><br>
> diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py<br>
> index 323985f..dc59b18 100644<br>
> --- a/generated_tests/gen_builtin_uniform_tests.py<br>
> +++ b/generated_tests/gen_builtin_uniform_tests.py<br>
<br>
</div>Just quickly removing a lot of excess patch. The only change needed is below.<br>
<div><div><br>
> +       return self.make_test_shader(<br>
> +           additional_declarations,<br>
> +           '  vec4 tmp_color;\n',<br>
> +           'tmp_color',<br>
> +           '  for (int i = 0; i < gl_PositionIn.length; i++) {\n'<br>
> +           '    gl_Position = gl_PositionIn[i];\n'<br>
> +           '    color = tmp_color;\n'<br>
> +           '    EmitVertex();\n'<br>
> +           '  }\n')<br>
> +<br>
</div></div></blockquote></div><br></div><div class="gmail_extra"><br></div></div>