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

Ilia Mirkin imirkin at alum.mit.edu
Fri Nov 21 21:37:37 PST 2014


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>
---

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



More information about the Piglit mailing list