[Piglit] [PATCH 7/8] teximage-errors: Only run the depth texture subtests when depth textures are supported

Ian Romanick idr at freedesktop.org
Wed May 31 05:33:45 UTC 2017


From: Ian Romanick <ian.d.romanick at intel.com>

Fixes failure on radeon and probably others.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/texturing/teximage-errors.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/tests/texturing/teximage-errors.c b/tests/texturing/teximage-errors.c
index 1c9fe14..bb993d3 100644
--- a/tests/texturing/teximage-errors.c
+++ b/tests/texturing/teximage-errors.c
@@ -236,20 +236,24 @@ piglit_display(void)
    pass = test_targets() && pass;
    pass = test_pos_and_sizes() && pass;
 
-  /*  From OpenGL 3.3 spec, page 141:
-   *    "Textures with a base internal format of DEPTH_COMPONENT or
-   *     DEPTH_STENCIL require either depth component data or depth/stencil
-   *     component data. Textures with other base internal formats require
-   *     RGBA component data. The error INVALID_OPERATION is generated if
-   *     one of the base internal format and format is DEPTH_COMPONENT or
-   *     DEPTH_STENCIL, and the other is neither of these values."
-   */
-   pass = test_depth_formats(formats_allowed, GL_NO_ERROR,
-                             ARRAY_SIZE(formats_allowed))
-          && pass;
-   pass = test_depth_formats(formats_not_allowed, GL_INVALID_OPERATION,
-                             ARRAY_SIZE(formats_not_allowed))
-          && pass;
+   if (piglit_get_gl_version() >= 14
+       || piglit_is_extension_supported("GL_ARB_depth_texture")) {
+	   /*  From OpenGL 3.3 spec, page 141:
+	    *    "Textures with a base internal format of DEPTH_COMPONENT or
+	    *     DEPTH_STENCIL require either depth component data or depth/stencil
+	    *     component data. Textures with other base internal formats require
+	    *     RGBA component data. The error INVALID_OPERATION is generated if
+	    *     one of the base internal format and format is DEPTH_COMPONENT or
+	    *     DEPTH_STENCIL, and the other is neither of these values."
+	    */
+	   pass = test_depth_formats(formats_allowed, GL_NO_ERROR,
+				     ARRAY_SIZE(formats_allowed))
+		   && pass;
+	   pass = test_depth_formats(formats_not_allowed, GL_INVALID_OPERATION,
+				     ARRAY_SIZE(formats_not_allowed))
+		   && pass;
+   }
+
    return pass ? PIGLIT_PASS: PIGLIT_FAIL;
 }
 
-- 
2.9.4



More information about the Piglit mailing list