[Mesa-dev] [PATCH 3/3] mesa: skip validation of legality of size/type queries for format queries

sroland at vmware.com sroland at vmware.com
Sat Jan 27 00:59:58 UTC 2018


From: Roland Scheidegger <sroland at vmware.com>

The size/type query is always legal (if we made it that far).
This causes a difference for GL_TEXTURE_BUFFER - the reason is that these
parameters are valid only with GetTexLevelParameter() if gl 3.1 is supported,
but not if only ARB_texture_buffer_object is supported.
However, while the spec says that these queries return "the same information
as querying GetTexLevelParameter" I believe we're not expected to return just
zeros here. By definition, these pnames are always valid (unlike for the
GetTexLevelParameter() function which would return an error without GL 3.1),
so returning 0 but no error makes no sense to me.

This breaks some piglit arb_internalformat_query2 tests (which I belive to
be wrong).
---
 src/mesa/main/formatquery.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 2214f97e67..f345140518 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -960,9 +960,6 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
       mesa_format texformat;
 
       if (target != GL_RENDERBUFFER) {
-         if (!_mesa_legal_get_tex_level_parameter_target(ctx, target, true))
-            goto end;
-
          baseformat = _mesa_base_tex_format(ctx, internalformat);
       } else {
          baseformat = _mesa_base_fbo_format(ctx, internalformat);
-- 
2.12.3



More information about the mesa-dev mailing list