[Piglit] [PATCH 05/17] ext_framebuffer_multisample: more tests against GL_RGBA16F/32F
Topi Pohjolainen
topi.pohjolainen at gmail.com
Tue Jul 18 19:16:30 UTC 2017
Currently these are run only against GL_RGBA.
Two integer formattted tests:
int-draw-buffers-alpha-to-one and
int-draw-buffers-alpha-to-coverage
will be addressed in another patch while
alpha-to-coverage-no-draw-buffer-zero and
alpha-to-one-single-sample-buffer
are not that meaningful to run against multiple formats.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
tests/all.py | 13 +++++++++----
.../alpha-to-coverage-dual-src-blend.cpp | 9 ++++++---
.../alpha-to-coverage-no-draw-buffer-zero-write.cpp | 9 ++++++---
.../alpha-to-one-dual-src-blend.cpp | 9 ++++++---
.../alpha-to-one-msaa-disabled.cpp | 9 ++++++---
tests/spec/ext_framebuffer_multisample/bitmap.cpp | 10 +++++++---
.../draw-buffers-alpha-to-coverage.cpp | 9 ++++++---
.../draw-buffers-alpha-to-one.cpp | 9 ++++++---
.../ext_framebuffer_multisample/draw-buffers-common.cpp | 4 +++-
tests/spec/ext_framebuffer_multisample/line-smooth.cpp | 9 ++++++---
tests/spec/ext_framebuffer_multisample/point-smooth.cpp | 9 ++++++---
tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp | 9 ++++++---
tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp | 12 ++++++++----
.../ext_framebuffer_multisample/sample-alpha-to-one.cpp | 9 ++++++---
14 files changed, 87 insertions(+), 42 deletions(-)
diff --git a/tests/all.py b/tests/all.py
index e08cee978..98b78ea89 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3049,14 +3049,19 @@ with profile.test_list.group_manager(
'draw-buffers-alpha-to-one',
'draw-buffers-alpha-to-coverage',
'alpha-to-coverage-dual-src-blend',
- 'alpha-to-coverage-no-draw-buffer-zero',
'alpha-to-coverage-no-draw-buffer-zero-write',
'alpha-to-one-dual-src-blend',
- 'int-draw-buffers-alpha-to-one',
- 'int-draw-buffers-alpha-to-coverage',
'alpha-to-one-msaa-disabled',
- 'alpha-to-one-single-sample-buffer',
'bitmap', 'polygon-stipple']:
+ for fmt in ('GL_RGBA', 'GL_RGBA16F', 'GL_RGBA32F'):
+ g(['ext_framebuffer_multisample-{}'.format(test),
+ sample_count, fmt],
+ '{} {} {}'.format(test, sample_count, fmt))
+
+ for test in ['alpha-to-coverage-no-draw-buffer-zero',
+ 'int-draw-buffers-alpha-to-one',
+ 'int-draw-buffers-alpha-to-coverage',
+ 'alpha-to-one-single-sample-buffer']:
g(['ext_framebuffer_multisample-{}'.format(test),
sample_count],
'{} {}'.format(test, sample_count))
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
index 777af0cc8..c363535f9 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
@@ -50,7 +50,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -60,7 +60,7 @@ piglit_init(int argc, char **argv)
int samples;
const int num_attachments = 1;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -69,6 +69,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(30);
int pattern_width = piglit_width / 2;
@@ -90,7 +93,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(true /* sample_alpha_to_coverage */,
true /* dual_src_blend */,
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero-write.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero-write.cpp
index 21c842eff..021b45e55 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero-write.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero-write.cpp
@@ -55,7 +55,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -68,7 +68,7 @@ piglit_init(int argc, char **argv)
*/
int num_attachments = 3;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
@@ -78,6 +78,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
piglit_require_extension("GL_EXT_framebuffer_multisample");
@@ -101,7 +104,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA /* color_buffer_zero_format */);
+ color_internal_format);
shader_compile(true /* sample_alpha_to_coverage */,
false /* dual_src_blend */,
false /* frag_out_zero_write */);
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
index c2adeb555..5ad4ce881 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
@@ -50,7 +50,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -60,7 +60,7 @@ piglit_init(int argc, char **argv)
int samples;
const int num_attachments = 1;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -69,6 +69,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(30);
int pattern_width = piglit_width / 2;
@@ -90,7 +93,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(false /* sample_alpha_to_coverage */,
true /* dual_src_blend */,
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
index f7da4b818..bb466121e 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
@@ -52,7 +52,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -62,7 +62,7 @@ piglit_init(int argc, char **argv)
int num_attachments = 1;
int samples;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -71,6 +71,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -94,7 +97,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(false /* sample_alpha_to_coverage */,
false /* dual_src_blend */,
true /* frag_out_zero_write */);
diff --git a/tests/spec/ext_framebuffer_multisample/bitmap.cpp b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
index 3b50dccb0..efda57c26 100644
--- a/tests/spec/ext_framebuffer_multisample/bitmap.cpp
+++ b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
@@ -142,7 +142,7 @@ test_multisample_bitmap()
void
piglit_init(int argc, char **argv)
{
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -151,6 +151,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -163,9 +166,10 @@ piglit_init(int argc, char **argv)
if (num_samples > max_samples)
piglit_report_result(PIGLIT_SKIP);
- ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+ ms_fbo.setup(FboConfig(color_internal_format, num_samples,
pattern_width, pattern_height));
- resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
+ resolve_fbo.setup(FboConfig(color_internal_format, 0,
+ pattern_width, pattern_height));
}
enum piglit_result
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
index fe6a4fa49..7b5e7c76f 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
@@ -57,7 +57,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -70,7 +70,7 @@ piglit_init(int argc, char **argv)
*/
int num_attachments = 3;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -79,6 +79,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -102,7 +105,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(true /* sample_alpha_to_coverage */,
false /* dual_src_blend */,
true /* frag_out_zero_write */);
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
index a9813ec63..332c3237e 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
@@ -79,7 +79,7 @@ static int samples;
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -91,7 +91,7 @@ piglit_init(int argc, char **argv)
*/
int num_attachments = 3;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -100,6 +100,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -123,7 +126,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(false /* sample_alpha_to_coverage */,
false /* dual_src_blend */,
true /* frag_out_zero_write */);
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
index 694931b6d..877b74a17 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
@@ -933,7 +933,9 @@ ms_fbo_and_draw_buffers_setup(int samples,
color_buffer_zero_format, 0,
pattern_width, pattern_height));
is_buffer_zero_integer_format = true;
- } else if (color_buffer_zero_format == GL_RGBA) {
+ } else if (color_buffer_zero_format == GL_RGBA ||
+ color_buffer_zero_format == GL_RGBA16F ||
+ color_buffer_zero_format == GL_RGBA32F) {
resolve_config.color_internalformat =
color_buffer_zero_format;
} else if (color_buffer_zero_format != GL_NONE) {
diff --git a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
index 29b1be04e..d4b18619b 100644
--- a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
@@ -75,7 +75,7 @@ void
piglit_init(int argc, char **argv)
{
int num_samples;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -84,6 +84,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -100,7 +103,7 @@ piglit_init(int argc, char **argv)
test_pattern = new Lines();
test_pattern->compile();
- test_fbo.setup(FboConfig(GL_RGBA, num_samples,
+ test_fbo.setup(FboConfig(color_internal_format, num_samples,
pattern_width, pattern_height));
glEnable (GL_BLEND);
@@ -133,7 +136,7 @@ piglit_display()
pattern_width, 0, 2*pattern_width, pattern_height,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
- /* Draw test pattern in mulisample test_fbo with GL_LINE_SMOOTH
+ /* Draw test pattern in multisample test_fbo with GL_LINE_SMOOTH
* enabled
*/
glEnable(GL_LINE_SMOOTH);
diff --git a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
index 544b001a6..fbf62a8fa 100644
--- a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
@@ -66,7 +66,7 @@ GLbitfield buffer_to_test;
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n",
+ printf("Usage: %s <num_samples> <format>\n",
prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -75,7 +75,7 @@ void
piglit_init(int argc, char **argv)
{
int num_samples;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -84,6 +84,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -100,7 +103,7 @@ piglit_init(int argc, char **argv)
test_pattern = new Points();
test_pattern->compile();
- test_fbo.setup(FboConfig(GL_RGBA, num_samples,
+ test_fbo.setup(FboConfig(color_internal_format, num_samples,
pattern_width, pattern_height));
/* Blending is required to test smooth points */
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
index e6f71807a..707ddaccc 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
@@ -65,7 +65,7 @@ TestPattern *test_pattern = NULL;
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n",
+ printf("Usage: %s <num_samples> <format>\n",
prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -74,7 +74,7 @@ void
piglit_init(int argc, char **argv)
{
int num_samples;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -83,6 +83,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -98,7 +101,7 @@ piglit_init(int argc, char **argv)
test_pattern = new Triangles();
test_pattern->compile();
- ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+ ms_fbo.setup(FboConfig(color_internal_format, num_samples,
pattern_width, pattern_height));
/* Enable blending to test GL_POLYGON_SMOOTH */
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
index f22386655..d5d12223c 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
@@ -209,14 +209,14 @@ test_polygon_stipple()
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
void
piglit_init(int argc, char **argv)
{
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -225,6 +225,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -237,9 +240,10 @@ piglit_init(int argc, char **argv)
if (num_samples > max_samples)
piglit_report_result(PIGLIT_SKIP);
- ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+ ms_fbo.setup(FboConfig(color_internal_format, num_samples,
pattern_width, pattern_height));
- resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
+ resolve_fbo.setup(FboConfig(color_internal_format, 0,
+ pattern_width, pattern_height));
buffer_to_test = GL_COLOR_BUFFER_BIT;
shader_compile();
diff --git a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
index 451686c91..374480987 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
@@ -52,7 +52,7 @@ PIGLIT_GL_TEST_CONFIG_END
void
print_usage_and_exit(char *prog_name)
{
- printf("Usage: %s <num_samples>\n", prog_name);
+ printf("Usage: %s <num_samples> <format>\n", prog_name);
piglit_report_result(PIGLIT_FAIL);
}
@@ -62,7 +62,7 @@ piglit_init(int argc, char **argv)
int num_attachments = 1;
int samples;
- if (argc < 2)
+ if (argc < 3)
print_usage_and_exit(argv[0]);
{
char *endptr = NULL;
@@ -71,6 +71,9 @@ piglit_init(int argc, char **argv)
print_usage_and_exit(argv[0]);
}
+ const GLenum color_internal_format =
+ piglit_get_gl_enum_from_name(argv[2]);
+
piglit_require_gl_version(21);
piglit_require_extension("GL_ARB_framebuffer_object");
piglit_require_extension("GL_ARB_vertex_array_object");
@@ -94,7 +97,7 @@ piglit_init(int argc, char **argv)
pattern_height,
num_attachments,
GL_COLOR_BUFFER_BIT,
- GL_RGBA);
+ color_internal_format);
shader_compile(false /* sample_alpha_to_coverage */,
false /* dual_src_blend */,
true /* frag_out_zero_write */);
--
2.11.0
More information about the Piglit
mailing list