[Mesa-dev] [PATCH 1/3] mesa: return 0 for GL_INTERNALFORMAT_SUPPORTED for unsupported TBO formats
Marek Olšák
maraeo at gmail.com
Sat Oct 21 12:54:33 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/main/formatquery.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 77c7faa..05b7810 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -895,20 +895,25 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
if (pname == GL_NUM_SAMPLE_COUNTS && ctx->API == API_OPENGLES2 &&
ctx->Version == 30 && _mesa_is_enum_format_integer(internalformat)) {
goto end;
}
ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
buffer);
break;
case GL_INTERNALFORMAT_SUPPORTED:
+ /* Reject invalid texture buffer formats. */
+ if (target == GL_TEXTURE_BUFFER &&
+ _mesa_validate_texbuffer_format(ctx, internalformat) == MESA_FORMAT_NONE)
+ break;
+
/* Having a supported <internalformat> is implemented as a prerequisite
* for all the <pnames>. Thus, if we reach this point, the internalformat is
* supported.
*/
buffer[0] = GL_TRUE;
break;
case GL_INTERNALFORMAT_PREFERRED:
/* The ARB_internalformat_query2 spec says:
*
--
2.7.4
More information about the mesa-dev
mailing list