mesa/textureview: Make _lookup_view_class public
authorAntia Puentes <apuentes@igalia.com>
Mon, 16 Nov 2015 14:45:54 +0000 (15:45 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:07 +0000 (15:14 +0100)
It will be used by the ARB_internalformat_query2 implementation to
implement the VIEW_COMPATIBILITY_CLASS <pname> query.

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

index 316d8280338e0ba6188d790ff74cc366f972130c..419fbebf2f052a40365c12d69b046be5d780ccc2 100644 (file)
@@ -162,12 +162,8 @@ static const struct internal_format_class_info s3tc_compatible_internal_formats[
    {GL_VIEW_CLASS_S3TC_DXT5_RGBA, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT},
 };
 
-/**
- * Lookup format view class based on internalformat
- * \return VIEW_CLASS if internalformat found in table, false otherwise.
- */
-static GLenum
-lookup_view_class(const struct gl_context *ctx, GLenum internalformat)
+GLenum
+_mesa_texture_view_lookup_view_class(const struct gl_context *ctx, GLenum internalformat)
 {
    GLuint i;
 
@@ -336,8 +332,8 @@ _mesa_texture_view_compatible_format(const struct gl_context *ctx,
    if (origInternalFormat == newInternalFormat)
       return true;
 
-   origViewClass = lookup_view_class(ctx, origInternalFormat);
-   newViewClass = lookup_view_class(ctx, newInternalFormat);
+   origViewClass = _mesa_texture_view_lookup_view_class(ctx, origInternalFormat);
+   newViewClass = _mesa_texture_view_lookup_view_class(ctx, newInternalFormat);
    if ((origViewClass == newViewClass) && origViewClass != false)
       return true;
 
index 59e24b68dd016a7780ca2c49d5873b45669e475a..39b415d8793f584f3632f143c65086b572d20fa0 100644 (file)
@@ -34,6 +34,14 @@ _mesa_texture_view_compatible_format(const struct gl_context *ctx,
                                      GLenum origInternalFormat,
                                      GLenum newInternalFormat);
 
+/**
+ * Lookup format view class based on internalformat
+ * \return VIEW_CLASS if internalformat found in table, false otherwise.
+ */
+GLenum
+_mesa_texture_view_lookup_view_class(const struct gl_context *ctx,
+                                     GLenum internalformat);
+
 extern void GLAPIENTRY
 _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture,
                   GLenum internalformat,