From c420c0e7d6c4b8fac90fd6a64a49652ac58535fd Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 22 Dec 2010 13:28:55 +0100 Subject: r300g: add support for B2G3R3 texturing --- src/gallium/drivers/r300/r300_state_derived.c | 4 ++++ src/gallium/drivers/r300/r300_texture.c | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'src/gallium/drivers/r300') diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index d5fc8ece252..d3985c11aa8 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -645,6 +645,10 @@ static uint32_t r300_get_border_color(enum pipe_format format, } switch (desc->channel[0].size) { + case 2: + util_pack_color(border_swizzled, PIPE_FORMAT_B2G3R3_UNORM, &uc); + break; + case 4: util_pack_color(border_swizzled, PIPE_FORMAT_B4G4R4A4_UNORM, &uc); break; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 24f1d68f4a7..6fdc504ed54 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -244,6 +244,11 @@ uint32_t r300_translate_texformat(enum pipe_format format, desc->channel[2].size == 6) { return R300_TX_FORMAT_Z6Y5X5 | result; } + if (desc->channel[0].size == 2 && + desc->channel[1].size == 3 && + desc->channel[2].size == 3) { + return R300_TX_FORMAT_Z3Y3X2 | result; + } return ~0; /* Unsupported/unknown. */ case 4: -- cgit v1.2.3