On 4 May 2012 15:02, 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">
This patch splits accuracy.cpp in to three files: common.h, common.cpp<br>
and accuracy.c.<br>
<br>
common.cpp defines the functions which can be utilized to develop new<br>
multisample test cases. Functions can be utilized to:<br>
- Draw a test image to default framebuffer.<br>
- Initialize a FBO with specified samples count.<br>
- Draw a test image to FBO.<br>
- Draw a reference image.<br>
- Verify the accuracy of multisample antialiasing in FBO.<br>
<br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br></blockquote><div><br>It seems like you've gone to a bunch of effort to provide a C interface (rather than a C++ interface) between the accuracy test and common.cpp, so that the accuracy test can be written in straight C. Can you comment on the benefits of this? I see two downsides: a. it forces us to introduce extra wrapper functions that manipulate global state, and that doesn't seem desirable. b. if we later decide to add a test that re-uses part of the common structure but not all of it (e.g. by adding a new TestPattern-derived class), we won't be able to do so easily.<br>
<br>Unless there's something I'm missing, I would prefer if we took an approach like this to sharing code:<br><br>- Move the class declarations from accuracy.cpp into common.h.<br>- Move the member function implementations from accuracy.cpp into common.cpp.<br>
- Leave the global variable Test *test = NULL; in accuracy.cpp, so that the global state is confined to the individual test file, and isn't part of the interface between accuracy and common. <br>- Leave accuracy.cpp as a C++ program.<br>
<br>If you're interested, I'd be willing to take a stab at this approach and send it to the list.<br><br>Other comments follow.<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>
.../ext_framebuffer_multisample/CMakeLists.gl.txt | 2 +-<br>
tests/spec/ext_framebuffer_multisample/accuracy.c | 128 ++<br>
.../spec/ext_framebuffer_multisample/accuracy.cpp | 1430 -------------------<br>
tests/spec/ext_framebuffer_multisample/common.cpp | 1503 ++++++++++++++++++++<br>
tests/spec/ext_framebuffer_multisample/common.h | 51 +<br>
5 files changed, 1683 insertions(+), 1431 deletions(-)<br>
create mode 100644 tests/spec/ext_framebuffer_multisample/accuracy.c<br>
delete mode 100644 tests/spec/ext_framebuffer_multisample/accuracy.cpp<br>
create mode 100644 tests/spec/ext_framebuffer_multisample/common.cpp<br>
create mode 100644 tests/spec/ext_framebuffer_multisample/common.h<br>
<br>
diff --git a/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt b/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
index c451f9f..3548074 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
+++ b/tests/spec/ext_framebuffer_multisample/CMakeLists.gl.txt<br>
@@ -11,7 +11,7 @@ link_libraries (<br>
${GLUT_glut_LIBRARY}<br>
)<br>
<br>
-piglit_add_executable (ext_framebuffer_multisample-accuracy accuracy.cpp)<br>
+piglit_add_executable (ext_framebuffer_multisample-accuracy common.cpp accuracy.c)<br>
piglit_add_executable (ext_framebuffer_multisample-dlist dlist.c)<br>
piglit_add_executable (ext_framebuffer_multisample-minmax minmax.c)<br>
piglit_add_executable (ext_framebuffer_multisample-negative-copypixels negative-copypixels.c)<br>
diff --git a/tests/spec/ext_framebuffer_multisample/accuracy.c b/tests/spec/ext_framebuffer_multisample/accuracy.c<br>
new file mode 100644<br>
index 0000000..e660714<br>
--- /dev/null<br>
+++ b/tests/spec/ext_framebuffer_multisample/accuracy.c<br>
@@ -0,0 +1,128 @@<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>
+#include "common.h"<br>
+<br>
+/**<br>
+ * \file accuracy.c<br>
+ *<br>
+ * Verify the accuracy of multisample antialiasing.<br>
+ *<br>
+ * This test utilizes the functions defined in common.cpp to verfify the<br>
+ * accuracy of MSAA.<br>
+ *<br>
+ * The test also accepts the following flags:<br>
+ *<br>
+ * - "small": Causes the MSAA image to be renedered in extremely tiny<br>
+ * (16x16) tiles that are then stitched together. This verifies<br>
+ * that MSAA works properly on very small buffers (a critical corner<br>
+ * case on i965).<br>
+ *<br>
+ * - "depthstencil": Causes the framebuffers to use a combined<br>
+ * depth/stencil buffer (as opposed to separate depth and stencil<br>
+ * buffers). On some implementations (e.g. the nVidia proprietary<br>
+ * driver for Linux) this is necessary for framebuffer completeness.<br>
+ * On others (e.g. i965), this is an important corner case to test.<br>
+ */<br>
+int piglit_width = 512; int piglit_height = 256;<br>
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_ALPHA;<br>
+<br>
+/* Define extern variables declared in common.cpp */<br>
+const int pattern_width = 256; const int pattern_height = 256;<br>
+const int supersample_factor = 16;<br>
+<br>
+void<br>
+print_usage_and_exit(char *prog_name)<br>
+{<br>
+ printf("Usage: %s <num_samples> <test_type> [options]\n"<br>
+ " where <test_type> is one of:\n"<br>
+ " color: test downsampling of color buffer\n"<br>
+ " stencil_draw: test drawing using MSAA stencil buffer\n"<br>
+ " stencil_resolve: test resolve of MSAA stencil buffer\n"<br>
+ " depth_draw: test drawing using MSAA depth buffer\n"<br>
+ " depth_resolve: test resolve of MSAA depth buffer\n"<br>
+ "Available options:\n"<br>
+ " small: use a very small (16x16) MSAA buffer\n"<br>
+ " depthstencil: use a combined depth/stencil buffer\n",<br>
+ prog_name);<br>
+ piglit_report_result(PIGLIT_FAIL);<br>
+}<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+ GLint max_samples;<br>
+ int i, num_samples;<br>
+ bool small = false;<br>
+ bool combine_depth_stencil = false;<br>
+<br>
+ if (argc < 3)<br>
+ print_usage_and_exit(argv[0]);<br>
+ {<br>
+ char *endptr = NULL;<br>
+ num_samples = strtol(argv[1], &endptr, 0);<br>
+ if (endptr != argv[1] + strlen(argv[1]))<br>
+ print_usage_and_exit(argv[0]);<br>
+ }<br>
+<br>
+ for (i = 3; i < argc; ++i) {<br>
+ if (strcmp(argv[i], "small") == 0) {<br>
+ small = true;<br>
+ } else if (strcmp(argv[i], "depthstencil") == 0) {<br>
+ combine_depth_stencil = true;<br>
+ } else {<br>
+ print_usage_and_exit(argv[0]);<br>
+ }<br>
+ }<br>
+<br>
+ piglit_require_gl_version(30);<br>
+ piglit_require_GLSL_version(130);<br>
+<br>
+ /* Skip the test if num_samples > GL_MAX_SAMPLES */<br>
+ glGetIntegerv(GL_MAX_SAMPLES, &max_samples);<br>
+ if (num_samples > max_samples)<br>
+ piglit_report_result(PIGLIT_SKIP);<br>
+<br>
+ if (strcmp(argv[2], "color") == 0) {<br>
+ test_init("color", num_samples, small, combine_depth_stencil);<br>
+ } else if (strcmp(argv[2], "stencil_draw") == 0) {<br>
+ test_init("stencil_draw", num_samples, small, combine_depth_stencil);<br>
+ } else if (strcmp(argv[2], "stencil_resolve") == 0) {<br>
+ test_init("stencil_resolve", num_samples, small, combine_depth_stencil);<br>
+ } else if (strcmp(argv[2], "depth_draw") == 0) {<br>
+ test_init("depth_draw", num_samples, small, combine_depth_stencil);<br>
+ } else if (strcmp(argv[2], "depth_resolve") == 0) {<br>
+ test_init("depth_resolve", num_samples, small, combine_depth_stencil);<br>
+ } else {<br>
+ print_usage_and_exit(argv[0]);<br>
+ }<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display()<br>
+{<br>
+ enum piglit_result result = test_run() ? PIGLIT_PASS : PIGLIT_FAIL;<br>
+<br>
+ piglit_present_results();<br>
+<br>
+ return result;<br>
+}<br></blockquote><div><br>(snip)<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp b/tests/spec/ext_framebuffer_multisample/common.cpp<br>
new file mode 100644<br>
index 0000000..e8543b0<br>
--- /dev/null<br>
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp<br>
@@ -0,0 +1,1503 @@<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 common.cpp<br>
+ *<br>
+ * This file defines the functions which can be utilized to develop new<br>
+ * multisample test cases. Functions can be utilized to:<br>
+ *<br>
+ * - Draw a test image to default framebuffer.<br>
+ * - Initialize test_fbo with specified sample count.<br>
+ * - Draw a test image to test_fbo.<br>
+ * - Draw a reference image.<br>
+ * - Verify the accuracy of multisample antialiasing in FBO.<br>
+ *<br>
+ * Accuracy verification is done by rendering a scene consisting of<br>
+ * triangles that aren't perfectly aligned to pixel coordinates. Every<br>
+ * triangle in the scene is rendered using a solid color whose color<br>
+ * components are all 0.0 or 1.0. The scene is renederd in two ways:<br>
+ *<br>
+ * - At normal resoluation, using MSAA.<br>
+ *<br>
+ * - At very high resolution ("supersampled" by a factor of 16 in both<br>
+ * X and Y dimensions), without MSAA.<br>
+ *<br>
+ * Then, the supersampled image is scaled down to match the resolution<br>
+ * of the MSAA image, using a fragment shader to manually blend each<br>
+ * block of 16x16 pixels down to 1 pixel. This produces a reference<br>
+ * image, which is then compared to the MSAA image to measure the<br>
+ * error introduced by MSAA.<br>
+ *<br>
+ * (Note: the supersampled image is actually larger than the maximum<br>
+ * texture size that GL 3.0 requires all implementations to support<br>
+ * (1024x1024), so it is actually done in 1024x1024 tiles that are<br>
+ * then stitched together to form the reference image).<br>
+ *<br>
+ * In the piglit window, the MSAA image appears on the left; the<br>
+ * reference image is on the right.<br>
+ *<br>
+ * For each color component of each pixel, if the reference image has<br>
+ * a value of exactly 0.0 or 1.0, that pixel is presumed to be<br>
+ * completely covered by a triangle, so the test verifies that the<br>
+ * corresponding pixel in the MSAA image is exactly 0.0 or 1.0. Where<br>
+ * the reference image has a value between 0.0 and 1.0, we know there<br>
+ * is a triangle boundary that MSAA should smooth out, so the test<br>
+ * estimates the accuracy of MSAA rendering by computing the RMS error<br>
+ * between the reference image and the MSAA image for these pixels.<br>
+ *<br>
+ * In addition to the above test (the "color" test), there are functions<br>
+ * which can also verify the proper behavior of the stencil MSAA buffer.<br>
+ * This can be done in two ways:<br>
+ *<br>
+ * - "stencil_draw" test: after drawing the scene, we clear the MSAA<br>
+ * color buffer and run a "manifest" pass which uses stencil<br>
+ * operations to make a visual representation of the contents of the<br>
+ * stencil buffer show up in the color buffer. The rest of the test<br>
+ * operates as usual. This allows us to verify that drawing<br>
+ * operations that use the stencil buffer operate correctly in MSAA<br>
+ * mode.<br>
+ *<br>
+ * - "stencil_resolve" test: same as above, except that we blit the<br>
+ * MSAA stencil buffer to a single-sampled FBO before running the<br>
+ * "manifest" pass. This allows us to verify that the<br>
+ * implementation properly downsamples the MSAA stencil buffer.<br>
+ *<br>
+ * There are similar variants "depth_draw" and "depth_resolve" for<br>
+ * testing the MSAA depth buffer.<br>
+ *<br>
+ * Note that when downsampling the MSAA color buffer, implementations<br>
+ * are expected to blend the values of each of the color samples;<br>
+ * but when downsampling the stencil and depth buffers, they are<br>
+ * expected to just choose one representative sample (this is because<br>
+ * an intermediate stencil or depth value would not be meaningful).<br>
+ * Therefore, the pass threshold is relaxed for the "stencil_resolve"<br>
+ * and "depth_resolve" tests.<br>
+ *<br>
+ * Functions also accepts the following flags:<br>
+ *<br>
+ * - "small": Causes the MSAA image to be renedered in extremely tiny<br>
+ * (16x16) tiles that are then stitched together. This verifies<br>
+ * that MSAA works properly on very small buffers (a critical corner<br>
+ * case on i965).<br>
+ *<br>
+ * - "depthstencil": Causes the framebuffers to use a combined<br>
+ * depth/stencil buffer (as opposed to separate depth and stencil<br>
+ * buffers). On some implementations (e.g. the nVidia proprietary<br>
+ * driver for Linux) this is necessary for framebuffer completeness.<br>
+ * On others (e.g. i965), this is an important corner case to test.<br>
+ */<br>
+<br>
+#include "common.h"<br>
+<br>
+/* Following extern variables must be defined in piglit test file */<br>
+extern const int pattern_width;<br>
+extern const int pattern_height;<br>
+extern const int supersample_factor;<br>
+<br>
+/* Set this flag while calling draw_test_image() in piglit test code to render<br>
+ * the test image in to default framebuffer. Flag automatically reset to<br>
+ * false after draw_test_image().<br>
+ */<br>
+bool render_to_default = false;<br></blockquote><div><br>Can you comment on why you chose to make this a global variable instead of a parameter to draw_test_image()? It seems like this sort of "action at a distance" is going to make the code unnecessarily difficult to follow.<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>
+/* Set this flag while calling fbo_set_samples() in piglit test code to use<br>
+ * a render buffer as color attachment in test_fbo in place of a texture<br>
+ * for zero sample count. Flag automatically reset to false after<br>
+ * fbo_set_samples(). This flag is insignificant for an FBO with sample<br>
+ * count > 0<br>
+ */<br>
+bool attach_render_buffer = false;<br></blockquote><div><br>Similar question about this global.<br><br>(snip)<br><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>
+/*<br>
+ * Following functions provide C interface to utilize member functions of<br>
+ * Test class. More such functions can be defined here based on requirement.<br>
+ */ <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>
+extern "C" void<br>
+test_init(const char *str, int n_samples, bool small, bool combine_depth_stencil)<br>
+{<br>
+ if (strcmp(str, "color") == 0) {<br>
+ test = new Test(new Triangles(), NULL, false, 0);<br>
+ } else if (strcmp(str, "stencil_draw") == 0) {<br>
+ test = new Test(new StencilSunburst(),<br>
+ new ManifestStencil(),<br>
+ false, 0);<br>
+ } else if (strcmp(str, "stencil_resolve") == 0) {<br>
+ test = new Test(new StencilSunburst(),<br>
+ new ManifestStencil(),<br>
+ true,<br>
+ GL_STENCIL_BUFFER_BIT);<br>
+ } else if (strcmp(str, "depth_draw") == 0) {<br>
+ test = new Test(new DepthSunburst(),<br>
+ new ManifestDepth(),<br>
+ false, 0);<br>
+ } else if (strcmp(str, "depth_resolve") == 0) {<br>
+ test = new Test(new DepthSunburst(),<br>
+ new ManifestDepth(),<br>
+ true,<br>
+ GL_DEPTH_BUFFER_BIT);<br>
+ }<br>
+<br>
+ test->init(n_samples, small, combine_depth_stencil);<br>
+}<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>
+extern "C" bool<br>
+test_run()<br>
+{<br>
+ return test->run();<br>
+}<br></blockquote><div><br>This is an example of the kind of extra effort and unnecessary global state I am concerned about. It seems like the code would be easier to follow if we got rid of this function and had accuracy.cpp simply call test->run() directly.<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>
+/* This function draws test image to default framebuffer or to<br>
+ * test_fbo based on state of render_to_default flag<br>
+ */<br>
+extern "C" void<br>
+draw_test_image(bool default_fb)<br>
+{<br>
+ if (default_fb) {<br>
+ render_to_default = true;<br>
+ test->draw_test_image(NULL);<br>
+ render_to_default = false;<br>
+ glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);<br>
+ }<br>
+ else {<br>
+ test->draw_test_image(&(test->test_fbo));<br>
+ glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT,<br>
+ test->test_fbo.handle);<br>
+ }<br>
+}<br></blockquote><div><br>This seems like it should be a member function of the Test class.<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>
+/* This function draws a reference image blitted in to right half of<br>
+ * default framebuffer*/<br>
+extern "C" void<br>
+draw_reference_image(void)<br>
+{<br>
+ test->draw_reference_image();<br>
+}<br>
+<br>
+/* This function verify the accuracy of MSAA by comparing the left half<br>
+ * and right half of default framebuffer<br>
+ */<br>
+extern "C" bool<br>
+measure_accuracy(void)<br>
+{<br>
+ return test->measure_accuracy();<br>
+} <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>
+/* This function allows to re initialize test_fbo with specified<br>
+ * sample count<br>
+ */<br>
+extern "C" void<br>
+fbo_set_samples(int n_samples, bool use_render_buffer,<br>
+ bool small, bool combine_depth_stencil)<br>
+{<br>
+ if (use_render_buffer)<br>
+ attach_render_buffer = true;<br>
+ glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT,<br>
+ test->test_fbo.handle);<br>
+ test->test_fbo.setup(n_samples,<br>
+ small ? 16 : pattern_width,<br>
+ small ? 16 : pattern_height,<br>
+ combine_depth_stencil);<br>
+ attach_render_buffer = false;<br>
+}<br></blockquote><div><br>I'm not sure why this refactor is helpful. The old Fbo::init() function did what Fbo::setup() does, except that it called glBindFramebuffer() first. If we restore Fbo::init(), and then make attach_render_buffer a parameter to it, it seems like we could eliminate this function entirely and just have the accuracy test call test->test_fbo.init(). <br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
diff --git a/tests/spec/ext_framebuffer_multisample/common.h b/tests/spec/ext_framebuffer_multisample/common.h<br>
new file mode 100644<br>
index 0000000..316e1d9<br>
--- /dev/null<br>
+++ b/tests/spec/ext_framebuffer_multisample/common.h<br>
@@ -0,0 +1,51 @@<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 common.h<br>
+ * This file declares functions which can be utilized to develop new multisample<br>
+ * test cases.<br>
+ */<br>
+<br>
+#include "piglit-util.h"<br>
+#include "math.h"<br>
+<br>
+#ifdef __cplusplus<br>
+extern "C"<br>
+{<br>
+#endif<br>
+void draw_test_image(bool default_fb);<br>
+<br>
+void draw_reference_image(void);<br>
+<br>
+void fbo_set_samples(int n_samples, bool use_render_buffer,<br>
+ bool small, bool combine_depth_stencil);<br>
+<br>
+bool measure_accuracy(void);<br>
+<br>
+bool test_run(void);<br>
+<br>
+void test_init(const char *str, int n_samples, bool small,<br>
+ bool combine_depth_stencil);<br>
+#ifdef __cplusplus<br>
+}<br>
+#endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.7.6<br>
<br>
</font></span></blockquote></div><br>