[Piglit] [PATCH 13/17] ext_framebuffer_multisample: upsample also against RGBA16F/32F
Topi Pohjolainen
topi.pohjolainen at gmail.com
Tue Jul 18 19:16:38 UTC 2017
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
.../spec/ext_framebuffer_multisample/upsample.cpp | 35 ++++++++++++++--------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/tests/spec/ext_framebuffer_multisample/upsample.cpp b/tests/spec/ext_framebuffer_multisample/upsample.cpp
index 5f1dc635f..16d7f3233 100644
--- a/tests/spec/ext_framebuffer_multisample/upsample.cpp
+++ b/tests/spec/ext_framebuffer_multisample/upsample.cpp
@@ -67,11 +67,11 @@ PIGLIT_GL_TEST_CONFIG_END
const int pattern_width = 256; const int pattern_height = 256;
-Fbo multisample_fbo;
-TestPattern *test_pattern = NULL;
-ManifestProgram *manifest_program = NULL;
-GLbitfield buffer_to_test;
-GLenum filter_mode = GL_NEAREST;
+static TestPattern *test_pattern = NULL;
+static ManifestProgram *manifest_program = NULL;
+static GLbitfield buffer_to_test;
+static GLenum filter_mode = GL_NEAREST;
+static int num_samples;
void
print_usage_and_exit(char *prog_name)
@@ -90,7 +90,6 @@ print_usage_and_exit(char *prog_name)
void
piglit_init(int argc, char **argv)
{
- int num_samples;
if (argc < 3)
print_usage_and_exit(argv[0]);
{
@@ -135,15 +134,16 @@ piglit_init(int argc, char **argv)
test_pattern->compile();
if (manifest_program)
manifest_program->compile();
-
- multisample_fbo.setup(FboConfig(GL_RGBA, num_samples, pattern_width,
- pattern_height));
}
-enum piglit_result
-piglit_display()
+static bool
+test_format(GLenum color_internal_format)
{
bool pass = true;
+ Fbo multisample_fbo;
+
+ multisample_fbo.setup(FboConfig(color_internal_format, num_samples,
+ pattern_width, pattern_height));
/* Draw the full test pattern on the right half of the piglit
* window, as a reference image.
@@ -204,7 +204,18 @@ piglit_display()
pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
piglit_height) && pass;
- pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+ return piglit_check_gl_error(GL_NO_ERROR) && pass;
+}
+
+enum piglit_result
+piglit_display()
+{
+ bool pass = test_format(GL_RGBA);
+
+ if (buffer_to_test == GL_COLOR_BUFFER_BIT) {
+ pass &= test_format(GL_RGBA16F);
+ pass &= test_format(GL_RGBA32F);
+ }
piglit_present_results();
--
2.11.0
More information about the Piglit
mailing list