summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/sis/sis_texstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_texstate.c')
-rw-r--r--src/mesa/drivers/dri/sis/sis_texstate.c132
1 files changed, 61 insertions, 71 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c
index 23f72589a7..001eb18a14 100644
--- a/src/mesa/drivers/dri/sis/sis_texstate.c
+++ b/src/mesa/drivers/dri/sis/sis_texstate.c
@@ -18,7 +18,7 @@ Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -60,11 +60,6 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
sisTexObjPtr t = texObj->DriverData;
- /*
- current->hwTexBlendClr0 = RGB_STAGE1;
- current->hwTexBlendAlpha0 = A_STAGE1;
- */
-
switch (texture_unit->EnvMode)
{
case GL_REPLACE:
@@ -72,19 +67,19 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr0 = A_REPLACE_RGB_STAGE0;
- current->hwTexBlendAlpha0 = A_REPLACE_A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CF;
+ current->hwTexBlendAlpha0 = STAGE0_A_AS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr0 = RGB_REPLACE__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGB_REPLACE__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
break;
case GL_INTENSITY:
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr0 = RGBA_REPLACE__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGBA_REPLACE__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AS;
break;
}
break;
@@ -94,19 +89,19 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr0 = A_MODULATE_RGB_STAGE0;
- current->hwTexBlendAlpha0 = A_MODULATE_A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CF;
+ current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr0 = RGB_MODULATE__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGB_MODULATE__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFCS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
break;
case GL_INTENSITY:
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr0 = RGBA_MODULATE__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGBA_MODULATE__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFCS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
break;
}
break;
@@ -116,12 +111,12 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_RGB:
- current->hwTexBlendClr0 = RGB_DECAL__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGB_DECAL__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
break;
case GL_RGBA:
- current->hwTexBlendClr0 = RGBA_DECAL__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGBA_DECAL__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFOMAS_CSAS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
break;
}
break;
@@ -137,34 +132,34 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr0 = A_BLEND_RGB_STAGE0;
- current->hwTexBlendAlpha0 = A_BLEND_A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CF;
+ current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr0 = RGB_BLEND__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGB_BLEND__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
break;
case GL_INTENSITY:
- current->hwTexBlendClr0 = I_BLEND__RGB_STAGE0;
- current->hwTexBlendAlpha0 = I_BLEND__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AFOMAS_ACAS;
break;
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr0 = RGBA_BLEND__RGB_STAGE0;
- current->hwTexBlendAlpha0 = RGBA_BLEND__A_STAGE0;
+ current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha0 = STAGE0_A_AFAS;
break;
}
break;
#endif
}
- if ((current->hwTexBlendClr0 != prev->hwTexBlendClr0) ||
+ if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) ||
(current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) ||
(current->hwTexEnvColor != prev->hwTexEnvColor))
{
prev->hwTexEnvColor = current->hwTexEnvColor;
- prev->hwTexBlendClr0 = current->hwTexBlendClr0;
+ prev->hwTexBlendColor0 = current->hwTexBlendColor0;
prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0;
smesa->GlobalFlag |= GFLAG_TEXTUREENV;
}
@@ -184,11 +179,6 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
sisTexObjPtr t = texObj->DriverData;
- /*
- current->hwTexBlendClr1 = RGB_STAGE1; current->hwTexBlendAlpha1 =
- A_STAGE1;
- */
-
switch (texture_unit->EnvMode)
{
case GL_REPLACE:
@@ -196,19 +186,19 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr1 = A_REPLACE_RGB_STAGE1;
- current->hwTexBlendAlpha1 = A_REPLACE_A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CF;
+ current->hwTexBlendAlpha1 = STAGE1_A_AS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr1 = RGB_REPLACE__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGB_REPLACE__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
break;
case GL_INTENSITY:
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr1 = RGBA_REPLACE__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGBA_REPLACE__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AS;
break;
}
break;
@@ -218,19 +208,19 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr1 = A_MODULATE_RGB_STAGE1;
- current->hwTexBlendAlpha1 = A_MODULATE_A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CF;
+ current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr1 = RGB_MODULATE__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGB_MODULATE__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFCS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
break;
case GL_INTENSITY:
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr1 = RGBA_MODULATE__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGBA_MODULATE__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFCS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
break;
}
break;
@@ -240,12 +230,12 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_RGB:
- current->hwTexBlendClr1 = RGB_DECAL__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGB_DECAL__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
break;
case GL_RGBA:
- current->hwTexBlendClr1 = RGBA_DECAL__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGBA_DECAL__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFOMAS_CSAS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
break;
}
break;
@@ -261,33 +251,33 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
switch (t->format)
{
case GL_ALPHA:
- current->hwTexBlendClr1 = A_BLEND_RGB_STAGE1;
- current->hwTexBlendAlpha1 = A_BLEND_A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CF;
+ current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
break;
case GL_LUMINANCE:
case GL_RGB:
- current->hwTexBlendClr1 = RGB_BLEND__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGB_BLEND__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
break;
case GL_INTENSITY:
- current->hwTexBlendClr1 = I_BLEND__RGB_STAGE1;
- current->hwTexBlendAlpha1 = I_BLEND__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AFOMAS_ACAS;
break;
case GL_LUMINANCE_ALPHA:
case GL_RGBA:
- current->hwTexBlendClr1 = RGBA_BLEND__RGB_STAGE1;
- current->hwTexBlendAlpha1 = RGBA_BLEND__A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS;
+ current->hwTexBlendAlpha1 = STAGE1_A_AFAS;
break;
}
break;
#endif
}
- if ((current->hwTexBlendClr1 != prev->hwTexBlendClr1) ||
+ if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) ||
(current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) ||
(current->hwTexEnvColor != prev->hwTexEnvColor))
{
- prev->hwTexBlendClr1 = current->hwTexBlendClr1;
+ prev->hwTexBlendColor1 = current->hwTexBlendColor1;
prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1;
prev->hwTexEnvColor = current->hwTexEnvColor;
smesa->GlobalFlag |= GFLAG_TEXTUREENV_1;
@@ -562,27 +552,27 @@ sis_reset_texture_env (GLcontext *ctx, int hw_unit)
if (hw_unit == 1)
{
- current->hwTexBlendClr1 = RGB_STAGE1;
- current->hwTexBlendAlpha1 = A_STAGE1;
+ current->hwTexBlendColor1 = STAGE1_C_CF;
+ current->hwTexBlendAlpha1 = STAGE1_A_AF;
- if ((current->hwTexBlendClr1 != prev->hwTexBlendClr1) ||
+ if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) ||
(current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) ||
(current->hwTexEnvColor != prev->hwTexEnvColor))
{
- prev->hwTexBlendClr1 = current->hwTexBlendClr1;
+ prev->hwTexBlendColor1 = current->hwTexBlendColor1;
prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1;
prev->hwTexEnvColor = current->hwTexEnvColor;
smesa->GlobalFlag |= GFLAG_TEXTUREENV_1;
}
} else {
- current->hwTexBlendClr0 = RGB_STAGE1;
- current->hwTexBlendAlpha0 = A_STAGE1;
+ current->hwTexBlendColor0 = STAGE0_C_CF;
+ current->hwTexBlendAlpha0 = STAGE0_A_AF;
- if ((current->hwTexBlendClr0 != prev->hwTexBlendClr0) ||
+ if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) ||
(current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) ||
(current->hwTexEnvColor != prev->hwTexEnvColor))
{
- prev->hwTexBlendClr0 = current->hwTexBlendClr0;
+ prev->hwTexBlendColor0 = current->hwTexBlendColor0;
prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0;
prev->hwTexEnvColor = current->hwTexEnvColor;
smesa->GlobalFlag |= GFLAG_TEXTUREENV;