summaryrefslogtreecommitdiff
path: root/tests/util
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2018-05-28 10:20:27 +1000
committerTimothy Arceri <tarceri@itsqueeze.com>2018-05-30 09:33:09 +1000
commitf904b12212edd28a0784a74dd9e1b7bcecafb33e (patch)
treee8294e11450db5a0b221d8bf9a187a0d5e8d35c9 /tests/util
parente28f602973f69e4edfc9a87290c3e239e10a9c65 (diff)
piglit-util-gl: add support for using patches with fixed function attributes
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'tests/util')
-rw-r--r--tests/util/piglit-util-gl.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 2443be03e..ebd57d77b 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -684,10 +684,22 @@ piglit_draw_rect_from_arrays(const void *verts, const void *tex,
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
- if (instance_count > 1)
- glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, instance_count);
- else
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ if (use_patches) {
+ GLint old_patch_vertices;
+
+ glGetIntegerv(GL_PATCH_VERTICES, &old_patch_vertices);
+ glPatchParameteri(GL_PATCH_VERTICES, 4);
+ if (instance_count > 1)
+ glDrawArraysInstanced(GL_PATCHES, 0, 4, instance_count);
+ else
+ glDrawArrays(GL_PATCHES, 0, 4);
+ glPatchParameteri(GL_PATCH_VERTICES, old_patch_vertices);
+ } else {
+ if (instance_count > 1)
+ glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, instance_count);
+ else
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ }
if (verts)
glDisableClientState(GL_VERTEX_ARRAY);