Browse Source

util: Distinguish between the different compression formats.

In particular, all current uses of util_format_is_compressed() actually
mean s3tc.
tags/mesa-7.9-rc1
José Fonseca 15 years ago
parent
commit
b9ad95d3ee
2 changed files with 26 additions and 14 deletions
  1. 12
    8
      src/gallium/auxiliary/util/u_format.csv
  2. 14
    6
      src/gallium/auxiliary/util/u_format.h

+ 12
- 8
src/gallium/auxiliary/util/u_format.csv View File

@@ -110,14 +110,18 @@ PIPE_FORMAT_UYVY , subsampled, 2, 1, x32 , , , , xyz
PIPE_FORMAT_YUYV , subsampled, 2, 1, x32 , , , , xyz1, yuv

# Compressed formats
PIPE_FORMAT_DXT1_RGB , compressed, 4, 4, x64 , , , , xyz1, rgb
PIPE_FORMAT_DXT1_RGBA , compressed, 4, 4, x64 , , , , xyzw, rgb
PIPE_FORMAT_DXT3_RGBA , compressed, 4, 4, x128, , , , xyzw, rgb
PIPE_FORMAT_DXT5_RGBA , compressed, 4, 4, x128, , , , xyzw, rgb
PIPE_FORMAT_DXT1_SRGB , compressed, 4, 4, x64 , , , , xyz1, srgb
PIPE_FORMAT_DXT1_SRGBA , compressed, 4, 4, x64 , , , , xyzw, srgb
PIPE_FORMAT_DXT3_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb
PIPE_FORMAT_DXT5_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb
# - http://en.wikipedia.org/wiki/S3_Texture_Compression
# - http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt
# - http://www.opengl.org/registry/specs/ARB/texture_compression_rgtc.txt
# - http://msdn.microsoft.com/en-us/library/bb694531.aspx
PIPE_FORMAT_DXT1_RGB , s3tc, 4, 4, x64 , , , , xyz1, rgb
PIPE_FORMAT_DXT1_RGBA , s3tc, 4, 4, x64 , , , , xyzw, rgb
PIPE_FORMAT_DXT3_RGBA , s3tc, 4, 4, x128, , , , xyzw, rgb
PIPE_FORMAT_DXT5_RGBA , s3tc, 4, 4, x128, , , , xyzw, rgb
PIPE_FORMAT_DXT1_SRGB , s3tc, 4, 4, x64 , , , , xyz1, srgb
PIPE_FORMAT_DXT1_SRGBA , s3tc, 4, 4, x64 , , , , xyzw, srgb
PIPE_FORMAT_DXT3_SRGBA , s3tc, 4, 4, x128, , , , xyzw, srgb
PIPE_FORMAT_DXT5_SRGBA , s3tc, 4, 4, x128, , , , xyzw, srgb

# Straightforward D3D10-like formats (also used for
# vertex buffer element description)

+ 14
- 6
src/gallium/auxiliary/util/u_format.h View File

@@ -56,15 +56,23 @@ enum util_format_layout {
*
* This is for formats like YV12 where there is less than one sample per
* pixel.
*
* XXX: This could actually b
*/
UTIL_FORMAT_LAYOUT_SUBSAMPLED = 3,

/**
* An unspecified compression algorithm.
* S3 Texture Compression formats.
*/
UTIL_FORMAT_LAYOUT_S3TC = 4,

/**
* Red-Green Texture Compression formats.
*/
UTIL_FORMAT_LAYOUT_RGTC = 5,

/**
* Everything else that doesn't fit in any of the above layouts.
*/
UTIL_FORMAT_LAYOUT_COMPRESSED = 4
UTIL_FORMAT_LAYOUT_OTHER = 6
};


@@ -210,7 +218,7 @@ util_format_name(enum pipe_format format)
}

static INLINE boolean
util_format_is_compressed(enum pipe_format format)
util_format_is_s3tc(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);

@@ -219,7 +227,7 @@ util_format_is_compressed(enum pipe_format format)
return FALSE;
}

return desc->layout == UTIL_FORMAT_LAYOUT_COMPRESSED ? TRUE : FALSE;
return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE;
}

static INLINE boolean

Loading…
Cancel
Save