<div dir="ltr">Hi Ilia,<div>This series got <span style="font-size:12.8px">Reviewed-by: Lionel Landwerlin, but unfortunately I don't have write access to the repo to merge them.</span></div><div><span style="font-size:12.8px">Lionel would you mind doing that for me?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thank you,</span></div><div><span style="font-size:12.8px">Pam</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 11, 2017 at 5:24 PM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What happened to these?<br>
<div><div class="h5"><br>
On Thu, Feb 2, 2017 at 9:34 AM, Plamena Manolova<br>
<<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>> wrote:<br>
> A simple multisampling test to check whether the values written<br>
> to gl_SampleMaskIn are still correct after enabling the<br>
> ARB_post_depth_coverage extension.<br>
><br>
> Signed-off-by: Plamena Manolova <<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>><br>
> ---<br>
> tests/all.py | 1 +<br>
> .../spec/arb_post_depth_<wbr>coverage/CMakeLists.gl.txt | 1 +<br>
> tests/spec/arb_post_depth_<wbr>coverage/multisampling.c | 311 +++++++++++++++++++++<br>
> 3 files changed, 313 insertions(+)<br>
> create mode 100644 tests/spec/arb_post_depth_<wbr>coverage/multisampling.c<br>
><br>
> diff --git a/tests/all.py b/tests/all.py<br>
> index cef4773..95aa952 100644<br>
> --- a/tests/all.py<br>
> +++ b/tests/all.py<br>
> @@ -4768,6 +4768,7 @@ with profile.test_list.group_<wbr>manager(<br>
> PiglitGLTest,<br>
> grouptools.join('spec', 'arb_post_depth_coverage')) as g:<br>
> g(['arb_post_depth_coverage-<wbr>basic'])<br>
> + g(['arb_post_depth_coverage-<wbr>multisampling'])<br>
><br>
> with profile.test_list.group_<wbr>manager(<br>
> PiglitGLTest,<br>
> diff --git a/tests/spec/arb_post_depth_<wbr>coverage/CMakeLists.gl.txt b/tests/spec/arb_post_depth_<wbr>coverage/CMakeLists.gl.txt<br>
> index 1a71774..9c1e826 100644<br>
> --- a/tests/spec/arb_post_depth_<wbr>coverage/CMakeLists.gl.txt<br>
> +++ b/tests/spec/arb_post_depth_<wbr>coverage/CMakeLists.gl.txt<br>
> @@ -9,3 +9,4 @@ link_libraries (<br>
> )<br>
><br>
> piglit_add_executable (arb_post_depth_coverage-basic basic.c)<br>
> +piglit_add_executable (arb_post_depth_coverage-<wbr>multisampling multisampling.c)<br>
> diff --git a/tests/spec/arb_post_depth_<wbr>coverage/multisampling.c b/tests/spec/arb_post_depth_<wbr>coverage/multisampling.c<br>
> new file mode 100644<br>
> index 0000000..0c867da<br>
> --- /dev/null<br>
> +++ b/tests/spec/arb_post_depth_<wbr>coverage/multisampling.c<br>
> @@ -0,0 +1,311 @@<br>
> +/*<br>
> + * Copyright (c) 2015 Intel Corporation.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice (including the next<br>
> + * paragraph) shall be included in all copies or substantial portions of the<br>
> + * Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
> + * DEALINGS IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include "piglit-util-gl.h"<br>
> +<br>
> +/*<br>
> + * A test to check whether the right values are written to gl_SampleMaskIn<br>
> + * when ARB_post_depth_coverage and multisampling are enabled. Tests at<br>
> + * 2, 4, 8, 16 sample rates.<br>
> + */<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
> + config.supports_gl_compat_<wbr>version = 43;<br>
> + config.supports_gl_core_<wbr>version = 43;<br>
> + config.window_width = 160;<br>
> + config.window_height = 160;<br>
> + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |<br>
> + PIGLIT_GL_VISUAL_DOUBLE;<br>
> +PIGLIT_GL_TEST_CONFIG_END<br>
> +<br>
> +static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;<br>
> +static GLint *sample_mask;<br>
> +<br>
> +static const char *vs_text =<br>
> + "#version 430\n"<br>
> + "in vec4 pos_in;\n"<br>
> + "void main()\n"<br>
> + "{\n"<br>
> + " gl_Position = pos_in;\n"<br>
> + "}\n";<br>
> +<br>
> +static const char *fs_text1 =<br>
> + "#version 430\n"<br>
> + "out vec4 color;\n"<br>
> + "void main()\n"<br>
> + "{\n"<br>
> + " gl_FragDepth = 0.5f;\n"<br>
> + " color = vec4(0.0, 1.0, 0.0, 1.0);\n"<br>
> + "}\n";<br>
> +<br>
> +static const char *fs_text2 =<br>
> + "#version 430\n"<br>
> + "#extension GL_ARB_post_depth_coverage: enable\n"<br>
> + "out vec4 color;\n"<br>
> + "layout(early_fragment_tests) in;\n"<br>
> + "layout(post_depth_coverage) in;\n"<br>
> + "layout(std430, binding = 0) buffer MaskOutput {\n"<br>
> + " int data[];\n"<br>
> + "} mask_output;\n"<br>
> + "layout(location = 1) uniform int width;\n"<br>
> + "layout(location = 2) uniform int samples;\n"<br>
> + "void main()\n"<br>
> + "{\n"<br>
> + " int index = int(gl_FragCoord.y) * width + int(gl_FragCoord.x);\n"<br>
> + " atomicAdd(mask_output.data[<wbr>index], bitCount(gl_SampleMaskIn[0]));<wbr>\n"<br>
> + " color = vec4(1.0, 0.0, 0.0, 1.0);\n"<br>
> + "}\n";<br>
> +<br>
> +static GLuint<br>
> +make_shader_program1(void)<br>
> +{<br>
> + GLuint prog;<br>
> +<br>
> + prog = piglit_build_simple_program(<wbr>vs_text, fs_text1);<br>
> + glUseProgram(prog);<br>
> +<br>
> + glBindAttribLocation(prog, 0, "pos_in");<br>
> +<br>
> + glLinkProgram(prog);<br>
> +<br>
> + if (!piglit_check_gl_error(GL_NO_<wbr>ERROR)) {<br>
> + piglit_report_result(PIGLIT_<wbr>FAIL);<br>
> + }<br>
> +<br>
> + return prog;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_shader_program2(void)<br>
> +{<br>
> + GLuint prog;<br>
> +<br>
> + prog = piglit_build_simple_program(<wbr>vs_text, fs_text2);<br>
> + glUseProgram(prog);<br>
> +<br>
> + glBindAttribLocation(prog, 0, "pos_in");<br>
> +<br>
> + glLinkProgram(prog);<br>
> +<br>
> + if (!piglit_check_gl_error(GL_NO_<wbr>ERROR)) {<br>
> + piglit_report_result(PIGLIT_<wbr>FAIL);<br>
> + }<br>
> +<br>
> + return prog;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_ssbo(void)<br>
> +{<br>
> + GLuint ssbo;<br>
> + glGenBuffers(1, &ssbo);<br>
> + glBindBuffer(GL_SHADER_<wbr>STORAGE_BUFFER, ssbo);<br>
> +<br>
> + if (!piglit_check_gl_error(GL_NO_<wbr>ERROR)) {<br>
> + piglit_report_result(PIGLIT_<wbr>FAIL);<br>
> + }<br>
> +<br>
> + return ssbo;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_fbo(void)<br>
> +{<br>
> + GLuint fbo;<br>
> + glGenFramebuffers(1, &fbo);<br>
> + glBindFramebuffer(GL_<wbr>FRAMEBUFFER, fbo );<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex_color);<br>
> + glFramebufferTexture2D(GL_<wbr>FRAMEBUFFER, GL_COLOR_ATTACHMENT0,<br>
> + GL_TEXTURE_2D_MULTISAMPLE, tex_color, 0);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex_depth);<br>
> + glFramebufferTexture2D(GL_<wbr>FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,<br>
> + GL_TEXTURE_2D_MULTISAMPLE, tex_depth, 0);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, 0);<br>
> +<br>
> + return fbo;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_texture_color(void)<br>
> +{<br>
> + GLuint tex;<br>
> +<br>
> + glGenTextures(1, &tex);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex);<br>
> + glTexImage2DMultisample(GL_<wbr>TEXTURE_2D_MULTISAMPLE, 2,<br>
> + GL_RGBA32F, piglit_width, piglit_height, false);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, 0);<br>
> +<br>
> + return tex;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_texture_depth(void)<br>
> +{<br>
> + GLuint tex;<br>
> +<br>
> + glGenTextures(1, &tex);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex);<br>
> + glTexImage2DMultisample(GL_<wbr>TEXTURE_2D_MULTISAMPLE, 2,<br>
> + GL_DEPTH24_STENCIL8, piglit_width, piglit_height, false);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, 0);<br>
> +<br>
> + return tex;<br>
> +}<br>
> +<br>
> +static GLuint<br>
> +make_vao(void)<br>
> +{<br>
> + static const float pos_tc[12][2] = {<br>
> + { -1.0, -1.0 },<br>
> + { 0.0, -1.0 },<br>
> + { 0.0, 1.0 },<br>
> + { 0.0, 1.0 },<br>
> + { -1.0, 1.0 },<br>
> + { -1.0, -1.0 },<br>
> + { -1.0, -1.0 },<br>
> + { 1.0, -1.0 },<br>
> + { 1.0, 1.0 },<br>
> + { 1.0, 1.0 },<br>
> + { -1.0, 1.0 },<br>
> + { -1.0, -1.0 }<br>
> + };<br>
> + const int stride = sizeof(pos_tc[0]);<br>
> + GLuint vbo, vao;<br>
> +<br>
> + glGenVertexArrays(1, &vao);<br>
> + glBindVertexArray(vao);<br>
> +<br>
> + glGenBuffers(1, &vbo);<br>
> + glBindBuffer(GL_ARRAY_BUFFER, vbo);<br>
> + glBufferData(GL_ARRAY_BUFFER, sizeof(pos_tc), pos_tc, GL_STATIC_DRAW);<br>
> + piglit_check_gl_error(GL_NO_<wbr>ERROR);<br>
> +<br>
> + glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, stride, (void *) 0);<br>
> +<br>
> + glEnableVertexAttribArray(0);<br>
> +<br>
> + if (!piglit_check_gl_error(GL_NO_<wbr>ERROR)) {<br>
> + piglit_report_result(PIGLIT_<wbr>FAIL);<br>
> + }<br>
> +<br>
> + return vbo;<br>
> +}<br>
> +<br>
> +void<br>
> +piglit_init(int argc, char **argv)<br>
> +{<br>
> + piglit_require_extension("GL_<wbr>ARB_post_depth_coverage");<br>
> +<br>
> + glEnable(GL_DEPTH_TEST);<br>
> + glEnable(GL_STENCIL_TEST);<br>
> + glEnable(GL_MULTISAMPLE);<br>
> + glClearColor(0.0, 0.0, 0.0, 1.0);<br>
> +<br>
> + prog1 = make_shader_program1();<br>
> + prog2 = make_shader_program2();<br>
> + vao = make_vao();<br>
> + ssbo = make_ssbo();<br>
> + tex_color = make_texture_color();<br>
> + tex_depth = make_texture_depth();<br>
> + fbo = make_fbo();<br>
> +}<br>
> +<br>
> +<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> + int samples[4] = { 2, 4, 8, 16 };<br>
> + bool pass = true;<br>
> + int i, j, k;<br>
> +<br>
> + glViewport(0, 0, piglit_width, piglit_height);<br>
> +<br>
> + for (j = 0; j < 4; j++) {<br>
> + sample_mask = (GLint*) calloc (piglit_width * piglit_height,<br>
> + sizeof(GLint));<br>
> + glBufferData(GL_SHADER_<wbr>STORAGE_BUFFER, sizeof(GLint) * piglit_width *<br>
> + piglit_height, &sample_mask[0], GL_DYNAMIC_DRAW);<br>
> + glBindBufferBase(GL_SHADER_<wbr>STORAGE_BUFFER, 0, ssbo);<br>
> +<br>
> + glBindFramebuffer(GL_DRAW_<wbr>FRAMEBUFFER, fbo);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex_color);<br>
> + glTexImage2DMultisample(GL_<wbr>TEXTURE_2D_MULTISAMPLE, samples[j],<br>
> + GL_RGBA8, piglit_width, piglit_height, false);<br>
> + glBindTexture(GL_TEXTURE_2D_<wbr>MULTISAMPLE, tex_depth);<br>
> + glTexImage2DMultisample(GL_<wbr>TEXTURE_2D_MULTISAMPLE, samples[j],<br>
> + GL_DEPTH24_STENCIL8, piglit_width, piglit_height, false);<br>
> +<br>
> + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |<br>
> + GL_STENCIL_BUFFER_BIT);<br>
> +<br>
> + glUseProgram(prog1);<br>
> + glStencilFunc(GL_ALWAYS, 1, 0xFF);<br>
> + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);<br>
> + glDrawArrays(GL_TRIANGLES, 0, 6);<br>
> +<br>
> + glUseProgram(prog2);<br>
> + glStencilFunc(GL_NOTEQUAL, 1, 0xFF);<br>
> + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);<br>
> + glUniform1i(1, piglit_width);<br>
> + glUniform1i(2, samples[j]);<br>
> + glDrawArrays(GL_TRIANGLES, 6, 6);<br>
> +<br>
> + glGetBufferSubData(GL_SHADER_<wbr>STORAGE_BUFFER, 0, sizeof(GLint) *<br>
> + piglit_width * piglit_height, sample_mask);<br>
> +<br>
> + for (i = 0; i < piglit_width; i++) {<br>
> + for (k = 0; k < piglit_height; k++) {<br>
> + if (i >= piglit_width / 2) {<br>
> + if (sample_mask[piglit_width * k + i] != samples[j]) {<br>
> + pass = false;<br>
> + break;<br>
> + }<br>
> + } else {<br>
> + if (sample_mask[piglit_width * k + i] != 0) {<br>
> + pass = false;<br>
> + break;<br>
> + }<br>
> + }<br>
> + }<br>
> +<br>
> + if (!pass)<br>
> + break;<br>
> + }<br>
> +<br>
> + glBindFramebuffer(GL_DRAW_<wbr>FRAMEBUFFER, 0);<br>
> + glBindFramebuffer(GL_READ_<wbr>FRAMEBUFFER, fbo);<br>
> + glDrawBuffer(GL_BACK);<br>
> + glBlitFramebuffer(0, 0, piglit_width, piglit_height, 0, 0, piglit_width,<br>
> + piglit_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);<br>
> +<br>
> + piglit_present_results();<br>
> + free(sample_mask);<br>
> + if (!pass)<br>
> + break;<br>
> + }<br>
> +<br>
> + pass = piglit_check_gl_error(GL_NO_<wbr>ERROR) && pass;<br>
> +<br>
> + return pass ? PIGLIT_PASS : PIGLIT_FAIL;<br>
> +}<br>
> --<br>
> 2.7.4<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Piglit mailing list<br>
> <a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</blockquote></div><br></div>