Re: [Piglit] [PATCH 1/2] arb_viewport_array/viewport_indices: allow float precision instead of double

2018-02-12 Thread Brian Paul

On 02/08/2018 05:59 PM, Marek Olšák wrote:

From: Marek Olšák 

Mesa will not use doubles for this state.
---
  tests/spec/arb_viewport_array/viewport_indices.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_viewport_array/viewport_indices.c 
b/tests/spec/arb_viewport_array/viewport_indices.c
index 0088828..567f83d 100644
--- a/tests/spec/arb_viewport_array/viewport_indices.c
+++ b/tests/spec/arb_viewport_array/viewport_indices.c
@@ -194,21 +194,23 @@ test_preserve_invalid_index(GLint maxVP)
|| vpGet[3] != vp[3]) {
printf("Viewport index %d got erroneously changed\n",
   i);
pass = false;
}
  #ifdef PIGLIT_USE_OPENGL
glGetDoublei_v(GL_DEPTH_RANGE, i, drGet);
  #else
glGetFloati_vOES(GL_DEPTH_RANGE, i, drGet);
  #endif
-   if (drGet[0] != dr[0] || drGet[1] != dr[1]) {
+   /* Allow float precisions instead of double for desktop GL. */
+   if ((float)drGet[0] != (float)dr[0] ||
+   (float)drGet[1] != (float)dr[1]) {
printf("DepthRange index %d got erroneously changed\n",
   i);
pass = false;
}
glGetIntegeri_v(GL_SCISSOR_BOX, i, scGet);
if (scGet[0] != sc[0] || scGet[1] != sc[1] || scGet[2] != sc[2]
|| scGet[3] != sc[3]) {
printf("Scissor Box for index %d got erroneously 
changed\n",
   i);
pass = false;



Reviewed-by: Brian Paul 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] AMD_performance_monitor: add VC4 specific tests

2018-02-12 Thread Boris Brezillon
On Fri, 09 Feb 2018 21:12:20 +
Eric Anholt  wrote:

> Boris Brezillon  writes:
> 
> > From: Boris Brezillon 
> >
> > This adds a specific test for the VC4 GPU.
> > Right now, it only checks that FEP-valid-quads and
> > QPU-total-clk-cycles-waiting-TMU are consistent after executing well
> > know operations (draw a rectangle or a texture).
> >
> > More tests will be added over time.  
> 
> I'd still like to put together some tests of state management (to catch
> things like the flushing bugs we had in the first revs), but this seems
> like a good start.

Ok. I think I'll need more inputs on how you want to test that.

> 
> > +#define FEP_VALID_QUADS_REF_VAL6440
> > +
> > +static void draw_rect(const struct perfmon_test *test)
> > +{
> > +   piglit_draw_rect(-1, -1, 3, 3);
> > +}
> > +
> > +static void draw_tex(const struct perfmon_test *test)
> > +{
> > +   GLuint tex;
> > +
> > +   tex = piglit_rgbw_texture(GL_RGBA, 64, 64, false, true,
> > + GL_UNSIGNED_BYTE);
> > +   verify(piglit_check_gl_error(GL_NO_ERROR));
> > +
> > +   glEnable(GL_TEXTURE_2D);
> > +   glBindTexture(GL_TEXTURE_2D, tex);
> > +   piglit_draw_rect_tex(-1, -1, 2, 2, 0, 0, 1, 1);
> > +   glDisable(GL_TEXTURE_2D);
> > +   glDeleteTextures(1, &tex);
> > +}
> > +
> > +static bool fep_valid_quads_check_res(uint64_t res)
> > +{
> > +   return res == FEP_VALID_QUADS_REF_VAL;  
> 
> We should probably have the number of valid quads either be some math
> based on the config.window_width/height, or explicitly set the
> window_width/height so it's not dependent on whatever defaults the
> framework chooses.
> 
> The valid quads is a pretty magic value because we're drawing this:
> 
> +---+
> |  /|
> | / |
> |/  |
> +---+
> 
> so some of the 2x2 quads get drawn twice along the middle edge between
> the tris.  If we drew the triangle outside of the window:
> 
> +---+---+
> |   |  /
> |   | /
> |   |/
> +---/
> |  /
> | /
> |/
> +
> 
> with piglit_draw_rect(-1, -2, 4, 4), then I don't think any of the quads
> would be drawn twice, and the magic REF_VAL would become
> align(window_width, 2) * align(window_height, 2) / 4.

Okay, I'll try that.


-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit