mesa/formatquery: Added CLEAR_BUFFER <pname> query
authorAntia Puentes <apuentes@igalia.com>
Sat, 19 Dec 2015 19:27:16 +0000 (20:27 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:07 +0000 (15:14 +0100)
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."

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/formatquery.c

index a921566760e464f0a79035d903751f6889b82fcb..9fe9072a781c84cefd041f5fde890883bc2cdc60 100644 (file)
@@ -616,6 +616,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;
 
@@ -1367,7 +1368,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: