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

Kenneth Graunke kenneth at whitecape.org
Mon Mar 30 19:09:29 PDT 2015


Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 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 10000 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) > 10000) {
+		printf("Skipping; the hardware doesn't appear to have real limits.\n");
+		piglit_report_result(PIGLIT_SKIP);
+	}
 }
-- 
2.3.4



More information about the Piglit mailing list