[Piglit] [PATCH] tess: avoid reading past the end of the gl_in array

Marek Olšák maraeo at gmail.com
Fri Aug 7 04:22:50 PDT 2015


It would be nice to keep these tests under names that say they test
out-of-bounds accesses.

Marek

On Wed, Jul 29, 2015 at 5:45 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Reading off the end causes out-of-bounds errors on nouveau, and one
> might think that it's somehow barrier-related given the name of these
> tests. If this is a valuable thing to test, there can be a separate test
> for that.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  .../spec/arb_tessellation_shader/execution/barrier-patch.shader_test | 5 ++++-
>  tests/spec/arb_tessellation_shader/execution/barrier.shader_test     | 5 ++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_tessellation_shader/execution/barrier-patch.shader_test b/tests/spec/arb_tessellation_shader/execution/barrier-patch.shader_test
> index d34fdc5..313e9d0 100644
> --- a/tests/spec/arb_tessellation_shader/execution/barrier-patch.shader_test
> +++ b/tests/spec/arb_tessellation_shader/execution/barrier-patch.shader_test
> @@ -12,7 +12,10 @@ patch out int val[6];
>  patch out vec4 pcolor;
>
>  void main() {
> -       gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
> +       if (gl_InvocationID < gl_PatchVerticesIn)
> +               gl_out[gl_InvocationID].gl_Position =
> +                       gl_in[gl_InvocationID].gl_Position;
> +
>          if (gl_InvocationID < val.length())
>                  val[gl_InvocationID] = gl_InvocationID;
>
> diff --git a/tests/spec/arb_tessellation_shader/execution/barrier.shader_test b/tests/spec/arb_tessellation_shader/execution/barrier.shader_test
> index 8ac74f0..a505e79 100644
> --- a/tests/spec/arb_tessellation_shader/execution/barrier.shader_test
> +++ b/tests/spec/arb_tessellation_shader/execution/barrier.shader_test
> @@ -12,7 +12,10 @@ out int val[];
>  patch out vec4 pcolor;
>
>  void main() {
> -       gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
> +       if (gl_InvocationID < gl_PatchVerticesIn)
> +               gl_out[gl_InvocationID].gl_Position =
> +                       gl_in[gl_InvocationID].gl_Position;
> +
>          if (gl_InvocationID < val.length())
>                  val[gl_InvocationID] = gl_InvocationID;
>
> --
> 2.3.6
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list