[Mesa-dev] [PATCH 7/9] gallium: add RGBX formats for existing GL RGB texture formats

Marek Olšák maraeo at gmail.com
Sun Jan 27 12:52:55 PST 2013


---
 src/gallium/auxiliary/util/u_format.csv |   14 ++++++++++++++
 src/gallium/auxiliary/util/u_format.h   |    8 ++++++++
 src/gallium/include/pipe/p_format.h     |   14 ++++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv
index 05f04b5..1d27407 100644
--- a/src/gallium/auxiliary/util/u_format.csv
+++ b/src/gallium/auxiliary/util/u_format.csv
@@ -346,3 +346,17 @@ PIPE_FORMAT_L32_SINT                , plain, 1, 1, sp32, , , , xxx1, rgb
 PIPE_FORMAT_L32A32_SINT             , plain, 1, 1, sp32, sp32, , , xxxy, rgb
 
 PIPE_FORMAT_B10G10R10A2_UINT        , plain, 1, 1, up10, up10, up10, up2, zyxw, rgb
+
+PIPE_FORMAT_R8G8B8X8_SNORM          , plain, 1, 1, sn8,  sn8,  sn8,  x8,  xyz1, rgb
+PIPE_FORMAT_R8G8B8X8_SRGB           , plain, 1, 1, un8,  un8,  un8,  x8,  xyz1, srgb
+PIPE_FORMAT_R8G8B8X8_UINT           , plain, 1, 1, up8,  up8,  up8,  x8,  xyz1, rgb
+PIPE_FORMAT_R8G8B8X8_SINT           , plain, 1, 1, sp8,  sp8,  sp8,  x8,  xyz1, rgb
+PIPE_FORMAT_B10G10R10X2_UNORM       , plain, 1, 1, un10, un10, un10, x2,  zyx1, rgb
+PIPE_FORMAT_R16G16B16X16_UNORM      , plain, 1, 1, un16, un16, un16, x16, xyz1, rgb
+PIPE_FORMAT_R16G16B16X16_SNORM      , plain, 1, 1, sn16, sn16, sn16, x16, xyz1, rgb
+PIPE_FORMAT_R16G16B16X16_FLOAT      , plain, 1, 1, f16,  f16,  f16,  x16, xyz1, rgb
+PIPE_FORMAT_R16G16B16X16_UINT       , plain, 1, 1, up16, up16, up16, x16, xyz1, rgb
+PIPE_FORMAT_R16G16B16X16_SINT       , plain, 1, 1, sp16, sp16, sp16, x16, xyz1, rgb
+PIPE_FORMAT_R32G32B32X32_FLOAT      , plain, 1, 1, f32,  f32,  f32,  x32, xyz1, rgb
+PIPE_FORMAT_R32G32B32X32_UINT       , plain, 1, 1, up32, up32, up32, x32, xyz1, rgb
+PIPE_FORMAT_R32G32B32X32_SINT       , plain, 1, 1, sp32, sp32, sp32, x32, xyz1, rgb
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index 156d5cf..63015dd 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -798,6 +798,10 @@ util_format_srgb(enum pipe_format format)
       return PIPE_FORMAT_A8R8G8B8_SRGB;
    case PIPE_FORMAT_X8R8G8B8_UNORM:
       return PIPE_FORMAT_X8R8G8B8_SRGB;
+   case PIPE_FORMAT_R8G8B8A8_UNORM:
+      return PIPE_FORMAT_R8G8B8A8_SRGB;
+   case PIPE_FORMAT_R8G8B8X8_UNORM:
+      return PIPE_FORMAT_R8G8B8X8_SRGB;
    case PIPE_FORMAT_DXT1_RGB:
       return PIPE_FORMAT_DXT1_SRGB;
    case PIPE_FORMAT_DXT1_RGBA:
@@ -837,6 +841,10 @@ util_format_linear(enum pipe_format format)
       return PIPE_FORMAT_A8R8G8B8_UNORM;
    case PIPE_FORMAT_X8R8G8B8_SRGB:
       return PIPE_FORMAT_X8R8G8B8_UNORM;
+   case PIPE_FORMAT_R8G8B8A8_SRGB:
+      return PIPE_FORMAT_R8G8B8A8_UNORM;
+   case PIPE_FORMAT_R8G8B8X8_SRGB:
+      return PIPE_FORMAT_R8G8B8X8_UNORM;
    case PIPE_FORMAT_DXT1_SRGB:
       return PIPE_FORMAT_DXT1_RGB;
    case PIPE_FORMAT_DXT1_SRGBA:
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index 4f0d1f2..5a3d000 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -314,6 +314,20 @@ enum pipe_format {
    PIPE_FORMAT_R8G8_R8B8_UNORM         = 227,
    PIPE_FORMAT_G8R8_B8R8_UNORM         = 228,
 
+   PIPE_FORMAT_R8G8B8X8_SNORM          = 229,
+   PIPE_FORMAT_R8G8B8X8_SRGB           = 230,
+   PIPE_FORMAT_R8G8B8X8_UINT           = 231,
+   PIPE_FORMAT_R8G8B8X8_SINT           = 232,
+   PIPE_FORMAT_B10G10R10X2_UNORM       = 233,
+   PIPE_FORMAT_R16G16B16X16_UNORM      = 234,
+   PIPE_FORMAT_R16G16B16X16_SNORM      = 235,
+   PIPE_FORMAT_R16G16B16X16_FLOAT      = 236,
+   PIPE_FORMAT_R16G16B16X16_UINT       = 237,
+   PIPE_FORMAT_R16G16B16X16_SINT       = 238,
+   PIPE_FORMAT_R32G32B32X32_FLOAT      = 239,
+   PIPE_FORMAT_R32G32B32X32_UINT       = 240,
+   PIPE_FORMAT_R32G32B32X32_SINT       = 241,
+
    PIPE_FORMAT_COUNT
 };
 
-- 
1.7.10.4



More information about the mesa-dev mailing list