[Piglit] [PATCH] arb_spec_shader_atomic_counters/unique-id: improve check print

Francisco Jerez currojerez at riseup.net
Sat Feb 21 02:18:19 PST 2015


Ilia Mirkin <imirkin at alum.mit.edu> writes:

> The frequencies are kept in the [start, end] range by mapping onto [0,
> end-start]. However when printing the observed values, don't subtract
> the starting value, to avoid confusion.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

Reviewed-by: Francisco Jerez <currojerez at riseup.net>
> ---
>
> Spent a ton of time trying to figure out why it was seeing
> -100... turns out it was seeing 0, which makes (very little) more
> sense.
>
>  tests/spec/arb_shader_atomic_counters/unique-id.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/arb_shader_atomic_counters/unique-id.c b/tests/spec/arb_shader_atomic_counters/unique-id.c
> index eee4f2c..e264bf0 100644
> --- a/tests/spec/arb_shader_atomic_counters/unique-id.c
> +++ b/tests/spec/arb_shader_atomic_counters/unique-id.c
> @@ -57,11 +57,12 @@ check(int dx, int dy, uint32_t start_value, uint32_t end_value)
>  
>          for (y = 0; y < L; y += dy) {
>                  for (x = 0; x < L; x += dx) {
> -                        uint32_t v = pixels[y][x] - base;
> +                        uint32_t p = pixels[y][x];
> +                        uint32_t v = p - base;
>  
>                          if (v >= size) {
>                                  printf("Probe value at (%d, %d)\n", x, y);
> -                                printf("  Observed: 0x%08x\n", v);
> +                                printf("  Observed: 0x%08x\n", p);
>                                  printf("  Value outside expected window.\n");
>                                  free(frequency);
>                                  return false;
> @@ -69,7 +70,7 @@ check(int dx, int dy, uint32_t start_value, uint32_t end_value)
>  
>                          if (size > 1 && frequency[v]++) {
>                                  printf("Probe value at (%d, %d)\n", x, y);
> -                                printf("  Observed: 0x%08x\n", v);
> +                                printf("  Observed: 0x%08x\n", p);
>                                  printf("  Value not unique.\n");
>                                  free(frequency);
>                                  return false;
> -- 
> 2.0.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150221/7fdcdfbf/attachment.sig>


More information about the Piglit mailing list