Mesa (master): mesa: Turn target_can_be_compressed() in to a utility function

Anuj Phogat aphogat at kemper.freedesktop.org
Tue Aug 5 01:32:10 UTC 2014


Module: Mesa
Branch: master
Commit: ac2adf66c1ce009fed9175c891f4d90c6d79b7ab
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac2adf66c1ce009fed9175c891f4d90c6d79b7ab

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Fri May 30 17:33:54 2014 -0700

mesa: Turn target_can_be_compressed() in to a utility function

V2:  Declare the function in teximage.h

Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/main/teximage.c |   12 ++++++------
 src/mesa/main/teximage.h |    3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index fb2dee7..b6c3e85 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1770,9 +1770,9 @@ compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
  * Helper function to determine whether a target and specific compression
  * format are supported.
  */
-static GLboolean
-target_can_be_compressed(const struct gl_context *ctx, GLenum target,
-                         GLenum intFormat)
+GLboolean
+_mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
+                               GLenum intFormat)
 {
    (void) intFormat;  /* not used yet */
 
@@ -2211,7 +2211,7 @@ texture_error_check( struct gl_context *ctx,
 
    /* additional checks for compressed textures */
    if (_mesa_is_compressed_format(ctx, internalFormat)) {
-      if (!target_can_be_compressed(ctx, target, internalFormat)) {
+      if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
          _mesa_error(ctx, GL_INVALID_ENUM,
                      "glTexImage%dD(target can't be compressed)", dimensions);
          return GL_TRUE;
@@ -2297,7 +2297,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
    GLenum error = GL_NO_ERROR;
    char *reason = ""; /* no error */
 
-   if (!target_can_be_compressed(ctx, target, internalFormat)) {
+   if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
       reason = "target";
       error = GL_INVALID_ENUM;
       goto error;
@@ -2738,7 +2738,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
    }
 
    if (_mesa_is_compressed_format(ctx, internalFormat)) {
-      if (!target_can_be_compressed(ctx, target, internalFormat)) {
+      if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
          _mesa_error(ctx, GL_INVALID_ENUM,
                      "glCopyTexImage%dD(target)", dimensions);
          return GL_TRUE;
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 42305f4..52bfa78 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -123,6 +123,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
                           mesa_format format,
                           GLint width, GLint height, GLint depth, GLint border);
 
+extern GLboolean
+_mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
+                               GLenum intFormat);
 
 extern GLuint
 _mesa_tex_target_to_face(GLenum target);




More information about the mesa-commit mailing list