[Piglit] [PATCH 12/21] arb_internalformat_query2: add a generic check for TEXTURE_IMAGE_FORMAT

Alejandro PiƱeiro apinheiro at igalia.com
Tue Jan 19 09:04:43 PST 2016


>From spec:

"Possible values include any value that is legal to pass for the
 <format> parameter to the Tex*Image*D commands, or NONE if the
 resource is not supported for this operation."

Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: fails:
In some cases is returns GL_R11F_G11F_B10F or GL_RGB9_ES5, that are
internalformats, not valid formats.

Tested on AMD Radeon (TM) R9 380 Series: fails:
It returns values different to NONE on cases where the
target/internalformat are not supported (via
INTERNALFORMAT_SUPPORTED).
---
 .../generic-pname-checks.c                         | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/tests/spec/arb_internalformat_query2/generic-pname-checks.c b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
index ab37b4b..606aa69 100644
--- a/tests/spec/arb_internalformat_query2/generic-pname-checks.c
+++ b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
@@ -145,6 +145,49 @@ static const GLint possible_values_image_pixel_type[] = {
         GL_BYTE,
 };
 
+/* From query2 spec:
+ *
+ * "TEXTURE_IMAGE_FORMAT:
+ * <skip>
+ * Possible values include any value that is legal to pass for the
+ * <format> parameter to the Tex*Image*D commands, or NONE if the
+ * resource is not supported for this operation."
+ *
+ * From 4.2 core spec:
+ * "TexImage3D
+ * <skip>
+ * format, type, and data specify the format of the image data, the
+ * type of those data, and a reference to the image data in the cur-
+ * rently bound pixel unpack buffer or client memory, as described in
+ * section 3.7.2. The format STENCIL_INDEX is not allowed."
+ *
+ * This is basically Table 3.3 (defined at section 3.7.2) minus
+ * STENCIL_INDEX.
+ */
+static GLint possible_values_texture_image_format[] = {
+        /* Table 3.3 minus STENCIL_INDEX */
+        GL_DEPTH_COMPONENT,
+        GL_DEPTH_STENCIL,
+        GL_RED,
+        GL_GREEN,
+        GL_BLUE,
+        GL_RG,
+        GL_RGB,
+        GL_RGBA,
+        GL_BGR,
+        GL_BGRA,
+        GL_RED_INTEGER,
+        GL_GREEN_INTEGER,
+        GL_BLUE_INTEGER,
+        GL_RG_INTEGER,
+        GL_RGB_INTEGER,
+        GL_RGBA_INTEGER,
+        GL_BGR_INTEGER,
+        GL_BGRA_INTEGER,
+        /* GL_NONE from query2 TEXTURE_IMAGE_FORMAT spec */
+        GL_NONE
+};
+
 enum piglit_result
 piglit_display(void)
 {
@@ -231,5 +274,10 @@ piglit_init(int argc, char **argv)
                            possible_values_true_false, ARRAY_SIZE(possible_values_true_false))
                 && pass;
 
+        pname = GL_TEXTURE_IMAGE_FORMAT;
+        pass = check_basic(&pname, 1, possible_values_texture_image_format,
+                           ARRAY_SIZE(possible_values_texture_image_format))
+                && pass;
+
         piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
-- 
2.1.4



More information about the Piglit mailing list