Re: [Piglit] [PATCH] Skip fp-indirections if the limits exposed are totally bogus.

2015-03-30 Thread Matt Turner
Reviewed-by: Matt Turner 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Skip fp-indirections if the limits exposed are totally bogus.

2015-03-30 Thread Kenneth Graunke
Signed-off-by: Kenneth Graunke 
---
 tests/shaders/fp-indirections.c | 13 +
 1 file changed, 13 insertions(+)

It looks like people expose real values, 128 (Intel/Windows), 16384 (NVIDIA, 
i965,
Gallium), 65536 (one NVIDIA card), and INT_MAX (AMD).  So 10,000 is pretty
arbitrary, but it's conservative and speeds up my Piglit run times.

diff --git a/tests/shaders/fp-indirections.c b/tests/shaders/fp-indirections.c
index 3c84aea..540c252 100644
--- a/tests/shaders/fp-indirections.c
+++ b/tests/shaders/fp-indirections.c
@@ -296,4 +296,17 @@ piglit_init(int argc, char **argv)
   get_program_i(GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB));
printf("Maximum native tex indirections: %d\n",
   get_program_i(GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB));
+
+   /* If the GL reports more than 1 texture indirections, then we're 
probably
+* running on hardware with no limitations - the driver just picked some
+* arbitrary large number to report back.  The test isn't meaningful, 
and
+* the run time explodes with huge limits, so just skip it.
+*
+* For reference, Mesa and NVIDIA report 16384; AMD reports 2147483647.
+* Pineview hardware (where this test is relevant) has a limit of 4.
+*/
+   if (get_program_i(GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB) > 1) {
+   printf("Skipping; the hardware doesn't appear to have real 
limits.\n");
+   piglit_report_result(PIGLIT_SKIP);
+   }
 }
-- 
2.3.4

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