diff options
author | ldelgass <ldelgass> | 2003-05-26 19:48:51 +0000 |
---|---|---|
committer | ldelgass <ldelgass> | 2003-05-26 19:48:51 +0000 |
commit | fd99b739d454ae87dd0e2379f3e87bc8f0292431 (patch) | |
tree | 49af73ba6071ac1080f58069e6a2a4448cb91828 | |
parent | 75bb8cf0a6ac8b829b88b078880c982473559b1c (diff) |
Add support for MESA_ycbcr_texture (Ian Romanick)
-rw-r--r-- | xc/lib/GL/mesa/src/drv/radeon/radeon_context.c | 1 | ||||
-rw-r--r-- | xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c | 7 | ||||
-rw-r--r-- | xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c index a5013dea7..d8de98a24 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c @@ -139,6 +139,7 @@ static const char * const card_extensions[] = "GL_ATI_texture_env_combine3", "GL_ATI_texture_mirror_once", "GL_IBM_texture_mirrored_repeat", + "GL_MESA_ycbcr_texture", "GL_NV_blend_square", "GL_SGIS_generate_mipmap", "GL_SGIS_texture_border_clamp", diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c index 11b384df6..46749dc60 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c @@ -347,6 +347,13 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_COMPRESSED_INTENSITY: return &_mesa_texformat_i8; + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_APPLE || + type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + default: _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__); return NULL; diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c index edb354845..2e4d45149 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c @@ -50,12 +50,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_tcl.h" -#define RADEON_TXFORMAT_AL88 RADEON_TXFORMAT_AI88 +#define RADEON_TXFORMAT_AL88 RADEON_TXFORMAT_AI88 +#define RADEON_TXFORMAT_YCBCR RADEON_TXFORMAT_YVYU422 +#define RADEON_TXFORMAT_YCBCR_REV RADEON_TXFORMAT_VYUY422 #define _COLOR(f) \ [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, 0 } #define _ALPHA(f) \ [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 } +#define _YUV(f) \ + [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, RADEON_YUV_TO_RGB } #define _INVALID(f) \ [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 } #define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_YCBCR_REV) \ @@ -77,8 +81,8 @@ tx_table[] = _INVALID(L8), _COLOR(I8), _INVALID(CI8), - _INVALID(YCBCR), - _INVALID(YCBCR_REV), + _YUV(YCBCR), + _YUV(YCBCR_REV), }; #undef _COLOR |