svga: Rename pipe formats.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 1 Mar 2010 18:14:12 +0000 (18:14 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 2 Mar 2010 10:21:55 +0000 (10:21 +0000)
src/gallium/drivers/svga/svga_pipe_clear.c
src/gallium/drivers/svga/svga_pipe_misc.c
src/gallium/drivers/svga/svga_pipe_sampler.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/svga/svga_screen_texture.c
src/gallium/drivers/svga/svga_state_framebuffer.c
src/gallium/drivers/svga/svga_state_need_swtnl.c

index 409b3b41cbc9d142ef976d468ea196599cee58d3..8483a3fad74c1af22c1558a91a6aec92427101e1 100644 (file)
@@ -54,7 +54,7 @@ try_clear(struct svga_context *svga,
 
    if ((buffers & PIPE_CLEAR_COLOR) && fb->cbufs[0]) {
       flags |= SVGA3D_CLEAR_COLOR;
-      util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &uc);
+      util_pack_color(rgba, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
 
       rect.w = fb->cbufs[0]->width;
       rect.h = fb->cbufs[0]->height;
@@ -63,7 +63,7 @@ try_clear(struct svga_context *svga,
    if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && fb->zsbuf) {
       flags |= SVGA3D_CLEAR_DEPTH;
 
-      if (svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_Z24S8_UNORM)
+      if (svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8Z24_UNORM)
          flags |= SVGA3D_CLEAR_STENCIL;
 
       rect.w = MAX2(rect.w, fb->zsbuf->width);
index 49b43bebc2967f0850600b04220edd75e73eacb5..95bf0e6f91bad3630fdaed7214b6dfceda6ac19e 100644 (file)
@@ -118,10 +118,10 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe,
       case PIPE_FORMAT_Z16_UNORM:
          svga->curr.depthscale = 1.0f / DEPTH_BIAS_SCALE_FACTOR_D16;
          break;
-      case PIPE_FORMAT_S8Z24_UNORM:
-      case PIPE_FORMAT_X8Z24_UNORM:
       case PIPE_FORMAT_Z24S8_UNORM:
       case PIPE_FORMAT_Z24X8_UNORM:
+      case PIPE_FORMAT_S8Z24_UNORM:
+      case PIPE_FORMAT_X8Z24_UNORM:
          svga->curr.depthscale = 1.0f / DEPTH_BIAS_SCALE_FACTOR_D24S8;
          break;
       case PIPE_FORMAT_Z32_UNORM:
index 224c4f4c1831c7c20fd19d4fffdf7e9bc35820de..acba2b8f9da64d79cd13d4a126dabe90ab7b14ae 100644 (file)
@@ -201,7 +201,7 @@ static void svga_set_sampler_textures(struct pipe_context *pipe,
       if (!texture[i])
          continue;
 
-      if (texture[i]->format == PIPE_FORMAT_A8R8G8B8_SRGB)
+      if (texture[i]->format == PIPE_FORMAT_B8G8R8A8_SRGB)
          flag_srgb |= 1 << i;
 
       if (texture[i]->target == PIPE_TEXTURE_1D)
index 414ac52e1f6c7f8e9c923f2137642ad58163623a..6022c38cfca016180089e862528f93cb46d11f5d 100644 (file)
@@ -196,23 +196,23 @@ svga_translate_format_cap(enum pipe_format format)
 {
    switch(format) {
    
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8A8_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8;
-   case PIPE_FORMAT_X8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8X8_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8;
 
-   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_R5G6B5;
-   case PIPE_FORMAT_A1R5G5B5_UNORM:
+   case PIPE_FORMAT_B5G5R5A1_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5;
-   case PIPE_FORMAT_A4R4G4B4_UNORM:
+   case PIPE_FORMAT_B4G4R4A4_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4;
 
    case PIPE_FORMAT_Z16_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_Z_D16;
-   case PIPE_FORMAT_Z24S8_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8;
-   case PIPE_FORMAT_Z24X8_UNORM:
+   case PIPE_FORMAT_X8Z24_UNORM:
       return SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8;
 
    case PIPE_FORMAT_A8_UNORM:
@@ -254,8 +254,8 @@ svga_is_format_supported( struct pipe_screen *screen,
       /* Often unsupported/problematic. This means we end up with the same
        * visuals for all virtual hardware implementations.
        */
-      case PIPE_FORMAT_A4R4G4B4_UNORM:
-      case PIPE_FORMAT_A1R5G5B5_UNORM:
+      case PIPE_FORMAT_B4G4R4A4_UNORM:
+      case PIPE_FORMAT_B5G5R5A1_UNORM:
          return FALSE;
          
       /* Simulate ability to render into compressed textures */
index 12f3531a1df7a5412cc74a4610d6b1ad9c7ec199..e9792e063e00ff958d46c85c295d8ea48904742b 100644 (file)
@@ -59,21 +59,21 @@ svga_translate_format(enum pipe_format format)
 {
    switch(format) {
    
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8A8_UNORM:
       return SVGA3D_A8R8G8B8;
-   case PIPE_FORMAT_X8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8X8_UNORM:
       return SVGA3D_X8R8G8B8;
 
       /* Required for GL2.1:
        */
-   case PIPE_FORMAT_A8R8G8B8_SRGB:
+   case PIPE_FORMAT_B8G8R8A8_SRGB:
       return SVGA3D_A8R8G8B8;
 
-   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
       return SVGA3D_R5G6B5;
-   case PIPE_FORMAT_A1R5G5B5_UNORM:
+   case PIPE_FORMAT_B5G5R5A1_UNORM:
       return SVGA3D_A1R5G5B5;
-   case PIPE_FORMAT_A4R4G4B4_UNORM:
+   case PIPE_FORMAT_B4G4R4A4_UNORM:
       return SVGA3D_A4R4G4B4;
 
       
@@ -83,9 +83,9 @@ svga_translate_format(enum pipe_format format)
     */
    case PIPE_FORMAT_Z16_UNORM:
       return SVGA3D_Z_D16;
-   case PIPE_FORMAT_Z24S8_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
       return SVGA3D_Z_D24S8;
-   case PIPE_FORMAT_Z24X8_UNORM:
+   case PIPE_FORMAT_X8Z24_UNORM:
       return SVGA3D_Z_D24X8;
 
    case PIPE_FORMAT_A8_UNORM:
@@ -111,13 +111,13 @@ SVGA3dSurfaceFormat
 svga_translate_format_render(enum pipe_format format)
 {
    switch(format) { 
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
-   case PIPE_FORMAT_X8R8G8B8_UNORM:
-   case PIPE_FORMAT_A1R5G5B5_UNORM:
-   case PIPE_FORMAT_A4R4G4B4_UNORM:
-   case PIPE_FORMAT_R5G6B5_UNORM:
-   case PIPE_FORMAT_Z24S8_UNORM:
-   case PIPE_FORMAT_Z24X8_UNORM:
+   case PIPE_FORMAT_B8G8R8A8_UNORM:
+   case PIPE_FORMAT_B8G8R8X8_UNORM:
+   case PIPE_FORMAT_B5G5R5A1_UNORM:
+   case PIPE_FORMAT_B4G4R4A4_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
+   case PIPE_FORMAT_X8Z24_UNORM:
    case PIPE_FORMAT_Z32_UNORM:
    case PIPE_FORMAT_Z16_UNORM:
    case PIPE_FORMAT_L8_UNORM:
@@ -403,9 +403,9 @@ svga_texture_blanket(struct pipe_screen * screen,
    
 
    if (sbuf->key.format == 1)
-      tex->base.format = PIPE_FORMAT_X8R8G8B8_UNORM;
+      tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM;
    else if (sbuf->key.format == 2)
-      tex->base.format = PIPE_FORMAT_A8R8G8B8_UNORM;
+      tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM;
 
    pipe_reference_init(&tex->base.reference, 1);
    tex->base.screen = screen;
@@ -462,9 +462,9 @@ svga_screen_texture_wrap_surface(struct pipe_screen *screen,
    
 
    if (format == 1)
-      tex->base.format = PIPE_FORMAT_X8R8G8B8_UNORM;
+      tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM;
    else if (format == 2)
-      tex->base.format = PIPE_FORMAT_A8R8G8B8_UNORM;
+      tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM;
 
    pipe_reference_init(&tex->base.reference, 1);
    tex->base.screen = screen;
index b4cafb8f219f90f75f9d883a8b78bf28afde9902..7b12c66f944421b2049a05c75143ff0ee015f873 100644 (file)
@@ -70,7 +70,7 @@ static int emit_framebuffer( struct svga_context *svga,
          return ret;
 
       if (curr->zsbuf &&
-          curr->zsbuf->format == PIPE_FORMAT_Z24S8_UNORM) {
+          curr->zsbuf->format == PIPE_FORMAT_S8Z24_UNORM) {
          ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_STENCIL, curr->zsbuf);
          if (ret != PIPE_OK)
             return ret;
index dd13a89d24db35921a9ee6aae5f838e0eea40e95..d3644fecad89022a3b6357ed667ef18989e60152 100644 (file)
@@ -43,7 +43,7 @@ svga_translate_vertex_format(enum pipe_format format)
    case PIPE_FORMAT_R32G32_FLOAT:         return SVGA3D_DECLTYPE_FLOAT2;
    case PIPE_FORMAT_R32G32B32_FLOAT:      return SVGA3D_DECLTYPE_FLOAT3;
    case PIPE_FORMAT_R32G32B32A32_FLOAT:   return SVGA3D_DECLTYPE_FLOAT4;
-   case PIPE_FORMAT_B8G8R8A8_UNORM:       return SVGA3D_DECLTYPE_D3DCOLOR;
+   case PIPE_FORMAT_A8R8G8B8_UNORM:       return SVGA3D_DECLTYPE_D3DCOLOR;
    case PIPE_FORMAT_R8G8B8A8_USCALED:     return SVGA3D_DECLTYPE_UBYTE4;
    case PIPE_FORMAT_R16G16_SSCALED:       return SVGA3D_DECLTYPE_SHORT2;
    case PIPE_FORMAT_R16G16B16A16_SSCALED: return SVGA3D_DECLTYPE_SHORT4;