Mesa (master): mesa: move/rename is_depth_or_stencil_format()

Brian Paul brianp at kemper.freedesktop.org
Tue Apr 27 15:33:24 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Apr 27 09:31:19 2010 -0600

mesa: move/rename is_depth_or_stencil_format()

Put it with other, similar functions.

---

 src/mesa/main/image.c              |   26 ++++++++++++++++++++++++++
 src/mesa/main/image.h              |    3 +++
 src/mesa/state_tracker/st_format.c |   23 +----------------------
 3 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 8aef306..93b0142 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -734,6 +734,32 @@ _mesa_is_depthstencil_format(GLenum format)
    }
 }
 
+
+/**
+ * Test if the given image format is a depth or stencil format.
+ */
+GLboolean
+_mesa_is_depth_or_stencil_format(GLenum format)
+{
+   switch (format) {
+      case GL_DEPTH_COMPONENT:
+      case GL_DEPTH_COMPONENT16:
+      case GL_DEPTH_COMPONENT24:
+      case GL_DEPTH_COMPONENT32:
+      case GL_STENCIL_INDEX:
+      case GL_STENCIL_INDEX1_EXT:
+      case GL_STENCIL_INDEX4_EXT:
+      case GL_STENCIL_INDEX8_EXT:
+      case GL_STENCIL_INDEX16_EXT:
+      case GL_DEPTH_STENCIL_EXT:
+      case GL_DEPTH24_STENCIL8_EXT:
+         return GL_TRUE;
+      default:
+         return GL_FALSE;
+   }
+}
+
+
 /**
  * Test if the given image format is a dudv format.
  */
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 3947bbc..48582eb 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -73,6 +73,9 @@ extern GLboolean
 _mesa_is_depthstencil_format(GLenum format);
 
 extern GLboolean
+_mesa_is_depth_or_stencil_format(GLenum format);
+
+extern GLboolean
 _mesa_is_dudv_format(GLenum format);
 
 extern GLboolean
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 1e918fa..d7d2be6 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -660,27 +660,6 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
 }
 
 
-static GLboolean
-is_depth_or_stencil_format(GLenum internalFormat)
-{
-   switch (internalFormat) {
-   case GL_DEPTH_COMPONENT:
-   case GL_DEPTH_COMPONENT16:
-   case GL_DEPTH_COMPONENT24:
-   case GL_DEPTH_COMPONENT32:
-   case GL_STENCIL_INDEX:
-   case GL_STENCIL_INDEX1_EXT:
-   case GL_STENCIL_INDEX4_EXT:
-   case GL_STENCIL_INDEX8_EXT:
-   case GL_STENCIL_INDEX16_EXT:
-   case GL_DEPTH_STENCIL_EXT:
-   case GL_DEPTH24_STENCIL8_EXT:
-      return GL_TRUE;
-   default:
-      return GL_FALSE;
-   }
-}
-
 /**
  * Called by FBO code to choose a PIPE_FORMAT_ for drawing surfaces.
  */
@@ -689,7 +668,7 @@ st_choose_renderbuffer_format(struct pipe_screen *screen,
                               GLenum internalFormat)
 {
    uint usage;
-   if (is_depth_or_stencil_format(internalFormat))
+   if (_mesa_is_depth_or_stencil_format(internalFormat))
       usage = PIPE_BIND_DEPTH_STENCIL;
    else
       usage = PIPE_BIND_RENDER_TARGET;




More information about the mesa-commit mailing list