texsubimage-depth-formats: check for ARB_depth_buffer_float

Submitted by Ilia Mirkin on March 16, 2015, 12:41 a.m.

Details

Message ID 1426466489-14712-1-git-send-email-imirkin@alum.mit.edu
State New
Headers show

Not browsing as part of any series.

Commit Message

Ilia Mirkin March 16, 2015, 12:41 a.m.
Avoid unnecessary failures on drivers not supporting float depth
buffers.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 tests/texturing/texsubimage-depth-formats.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/texturing/texsubimage-depth-formats.c b/tests/texturing/texsubimage-depth-formats.c
index b6d9416..2d35e63 100644
--- a/tests/texturing/texsubimage-depth-formats.c
+++ b/tests/texturing/texsubimage-depth-formats.c
@@ -55,8 +55,8 @@  struct format_info {
 };
 static const struct format_info formats[] = {
 	{ GL_DEPTH_COMPONENT16,  GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,                 sizeof(short) },
-	{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT,                          sizeof(float) },
 	{ GL_DEPTH24_STENCIL8,   GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8,              sizeof(int) },
+	{ GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT,                          sizeof(float) },
 	{ GL_DEPTH32F_STENCIL8,  GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV, sizeof(int) + sizeof(float) }
 };
 
@@ -166,6 +166,9 @@  piglit_display(void)
 	glGenTextures(ARRAY_SIZE(formats), tex);
 
 	for (i = 0; i < ARRAY_SIZE(formats); i++) {
+		if (!piglit_is_extension_supported("GL_ARB_depth_buffer_float") &&
+		    i >= 2)
+			continue;
 		for (j = 0; j < ARRAY_SIZE(tex_size); j++) {
 			result = true;
 			load_texture(i, j);

Comments

On Sun, Mar 15, 2015 at 8:41 PM, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> Avoid unnecessary failures on drivers not supporting float depth
> buffers.
>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>  tests/texturing/texsubimage-depth-formats.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/texturing/texsubimage-depth-formats.c b/tests/texturing/texsubimage-depth-formats.c
> index b6d9416..2d35e63 100644
> --- a/tests/texturing/texsubimage-depth-formats.c
> +++ b/tests/texturing/texsubimage-depth-formats.c
> @@ -55,8 +55,8 @@ struct format_info {
>  };
>  static const struct format_info formats[] = {
>         { GL_DEPTH_COMPONENT16,  GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,                 sizeof(short) },
> -       { GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT,                          sizeof(float) },
>         { GL_DEPTH24_STENCIL8,   GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8,              sizeof(int) },
> +       { GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT,                          sizeof(float) },
>         { GL_DEPTH32F_STENCIL8,  GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV, sizeof(int) + sizeof(float) }
>  };
>
> @@ -166,6 +166,9 @@ piglit_display(void)
>         glGenTextures(ARRAY_SIZE(formats), tex);
>
>         for (i = 0; i < ARRAY_SIZE(formats); i++) {
> +               if (!piglit_is_extension_supported("GL_ARB_depth_buffer_float") &&

Glenn mentioned that this should also be

piglit_get_gl_version() < 30 &&

since all of this is implicitly in GL 3.0. I've added it locally.

> +                   i >= 2)
> +                       continue;
>                 for (j = 0; j < ARRAY_SIZE(tex_size); j++) {
>                         result = true;
>                         load_texture(i, j);
> --
> 2.0.5
>