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>My same comment about calling piglit_check_gl_error() at the end of piglit_init() applies to this patch too.<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-formats.cpp                    |   95 ++++++++++++++++++++<br>
 3 files changed, 97 insertions(+), 0 deletions(-)<br>
 create mode 100644 tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index ee6b22d..754a7e5 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -1312,6 +1312,7 @@ 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['blit-mismatched-formats'] = concurrent_test('ext_framebuffer_multisample-blit-mismatched-formats')<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 f4efa91..7e37787 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
+++ b/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
@@ -12,6 +12,7 @@ link_libraries (<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-blit-mismatched-formats common.cpp blit-mismatched-formats.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-formats.cpp b/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp<br>
new file mode 100644<br>
index 0000000..3a4fdaa<br>
--- /dev/null<br>
+++ b/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp<br>
@@ -0,0 +1,95 @@<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-formats.cpp<br>
+ *<br>
+ * This test verifies if glBlitFramebuffer() throws GL_INVALID_OPERATION with<br>
+ * non-matching formats for multisample framebuffer objects.<br>
+ *<br>
+ * We initialize two FBOs with minimum supported sample count and different<br>
+ * buffer formats, do blitting operation between them and then query the gl<br>
+ * 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>
+static GLenum color_formats[] = {<br>
+       GL_RED,<br>
+       GL_RG,<br>
+       GL_RGB,<br>
+       GL_ALPHA};<br></blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+enum piglit_result<br>
+piglit_display()<br>
+{<br>
+       bool pass = true;<br>
+       GLuint i;<br>
+<br>
+       FboConfig config_ms(1 , pattern_width, pattern_height);<br>
+<br>
+       for(i = 0; i < ARRAY_SIZE(color_formats); i++) {<br>
+               config_ms.color_internalformat = color_formats[i];<br>
+               src_fbo.setup(config_ms);<br>
+<br>
+               /* Blit multisample-to-multisample with non-matching formats */<br>
+               glBindFramebuffer(GL_READ_FRAMEBUFFER, src_fbo.handle);<br>
+               glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_fbo.handle);<br></blockquote><div><br>I would recommend also calling piglit_check_gl_error() here, just to make sure that an error didn't occur while setting up the formats.<br>
<br>With these two minor changes, 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">

+               glBlitFramebuffer(0, 0, pattern_width, pattern_height,<br>
+                                 0, 0, pattern_width, pattern_height,<br>
+                                 GL_COLOR_BUFFER_BIT, GL_NEAREST);<br>
+<br>
+               /* Blitting between different formats is not allowed for<br>
+                * multisample frambuffers. Here GL_INVALID_OPERATION is an<br>
+                * expected gl error.<br>
+                */<br>
+               pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;<br>
+       }<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. Both FBOs are created with GL_RGBA format by default.<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>