summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2004-06-17 21:08:02 +0000
committerRoland Scheidegger <[email protected]>2004-06-17 21:08:02 +0000
commite3f926ad514d915a983a873540f201fc19d8d913 (patch)
treeb9c51ce8387a8bf8fc4206075527b2a2db655773 /src/mesa/drivers/dri
parent6c1833e37223edbcb818b6d98bd62058ce14dd86 (diff)
use I8 internal format for GL_INTENSITY, GL_ALPHA and GL_LUMINANCE texture formats. Fix potential bug with tex env combine mode GL_DOT3_RGB/GL_DOT3_RGB_EXT and ALPHA_SCALE
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_tex.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c17
2 files changed, 13 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c
index 3de407df3bb..cb5073d3ccb 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
@@ -345,7 +345,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_ALPHA12:
case GL_ALPHA16:
case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_al88;
+ return &_mesa_texformat_a8;
case 1:
case GL_LUMINANCE:
@@ -354,7 +354,7 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12:
case GL_LUMINANCE16:
case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_al88;
+ return &_mesa_texformat_l8;
case 2:
case GL_LUMINANCE_ALPHA:
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index e3c305ef223..1ec4e7dce32 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -50,6 +50,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_tcl.h"
+#define RADEON_TXFORMAT_A8 RADEON_TXFORMAT_I8
+#define RADEON_TXFORMAT_L8 RADEON_TXFORMAT_I8
#define RADEON_TXFORMAT_AL88 RADEON_TXFORMAT_AI88
#define RADEON_TXFORMAT_YCBCR RADEON_TXFORMAT_YVYU422
#define RADEON_TXFORMAT_YCBCR_REV RADEON_TXFORMAT_VYUY422
@@ -62,7 +64,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[ 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) \
+#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5) \
&& (tx_table[f].format != 0xffffffff) )
static const struct {
@@ -77,9 +79,9 @@ tx_table[] =
_ALPHA(ARGB4444),
_ALPHA(ARGB1555),
_ALPHA(AL88),
- _INVALID(A8),
- _INVALID(L8),
- _COLOR(I8),
+ _ALPHA(A8),
+ _COLOR(L8),
+ _ALPHA(I8),
_INVALID(CI8),
_YUV(YCBCR),
_YUV(YCBCR_REV),
@@ -556,7 +558,6 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
* 1.3) does.
*/
RGBshift = 0;
- Ashift = 0;
/* FALLTHROUGH */
case GL_DOT3_RGB:
@@ -569,7 +570,11 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
}
RGBshift += 2;
- Ashift = RGBshift;
+ if ( (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT)
+ || (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ) {
+ /* is it necessary to set this or will it be ignored anyway? */
+ Ashift = RGBshift;
+ }
color_combine = (RADEON_COLOR_ARG_C_ZERO |
RADEON_BLEND_CTL_DOT3 |