Re: [Piglit] [PATCH] texwrap: minor assorted changes
By removing offset++, you left some empty if statements in there. Other than that: Reviewed-by: Marek Olšák Marek On Mon, Jul 14, 2014 at 4:37 PM, Brian Paul wrote: > Always draw a (mode, filter) test pattern at the same window position, > regardless of border mode, supported, etc. This makes it a little > easier to do visual inspections. > > In non-auto mode, print names of wrap modes to help identify the > test patterns. Ideally, we'd print this in the window instead of > the terminal but piglit doesn't have a text-drawing feature. > --- > tests/texturing/texwrap.c | 53 > - > 1 file changed, 28 insertions(+), 25 deletions(-) > > diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c > index 383681e..21e49ac 100644 > --- a/tests/texturing/texwrap.c > +++ b/tests/texturing/texwrap.c > @@ -807,11 +807,25 @@ static GLboolean skip_test(GLenum mode, GLenum filter) > return test_border_color; > } > > +/** > + * For a given wrap mode index, filter mode index and npot flag, return > + * the (x,y) position for drawing the test pattern. > + */ > +static void > +test_to_xy(unsigned mode, unsigned filter, unsigned npot, int *x, int *y) > +{ > + assert(mode < ARRAY_SIZE(wrap_modes)); > + assert(filter < 2); > + assert(npot < 2); > + *x = mode * (TILE_SIZE(npot) + TILE_SPACE) + 5; > + *y = filter * (TILE_SIZE(npot) + TILE_SPACE) + 35; > +} > + > + > static void draw(const struct format_desc *format, > GLboolean npot, GLboolean texproj) > { > unsigned i, j; > - int offset; > int num_filters = format->type == FLOAT_TYPE ? 2 : 1; > int bits = get_int_format_bits(format); > float scale[4]; > @@ -840,13 +854,12 @@ static void draw(const struct format_desc *format, > for (i = 0; i < num_filters; i++) { > GLenum filter = i ? GL_LINEAR : GL_NEAREST; > > - offset = 0; > - > glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, > filter); > glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, > filter); > > /* Loop over wrap modes. */ > for (j = 0; wrap_modes[j].mode != 0; j++) { > + int xpos, ypos; > float x0 = 0; > float y0 = 0; > float x1 = TILE_SIZE(npot); > @@ -858,13 +871,13 @@ static void draw(const struct format_desc *format, > float q = 1; > float ts0 = s0, ts1 = s1, tt0 = t0, tt1 = t1, tr = > 0.5; > > - if (!wrap_modes[j].supported) > + if (!wrap_modes[j].supported) { > continue; > +} > > if (skip_test(wrap_modes[j].mode, filter)) { > if (skip_test(wrap_modes[j].mode, GL_LINEAR) > != > skip_test(wrap_modes[j].mode, > GL_NEAREST)) { > - offset++; > } > continue; > } > @@ -895,10 +908,8 @@ static void draw(const struct format_desc *format, > wrap_modes[j].mode); > > glPushMatrix(); > - glTranslatef(offset * (TILE_SIZE(npot) + TILE_SPACE) > + 5, > -i * (TILE_SIZE(npot) + TILE_SPACE) + 35, > -0); > - offset++; > + test_to_xy(j, i, npot, &xpos, &ypos); > + glTranslatef(xpos, ypos, 0.0); > > glEnable(texture_target); > glColor3f(1, 1, 1); > @@ -939,21 +950,14 @@ static void draw(const struct format_desc *format, > > glDisable(texture_target); > glColor3f(1, 1, 1); > - offset = 0; > > if (!piglit_automatic) { > + printf("modes: "); > for (i = 0; wrap_modes[i].mode != 0; i++) { > - if (wrap_modes[i].supported) { > - if (skip_test(wrap_modes[i].mode, GL_LINEAR) > && > - skip_test(wrap_modes[i].mode, > GL_NEAREST)) { > - continue; > - } > - > - glWindowPos2iARB(offset * (TILE_SIZE(npot) + > TILE_SPACE) + 5, > -5 + ((offset & 1) * 15)); > - offset++; > - } > + printf("%s, ", > + piglit_get_gl_enum_name(wrap_modes[i].mode)); > } > + printf("\n"); > } > } > > @@ -978,7 +982,6 @@ static GLboolean probe_pixels(const s
[Piglit] [PATCH] polygon-offset: limit line width to 12 pixels
12 is somewhat arbitrary, but it avoids total failure if the max line width is something large (like 255 in llvmpipe). --- tests/general/polygon-offset.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/general/polygon-offset.c b/tests/general/polygon-offset.c index da3a069..1d0b4dc 100644 --- a/tests/general/polygon-offset.c +++ b/tests/general/polygon-offset.c @@ -92,6 +92,9 @@ piglit_display(void) glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, point_size_range); if (line_width > point_size_range[1]) line_width = point_size_range[1]; + +line_width = MIN2(line_width, 12); + glLineWidth(line_width); glPointSize(line_width); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 2/2] Delete [ shader file] support from shader_runner.
On 07/14/2014 09:52 AM, Kenneth Graunke wrote: This hasn't proven to be terribly useful; most tests don't use it. Dropping it allows us to drop code for: - Loading shaders from files - Determining where to look for said files (platform specific) - A bunch of per-shader stage enums - compile_glsl parameter for whether or not to free the shader string Signed-off-by: Kenneth Graunke Both LGTM. Nice simplifications! Reviewed-by: Brian Paul ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/2] Replace [vertex/fragment shader file] sections in shader_test files.
This replaces sections like: [fragment shader file] glsl-color.frag with [fragment shader] and the contents of that file. The majority of shader_test files include all their shaders in a single file, which is nice: you can read and understand them all at a glance, without having to open multiple files. You also don't need to worry about extra data files that live in some path. In roughly 60% of these cases, the shader file being included was a a single line (such as gl_FragColor = gl_Color), so just importing it into the shader_test doesn't even add much extra data. The other 40% were shadow tests where it added a bit more, but it's still not horrible. This commit was autogenerated by a python script, with extra 'git rm's for the unnecessary .vert/.frag files after the conversion. Signed-off-by: Kenneth Graunke --- I've trimmed down the patch for the mailing list because it was 148K. You can get the entire patch in the 'shaderrunnerclean' branch of ~kwg/piglit. You can also generate the patch by running: $ find tests -name '*.shader_test' -exec ./rip-out-shader-files.py {} \; where rip-out-shader-files.py is: #! /usr/bin/python3 import sys import os.path as path dirname = path.dirname(sys.argv[1]) with open(sys.argv[1]) as f: line_is_filename = False output = "" for line in f.readlines(): if line_is_filename: line_is_filename = False with open(path.join(dirname, line.strip())) as shader: output += shader.read().strip() output += '\n' continue if line == '[vertex shader file]\n': output += '[vertex shader]\n' line_is_filename = True elif line == '[fragment shader file]\n': output += '[fragment shader]\n' line_is_filename = True else: output += line with open(sys.argv[1], 'w') as f: f.write(output) .../arb_texture_gather-miplevels.shader_test | 7 ++- tests/shaders/glsl-array-bounds-01.shader_test | 7 ++- tests/shaders/glsl-array-bounds-02.shader_test | 7 ++- tests/shaders/glsl-array-bounds-03.shader_test | 7 ++- tests/shaders/glsl-array-bounds-04.shader_test | 7 ++- tests/shaders/glsl-array-bounds-05.shader_test | 7 ++- tests/shaders/glsl-array-bounds-06.shader_test | 7 ++- tests/shaders/glsl-array-bounds-07.shader_test | 7 ++- tests/shaders/glsl-array-bounds-08.shader_test | 7 ++- tests/shaders/glsl-array-length.shader_test| 7 ++- .../shaders/glsl-array-uniform-length.shader_test | 7 ++- tests/shaders/glsl-const-builtin-abs.shader_test | 7 ++- tests/shaders/glsl-const-builtin-acos.shader_test | 7 ++- tests/shaders/glsl-const-builtin-all.shader_test | 7 ++- tests/shaders/glsl-const-builtin-any.shader_test | 7 ++- tests/shaders/glsl-const-builtin-asin.shader_test | 7 ++- tests/shaders/glsl-const-builtin-atan.shader_test | 7 ++- tests/shaders/glsl-const-builtin-ceil.shader_test | 7 ++- tests/shaders/glsl-const-builtin-clamp.shader_test | 7 ++- tests/shaders/glsl-const-builtin-cos.shader_test | 7 ++- tests/shaders/glsl-const-builtin-cosh.shader_test | 7 ++- tests/shaders/glsl-const-builtin-cross.shader_test | 7 ++- .../shaders/glsl-const-builtin-degrees.shader_test | 7 ++- .../glsl-const-builtin-derivatives.shader_test | 7 ++- .../glsl-const-builtin-distance.shader_test| 7 ++- tests/shaders/glsl-const-builtin-dot.shader_test | 7 ++- .../glsl-const-builtin-equal-bool.shader_test | 7 ++- tests/shaders/glsl-const-builtin-equal.shader_test | 7 ++- tests/shaders/glsl-const-builtin-exp.shader_test | 7 ++- tests/shaders/glsl-const-builtin-exp2.shader_test | 7 ++- .../glsl-const-builtin-faceforward.shader_test | 7 ++- tests/shaders/glsl-const-builtin-floor.shader_test | 7 ++- tests/shaders/glsl-const-builtin-fract.shader_test | 7 ++- .../glsl-const-builtin-greaterThan.shader_test | 7 ++- ...glsl-const-builtin-greaterThanEqual.shader_test | 7 ++- .../glsl-const-builtin-inversesqrt.shader_test | 7 ++- .../shaders/glsl-const-builtin-length.shader_test | 7 ++- .../glsl-const-builtin-lessThan.shader_test| 7 ++- .../glsl-const-builtin-lessThanEqual.shader_test | 7 ++- tests/shaders/glsl-const-builtin-log.shader_test | 7 ++- tests/shaders/glsl-const-builtin-log2.shader_test | 7 ++- .../glsl-const-builtin-matrixCompMult.shader_test | 7 ++- tests/shaders/glsl-const-builtin-max.shader_test | 7 ++- tests/shaders/glsl-const-builtin-min.shader_test | 7 ++- tests/shaders/glsl-const-builtin-mix.shader_test | 7 ++- tests/shaders/glsl-const-builtin-mod.shader_test | 7 ++- .../glsl-const-builtin-normalize.shader_test | 7 ++- tests/shaders/glsl-const-builtin-not.shader_test | 7 ++- .../glsl-const-builtin-notEqual-bool.shader_test | 7 ++- .../glsl-const-builtin-notEqual.shader_test| 7 ++- .../glsl-const-buil
[Piglit] [PATCH 2/2] Delete [ shader file] support from shader_runner.
This hasn't proven to be terribly useful; most tests don't use it. Dropping it allows us to drop code for: - Loading shaders from files - Determining where to look for said files (platform specific) - A bunch of per-shader stage enums - compile_glsl parameter for whether or not to free the shader string Signed-off-by: Kenneth Graunke --- tests/shaders/shader_runner.c | 140 +++--- 1 file changed, 10 insertions(+), 130 deletions(-) diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index a1bd5ee..5c5e2c1 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -134,21 +134,15 @@ enum states { none = 0, requirements, vertex_shader, - vertex_shader_file, vertex_shader_passthrough, vertex_program, tess_ctrl_shader, - tess_ctrl_shader_file, tess_eval_shader, - tess_eval_shader_file, geometry_shader, - geometry_shader_file, geometry_layout, fragment_shader, - fragment_shader_file, fragment_program, compute_shader, - compute_shader_file, vertex_data, test, }; @@ -269,7 +263,7 @@ target_to_short_name(GLenum target) void -compile_glsl(GLenum target, bool release_text) +compile_glsl(GLenum target) { GLuint shader = glCreateShader(target); GLint ok; @@ -348,10 +342,6 @@ compile_glsl(GLenum target, bool release_text) piglit_report_result(PIGLIT_FAIL); } - if (release_text) { - free(shader_string); - } - switch (target) { case GL_VERTEX_SHADER: vertex_shaders[num_vertex_shaders] = shader; @@ -461,42 +451,6 @@ comparison_string(enum comparison cmp) } -void -load_shader_file(const char *line) -{ - GLsizei *const size = &shader_string_size; - char buf[256]; - char *text; - - if (shader_string) { - printf("Multiple shader files in same section: %s\n", line); - piglit_report_result(PIGLIT_FAIL); - } - - strcpy_to_space(buf, line); - - text = piglit_load_text_file(buf, (unsigned *) size); - if ((text == NULL) && (path != NULL)) { - const size_t len = strlen(path); - - memcpy(buf, path, len); - buf[len] = '/'; - strcpy_to_space(&buf[len + 1], line); - - text = piglit_load_text_file(buf, (unsigned *) size); - } - - if (text == NULL) { - strcpy_to_space(buf, line); - - printf("could not load file \"%s\"\n", buf); - piglit_report_result(PIGLIT_FAIL); - } - - shader_string = text; -} - - /** * Parse a binary comparison operator and return the matching token */ @@ -747,15 +701,11 @@ leave_state(enum states state, const char *line) case vertex_shader: shader_string_size = line - shader_string; - compile_glsl(GL_VERTEX_SHADER, false); + compile_glsl(GL_VERTEX_SHADER); break; case vertex_shader_passthrough: - compile_glsl(GL_VERTEX_SHADER, false); - break; - - case vertex_shader_file: - compile_glsl(GL_VERTEX_SHADER, true); + compile_glsl(GL_VERTEX_SHADER); break; case vertex_program: @@ -766,29 +716,17 @@ leave_state(enum states state, const char *line) case tess_ctrl_shader: shader_string_size = line - shader_string; - compile_glsl(GL_TESS_CONTROL_SHADER, false); - break; - - case tess_ctrl_shader_file: - compile_glsl(GL_TESS_CONTROL_SHADER, true); + compile_glsl(GL_TESS_CONTROL_SHADER); break; case tess_eval_shader: shader_string_size = line - shader_string; - compile_glsl(GL_TESS_EVALUATION_SHADER, false); - break; - - case tess_eval_shader_file: - compile_glsl(GL_TESS_EVALUATION_SHADER, true); + compile_glsl(GL_TESS_EVALUATION_SHADER); break; case geometry_shader: shader_string_size = line - shader_string; - compile_glsl(GL_GEOMETRY_SHADER, false); - break; - - case geometry_shader_file: - compile_glsl(GL_GEOMETRY_SHADER, true); + compile_glsl(GL_GEOMETRY_SHADER); break; case geometry_layout: @@ -796,11 +734,7 @@ leave_state(enum states state, const char *line) case fragment_shader: shader_string_size = line - shader_string; - compile_glsl(GL_FRAGMENT_SHADER, false); - break; - - case fragment_shader_file: - compile_glsl(GL_FRAGMENT_SHADER, true); + compile_glsl(GL_FRAGMENT_SHADER); break;
[Piglit] [PATCH] texwrap: minor assorted changes
Always draw a (mode, filter) test pattern at the same window position, regardless of border mode, supported, etc. This makes it a little easier to do visual inspections. In non-auto mode, print names of wrap modes to help identify the test patterns. Ideally, we'd print this in the window instead of the terminal but piglit doesn't have a text-drawing feature. --- tests/texturing/texwrap.c | 53 - 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c index 383681e..21e49ac 100644 --- a/tests/texturing/texwrap.c +++ b/tests/texturing/texwrap.c @@ -807,11 +807,25 @@ static GLboolean skip_test(GLenum mode, GLenum filter) return test_border_color; } +/** + * For a given wrap mode index, filter mode index and npot flag, return + * the (x,y) position for drawing the test pattern. + */ +static void +test_to_xy(unsigned mode, unsigned filter, unsigned npot, int *x, int *y) +{ + assert(mode < ARRAY_SIZE(wrap_modes)); + assert(filter < 2); + assert(npot < 2); + *x = mode * (TILE_SIZE(npot) + TILE_SPACE) + 5; + *y = filter * (TILE_SIZE(npot) + TILE_SPACE) + 35; +} + + static void draw(const struct format_desc *format, GLboolean npot, GLboolean texproj) { unsigned i, j; - int offset; int num_filters = format->type == FLOAT_TYPE ? 2 : 1; int bits = get_int_format_bits(format); float scale[4]; @@ -840,13 +854,12 @@ static void draw(const struct format_desc *format, for (i = 0; i < num_filters; i++) { GLenum filter = i ? GL_LINEAR : GL_NEAREST; - offset = 0; - glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, filter); glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, filter); /* Loop over wrap modes. */ for (j = 0; wrap_modes[j].mode != 0; j++) { + int xpos, ypos; float x0 = 0; float y0 = 0; float x1 = TILE_SIZE(npot); @@ -858,13 +871,13 @@ static void draw(const struct format_desc *format, float q = 1; float ts0 = s0, ts1 = s1, tt0 = t0, tt1 = t1, tr = 0.5; - if (!wrap_modes[j].supported) + if (!wrap_modes[j].supported) { continue; +} if (skip_test(wrap_modes[j].mode, filter)) { if (skip_test(wrap_modes[j].mode, GL_LINEAR) != skip_test(wrap_modes[j].mode, GL_NEAREST)) { - offset++; } continue; } @@ -895,10 +908,8 @@ static void draw(const struct format_desc *format, wrap_modes[j].mode); glPushMatrix(); - glTranslatef(offset * (TILE_SIZE(npot) + TILE_SPACE) + 5, -i * (TILE_SIZE(npot) + TILE_SPACE) + 35, -0); - offset++; + test_to_xy(j, i, npot, &xpos, &ypos); + glTranslatef(xpos, ypos, 0.0); glEnable(texture_target); glColor3f(1, 1, 1); @@ -939,21 +950,14 @@ static void draw(const struct format_desc *format, glDisable(texture_target); glColor3f(1, 1, 1); - offset = 0; if (!piglit_automatic) { + printf("modes: "); for (i = 0; wrap_modes[i].mode != 0; i++) { - if (wrap_modes[i].supported) { - if (skip_test(wrap_modes[i].mode, GL_LINEAR) && - skip_test(wrap_modes[i].mode, GL_NEAREST)) { - continue; - } - - glWindowPos2iARB(offset * (TILE_SIZE(npot) + TILE_SPACE) + 5, -5 + ((offset & 1) * 15)); - offset++; - } + printf("%s, ", + piglit_get_gl_enum_name(wrap_modes[i].mode)); } + printf("\n"); } } @@ -978,7 +982,6 @@ static GLboolean probe_pixels(const struct format_desc *format, GLboolean npot, unsigned deltamax[4] = {0}; unsigned deltamax_swizzled[4] = {0}; unsigned *deltamax_lut = i ? linear_deltamax : nearest_deltamax; - unsigned offset = 0; /* Get the deltamax for each channel. */ if (format->intensity) { @@ -1012,17 +1015,17 @@ static GLboolean pr
Re: [Piglit] [PATCH 0/9] Implement more CL relational builtins
On Fri, Jul 11, 2014 at 11:33:45PM -0500, Aaron Watry wrote: > Fixes a bad test value in isnan, and implements more relational builtins > > After this, the only relational ones that are missing auto-generated tests > are: > any > all > bitselect (has a hand-coded test, but just 1 scalar test) > select > For the series: Reviewed-by: Tom Stellard > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits
On 07/11/2014 04:30 PM, Matthew McClure wrote: Okay fixed. If approved, I am new to the project and do not have commit access so I will need help checking this in. Thanks, Matthew LGTM. I'll put my R-b on it and push it soon. -Brian ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] framework: fix summary totals when multiple results are specified
On Monday, July 14, 2014 10:51:07 AM Thomas Wood wrote: > Ensure the correct totals are displayed for each result summary when > multiple results are specified. > > Signed-off-by: Thomas Wood > --- > framework/summary.py | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/framework/summary.py b/framework/summary.py > index 0db2a80..332aa40 100644 > --- a/framework/summary.py > +++ b/framework/summary.py > @@ -410,16 +410,16 @@ class Summary: > self.tests['fixes'].add(test) > self.tests['changes'].add(test) > > -def __find_totals(self): > +def __find_totals(self, results): > """ > Private: Find the total number of pass, fail, crash, skip, and warn > in -the *last* set of results stored in self.results. > +the specified results. > """ > self.totals = {'pass': 0, 'fail': 0, 'crash': 0, 'skip': 0, > 'timeout': 0, 'warn': 0, 'dmesg-warn': 0, > 'dmesg-fail': 0} > > -for test in self.results[-1].tests.itervalues(): > +for test in results.tests.itervalues(): > self.totals[str(test['result'])] += 1 > > def generate_html(self, destination, exclude): > @@ -461,7 +461,7 @@ class Summary: > else: > time = None > > -self.__find_totals() > +self.__find_totals(each) > > with open(path.join(destination, each.name, "index.html"), 'w') > as out: out.write(testindex.render(name=each.name, > @@ -533,7 +533,7 @@ class Summary: > > def generate_text(self, diff, summary): > """ Write summary information to the console """ > -self.__find_totals() > +self.__find_totals(self.results[-1]) > > # Print the name of the test and the status from each test run > if not summary: This is fine, but could you update the commit message to mention that that is needed to fix the HTML output? With that change this is Reviewed-by: Dylan Baker signature.asc Description: This is a digitally signed message part. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] framework: fix summary totals when multiple results are specified
Ensure the correct totals are displayed for each result summary when multiple results are specified. Signed-off-by: Thomas Wood --- framework/summary.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/summary.py b/framework/summary.py index 0db2a80..332aa40 100644 --- a/framework/summary.py +++ b/framework/summary.py @@ -410,16 +410,16 @@ class Summary: self.tests['fixes'].add(test) self.tests['changes'].add(test) -def __find_totals(self): +def __find_totals(self, results): """ Private: Find the total number of pass, fail, crash, skip, and warn in -the *last* set of results stored in self.results. +the specified results. """ self.totals = {'pass': 0, 'fail': 0, 'crash': 0, 'skip': 0, 'timeout': 0, 'warn': 0, 'dmesg-warn': 0, 'dmesg-fail': 0} -for test in self.results[-1].tests.itervalues(): +for test in results.tests.itervalues(): self.totals[str(test['result'])] += 1 def generate_html(self, destination, exclude): @@ -461,7 +461,7 @@ class Summary: else: time = None -self.__find_totals() +self.__find_totals(each) with open(path.join(destination, each.name, "index.html"), 'w') as out: out.write(testindex.render(name=each.name, @@ -533,7 +533,7 @@ class Summary: def generate_text(self, diff, summary): """ Write summary information to the console """ -self.__find_totals() +self.__find_totals(self.results[-1]) # Print the name of the test and the status from each test run if not summary: -- 1.9.3 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit