mesa: move/rename is_depth_or_stencil_format()
authorBrian Paul <brianp@vmware.com>
Tue, 27 Apr 2010 15:31:19 +0000 (09:31 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 27 Apr 2010 15:31:22 +0000 (09:31 -0600)
Put it with other, similar functions.

src/mesa/main/image.c
src/mesa/main/image.h
src/mesa/state_tracker/st_format.c

index 8aef306fd81731475fb724b2bda98332df696623..93b01423dcf08551c297d8a72e91cd49c6348738 100644 (file)
@@ -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.
  */
index 3947bbc27862d72fa888f924781b6af3e251f067..48582eb3bbe1490464a1a3b81e3ba363cad5d9ef 100644 (file)
@@ -72,6 +72,9 @@ _mesa_is_ycbcr_format(GLenum format);
 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);
 
index 1e918facda43df9a60001b97f127177262311770..d7d2be6d45496e79bd8138d88193df35a1333fc6 100644 (file)
@@ -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;