summaryrefslogtreecommitdiff
path: root/tests/spec/arb_post_depth_coverage/multisampling.c
diff options
context:
space:
mode:
authorLyude <lyude@redhat.com>2017-05-22 14:55:09 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2017-07-19 20:41:23 -0400
commit779548372f0a0bab3a344d0470812faa4ae6d7cc (patch)
tree7b2608bbeb2c10d71272238c8ba73a601d16be13 /tests/spec/arb_post_depth_coverage/multisampling.c
parent56e7e5583cd4a3ca15a8cda154d46d168959dd25 (diff)
arb_post_depth_coverage: Don't try sample rates we don't support
Some intel hardware supports up to 16 samples, but nvidia only goes up to 8. So stop these tests from failing on nvidia hardware by only testing up to the max sample rate we can support. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'tests/spec/arb_post_depth_coverage/multisampling.c')
-rw-r--r--tests/spec/arb_post_depth_coverage/multisampling.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/spec/arb_post_depth_coverage/multisampling.c b/tests/spec/arb_post_depth_coverage/multisampling.c
index 0c867da7c..f90208d74 100644
--- a/tests/spec/arb_post_depth_coverage/multisampling.c
+++ b/tests/spec/arb_post_depth_coverage/multisampling.c
@@ -236,12 +236,14 @@ enum piglit_result
piglit_display(void)
{
int samples[4] = { 2, 4, 8, 16 };
+ int max_samples;
bool pass = true;
int i, j, k;
glViewport(0, 0, piglit_width, piglit_height);
+ glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
- for (j = 0; j < 4; j++) {
+ for (j = 0; j < 4 && samples[j] <= max_samples; j++) {
sample_mask = (GLint*) calloc (piglit_width * piglit_height,
sizeof(GLint));
glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(GLint) * piglit_width *