mesa/formatquery: Added the INTERNALFORMAT_SUPPORTED <pname> query
authorAntia Puentes <apuentes@igalia.com>
Tue, 22 Dec 2015 14:14:23 +0000 (15:14 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:06 +0000 (15:14 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/formatquery.c

index 60d8b71b0d29fb7328dc5ae6f6c43255f53144ee..00abe399ed27b30d41badcfffed4795d4297ddf2 100644 (file)
@@ -577,6 +577,11 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
    case GL_NUM_SAMPLE_COUNTS:
       params[0] = 1;
       break;
+
+   case GL_INTERNALFORMAT_SUPPORTED:
+      params[0] = GL_TRUE;
+      break;
+
    default:
       _set_default_response(pname, params);
       break;
@@ -652,7 +657,11 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
       break;
 
    case GL_INTERNALFORMAT_SUPPORTED:
-      /* @TODO */
+      /* 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: