summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-11-28 10:20:04 +0100
committerMichel Dänzer <[email protected]>2007-11-28 10:25:01 +0100
commit3f18c0a9f27fded8f52a5f0c5b8ad71f71c46aa2 (patch)
tree63fc1b8c1a302ccd1a2ffa8820bc220689f2ce4f /src
parentb14be6193891dd7f03efcadb674a759acf3722c9 (diff)
r200: Fix texture format regression on big endian systems.
See https://bugs.freedesktop.org/show_bug.cgi?id=13324 . Also use tx_table_be for VALID_FORMAT, in case r200SetTexImages ever gets called for MESA_FORMAT_RGB888. (cherry picked from commit dc88a96631c21c2bc2cdffefc8947e8924d77c91)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index af5092bb972..d12c3bc664c 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -72,7 +72,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _INVALID(f) \
[ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
- && (tx_table_le[f].format != 0xffffffff) )
+ && (tx_table_be[f].format != 0xffffffff) )
struct tx_table {
GLuint format, filter;
@@ -165,12 +165,15 @@ static void r200SetTexImages( r200ContextPtr rmesa,
*/
if ( !t->image_override ) {
if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) {
+ const struct tx_table *table = _mesa_little_endian() ? tx_table_le :
+ tx_table_be;
+
t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
R200_TXFORMAT_ALPHA_IN_MAP);
t->pp_txfilter &= ~R200_YUV_TO_RGB;
- t->pp_txformat |= tx_table_le[ baseImage->TexFormat->MesaFormat ].format;
- t->pp_txfilter |= tx_table_le[ baseImage->TexFormat->MesaFormat ].filter;
+ t->pp_txformat |= table[ baseImage->TexFormat->MesaFormat ].format;
+ t->pp_txfilter |= table[ baseImage->TexFormat->MesaFormat ].filter;
}
else {
_mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__);