static inline int to_pipe_swizzle(GLenum swizzle)
{
   switch (swizzle) {
   case GL_RED: return PIPE_SWIZZLE_RED;
   case GL_GREEN: return PIPE_SWIZZLE_GREEN;
   case GL_BLUE: return PIPE_SWIZZLE_BLUE;
   case GL_ALPHA: return PIPE_SWIZZLE_ALPHA;
   case GL_ZERO: return PIPE_SWIZZLE_ZERO;
   case GL_ONE: return PIPE_SWIZZLE_ONE;
   default:
      assert(0);
      return 0;
   }
}
static inline int to_pipe_swizzle(GLenum swizzle)
{
   switch (swizzle) {
   case GL_RED: return PIPE_SWIZZLE_RED;
   case GL_GREEN: return PIPE_SWIZZLE_GREEN;
   case GL_BLUE: return PIPE_SWIZZLE_BLUE;
   case GL_ALPHA: return PIPE_SWIZZLE_ALPHA;
   case GL_ZERO: return PIPE_SWIZZLE_ZERO;
   case GL_ONE: return PIPE_SWIZZLE_ONE;
   default:
      assert(0);
      return 0;
   }
}