<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">

These tests have proved to be useful for implementing and fixing MSAA<br>
visuals.<br>
<br>
I also recommend the mesa/demos tests "reflect" and "copypixrate" to test front<br>
buffer MSAA rendering.<br></blockquote><div><br></div>Thanks for adding these tests.  They expose some bugs in the Intel driver too.<br></div><div class="gmail_quote"><br>Patches 1, 4, and 5 are:<br><div><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">

---<br>
 tests/all.tests |   64 ++++++++++++++++++++++++++++++++++---------------------<br>
 1 file changed, 40 insertions(+), 24 deletions(-)<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 058253d..e7d1f7a 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -70,21 +70,31 @@ except SystemExit:<br>
 # List of all of the MSAA sample counts we wish to test<br>
 MSAA_SAMPLE_COUNTS = (2, 4, 6, 8, 16, 32)<br>
<br>
-def add_fbo_depthstencil_tests(group, format):<br>
+def add_fbo_depthstencil_tests(group, format, num_samples):<br>
        if format == 'default_fb':<br>
                prefix = ''<br>
        else:<br>
                prefix = 'fbo-'<br>
-       group[prefix + 'depthstencil-' + format + '-clear'] = PlainExecTest(['fbo-depthstencil', '-auto', 'clear', format])<br>
-       group[prefix + 'depthstencil-' + format + '-readpixels-FLOAT-and-USHORT'] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, 'FLOAT-and-USHORT'])<br>


-       group[prefix + 'depthstencil-' + format + '-readpixels-24_8'] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, '24_8'])<br>
-       group[prefix + 'depthstencil-' + format + '-readpixels-32F_24_8_REV'] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, '32F_24_8_REV'])<br>
-       group[prefix + 'depthstencil-' + format + '-drawpixels-FLOAT-and-USHORT'] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, 'FLOAT-and-USHORT'])<br>


-       group[prefix + 'depthstencil-' + format + '-drawpixels-24_8'] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, '24_8'])<br>
-       group[prefix + 'depthstencil-' + format + '-drawpixels-32F_24_8_REV'] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, '32F_24_8_REV'])<br>
-       group[prefix + 'depthstencil-' + format + '-copypixels'] = PlainExecTest(['fbo-depthstencil', '-auto', 'copypixels', format])<br>
-       group[prefix + 'depthstencil-' + format + '-blit'] = PlainExecTest(['fbo-depthstencil', '-auto', 'blit', format])<br>
-<br>
+       if num_samples > 1:<br>
+               suffix = ' samples=' + str(num_samples)<br>
+               psamples = ['-samples=' + str(num_samples)]<br>
+       else:<br>
+               suffix = ''<br>
+               psamples = []<br>
+       group[prefix + 'depthstencil-' + format + '-clear' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'clear', format] + psamples)<br>
+       group[prefix + 'depthstencil-' + format + '-readpixels-FLOAT-and-USHORT' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, 'FLOAT-and-USHORT'] + psamples)<br>


+       group[prefix + 'depthstencil-' + format + '-readpixels-24_8' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, '24_8'] + psamples)<br>
+       group[prefix + 'depthstencil-' + format + '-readpixels-32F_24_8_REV' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'readpixels', format, '32F_24_8_REV'] + psamples)<br>


+       group[prefix + 'depthstencil-' + format + '-drawpixels-FLOAT-and-USHORT' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, 'FLOAT-and-USHORT'] + psamples)<br>


+       group[prefix + 'depthstencil-' + format + '-drawpixels-24_8' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, '24_8'] + psamples)<br>
+       group[prefix + 'depthstencil-' + format + '-drawpixels-32F_24_8_REV' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'drawpixels', format, '32F_24_8_REV'] + psamples)<br>


+       group[prefix + 'depthstencil-' + format + '-copypixels' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'copypixels', format] + psamples)<br>
+       group[prefix + 'depthstencil-' + format + '-blit' + suffix] = PlainExecTest(['fbo-depthstencil', '-auto', 'blit', format] + psamples)<br>
+<br>
+def add_fbo_depthstencil_msaa_visual_tests(group, format):<br>
+       add_fbo_depthstencil_tests(group, format, 0)<br>
+       for num_samples in MSAA_SAMPLE_COUNTS:<br>
+               add_fbo_depthstencil_tests(group, format, num_samples)<br>
<br>
 def add_depthstencil_render_miplevels_tests(group, test_types):<br>
         # Note: the buffer sizes below have been chosen to exercise<br>
@@ -95,6 +105,12 @@ def add_depthstencil_render_miplevels_tests(group, test_types):<br>
                                 texture_size, test_type)<br>
                         group[test_name] = PlainExecTest(test_name + ' -auto')<br>
<br>
+def add_msaa_visual_plain_tests(group, args):<br>
+       add_plain_test(group, args)<br>
+       for num_samples in MSAA_SAMPLE_COUNTS:<br>
+               group[args + ' samples=' + str(num_samples)] = PlainExecTest(<br>
+                       shlex.split(args) + ['-auto'] +<br>
+                       ['-samples=' + str(num_samples)])<br>
<br>
 glean = Group()<br>
 glean['basic'] = GleanTest('basic')<br>
@@ -336,7 +352,7 @@ def add_vpfpgeneric(group, name):<br>
        group[name] = PlainExecTest(['vpfp-generic', '-auto', testsDir + '/shaders/generic/' + name + '.vpfp'])<br>
<br>
 glx = Group()<br>
-add_plain_test(glx, 'glx-copy-sub-buffer')<br>
+add_msaa_visual_plain_tests(glx, 'glx-copy-sub-buffer')<br>
 add_plain_test(glx, 'glx-destroycontext-1')<br>
 add_plain_test(glx, 'glx-destroycontext-2')<br>
 add_plain_test(glx, 'glx-dont-care-mask')<br>
@@ -506,11 +522,11 @@ add_plain_test(gl11, 'dlist-fdo31590')<br>
 add_plain_test(gl11, 'draw-arrays-colormaterial')<br>
 add_plain_test(gl11, 'draw-copypixels-sync')<br>
 add_concurrent_test(gl11, 'draw-pixel-with-texture')<br>
-add_plain_test(gl11, 'draw-pixels')<br>
+add_msaa_visual_plain_tests(gl11, 'draw-pixels')<br>
 add_concurrent_test(gl11, 'drawpix-z')<br>
 add_plain_test(gl11, 'fog-modes')<br>
 add_plain_test(gl11, 'fragment-center')<br>
-add_fbo_depthstencil_tests(gl11, 'default_fb')<br>
+add_fbo_depthstencil_msaa_visual_tests(gl11, 'default_fb')<br>
 add_plain_test(gl11, 'geterror-invalid-enum')<br>
 add_plain_test(gl11, 'geterror-inside-begin')<br>
 add_concurrent_test(gl11, 'glinfo')<br>
@@ -525,8 +541,8 @@ add_plain_test(gl11, 'polygon-mode')<br>
 add_concurrent_test(gl11, 'polygon-mode-offset')<br>
 add_concurrent_test(gl11, 'push-pop-texture-state')<br>
 add_concurrent_test(gl11, 'quad-invariance')<br>
-add_plain_test(gl11, 'read-front')<br>
-add_plain_test(gl11, 'read-front clear-front-first')<br>
+add_msaa_visual_plain_tests(gl11, 'read-front')<br>
+add_msaa_visual_plain_tests(gl11, 'read-front clear-front-first')<br>
 add_concurrent_test(gl11, 'readpix-z')<br>
 add_plain_test(gl11, 'roundmode-getintegerv')<br>
 add_plain_test(gl11, 'roundmode-pixelstore')<br>
@@ -580,7 +596,7 @@ add_concurrent_test(gl10, 'gl-1.0-rendermode-feedback')<br>
 gl12 = Group()<br>
 spec['!OpenGL 1.2'] = gl12<br>
 add_texwrap_target_tests(gl12, '3D')<br>
-gl12['copyteximage 3D'] = PlainExecTest(['copyteximage', '-auto', '3D'])<br>
+add_msaa_visual_plain_tests(gl12, 'copyteximage 3D')<br>
 add_plain_test(gl12, 'crash-texparameter-before-teximage')<br>
 add_plain_test(gl12, 'draw-elements-vs-inputs')<br>
 add_plain_test(gl12, 'two-sided-lighting-separate-specular')<br>
@@ -608,7 +624,7 @@ add_plain_test(gl14, 'fdo25614-genmipmap')<br>
 add_plain_test(gl14, 'tex1d-2dborder')<br>
 add_plain_test(gl14, 'blendminmax')<br>
 add_plain_test(gl14, 'blendsquare')<br>
-add_plain_test(gl14, 'copy-pixels')<br>
+add_msaa_visual_plain_tests(gl14, 'copy-pixels')<br>
 add_plain_test(gl14, 'draw-batch')<br>
 add_plain_test(gl14, 'stencil-wrap')<br>
 add_plain_test(gl14, 'triangle-rasterization')<br>
@@ -1224,7 +1240,7 @@ add_texwrap_target_tests(arb_texture_rectangle, 'RECT')<br>
 add_shader_test_dir(arb_texture_rectangle,<br>
                     testsDir + '/spec/arb_texture_rectangle',<br>
                     recursive=True)<br>
-arb_texture_rectangle['copyteximage RECT'] = PlainExecTest(['copyteximage', '-auto', 'RECT'])<br>
+add_msaa_visual_plain_tests(arb_texture_rectangle, 'copyteximage RECT')<br>
 add_concurrent_test(arb_texture_rectangle, '1-1-linear-texture')<br>
 add_plain_test(arb_texture_rectangle, 'texrect-many')<br>
 add_concurrent_test(arb_texture_rectangle, 'getteximage-targets RECT')<br>
@@ -1313,7 +1329,7 @@ spec['ARB_depth_buffer_float'] = arb_depth_buffer_float<br>
 add_fbo_depth_tests(arb_depth_buffer_float, 'GL_DEPTH_COMPONENT32F')<br>
 add_fbo_depth_tests(arb_depth_buffer_float, 'GL_DEPTH32F_STENCIL8')<br>
 add_fbo_stencil_tests(arb_depth_buffer_float, 'GL_DEPTH32F_STENCIL8')<br>
-add_fbo_depthstencil_tests(arb_depth_buffer_float, 'GL_DEPTH32F_STENCIL8')<br>
+add_fbo_depthstencil_tests(arb_depth_buffer_float, 'GL_DEPTH32F_STENCIL8', 0)<br>
 add_fbo_formats_tests('spec/ARB_depth_buffer_float', 'GL_ARB_depth_buffer_float')<br>
 add_texwrap_format_tests(arb_depth_buffer_float, 'GL_ARB_depth_buffer_float')<br>
 add_depthstencil_render_miplevels_tests(<br>
@@ -1707,7 +1723,7 @@ ext_packed_depth_stencil = Group()<br>
 spec['EXT_packed_depth_stencil'] = ext_packed_depth_stencil<br>
 add_fbo_depth_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8')<br>
 add_fbo_stencil_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8')<br>
-add_fbo_depthstencil_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8')<br>
+add_fbo_depthstencil_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8', 0)<br>
 add_fbo_formats_tests('spec/EXT_packed_depth_stencil', 'GL_EXT_packed_depth_stencil')<br>
 add_texwrap_format_tests(ext_packed_depth_stencil, 'GL_EXT_packed_depth_stencil')<br>
 ext_packed_depth_stencil['readpixels-24_8'] = PlainExecTest(['ext_packed_depth_stencil-readpixels-24_8', '-auto'])<br>
@@ -1726,8 +1742,8 @@ spec['EXT_texture_array']['maxlayers'] = concurrent_test('ext_texture_array-maxl<br>
 add_shader_test_dir(ext_texture_array,<br>
                     testsDir + '/spec/ext_texture_array',<br>
                     recursive=True)<br>
-ext_texture_array['copyteximage 1D_ARRAY'] = PlainExecTest(['copyteximage', '-auto', '1D_ARRAY'])<br>
-ext_texture_array['copyteximage 2D_ARRAY'] = PlainExecTest(['copyteximage', '-auto', '2D_ARRAY'])<br>
+add_msaa_visual_plain_tests(ext_texture_array, 'copyteximage 1D_ARRAY')<br>
+add_msaa_visual_plain_tests(ext_texture_array, 'copyteximage 2D_ARRAY')<br>
 add_plain_test(ext_texture_array, 'fbo-array')<br>
 add_plain_test(ext_texture_array, 'fbo-depth-array')<br>
 add_plain_test(ext_texture_array, 'array-texture')<br>
@@ -1739,7 +1755,7 @@ for test_mode in ['teximage', 'texsubimage']:<br>
<br>
 arb_texture_cube_map = Group()<br>
 spec['ARB_texture_cube_map'] = arb_texture_cube_map<br>
-arb_texture_cube_map['copyteximage CUBE'] = PlainExecTest(['copyteximage', '-auto', 'CUBE'])<br>
+add_msaa_visual_plain_tests(arb_texture_cube_map, 'copyteximage CUBE')<br>
 add_plain_test(arb_texture_cube_map, 'crash-cubemap-order')<br>
 add_plain_test(arb_texture_cube_map, 'cubemap')<br>
 arb_texture_cube_map['cubemap npot'] = PlainExecTest(['cubemap', '-auto', 'npot'])<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>