[Piglit] [PATCH 04/17] ext_framebuffer_multisample: accuracy also against RGBA16F/32F
Topi Pohjolainen
topi.pohjolainen at gmail.com
Tue Jul 18 19:16:29 UTC 2017
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
.../spec/ext_framebuffer_multisample/accuracy.cpp | 29 +++++++++++++++++-----
tests/spec/ext_framebuffer_multisample/common.cpp | 10 +++++---
tests/spec/ext_framebuffer_multisample/common.h | 6 +++--
.../ext_framebuffer_multisample/turn-on-off.cpp | 2 +-
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/tests/spec/ext_framebuffer_multisample/accuracy.cpp b/tests/spec/ext_framebuffer_multisample/accuracy.cpp
index c571771cb..7ad7281a7 100644
--- a/tests/spec/ext_framebuffer_multisample/accuracy.cpp
+++ b/tests/spec/ext_framebuffer_multisample/accuracy.cpp
@@ -62,7 +62,6 @@ bool small = false, combine_depth_stencil = false;
bool all_samples = false;
GLenum filter_mode = GL_NEAREST;
test_type_enum test_type;
-Test *test = NULL;
NORETURN void
print_usage_and_exit(char *prog_name)
@@ -145,11 +144,29 @@ piglit_init(int argc, char **argv)
bool
test_create_and_execute()
{
- test = create_test(test_type, num_samples, small,
- combine_depth_stencil,
- pattern_width, pattern_height, supersample_factor,
- filter_mode);
- return test->run();
+ Test *test = create_test(test_type, num_samples, small,
+ combine_depth_stencil,
+ pattern_width, pattern_height,
+ supersample_factor, filter_mode, GL_RGBA);
+ bool result = test->run();
+
+ if (test_type == TEST_TYPE_COLOR) {
+ test = create_test(test_type, num_samples, small,
+ combine_depth_stencil,
+ pattern_width, pattern_height,
+ supersample_factor,
+ filter_mode, GL_RGBA16F);
+ result &= test->run();
+
+ test = create_test(test_type, num_samples, small,
+ combine_depth_stencil,
+ pattern_width, pattern_height,
+ supersample_factor,
+ filter_mode, GL_RGBA32F);
+ result &= test->run();
+ }
+
+ return result;
}
enum piglit_result
diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp b/tests/spec/ext_framebuffer_multisample/common.cpp
index f6e2d7421..93beb57a3 100644
--- a/tests/spec/ext_framebuffer_multisample/common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp
@@ -271,7 +271,7 @@ Test::Test(TestPattern *pattern, ManifestProgram *manifest_program,
void
Test::init(int num_samples, bool small, bool combine_depth_stencil,
int pattern_width, int pattern_height, int supersample_factor,
- GLenum filter_mode)
+ GLenum filter_mode, GLenum color_internal_format)
{
this->num_samples = num_samples;
this->pattern_width = pattern_width;
@@ -284,6 +284,8 @@ Test::init(int num_samples, bool small, bool combine_depth_stencil,
small ? 16 : pattern_height);
if (srgb)
test_fbo_config.color_internalformat = GL_SRGB8_ALPHA8;
+ else
+ test_fbo_config.color_internalformat = color_internal_format;
test_fbo_config.combine_depth_stencil = combine_depth_stencil;
test_fbo.setup(test_fbo_config);
@@ -603,7 +605,8 @@ Test::run()
Test *
create_test(test_type_enum test_type, int n_samples, bool small,
bool combine_depth_stencil, int pattern_width, int pattern_height,
- int supersample_factor, GLenum filter_mode)
+ int supersample_factor, GLenum filter_mode,
+ GLenum color_internal_format)
{
Test *test = NULL;
switch (test_type) {
@@ -642,6 +645,7 @@ create_test(test_type_enum test_type, int n_samples, bool small,
}
test->init(n_samples, small, combine_depth_stencil, pattern_width,
- pattern_height, supersample_factor, filter_mode);
+ pattern_height, supersample_factor, filter_mode,
+ color_internal_format);
return test;
}
diff --git a/tests/spec/ext_framebuffer_multisample/common.h b/tests/spec/ext_framebuffer_multisample/common.h
index 948a1d4a8..d4a0686e0 100644
--- a/tests/spec/ext_framebuffer_multisample/common.h
+++ b/tests/spec/ext_framebuffer_multisample/common.h
@@ -101,7 +101,8 @@ public:
bool test_resolve, GLbitfield blit_type, bool srgb);
void init(int num_samples, bool small, bool combine_depth_stencil,
int pattern_width, int pattern_height,
- int supersample_factor, GLenum filter_mode);
+ int supersample_factor, GLenum filter_mode,
+ GLenum color_internal_format);
bool run();
void draw_test_image(piglit_util_fbo::Fbo *fbo);
void draw_to_default_framebuffer();
@@ -183,4 +184,5 @@ private:
Test *
create_test(test_type_enum test_type, int n_samples, bool small,
bool combine_depth_stencil, int pattern_width,
- int pattern_height, int supersample_factor, GLenum filter_mode);
+ int pattern_height, int supersample_factor, GLenum filter_mode,
+ GLenum color_internal_format);
diff --git a/tests/spec/ext_framebuffer_multisample/turn-on-off.cpp b/tests/spec/ext_framebuffer_multisample/turn-on-off.cpp
index 4c9c5046d..1b62899cb 100644
--- a/tests/spec/ext_framebuffer_multisample/turn-on-off.cpp
+++ b/tests/spec/ext_framebuffer_multisample/turn-on-off.cpp
@@ -152,5 +152,5 @@ piglit_init(int argc, char **argv)
true /* combine_depth_stencil */,
pattern_width, pattern_height,
16 /* supersample_factor */,
- GL_NEAREST);
+ GL_NEAREST, GL_RGBA);
}
--
2.11.0
More information about the Piglit
mailing list