diff options
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_texstate.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texstate.c | 16 |
2 files changed, 10 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 60a20071d97..8826a9bd7e7 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -691,29 +691,23 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format pitch_val = rb->pitch; switch (rb->cpp) { case 4: - if (texture_format == __DRI_TEXTURE_FORMAT_RGB) { + if (texture_format == __DRI_TEXTURE_FORMAT_RGB) texFormat = MESA_FORMAT_BGR_UNORM8; - t->pp_txformat = tx_table_le[MESA_FORMAT_BGR_UNORM8].format; - } - else { + else texFormat = MESA_FORMAT_B8G8R8A8_UNORM; - t->pp_txformat = tx_table_le[MESA_FORMAT_B8G8R8A8_UNORM].format; - } - t->pp_txfilter |= tx_table_le[MESA_FORMAT_B8G8R8A8_UNORM].filter; break; case 3: default: texFormat = MESA_FORMAT_BGR_UNORM8; - t->pp_txformat = tx_table_le[MESA_FORMAT_BGR_UNORM8].format; - t->pp_txfilter |= tx_table_le[MESA_FORMAT_BGR_UNORM8].filter; break; case 2: texFormat = MESA_FORMAT_B5G6R5_UNORM; - t->pp_txformat = tx_table_le[MESA_FORMAT_B5G6R5_UNORM].format; - t->pp_txfilter |= tx_table_le[MESA_FORMAT_B5G6R5_UNORM].filter; break; } + t->pp_txformat = tx_table_le[texFormat].format; + t->pp_txfilter |= tx_table_le[texFormat].filter; + _mesa_init_teximage_fields(&radeon->glCtx, texImage, rb->base.Base.Width, rb->base.Base.Height, 1, 0, diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 47eac855c66..1cfca191375 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -597,29 +597,23 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form t->override_offset = 0; switch (rb->cpp) { case 4: - if (texture_format == __DRI_TEXTURE_FORMAT_RGB) { - t->pp_txformat = tx_table[MESA_FORMAT_BGR_UNORM8].format; + if (texture_format == __DRI_TEXTURE_FORMAT_RGB) texFormat = MESA_FORMAT_BGR_UNORM8; - } - else { - t->pp_txformat = tx_table[MESA_FORMAT_B8G8R8A8_UNORM].format; + else texFormat = MESA_FORMAT_B8G8R8A8_UNORM; - } - t->pp_txfilter |= tx_table[MESA_FORMAT_B8G8R8A8_UNORM].filter; break; case 3: default: texFormat = MESA_FORMAT_BGR_UNORM8; - t->pp_txformat = tx_table[MESA_FORMAT_BGR_UNORM8].format; - t->pp_txfilter |= tx_table[MESA_FORMAT_BGR_UNORM8].filter; break; case 2: texFormat = MESA_FORMAT_B5G6R5_UNORM; - t->pp_txformat = tx_table[MESA_FORMAT_B5G6R5_UNORM].format; - t->pp_txfilter |= tx_table[MESA_FORMAT_B5G6R5_UNORM].filter; break; } + t->pp_txformat = tx_table[texFormat].format; + t->pp_txfilter |= tx_table[texFormat].filter; + _mesa_init_teximage_fields(&radeon->glCtx, texImage, rb->base.Base.Width, rb->base.Base.Height, 1, 0, |