[Piglit] [PATCH 12/17] ext_framebuffer_multisample: unaligned-blit also against RGBA16F/32F
Topi Pohjolainen
topi.pohjolainen at gmail.com
Tue Jul 18 19:16:37 UTC 2017
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
.../ext_framebuffer_multisample/unaligned-blit.cpp | 38 ++++++++++++++--------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
index 299eab097..57cac3b80 100644
--- a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
@@ -76,11 +76,10 @@ const int inverse_permutation[num_tiles] = {
3, 13, 19, 20, 7, 18, 10, 9
};
-Fbo src_fbo;
-Fbo dst_fbo;
-TestPattern *test_pattern = NULL;
-ManifestProgram *manifest_program = NULL;
-GLbitfield buffer_to_test;
+static TestPattern *test_pattern = NULL;
+static ManifestProgram *manifest_program = NULL;
+static GLbitfield buffer_to_test;
+static unsigned src_samples, dst_samples;
void
scrambling_blit(const int *permutation)
@@ -118,8 +117,6 @@ void
piglit_init(int argc, char **argv)
{
int num_samples;
- int src_samples;
- int dst_samples;
if (argc < 4)
print_usage_and_exit(argv[0]);
@@ -168,16 +165,18 @@ piglit_init(int argc, char **argv)
test_pattern->compile();
if (manifest_program)
manifest_program->compile();
- src_fbo.setup(FboConfig(GL_RGBA, src_samples,
- pattern_size, pattern_size));
- dst_fbo.setup(FboConfig(GL_RGBA, dst_samples,
- pattern_size, pattern_size));
}
-enum piglit_result
-piglit_display()
+static bool
+test_format(GLenum color_internal_format)
{
bool pass = true;
+ Fbo src_fbo, dst_fbo;
+
+ src_fbo.setup(FboConfig(color_internal_format, src_samples,
+ pattern_size, pattern_size));
+ dst_fbo.setup(FboConfig(color_internal_format, dst_samples,
+ pattern_size, pattern_size));
/* Draw the test pattern in src_fbo. */
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, src_fbo.handle);
@@ -224,7 +223,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