diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-05-11 02:05:02 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-05-11 19:38:58 +0200 |
commit | fafad2ea50cac9d6c0e28ed8feb9e8a55e1b480e (patch) | |
tree | ec77dfda2d1d70f1290b474a7da6c5124a519eb3 /tests/util | |
parent | e8702c349a80e78747d3df4a371a6e2a1ebc0edd (diff) |
piglit-util: set GL_PATCH_VERTICES when drawing a quad as a patch
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/piglit-util-gl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c index 131f63eca..0ffb82cfb 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); |