mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
cut out dead texture state code
This commit is contained in:
parent
5bd6a5f2df
commit
df14522540
2 changed files with 0 additions and 296 deletions
|
|
@ -890,13 +890,8 @@ static void viaChooseTextureState(GLcontext *ctx)
|
|||
|
||||
if (texUnit0->_ReallyEnabled) {
|
||||
struct gl_texture_object *texObj = texUnit0->_Current;
|
||||
struct gl_texture_image *texImage = texObj->Image[0][0];
|
||||
|
||||
if (VIA_DEBUG) fprintf(stderr, "texUnit0->_ReallyEnabled\n");
|
||||
if (texImage->Border) {
|
||||
FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, GL_TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
vmesa->regEnable |= HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK;
|
||||
|
||||
|
|
@ -957,12 +952,6 @@ static void viaChooseTextureState(GLcontext *ctx)
|
|||
|
||||
if (texUnit1->_ReallyEnabled) {
|
||||
struct gl_texture_object *texObj = texUnit1->_Current;
|
||||
struct gl_texture_image *texImage = texObj->Image[0][0];
|
||||
|
||||
if (texImage->Border) {
|
||||
FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, GL_TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
vmesa->regEnable |= HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK;
|
||||
|
||||
|
|
|
|||
|
|
@ -360,283 +360,7 @@ static void viaSetTexImages(viaContextPtr vmesa,
|
|||
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
* Texture combine functions
|
||||
*/
|
||||
#define VIA_DISABLE 0
|
||||
#define VIA_PASSTHRU 1
|
||||
#define VIA_REPLACE 2
|
||||
#define VIA_MODULATE 3
|
||||
#define VIA_DECAL 4
|
||||
#define VIA_BLEND 5
|
||||
#define VIA_ALPHA_BLEND 6
|
||||
#define VIA_ADD 7
|
||||
#define VIA_MAX_COMBFUNC 8
|
||||
|
||||
static GLuint via_color_combine[][VIA_MAX_COMBFUNC] =
|
||||
{
|
||||
/* Unit 0:
|
||||
*/
|
||||
{
|
||||
/* Disable combiner stage
|
||||
*/
|
||||
0,
|
||||
|
||||
/* Passthru
|
||||
*/
|
||||
1,
|
||||
|
||||
/* GL_REPLACE
|
||||
*/
|
||||
2,
|
||||
|
||||
/* GL_MODULATE
|
||||
*/
|
||||
3,
|
||||
|
||||
/* GL_DECAL
|
||||
*/
|
||||
4,
|
||||
|
||||
/* GL_BLEND
|
||||
*/
|
||||
5,
|
||||
|
||||
/* GL_BLEND according to alpha
|
||||
*/
|
||||
6,
|
||||
|
||||
/* GL_ADD
|
||||
*/
|
||||
7,
|
||||
},
|
||||
|
||||
/* Unit 1:
|
||||
*/
|
||||
{
|
||||
/* Disable combiner stage (Note: disables all subsequent stages)
|
||||
*/
|
||||
0,
|
||||
|
||||
/* Passthru
|
||||
*/
|
||||
1,
|
||||
|
||||
/* GL_REPLACE
|
||||
*/
|
||||
2,
|
||||
|
||||
/* GL_MODULATE
|
||||
*/
|
||||
3,
|
||||
|
||||
/* GL_DECAL
|
||||
*/
|
||||
4,
|
||||
|
||||
/* GL_BLEND
|
||||
*/
|
||||
5,
|
||||
|
||||
/* GL_BLEND according to alpha
|
||||
*/
|
||||
6,
|
||||
|
||||
/* GL_ADD
|
||||
*/
|
||||
7,
|
||||
}
|
||||
};
|
||||
|
||||
static GLuint via_alpha_combine[][VIA_MAX_COMBFUNC] =
|
||||
{
|
||||
/* Unit 0:
|
||||
*/
|
||||
{
|
||||
/* Disable combiner stage
|
||||
*/
|
||||
0,
|
||||
|
||||
/* Passthru
|
||||
*/
|
||||
1,
|
||||
|
||||
/* GL_REPLACE
|
||||
*/
|
||||
2,
|
||||
|
||||
/* GL_MODULATE
|
||||
*/
|
||||
3,
|
||||
|
||||
/* GL_DECAL
|
||||
*/
|
||||
4,
|
||||
|
||||
/* GL_BLEND
|
||||
*/
|
||||
5,
|
||||
|
||||
/* GL_BLEND according to alpha (same as above)
|
||||
*/
|
||||
6,
|
||||
|
||||
/* GL_ADD
|
||||
*/
|
||||
7,
|
||||
},
|
||||
|
||||
/* Unit 1:
|
||||
*/
|
||||
{
|
||||
/* Disable combiner stage
|
||||
*/
|
||||
0,
|
||||
|
||||
/* Passthru
|
||||
*/
|
||||
1,
|
||||
|
||||
/* GL_REPLACE
|
||||
*/
|
||||
2,
|
||||
|
||||
/* GL_MODULATE
|
||||
*/
|
||||
3,
|
||||
|
||||
/* GL_DECAL
|
||||
*/
|
||||
4,
|
||||
|
||||
/* GL_BLEND
|
||||
*/
|
||||
5,
|
||||
|
||||
/* GL_BLEND according to alpha (same as above)
|
||||
*/
|
||||
6,
|
||||
|
||||
/* GL_ADD
|
||||
*/
|
||||
7,
|
||||
}
|
||||
};
|
||||
|
||||
static void viaUpdateTexEnv(GLcontext *ctx, GLuint unit)
|
||||
{
|
||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||
const struct gl_texture_object *tObj = texUnit->_Current;
|
||||
const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
|
||||
GLuint color_combine, alpha_combine;
|
||||
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
|
||||
switch (texUnit->EnvMode) {
|
||||
case GL_REPLACE:
|
||||
if (format == GL_ALPHA) {
|
||||
color_combine = via_color_combine[unit][VIA_PASSTHRU];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_REPLACE];
|
||||
}
|
||||
else if (format == GL_LUMINANCE || format == GL_RGB) {
|
||||
color_combine = via_color_combine[unit][VIA_REPLACE];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
}
|
||||
else {
|
||||
color_combine = via_color_combine[unit][VIA_REPLACE];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_REPLACE];
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_MODULATE:
|
||||
if (format == GL_ALPHA) {
|
||||
color_combine = via_color_combine[unit][VIA_PASSTHRU];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
}
|
||||
else {
|
||||
color_combine = via_color_combine[unit][VIA_MODULATE];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_DECAL:
|
||||
switch (format) {
|
||||
case GL_RGBA:
|
||||
color_combine = via_color_combine[unit][VIA_ALPHA_BLEND];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
break;
|
||||
case GL_RGB:
|
||||
color_combine = via_color_combine[unit][VIA_REPLACE];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
break;
|
||||
case GL_ALPHA:
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
case GL_INTENSITY:
|
||||
color_combine = via_color_combine[unit][VIA_PASSTHRU];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
break;
|
||||
case GL_COLOR_INDEX:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_BLEND:
|
||||
switch (format) {
|
||||
case GL_RGB:
|
||||
case GL_LUMINANCE:
|
||||
color_combine = via_color_combine[unit][VIA_BLEND];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
color_combine = via_color_combine[unit][VIA_BLEND];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
break;
|
||||
case GL_ALPHA:
|
||||
color_combine = via_color_combine[unit][VIA_PASSTHRU];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
color_combine = via_color_combine[unit][VIA_BLEND];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_BLEND];
|
||||
break;
|
||||
case GL_COLOR_INDEX:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_ADD:
|
||||
switch (format) {
|
||||
case GL_RGB:
|
||||
case GL_LUMINANCE:
|
||||
color_combine = via_color_combine[unit][VIA_ADD];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_PASSTHRU];
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
color_combine = via_color_combine[unit][VIA_ADD];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
break;
|
||||
case GL_ALPHA:
|
||||
color_combine = via_color_combine[unit][VIA_PASSTHRU];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_MODULATE];
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
color_combine = via_color_combine[unit][VIA_ADD];
|
||||
alpha_combine = via_alpha_combine[unit][VIA_ADD];
|
||||
break;
|
||||
case GL_COLOR_INDEX:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
static GLboolean viaUpdateTexUnit(GLcontext *ctx, GLuint unit)
|
||||
{
|
||||
|
|
@ -672,14 +396,6 @@ static GLboolean viaUpdateTexUnit(GLcontext *ctx, GLuint unit)
|
|||
viaUpdateTexLRU(vmesa, t); /* done too often */
|
||||
}
|
||||
|
||||
/* Update texture environment if texture object image format or
|
||||
* texture environment state has changed.
|
||||
*/
|
||||
if (tObj->Image[0][tObj->BaseLevel]->Format != vmesa->TexEnvImageFmt[unit]) {
|
||||
vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
|
||||
viaUpdateTexEnv(ctx, unit);
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
else if (texUnit->_ReallyEnabled) {
|
||||
|
|
@ -687,7 +403,6 @@ static GLboolean viaUpdateTexUnit(GLcontext *ctx, GLuint unit)
|
|||
}
|
||||
else {
|
||||
vmesa->CurrentTexObj[unit] = 0;
|
||||
vmesa->TexEnvImageFmt[unit] = 0;
|
||||
VIA_FLUSH_DMA(vmesa);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue