On 18 June 2012 07:37, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br></blockquote><div><br>The subject line of the patch, and several of the comments in the code, refer to "non-matching buffer sizes".  I think you mean to say "non-matching rectangle sizes".<br>
<br>Also, as in the previous patch, I'd recommending doing this test at the end of piglit_init()<br><br>    if (!piglit_check_gl_error(GL_NO_ERROR)) {<br>        printf("Error setting up fbos\n");<br>        piglit_report_result(PIGLIT_FAIL);<br>
    }<br><br>so that if there's an error in setting up the fbo's, it won't cause the test to erroneously pass.<br><br>With those minor fixes, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 tests/all.tests                                    |    1 +<br>
 .../ext_framebuffer_multisample/CMakeLists.gl.txt  |    1 +<br>
 .../blit-mismatched-sizes.cpp                      |   79 ++++++++++++++++++++<br>
 3 files changed, 81 insertions(+), 0 deletions(-)<br>
 create mode 100644 tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 550d330..ee6b22d 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -1311,6 +1311,7 @@ arb_vertex_program['minmax'] = concurrent_test('arb_vertex_program-minmax')<br>
 ext_framebuffer_multisample = Group()<br>
 spec['EXT_framebuffer_multisample'] = ext_framebuffer_multisample<br>
 ext_framebuffer_multisample['blit-mismatched-samples'] = concurrent_test('ext_framebuffer_multisample-blit-mismatched-samples')<br>
+ext_framebuffer_multisample['blit-mismatched-sizes'] = concurrent_test('ext_framebuffer_multisample-blit-mismatched-sizes')<br>
 ext_framebuffer_multisample['dlist'] = concurrent_test('ext_framebuffer_multisample-dlist')<br>
 ext_framebuffer_multisample['minmax'] = concurrent_test('ext_framebuffer_multisample-minmax')<br>
 ext_framebuffer_multisample['negative-copypixels'] = concurrent_test('ext_framebuffer_multisample-negative-copypixels')<br>
diff --git a/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt b/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
index 146b80e..f4efa91 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
+++ b/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
@@ -11,6 +11,7 @@ link_libraries (<br>
<br>
 piglit_add_executable (ext_framebuffer_multisample-accuracy common.cpp accuracy.cpp)<br>
 piglit_add_executable (ext_framebuffer_multisample-blit-mismatched-samples common.cpp blit-mismatched-samples.cpp)<br>
+piglit_add_executable (ext_framebuffer_multisample-blit-mismatched-sizes common.cpp blit-mismatched-sizes.cpp)<br>
 piglit_add_executable (ext_framebuffer_multisample-dlist dlist.c)<br>
 piglit_add_executable (ext_framebuffer_multisample-formats common.cpp formats.cpp)<br>
 piglit_add_executable (ext_framebuffer_multisample-line-smooth common.cpp line-smooth.cpp)<br>
diff --git a/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp b/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp<br>
new file mode 100644<br>
index 0000000..4e20bed<br>
--- /dev/null<br>
+++ b/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp<br>
@@ -0,0 +1,79 @@<br>
+/*<br>
+ * Copyright © 2012 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 DEALINGS<br>
+ * IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/**<br>
+ * @file blit-mismatched-sizes.cpp<br>
+ *<br>
+ * This test verifies if glBlitFramebuffer() throws GL_INVALID_OPERATION with<br>
+ * non-matching buffer sizes for multisample framebuffer objects.<br>
+ *<br>
+ * We initialize two FBOs with minimum supported sample count, do blitting<br>
+ * operation between non-matching buffer sizes and then query the gl error.<br>
+ *<br>
+ * Author: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
+ */<br>
+<br>
+#include "common.h"<br>
+<br>
+int piglit_width = 256; int piglit_height = 256;<br>
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA;<br>
+<br>
+const int pattern_width = 256; const int pattern_height = 256;<br>
+Fbo src_fbo, dst_fbo;<br>
+<br>
+enum piglit_result<br>
+piglit_display()<br>
+{<br>
+       bool pass = true;<br>
+<br>
+       /* Blit multisample-to-multisample with non-matching buffer size */<br>
+       glBindFramebuffer(GL_READ_FRAMEBUFFER, src_fbo.handle);<br>
+       glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_fbo.handle);<br>
+       glBlitFramebuffer(0, 0, pattern_width, pattern_height,<br>
+                         0, 0, pattern_width / 2, pattern_height,<br>
+                         GL_COLOR_BUFFER_BIT, GL_NEAREST);<br>
+<br>
+       /* Scaling blits are not allowed for multisample frambuffers. Here<br>
+        * GL_INVALID_OPERATION is an expected gl error<br>
+        */<br>
+       pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;<br>
+<br>
+       return (pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_gl_version(30);<br>
+<br>
+       /* Passing sample count = 1 will create the FBOs with minimum supported<br>
+        * sample count.<br>
+        */<br>
+       src_fbo.setup(FboConfig(1 /* sample count */,<br>
+                               pattern_width,<br>
+                               pattern_height));<br>
+<br>
+       dst_fbo.setup(FboConfig(1 /* sample count */,<br>
+                               pattern_width,<br>
+                               pattern_height));<br>
+}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.7.6<br>
<br>
</font></span></blockquote></div><br>