[Mesa-dev] [PATCH 51/65] mesa/formatquery: Added CLEAR_BUFFER <pname> query

Eduardo Lima Mitev elima at igalia.com
Wed Feb 3 15:45:36 UTC 2016


From: Antia Puentes <apuentes at igalia.com>

>From the ARB_internalformat_query2 specification:

   "- CLEAR_BUFFER: The support for using the resource with ClearBuffer*Data
      commands is returned in <params>.
      Possible values returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE.
      If the resource or operation is not supported, NONE is returned."
---
 src/mesa/main/formatquery.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 166c258..93562ef 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -611,6 +611,7 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
    case GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST:
    case GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE:
    case GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE:
+   case GL_CLEAR_BUFFER:
       params[0] = GL_FULL_SUPPORT;
       break;
 
@@ -1346,7 +1347,11 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
    }
 
    case GL_CLEAR_BUFFER:
-      /* @TODO */
+      if (target != GL_TEXTURE_BUFFER)
+         goto end;
+
+      ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+                                      buffer);
       break;
 
    case GL_TEXTURE_VIEW:
-- 
2.5.3



More information about the mesa-dev mailing list