summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-06-27 11:58:00 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-06-27 12:07:59 -0700
commit928a5684177fdb6cd013949348aee6078dd305c0 (patch)
tree1f53d05fd7da5a742a89821d4a995b856c2b6998 /src/gallium/drivers/r300
parentf150e05afcbce73ff8422ffef2ce02536f691f2c (diff)
r300g: YCbCr and sRGB textures.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_reg.h3
-rw-r--r--src/gallium/drivers/r300/r300_screen.c3
-rw-r--r--src/gallium/drivers/r300/r300_texture.h10
3 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
index e57535fe9e..79c778f954 100644
--- a/src/gallium/drivers/r300/r300_reg.h
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -1565,7 +1565,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_TX_FORMAT_CONST_Z (4<<5)
# define R300_TX_FORMAT_CONST_W (8<<5)
-# define R300_TX_FORMAT_YUV_MODE 0x00800000
+# define R300_TX_FORMAT_GAMMA (1 << 21)
+# define R300_TX_FORMAT_YUV_TO_RGB (1 << 22)
#define R300_TX_FORMAT2_0 0x4500 /* obvious missing in gap */
# define R300_TX_PITCHMASK_SHIFT 0
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 42a7009481..da1d5ffe2f 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -196,10 +196,13 @@ static boolean check_tex_2d_format(enum pipe_format format, uint32_t usage,
PIPE_TEXTURE_USAGE_PRIMARY);
/* Texture */
+ case PIPE_FORMAT_A8R8G8B8_SRGB:
+ case PIPE_FORMAT_R8G8B8A8_SRGB:
case PIPE_FORMAT_DXT1_RGB:
case PIPE_FORMAT_DXT1_RGBA:
case PIPE_FORMAT_DXT3_RGBA:
case PIPE_FORMAT_DXT5_RGBA:
+ case PIPE_FORMAT_YCBCR:
return usage & PIPE_TEXTURE_USAGE_SAMPLER;
/* Colorbuffer or texture */
diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h
index 5511cca48c..3b56f0307c 100644
--- a/src/gallium/drivers/r300/r300_texture.h
+++ b/src/gallium/drivers/r300/r300_texture.h
@@ -44,6 +44,12 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
case PIPE_FORMAT_R8G8B8A8_UNORM:
return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8);
+ case PIPE_FORMAT_A8R8G8B8_SRGB:
+ return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8) |
+ R300_TX_FORMAT_GAMMA;
+ case PIPE_FORMAT_R8G8B8A8_SRGB:
+ return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8) |
+ R300_TX_FORMAT_GAMMA;
/* DXT1 */
case PIPE_FORMAT_DXT1_RGB:
return R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1);
@@ -55,6 +61,10 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format)
/* DXT5 */
case PIPE_FORMAT_DXT5_RGBA:
return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5);
+ /* YVYU422 */
+ case PIPE_FORMAT_YCBCR:
+ return R300_EASY_TX_FORMAT(X, Y, Z, ONE, YVYU422) |
+ R300_TX_FORMAT_YUV_TO_RGB;
/* W24_FP */
case PIPE_FORMAT_Z24S8_UNORM:
return R300_EASY_TX_FORMAT(X, X, X, X, W24_FP);