[Piglit] [PATCH] piglit-util: set GL_PATCH_VERTICES when drawing a quad as a patch

Chris Forbes chrisf at ijw.co.nz
Sun May 10 18:50:00 PDT 2015


Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

On Mon, May 11, 2015 at 12:06 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
>  tests/util/piglit-util-gl.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
> index 131f63e..0ffb82c 100644
> --- a/tests/util/piglit-util-gl.c
> +++ b/tests/util/piglit-util-gl.c
> @@ -755,7 +755,16 @@ piglit_draw_rect_from_arrays(const void *verts, const void *tex,
>                         glEnableVertexAttribArray(PIGLIT_ATTRIB_TEX);
>                 }
>
> -               glDrawArrays(use_patches ? GL_PATCHES : GL_TRIANGLE_STRIP, 0, 4);
> +               if (use_patches) {
> +                       GLint old_patch_vertices;
> +
> +                       glGetIntegerv(GL_PATCH_VERTICES, &old_patch_vertices);
> +                       glPatchParameteri(GL_PATCH_VERTICES, 4);
> +                       glDrawArrays(GL_PATCHES, 0, 4);
> +                       glPatchParameteri(GL_PATCH_VERTICES, old_patch_vertices);
> +               }
> +               else
> +                       glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
>
>                 if (verts)
>                         glDisableVertexAttribArray(PIGLIT_ATTRIB_POS);
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list