Re: [Piglit] [PATCH 1/3] arb_texture_multisample: don't use hard-coded sample counts
On 12/05/2017 10:19 AM, Roland Scheidegger wrote: Am 05.12.2017 um 17:43 schrieb Brian Paul: Instead of using a fixed number of samples, query the GL_MAX_COLOR_TEXTURE_SAMPLES or GL_MAX_DEPTH_TEXTURE_SAMPLES value and use those. Fixes failures with llvmpipe and VMware driver when MSAA is disabled. --- tests/spec/arb_texture_multisample/errors.c| 10 +- tests/spec/arb_texture_multisample/sample-depth.c | 12 +++ tests/spec/arb_texture_multisample/stencil-clear.c | 23 +- .../teximage-2d-multisample.c | 13 .../teximage-3d-multisample.c | 13 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/tests/spec/arb_texture_multisample/errors.c b/tests/spec/arb_texture_multisample/errors.c index 42cc2c1..08e1696 100644 --- a/tests/spec/arb_texture_multisample/errors.c +++ b/tests/spec/arb_texture_multisample/errors.c @@ -44,6 +44,14 @@ piglit_init(int argc, char **argv) GLuint fbo; GLuint tex[2]; +GLint max_samples; + +glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &max_samples); +if (max_samples < 1) { + printf("GL_MAX_COLOR_TEXTURE_SAMPLES must be at least one\n"); + piglit_report_result(PIGLIT_FAIL); +} Do you want to use the maximum possible or restrict that to something smaller (in case the value returned is large)? Whatever value is returned, it should work. If not, either the driver is broken or perhaps the surface is too large (but all these tests use small textures). (Same below, and in the other patches.) Either way, for the series: Reviewed-by: Roland Scheidegger Thanks. -Brian + glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); @@ -51,7 +59,7 @@ piglit_init(int argc, char **argv) glGenTextures(2, tex); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex[0]); glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, -4, GL_RGBA, 64, 64, 2, GL_TRUE); +max_samples, GL_RGBA, 64, 64, 2, GL_TRUE); if (!piglit_check_gl_error(GL_NO_ERROR)) { printf("should be no error so far\n"); diff --git a/tests/spec/arb_texture_multisample/sample-depth.c b/tests/spec/arb_texture_multisample/sample-depth.c index ef2be19..94bc63d 100644 --- a/tests/spec/arb_texture_multisample/sample-depth.c +++ b/tests/spec/arb_texture_multisample/sample-depth.c @@ -38,7 +38,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN PIGLIT_GL_TEST_CONFIG_END -#define NUM_SAMPLES 4 #define TEX_WIDTH 64 #define TEX_HEIGHT 64 @@ -93,16 +92,21 @@ void piglit_init(int argc, char **argv) { GLuint tex; + int num_samples; + piglit_require_extension("GL_ARB_texture_multisample"); + /* Use the max number of samples for testing */ + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples); + /* setup an fbo with multisample depth texture */ glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex); glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, - NUM_SAMPLES, GL_DEPTH_COMPONENT24, - TEX_WIDTH, TEX_HEIGHT, - GL_TRUE); + num_samples, GL_DEPTH_COMPONENT24, + TEX_WIDTH, TEX_HEIGHT, + GL_TRUE); glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); diff --git a/tests/spec/arb_texture_multisample/stencil-clear.c b/tests/spec/arb_texture_multisample/stencil-clear.c index ca0fd81..413aa41 100644 --- a/tests/spec/arb_texture_multisample/stencil-clear.c +++ b/tests/spec/arb_texture_multisample/stencil-clear.c @@ -108,7 +108,7 @@ piglit_display(void) return pass ? PIGLIT_PASS : PIGLIT_FAIL; } -GLuint create_fbo(unsigned num_samples) +GLuint create_fbo(unsigned num_color_samples, unsigned num_depth_samples) { GLenum tex_target; GLuint texColor; @@ -119,17 +119,17 @@ GLuint create_fbo(unsigned num_samples) glGenTextures(1, &texColor); glGenTextures(1, &texZS); - if (num_samples != 0) { + if (num_color_samples != 0) { tex_target = GL_TEXTURE_2D_MULTISAMPLE; glBindTexture(tex_target, texZS); glTexImage2DMultisample( - tex_target, num_samples, GL_DEPTH32F_STENCIL8, + tex_target, num_depth_samples, GL_DEPTH32F_STENCIL8, TEX_WIDTH, TEX_HEIGHT, GL_TRUE); glBindTexture(tex_target, texColor); glTexImage2DMultisample( - tex_target, num_samples, GL_RGBA8, + tex_target, num_color_samples, GL_RGBA8, TEX_WIDTH, TEX_HEIGHT, GL_TRUE); } else { tex_target = GL_TEXTURE_2D; @@ -167,22 +167,27 @@ GLuint create_fbo(unsigned num_samples) void piglit_i
Re: [Piglit] [PATCH 1/3] arb_texture_multisample: don't use hard-coded sample counts
Am 05.12.2017 um 17:43 schrieb Brian Paul: > Instead of using a fixed number of samples, query the > GL_MAX_COLOR_TEXTURE_SAMPLES or GL_MAX_DEPTH_TEXTURE_SAMPLES value > and use those. > > Fixes failures with llvmpipe and VMware driver when MSAA is disabled. > --- > tests/spec/arb_texture_multisample/errors.c| 10 +- > tests/spec/arb_texture_multisample/sample-depth.c | 12 +++ > tests/spec/arb_texture_multisample/stencil-clear.c | 23 > +- > .../teximage-2d-multisample.c | 13 > .../teximage-3d-multisample.c | 13 > 5 files changed, 49 insertions(+), 22 deletions(-) > > diff --git a/tests/spec/arb_texture_multisample/errors.c > b/tests/spec/arb_texture_multisample/errors.c > index 42cc2c1..08e1696 100644 > --- a/tests/spec/arb_texture_multisample/errors.c > +++ b/tests/spec/arb_texture_multisample/errors.c > @@ -44,6 +44,14 @@ piglit_init(int argc, char **argv) > > GLuint fbo; > GLuint tex[2]; > +GLint max_samples; > + > +glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &max_samples); > +if (max_samples < 1) { > + printf("GL_MAX_COLOR_TEXTURE_SAMPLES must be at least one\n"); > + piglit_report_result(PIGLIT_FAIL); > +} Do you want to use the maximum possible or restrict that to something smaller (in case the value returned is large)? (Same below, and in the other patches.) Either way, for the series: Reviewed-by: Roland Scheidegger > + > glGenFramebuffers(1, &fbo); > > glBindFramebuffer(GL_FRAMEBUFFER, fbo); > @@ -51,7 +59,7 @@ piglit_init(int argc, char **argv) > glGenTextures(2, tex); > glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex[0]); > glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, > -4, GL_RGBA, 64, 64, 2, GL_TRUE); > +max_samples, GL_RGBA, 64, 64, 2, GL_TRUE); > > if (!piglit_check_gl_error(GL_NO_ERROR)) { > printf("should be no error so far\n"); > diff --git a/tests/spec/arb_texture_multisample/sample-depth.c > b/tests/spec/arb_texture_multisample/sample-depth.c > index ef2be19..94bc63d 100644 > --- a/tests/spec/arb_texture_multisample/sample-depth.c > +++ b/tests/spec/arb_texture_multisample/sample-depth.c > @@ -38,7 +38,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN > > PIGLIT_GL_TEST_CONFIG_END > > -#define NUM_SAMPLES 4 > #define TEX_WIDTH 64 > #define TEX_HEIGHT 64 > > @@ -93,16 +92,21 @@ void > piglit_init(int argc, char **argv) > { > GLuint tex; > + int num_samples; > + > piglit_require_extension("GL_ARB_texture_multisample"); > > + /* Use the max number of samples for testing */ > + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples); > + > /* setup an fbo with multisample depth texture */ > > glGenTextures(1, &tex); > glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex); > glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, > - NUM_SAMPLES, GL_DEPTH_COMPONENT24, > - TEX_WIDTH, TEX_HEIGHT, > - GL_TRUE); > + num_samples, GL_DEPTH_COMPONENT24, > + TEX_WIDTH, TEX_HEIGHT, > + GL_TRUE); > > glGenFramebuffers(1, &fbo); > glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); > diff --git a/tests/spec/arb_texture_multisample/stencil-clear.c > b/tests/spec/arb_texture_multisample/stencil-clear.c > index ca0fd81..413aa41 100644 > --- a/tests/spec/arb_texture_multisample/stencil-clear.c > +++ b/tests/spec/arb_texture_multisample/stencil-clear.c > @@ -108,7 +108,7 @@ piglit_display(void) > return pass ? PIGLIT_PASS : PIGLIT_FAIL; > } > > -GLuint create_fbo(unsigned num_samples) > +GLuint create_fbo(unsigned num_color_samples, unsigned num_depth_samples) > { > GLenum tex_target; > GLuint texColor; > @@ -119,17 +119,17 @@ GLuint create_fbo(unsigned num_samples) > glGenTextures(1, &texColor); > glGenTextures(1, &texZS); > > - if (num_samples != 0) { > + if (num_color_samples != 0) { > tex_target = GL_TEXTURE_2D_MULTISAMPLE; > > glBindTexture(tex_target, texZS); > glTexImage2DMultisample( > - tex_target, num_samples, GL_DEPTH32F_STENCIL8, > + tex_target, num_depth_samples, GL_DEPTH32F_STENCIL8, > TEX_WIDTH, TEX_HEIGHT, GL_TRUE); > > glBindTexture(tex_target, texColor); > glTexImage2DMultisample( > - tex_target, num_samples, GL_RGBA8, > + tex_target, num_color_samples, GL_RGBA8, > TEX_WIDTH, TEX_HEIGHT, GL_TRUE); > } else { > tex_target = GL_TEXTURE_2D; > @@ -167,22 +167,27 @@ GLuint create_fbo(unsigned num_samples) > void > piglit_init(int argc, char **argv) > { > - unsigned num_samples = 4; > + GLint num_colo
[Piglit] [PATCH 3/3] ext_framebuffer_multisample: don't use fixed sample count
--- tests/spec/ext_framebuffer_multisample/fast-clear.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/spec/ext_framebuffer_multisample/fast-clear.c b/tests/spec/ext_framebuffer_multisample/fast-clear.c index d4bf7ce..49ec0a3 100644 --- a/tests/spec/ext_framebuffer_multisample/fast-clear.c +++ b/tests/spec/ext_framebuffer_multisample/fast-clear.c @@ -133,6 +133,7 @@ static GLuint prog_float, prog_int, prog_uint; static GLuint result_fbo; static bool enable_fb_srgb = false; static bool single_sample = false; +static int num_samples = 2; static void convert_srgb_color(const struct format_desc *format, @@ -395,7 +396,7 @@ test_format(const struct format_desc *format) * fast clears. */ glTexImage2DMultisample(tex_target, - 2, /* samples */ + num_samples, format->internalformat, 1, 1, /* width/height */ GL_FALSE /* fixed sample locations */); @@ -557,8 +558,13 @@ piglit_init(int argc, char **argv) } } - if (!single_sample) + if (!single_sample) { piglit_require_extension("GL_ARB_texture_multisample"); + /* Use the max number of samples for testing */ + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples); + printf("Testing %d samples\n", num_samples); + } + piglit_require_extension("GL_ARB_texture_float"); piglit_require_GLSL_version(130); -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/3] arb_texture_multisample: don't use hard-coded sample counts
Instead of using a fixed number of samples, query the GL_MAX_COLOR_TEXTURE_SAMPLES or GL_MAX_DEPTH_TEXTURE_SAMPLES value and use those. Fixes failures with llvmpipe and VMware driver when MSAA is disabled. --- tests/spec/arb_texture_multisample/errors.c| 10 +- tests/spec/arb_texture_multisample/sample-depth.c | 12 +++ tests/spec/arb_texture_multisample/stencil-clear.c | 23 +- .../teximage-2d-multisample.c | 13 .../teximage-3d-multisample.c | 13 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/tests/spec/arb_texture_multisample/errors.c b/tests/spec/arb_texture_multisample/errors.c index 42cc2c1..08e1696 100644 --- a/tests/spec/arb_texture_multisample/errors.c +++ b/tests/spec/arb_texture_multisample/errors.c @@ -44,6 +44,14 @@ piglit_init(int argc, char **argv) GLuint fbo; GLuint tex[2]; +GLint max_samples; + +glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &max_samples); +if (max_samples < 1) { + printf("GL_MAX_COLOR_TEXTURE_SAMPLES must be at least one\n"); + piglit_report_result(PIGLIT_FAIL); +} + glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); @@ -51,7 +59,7 @@ piglit_init(int argc, char **argv) glGenTextures(2, tex); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex[0]); glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, -4, GL_RGBA, 64, 64, 2, GL_TRUE); +max_samples, GL_RGBA, 64, 64, 2, GL_TRUE); if (!piglit_check_gl_error(GL_NO_ERROR)) { printf("should be no error so far\n"); diff --git a/tests/spec/arb_texture_multisample/sample-depth.c b/tests/spec/arb_texture_multisample/sample-depth.c index ef2be19..94bc63d 100644 --- a/tests/spec/arb_texture_multisample/sample-depth.c +++ b/tests/spec/arb_texture_multisample/sample-depth.c @@ -38,7 +38,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN PIGLIT_GL_TEST_CONFIG_END -#define NUM_SAMPLES 4 #define TEX_WIDTH 64 #define TEX_HEIGHT 64 @@ -93,16 +92,21 @@ void piglit_init(int argc, char **argv) { GLuint tex; + int num_samples; + piglit_require_extension("GL_ARB_texture_multisample"); + /* Use the max number of samples for testing */ + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples); + /* setup an fbo with multisample depth texture */ glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex); glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, - NUM_SAMPLES, GL_DEPTH_COMPONENT24, - TEX_WIDTH, TEX_HEIGHT, - GL_TRUE); + num_samples, GL_DEPTH_COMPONENT24, + TEX_WIDTH, TEX_HEIGHT, + GL_TRUE); glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); diff --git a/tests/spec/arb_texture_multisample/stencil-clear.c b/tests/spec/arb_texture_multisample/stencil-clear.c index ca0fd81..413aa41 100644 --- a/tests/spec/arb_texture_multisample/stencil-clear.c +++ b/tests/spec/arb_texture_multisample/stencil-clear.c @@ -108,7 +108,7 @@ piglit_display(void) return pass ? PIGLIT_PASS : PIGLIT_FAIL; } -GLuint create_fbo(unsigned num_samples) +GLuint create_fbo(unsigned num_color_samples, unsigned num_depth_samples) { GLenum tex_target; GLuint texColor; @@ -119,17 +119,17 @@ GLuint create_fbo(unsigned num_samples) glGenTextures(1, &texColor); glGenTextures(1, &texZS); - if (num_samples != 0) { + if (num_color_samples != 0) { tex_target = GL_TEXTURE_2D_MULTISAMPLE; glBindTexture(tex_target, texZS); glTexImage2DMultisample( - tex_target, num_samples, GL_DEPTH32F_STENCIL8, + tex_target, num_depth_samples, GL_DEPTH32F_STENCIL8, TEX_WIDTH, TEX_HEIGHT, GL_TRUE); glBindTexture(tex_target, texColor); glTexImage2DMultisample( - tex_target, num_samples, GL_RGBA8, + tex_target, num_color_samples, GL_RGBA8, TEX_WIDTH, TEX_HEIGHT, GL_TRUE); } else { tex_target = GL_TEXTURE_2D; @@ -167,22 +167,27 @@ GLuint create_fbo(unsigned num_samples) void piglit_init(int argc, char **argv) { - unsigned num_samples = 4; + GLint num_color_samples, num_depth_samples; piglit_require_extension("GL_ARB_texture_multisample"); + /* By default, se the max number of samples for testing */ + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_color_samples); + glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &num_depth_samples); + for (int i = 1; i < argc; ++i) { if (!strcmp(argv[i], "samples")) { +
[Piglit] [PATCH 2/3] arb_texture_storage_multisample: don't use fixed sample count
--- tests/spec/arb_texture_storage_multisample/tex-param.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/spec/arb_texture_storage_multisample/tex-param.c b/tests/spec/arb_texture_storage_multisample/tex-param.c index 8aa3df3..bc40ecc 100644 --- a/tests/spec/arb_texture_storage_multisample/tex-param.c +++ b/tests/spec/arb_texture_storage_multisample/tex-param.c @@ -149,11 +149,15 @@ piglit_display(void) struct subtest *t; enum piglit_result result = PIGLIT_PASS; enum piglit_result subtest_result; + GLint num_samples; + + /* Use the max number of samples for testing */ + glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex); glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, - 4, GL_RGBA, 64, 64, GL_TRUE); + num_samples, GL_RGBA, 64, 64, GL_TRUE); for (t = subtests; t->param; t++) { subtest_result = check_subtest(t); -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] summary/console: Add -p / --problems
This is convenient for extracting a focused test set from a more comprehensive run, to speed up bisection or per-commit validation. --- framework/programs/summary.py | 5 + framework/summary/console_.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/framework/programs/summary.py b/framework/programs/summary.py index e400d9a76..ef106bc1b 100644 --- a/framework/programs/summary.py +++ b/framework/programs/summary.py @@ -145,6 +145,11 @@ def console(input_): const="incomplete", dest='mode', help="Only display tests that are incomplete.") +excGroup1.add_argument("-p", "--problems", + action="store_const", + const="problems", + dest='mode', + help="Onlu display tests that had problems.") parser.add_argument("-l", "--list", action="store", help="Use test results from a list file") diff --git a/framework/summary/console_.py b/framework/summary/console_.py index ee6cbd858..a51a54efc 100644 --- a/framework/summary/console_.py +++ b/framework/summary/console_.py @@ -108,7 +108,7 @@ def _print_result(results, list_): def console(resultsFiles, mode): """ Write summary information to the console for the given list of results files in the given mode.""" -assert mode in ['summary', 'diff', 'incomplete', 'all'], mode +assert mode in ['summary', 'diff', 'incomplete', 'problems', 'all'], mode results = Results([backends.load(r) for r in resultsFiles]) # Print the name of the test and the status from each test run @@ -120,5 +120,7 @@ def console(resultsFiles, mode): _print_summary(results) elif mode == 'incomplete': _print_result(results, results.names.all_incomplete) +elif mode == 'problems': +_print_result(results, results.names.all_problems) elif mode == 'summary': _print_summary(results) -- 2.14.3 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit