[Piglit] [PATCH] arb_internalformat_query: api-errors should take into account query2 when checking invalid formats

Alejandro Piñeiro apinheiro at igalia.com
Thu Oct 29 05:18:38 PDT 2015


From: Alejandro Piñeiro <apinheiro at igaila.com>

That check is based on the following paragraph at internalformat_query
spec (Error section):

    If the <internalformat> parameter to GetInternalformativ is not
    color-, depth- or stencil-renderable, then an INVALID_ENUM error is
    generated.

But that is not listed as an error condition on internalformat_query2
spec. query2 relies on INTERNALFORMAT_SUPPORTED for this:

    <internalformat> can be any value. The INTERNALFORMAT_SUPPORTED <pname>
    can be used to determine if the internal format is supported, and the
    other <pnames> are defined in terms of whether or not the format is
    supported.

More info on the Issue2 of query2 spec.

This change was tested on the following proprietary drivers:
  * 4.5.0 NVIDIA 352.55 on GeForce GTX 950
  * 4.5.13399 on AMD Radeon (TM) R9 380 Series

That already supports query2.
---

This would be also needed to avoid the test failing when query2
gets support on mesa/i965, that is an ongoing work:

https://bugs.freedesktop.org/show_bug.cgi?id=92687

 tests/spec/arb_internalformat_query/api-errors.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/spec/arb_internalformat_query/api-errors.c b/tests/spec/arb_internalformat_query/api-errors.c
index ee21c17..9eb76f3 100644
--- a/tests/spec/arb_internalformat_query/api-errors.c
+++ b/tests/spec/arb_internalformat_query/api-errors.c
@@ -291,12 +291,18 @@ piglit_init(int argc, char **argv)
 	 *     "If the <internalformat> parameter to GetInternalformativ is
 	 *     not color-, depth- or stencil-renderable, then an INVALID_ENUM
 	 *     error is generated."
+	 *
+	 * However, GL_ARB_internalformat_query2 spec doesn't include that
+	 * error condition, and in general, relies on for querying
+	 * INTERNALFORMAT_SUPPORTED
 	 */
-	pass = try(valid_targets, ARRAY_SIZE(valid_targets),
-		   invalid_formats, ARRAY_SIZE(invalid_formats),
-		   valid_pnames, ARRAY_SIZE(valid_pnames),
-		   GL_INVALID_ENUM)
-		&& pass;
+	if (!piglit_is_extension_supported("GL_ARB_internalformat_query2")) {
+	  pass = try(valid_targets, ARRAY_SIZE(valid_targets),
+		     invalid_formats, ARRAY_SIZE(invalid_formats),
+		     valid_pnames, ARRAY_SIZE(valid_pnames),
+		     GL_INVALID_ENUM)
+	    && pass;
+	}
 
 	/* The GL_ARB_internalformat_query spec says:
 	 *
-- 
2.1.4



More information about the Piglit mailing list