added st_mesa_format_to_pipe_format()
authorBrian <brian.paul@tungstengraphics.com>
Fri, 10 Aug 2007 19:02:25 +0000 (13:02 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 10 Aug 2007 19:03:57 +0000 (13:03 -0600)
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_format.h

index 4f36c84d4e579d6ca5a9e499e9c9a4e1f594b242..4aa5066b8cbff0bb0a2ea99b770f224eb86021b6 100644 (file)
@@ -98,6 +98,20 @@ st_get_format_info(GLuint format)
 }
 
 
+GLuint
+st_mesa_format_to_pipe_format(GLuint mesaFormat)
+{
+   switch (mesaFormat) {
+      /* fix this */
+   case MESA_FORMAT_ARGB8888_REV:
+   case MESA_FORMAT_ARGB8888:
+      return PIPE_FORMAT_U_A8_R8_G8_B8;
+   default:
+      assert(0);
+      return 0;
+   }
+}
+
 
 /**
  * Search list of formats for first RGBA format.
index 452ae59d6d3d54d9c9edc9b321f799e9e5074026..dde4731e94d4f3f343579f30d9312831c6cd15bb 100644 (file)
@@ -50,6 +50,10 @@ extern const struct pipe_format_info *
 st_get_format_info(GLuint format);
 
 
+extern GLuint
+st_mesa_format_to_pipe_format(GLuint mesaFormat);
+
+
 extern GLuint
 st_choose_pipe_format(struct pipe_context *pipe, GLint internalFormat,
                       GLenum format, GLenum type);