[Piglit] [PATCH 2/7] astc_sliced_3d: Fix computing test result in draw_compare_levels
Nanley Chery
nanleychery at gmail.com
Mon Aug 1 22:50:05 UTC 2016
On Mon, Aug 01, 2016 at 03:16:15PM -0700, Anuj Phogat wrote:
Patches 2 and 5 are,
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
> Cc: Nanley Chery <nanley.g.chery at intel.com>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> .../khr_compressed_astc-sliced-3d-miptree.c | 37 ++++++++++------------
> 1 file changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-sliced-3d-miptree.c b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-sliced-3d-miptree.c
> index 53f0529..29ecc8b 100644
> --- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-sliced-3d-miptree.c
> +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-sliced-3d-miptree.c
> @@ -170,14 +170,14 @@ bool draw_compare_levels(bool check_error,
>
> unsigned y = 0;
> unsigned x = 0;
> - bool pass = true;
> + bool result = true;
> int level = 0;
>
> for (; level < NUM_LEVELS; ++level) {
> int w = LEVEL0_WIDTH >> level;
> int h = LEVEL0_HEIGHT >> level;
> int d = LEVEL0_DEPTH >> level;
> - pass = true;
> + bool pass = true;
> glUniform2f(level_pixel_size_loc, (float) w, (float) h);
> glUniform1f(slice_loc, slice);
> glUniform1f(depth_loc, d);
> @@ -187,27 +187,24 @@ bool draw_compare_levels(bool check_error,
> glUniform2f(pixel_offset_loc, x, y);
> glDrawArrays(GL_TRIANGLE_FAN, 0, NUM_VERTICES);
>
> - /* Draw miplevel of decompressed texture. */
> - if (!check_error) {
> + /* Check the textures (or error-colors) for equivalence. */
> + if (check_error) {
> + pass = piglit_probe_rect_rgba(x, y, w, h,
> + error_color);
> + } else {
> + /* Draw miplevel of decompressed texture. */
> glBindTexture(GL_TEXTURE_3D, decompressed_tex);
> glUniform2f(pixel_offset_loc, LEVEL0_WIDTH + x, y);
> glDrawArrays(GL_TRIANGLE_FAN, 0, NUM_VERTICES);
> - }
> -
> - /* Check the textures (or error-colors) for equivalence. */
> - if (pass) {
> - if (check_error) {
> - pass = piglit_probe_rect_rgba(x, y, w, h,
> - error_color);
> - } else {
> - pass = piglit_probe_rects_equal(x, y,
> - LEVEL0_WIDTH + x, y,
> - w, h, GL_RGBA);
> - }
>
> - if (!pass)
> - piglit_loge("Slice: %d, Miplevel: %d",
> - slice, level);
> + pass = piglit_probe_rects_equal(x, y,
> + LEVEL0_WIDTH + x, y,
> + w, h, GL_RGBA);
> + }
> + if (!pass) {
> + piglit_loge("Slice: %d, Miplevel: %d",
> + slice, level);
> + result = false;
> }
>
> /* Update the next miplevel arrangement */
> @@ -222,7 +219,7 @@ bool draw_compare_levels(bool check_error,
> glDeleteTextures(1, &decompressed_tex);
>
> piglit_present_results();
> - return pass;
> + return result;
> }
>
> enum piglit_result
> --
> 2.5.5
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list