[Piglit] [PATCH] Probe pixel colors in bitmap-heart-dance test

2018-11-23 Thread Kenneth Graunke
This probes a single pixel at the center of each heart drawn, ensuring
it's the correct color.  Otherwise, failing to draw both halves would
cause the test to pass.
---
 tests/spec/gl-1.0/bitmap-heart-dance.c | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/tests/spec/gl-1.0/bitmap-heart-dance.c 
b/tests/spec/gl-1.0/bitmap-heart-dance.c
index cb1c7faa7..768fee6e4 100644
--- a/tests/spec/gl-1.0/bitmap-heart-dance.c
+++ b/tests/spec/gl-1.0/bitmap-heart-dance.c
@@ -146,6 +146,18 @@ draw_row(const float* color, int length,
}
 }
 
+static bool
+check_row(const float *color, int length, int x, int y, int spacex)
+{
+   bool pass = true;
+   for (int i = 0; i < length; i++) {
+   int probe_x = x + 8 + spacex + 4;
+   int probe_y = y + 4;
+   pass &= piglit_probe_pixel_rgb(probe_x, probe_y, color);
+   }
+   return pass;
+}
+
 static GLuint fragShader, program;
 
 enum piglit_result
@@ -203,8 +215,15 @@ piglit_display(void)
 
piglit_present_results();
 
-   pass = piglit_probe_rects_equal(0, 0, 0, piglit_height/2,
-   piglit_width, piglit_height/2, GL_RGB);
+   pass &= check_row( red, length, x, y + 5*spacing, spacing);
+   pass &= check_row(  salmon, length, x, y + 4*spacing, spacing);
+   pass &= check_row(pink, length, x, y + 3*spacing, spacing);
+   pass &= check_row(  orange, length, x, y + 2*spacing, spacing);
+   pass &= check_row(ltorange, length, x, y + 1*spacing, spacing);
+   pass &= check_row(  yellow, length, x, y + 0*spacing, spacing);
+
+   pass &= piglit_probe_rects_equal(0, 0, 0, piglit_height/2,
+piglit_width, piglit_height/2, GL_RGB);
 
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
-- 
2.19.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_gl_spirv: add test for uniform blocks with the same structure

2018-11-23 Thread Józef Kucia
On Thu, Nov 22, 2018 at 11:21 AM apinheiro  wrote:
> some weeks ago I sent a series with ubo/ssbo tests (still pending review)
>
> https://lists.freedesktop.org/archives/piglit/2018-September/025116.html
>
> All those has the name stripped. Could you try them and see if any of
> them triggers the NVIDIA bug you found?

arb_gl_spirv @ execution @ ubo @ matrix @ column-vs-row.shader_test
triggers the NVIDIA bug.

BTW, where can I find the "shader_test_spirv.py" script?

Thanks,
Józef
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v1 2/2] test: fix resources usage for depthstencil-render-miplevels

2018-11-23 Thread Eric Anholt
Sergii Romantsov  writes:

> Usage test 'depthstencil-render-miplevels 200 s=z24_s8' causes core dump on 
> exit.
> Issues:
> 1. Allocation of memory many times to the same variable
> 2. Not complete array to store pointers
> 3. Absence of memory freeing

Can you explain how not freeing memory could cause a core dump on exit?
And, in general, I would recommend just freeing data after usage, rather
than having a deinit function.


signature.asc
Description: PGP signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit