summaryrefslogtreecommitdiff
path: root/tests/util/piglit-framework-gl.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-06-01 12:56:16 +0200
committerMarek Olšák <maraeo@gmail.com>2013-06-12 16:38:30 +0200
commit3a99a8ba3b3a95994541841ae0d259aae80280f3 (patch)
tree46e2a9b5b558e161d252e0f22713a093de075367 /tests/util/piglit-framework-gl.c
parent2e36f3c61721df5272b29cfb2edc161c15462041 (diff)
Add -samples=n command-line argument forcing MSAA visuals
v2: combining -fbo and -samples should report FAIL Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'tests/util/piglit-framework-gl.c')
-rw-r--r--tests/util/piglit-framework-gl.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index 441e271c4..82197bbb8 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -60,7 +60,7 @@ delete_arg(char *argv[], int argc, int arg)
* length is returned in @a argc.
*/
static void
-process_args(int *argc, char *argv[])
+process_args(int *argc, char *argv[], unsigned *force_samples)
{
int j;
@@ -104,6 +104,10 @@ process_args(int *argc, char *argv[])
}
*argc -= 2;
j -= 2;
+ } else if (!strncmp(argv[j], "-samples=", 9)) {
+ *force_samples = atoi(argv[j]+9);
+ delete_arg(argv, *argc, j--);
+ *argc -= 1;
}
}
}
@@ -112,12 +116,18 @@ void
piglit_gl_test_run(int argc, char *argv[],
const struct piglit_gl_test_config *config)
{
- process_args(&argc, argv);
+ struct piglit_gl_test_config conf = *config;
+ unsigned force_samples = 0;
+
+ process_args(&argc, argv, &force_samples);
+
+ if (force_samples > 1)
+ conf.window_samples = force_samples;
- piglit_width = config->window_width;
- piglit_height = config->window_height;
+ piglit_width = conf.window_width;
+ piglit_height = conf.window_height;
- gl_fw = piglit_gl_framework_factory(config);
+ gl_fw = piglit_gl_framework_factory(&conf);
if (gl_fw == NULL) {
printf("piglit: error: failed to create "
"piglit_gl_framework\n");