<div dir="ltr">On 1 June 2013 05:38, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
tests/util/piglit-framework-gl.c | 20 +++++++++++++++-----<br>
tests/util/piglit-framework-gl.h | 1 +<br>
.../piglit-framework-gl/piglit_fbo_framework.c | 5 +++++<br>
.../piglit-framework-gl/piglit_glut_framework.c | 5 +++++<br>
.../piglit-framework-gl/piglit_winsys_framework.c | 7 +++++++<br>
5 files changed, 33 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c<br>
index 441e271..82197bb 100644<br>
--- a/tests/util/piglit-framework-gl.c<br>
+++ b/tests/util/piglit-framework-gl.c<br>
@@ -60,7 +60,7 @@ delete_arg(char *argv[], int argc, int arg)<br>
* length is returned in @a argc.<br>
*/<br>
static void<br>
-process_args(int *argc, char *argv[])<br>
+process_args(int *argc, char *argv[], unsigned *force_samples)<br>
{<br>
int j;<br>
<br>
@@ -104,6 +104,10 @@ process_args(int *argc, char *argv[])<br>
}<br>
*argc -= 2;<br>
j -= 2;<br>
+ } else if (!strncmp(argv[j], "-samples=", 9)) {<br>
+ *force_samples = atoi(argv[j]+9);<br>
+ delete_arg(argv, *argc, j--);<br>
+ *argc -= 1;<br>
}<br>
}<br>
}<br>
@@ -112,12 +116,18 @@ void<br>
piglit_gl_test_run(int argc, char *argv[],<br>
const struct piglit_gl_test_config *config)<br>
{<br>
- process_args(&argc, argv);<br>
+ struct piglit_gl_test_config conf = *config;<br>
+ unsigned force_samples = 0;<br>
+<br>
+ process_args(&argc, argv, &force_samples);<br>
+<br>
+ if (force_samples > 1)<br>
+ conf.window_samples = force_samples;<br>
<br>
- piglit_width = config->window_width;<br>
- piglit_height = config->window_height;<br>
+ piglit_width = conf.window_width;<br>
+ piglit_height = conf.window_height;<br>
<br>
- gl_fw = piglit_gl_framework_factory(config);<br>
+ gl_fw = piglit_gl_framework_factory(&conf);<br>
if (gl_fw == NULL) {<br>
printf("piglit: error: failed to create "<br>
"piglit_gl_framework\n");<br>
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h<br>
index 4406c1b..95be1c1 100644<br>
--- a/tests/util/piglit-framework-gl.h<br>
+++ b/tests/util/piglit-framework-gl.h<br>
@@ -140,6 +140,7 @@ struct piglit_gl_test_config {<br>
<br>
int window_width;<br>
int window_height;<br>
+ int window_samples;<br>
<br>
/**<br>
* A bitmask of `enum piglit_gl_visual`.<br>
diff --git a/tests/util/piglit-framework-gl/piglit_fbo_framework.c b/tests/util/piglit-framework-gl/piglit_fbo_framework.c<br>
index 1b844bb..1aad5fe 100644<br>
--- a/tests/util/piglit-framework-gl/piglit_fbo_framework.c<br>
+++ b/tests/util/piglit-framework-gl/piglit_fbo_framework.c<br>
@@ -139,6 +139,11 @@ piglit_fbo_framework_create(const struct piglit_gl_test_config *test_config)<br>
int32_t platform = piglit_wfl_framework_choose_platform(test_config);<br>
bool ok = true;<br>
<br>
+ if (test_config->window_samples > 1) {<br>
+ puts("The FBO mode doesn't support multisampling\n");<br>
+ piglit_report_result(PIGLIT_SKIP);<br>
+ }<br>
+<br></blockquote><div><br></div><div>I'd prefer PIGLIT_FAIL here. PIGLIT_SKIP is for cases where we can't run the test because a required feature is missing from the underlying GL implementation. But in this case it's a feature that the piglit framework doesn't support (just because we haven't gotten around to adding it yet). If, in the future, someone adds a test to all.tests that tries to combine "-samples=n" with "-fbo", I'd like them to get a big nasty PIGLIT_FAIL to alert them to the fact that they are trying to use an unimplemented piglit feature.<br>
<br></div><div>Alternatively, we could just go ahead and implement support. It wouldn't be too much work to add it to piglit_fbo_framework.c.<br><br></div><div>With that changed, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wfl_fw = calloc(1, sizeof(*wfl_fw));<br>
gl_fw = &wfl_fw->gl_fw;<br>
<br>
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>
index cfadf77..ff48abb 100644<br>
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>
@@ -180,6 +180,11 @@ piglit_glut_framework_create(const struct piglit_gl_test_config *test_config)<br>
piglit_report_result(PIGLIT_SKIP);<br>
}<br>
<br>
+ if (test_config->window_samples > 1) {<br>
+ printf("GLUT doesn't support MSAA visuals.\n");<br>
+ piglit_report_result(PIGLIT_SKIP);<br>
+ }<br>
+<br>
ok = piglit_gl_framework_init(&glut_fw.gl_fw, test_config);<br>
if (!ok)<br>
return NULL;<br>
diff --git a/tests/util/piglit-framework-gl/piglit_winsys_framework.c b/tests/util/piglit-framework-gl/piglit_winsys_framework.c<br>
index 971f183..205ea21 100644<br>
--- a/tests/util/piglit-framework-gl/piglit_winsys_framework.c<br>
+++ b/tests/util/piglit-framework-gl/piglit_winsys_framework.c<br>
@@ -128,6 +128,13 @@ choose_config_attribs(const struct piglit_gl_test_config *test_config)<br>
attrib_list[i++] = true;<br>
}<br>
<br>
+ if (test_config->window_samples > 1) {<br>
+ attrib_list[i++] = WAFFLE_SAMPLE_BUFFERS;<br>
+ attrib_list[i++] = 1;<br>
+ attrib_list[i++] = WAFFLE_SAMPLES;<br>
+ attrib_list[i++] = test_config->window_samples;<br>
+ }<br>
+<br>
attrib_list[i++] = WAFFLE_NONE;<br>
<br>
return attrib_list;<br>
<span><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>