Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.
On 2016-05-31 23:00:02, Ilia Mirkin wrote: > On Wed, Jun 1, 2016 at 1:49 AM, Kenneth Graunkewrote: > > On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote: > >> Because strtol() truncates the the maximum value of "long", as does > >> scanf apparently. This will make it impossible to test that a counter > >> == -1 though, right? > > > > Yes, I suppose it would. But you can always do == 4294967295 instead, > > and that seems pretty reasonable (if a bit inconvenient) considering > > the GLSL type is "atomic_uint"... > > Fair enough. For ssbo I made it read 0xfoo for those. And there's already a > > tests/spec/arb_compute_shader/execution/atomic-counter.shader_test:probe > atomic counter 1 == 4294966784 > And another bug as well: https://bugs.freedesktop.org/show_bug.cgi?id=96298 Reviewed-by: Jordan Justen > So what you're doing seems reasonable. > > Reviewed-by: Ilia Mirkin > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.
On Wed, Jun 1, 2016 at 1:49 AM, Kenneth Graunkewrote: > On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote: >> Because strtol() truncates the the maximum value of "long", as does >> scanf apparently. This will make it impossible to test that a counter >> == -1 though, right? > > Yes, I suppose it would. But you can always do == 4294967295 instead, > and that seems pretty reasonable (if a bit inconvenient) considering > the GLSL type is "atomic_uint"... Fair enough. For ssbo I made it read 0xfoo for those. And there's already a tests/spec/arb_compute_shader/execution/atomic-counter.shader_test:probe atomic counter 1 == 4294966784 So what you're doing seems reasonable. Reviewed-by: Ilia Mirkin ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.
On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote: > Because strtol() truncates the the maximum value of "long", as does > scanf apparently. This will make it impossible to test that a counter > == -1 though, right? Yes, I suppose it would. But you can always do == 4294967295 instead, and that seems pretty reasonable (if a bit inconvenient) considering the GLSL type is "atomic_uint"... --Ken signature.asc Description: This is a digitally signed message part. ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.
Because strtol() truncates the the maximum value of "long", as does scanf apparently. This will make it impossible to test that a counter == -1 though, right? On Wed, Jun 1, 2016 at 1:02 AM, Kenneth Graunkewrote: > We're trying to compare two unsigned values, so we should use %u. > > For whatever reason, using %d instead of %u causes > tests/spec/arb_compute_shader/execution/atomic-counter.shader_test > to read 2147483647 instead of 4294966784 for the expected value > which is written directly in the [test] script, but only on 32-bit > x86 platforms - x86_64 seems to work fine as is. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9 > Signed-off-by: Kenneth Graunke > Cc: Mark Janes > --- > tests/shaders/shader_runner.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > Technically using and works too - but you're supposed to pass > in pointers to unsigned variables, so I went ahead and did that. > > diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c > index ab72c1f..94c7826 100644 > --- a/tests/shaders/shader_runner.c > +++ b/tests/shaders/shader_runner.c > @@ -2734,6 +2734,7 @@ piglit_display(void) > float c[32]; > double d[4]; > int x, y, z, w, h, l, tex, level; > + unsigned ux, uy; > char s[32]; > > > @@ -2969,9 +2970,9 @@ piglit_display(void) > pass = false; > } > } else if (sscanf(line, > - "probe atomic counter %d %s %d", > - , s, ) == 3) { > - if (!probe_atomic_counter(x, s, y)) { > + "probe atomic counter %u %s %u", > + , s, ) == 3) { > + if (!probe_atomic_counter(ux, s, uy)) { > piglit_report_result(PIGLIT_FAIL); > } > } else if (sscanf(line, "probe ssbo uint %d %d %s 0x%x", > -- > 2.8.3 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.
We're trying to compare two unsigned values, so we should use %u. For whatever reason, using %d instead of %u causes tests/spec/arb_compute_shader/execution/atomic-counter.shader_test to read 2147483647 instead of 4294966784 for the expected value which is written directly in the [test] script, but only on 32-bit x86 platforms - x86_64 seems to work fine as is. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9 Signed-off-by: Kenneth GraunkeCc: Mark Janes --- tests/shaders/shader_runner.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Technically using and works too - but you're supposed to pass in pointers to unsigned variables, so I went ahead and did that. diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index ab72c1f..94c7826 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -2734,6 +2734,7 @@ piglit_display(void) float c[32]; double d[4]; int x, y, z, w, h, l, tex, level; + unsigned ux, uy; char s[32]; @@ -2969,9 +2970,9 @@ piglit_display(void) pass = false; } } else if (sscanf(line, - "probe atomic counter %d %s %d", - , s, ) == 3) { - if (!probe_atomic_counter(x, s, y)) { + "probe atomic counter %u %s %u", + , s, ) == 3) { + if (!probe_atomic_counter(ux, s, uy)) { piglit_report_result(PIGLIT_FAIL); } } else if (sscanf(line, "probe ssbo uint %d %d %s 0x%x", -- 2.8.3 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit