mesa/formatquery: Add (GET_)TEXTURE_IMAGE_TYPE pnames
authorEduardo Lima Mitev <elima@igalia.com>
Tue, 22 Dec 2015 18:33:57 +0000 (19:33 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:07 +0000 (15:14 +0100)
These basically reuse the default implementation of GL_READ_PIXELS_TYPE.

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

index d9dc5b41630e991be6a28530267b8f27dce2693a..215c14f889fe131c1e350f1bf1d347e15e7a0a0a 100644 (file)
@@ -645,7 +645,9 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
       break;
    }
 
-   case GL_READ_PIXELS_TYPE: {
+   case GL_READ_PIXELS_TYPE:
+   case GL_TEXTURE_IMAGE_TYPE:
+   case GL_GET_TEXTURE_IMAGE_TYPE: {
       GLenum base_format = _mesa_base_tex_format(ctx, internalFormat);
       if (base_format > 0)
          params[0] = _mesa_generic_type_for_internal_format(internalFormat);
@@ -1151,16 +1153,10 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
 
    case GL_TEXTURE_IMAGE_FORMAT:
    case GL_GET_TEXTURE_IMAGE_FORMAT:
-      ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
-                                      buffer);
-      break;
-
    case GL_TEXTURE_IMAGE_TYPE:
-      /* @TODO */
-      break;
-
    case GL_GET_TEXTURE_IMAGE_TYPE:
-      /* @TODO */
+      ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+                                      buffer);
       break;
 
    case GL_MIPMAP: