summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordok666 <dok666>2003-05-21 16:49:33 +0000
committerdok666 <dok666>2003-05-21 16:49:33 +0000
commit7dfd7f2c30106195173e13eae53304e41b9eaa90 (patch)
tree033f017cfdef5cbf350b2db9a95e2de0c69d550b
parenta65fdd2d6088e5298ff163be581e48dcf49493f4 (diff)
GL_MESA_ycbcr_texture support by Ian Romanick <idr@us.ibm.com>.
-rw-r--r--src/mesa/drivers/dri/mga/mga_texstate.c8
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c1
-rw-r--r--src/mesa/drivers/dri/mga/mgaregs.h1
-rw-r--r--src/mesa/drivers/dri/mga/mgatex.c7
4 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c
index 45e6906f19d..925cdc515a9 100644
--- a/src/mesa/drivers/dri/mga/mga_texstate.c
+++ b/src/mesa/drivers/dri/mga/mga_texstate.c
@@ -43,9 +43,9 @@
#include "simple_list.h"
#include "texformat.h"
-
+#define MGA_USE_TABLE_FOR_FORMAT
#ifdef MGA_USE_TABLE_FOR_FORMAT
-#define TMC_nr_tformat (MESA_FORMAT_CI8 + 1)
+#define TMC_nr_tformat (MESA_FORMAT_YCBCR_REV + 1)
static const unsigned TMC_tformat[ TMC_nr_tformat ] =
{
[MESA_FORMAT_ARGB8888] = TMC_tformat_tw32 | TMC_takey_1 | TMC_tamask_0,
@@ -53,6 +53,8 @@ static const unsigned TMC_tformat[ TMC_nr_tformat ] =
[MESA_FORMAT_ARGB4444] = TMC_tformat_tw12 | TMC_takey_1 | TMC_tamask_0,
[MESA_FORMAT_ARGB1555] = TMC_tformat_tw15 | TMC_takey_1 | TMC_tamask_0,
[MESA_FORMAT_CI8] = TMC_tformat_tw8 | TMC_takey_1 | TMC_tamask_0,
+ [MESA_FORMAT_YCBCR] = TMC_tformat_tw422uyvy | TMC_takey_1 | TMC_tamask_0,
+ [MESA_FORMAT_YCBCR_REV] = TMC_tformat_tw422 | TMC_takey_1 | TMC_tamask_0,
};
#endif
@@ -80,6 +82,8 @@ mgaSetTexImages( mgaContextPtr mmesa,
case MESA_FORMAT_ARGB4444: txformat = TMC_tformat_tw12; break;
case MESA_FORMAT_ARGB1555: txformat = TMC_tformat_tw15; break;
case MESA_FORMAT_CI8: txformat = TMC_tformat_tw8; break;
+ case MESA_FORMAT_YCBCR: txformat = TMC_tformat_tw422uyvy; break;
+ case MESA_FORMAT_YCBCR_REV: txformat = TMC_tformat_tw422; break;
default:
_mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 55e6b6033b2..80a5fc6e6a2 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -272,6 +272,7 @@ static const char * const card_extensions[] =
#endif
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
+ "GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
"GL_SGIS_texture_lod",
NULL
diff --git a/src/mesa/drivers/dri/mga/mgaregs.h b/src/mesa/drivers/dri/mga/mgaregs.h
index ff5b6063ee3..e1291ca01bd 100644
--- a/src/mesa/drivers/dri/mga/mgaregs.h
+++ b/src/mesa/drivers/dri/mga/mgaregs.h
@@ -1052,6 +1052,7 @@
# define TMC_tformat_tw8a 0x7 /* val 7, shift 0 */
# define TMC_tformat_tw8al 0x8 /* val 8, shift 0 */
# define TMC_tformat_tw422 0xa /* val 10, shift 0 */
+# define TMC_tformat_tw422uyvy 0xb /* val 11, shift 0 */
# define TMC_tpitchlin_MASK 0xfffffeff /* bit 8 */
# define TMC_tpitchlin_disable 0x0
# define TMC_tpitchlin_enable 0x100
diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c
index 45410c04874..4852838fdb3 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -222,6 +222,13 @@ mgaChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
/* FIXME: This will report incorrect component sizes... */
return &_mesa_texformat_argb4444;
+ 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;
+
case GL_COLOR_INDEX:
case GL_COLOR_INDEX1_EXT:
case GL_COLOR_INDEX2_EXT: