summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2024-03-19 19:13:35 +0100
committerMarge Bot <emma+marge@anholt.net>2024-03-20 10:17:35 +0000
commit74064b1d43e6817e2ecd4b2754fdc164420d9cc7 (patch)
treea42a8af169a1328af3b0d6dc679df6e92ce62143
parent9c941dfc36e91f4cb0758e8b7f3b63d8290bdf95 (diff)
arb_clear_texture: only test float depth textures when supported
Don't test clearing float depth textures when the driver doesn't advertise support for them. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/890>
-rw-r--r--tests/spec/arb_clear_texture/depth.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/spec/arb_clear_texture/depth.c b/tests/spec/arb_clear_texture/depth.c
index 93c5b1be0..096885ee9 100644
--- a/tests/spec/arb_clear_texture/depth.c
+++ b/tests/spec/arb_clear_texture/depth.c
@@ -40,10 +40,14 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
static const struct format
-formats[] = {
+base_formats[] = {
{ GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4 },
{ GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4 },
{ GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4 },
+};
+
+static const struct format
+float_formats[] = {
{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4 },
};
@@ -54,7 +58,11 @@ piglit_init(int argc, char **argv)
piglit_require_extension("GL_ARB_depth_texture");
- pass = test_formats(formats, ARRAY_SIZE(formats));
+ pass = test_formats(base_formats, ARRAY_SIZE(base_formats));
+
+ if (piglit_is_extension_supported("GL_ARB_depth_buffer_float")) {
+ pass &= test_formats(float_formats, ARRAY_SIZE(float_formats));
+ }
piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}