diff options
author | Keith Whitwell <[email protected]> | 2005-01-13 13:00:23 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-01-13 13:00:23 +0000 |
commit | df14522540365d04e0077a3da5666084aafb68c7 (patch) | |
tree | b260dae04318f25c254aa03f6ca1cf82e8d31c01 /src | |
parent | 5bd6a5f2dfe855ad6aabb2126c518245cdc20e37 (diff) |
cut out dead texture state code
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_state.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_texstate.c | 285 |
2 files changed, 0 insertions, 296 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index fffea017895..a1b5a0ac3e3 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -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; diff --git a/src/mesa/drivers/dri/unichrome/via_texstate.c b/src/mesa/drivers/dri/unichrome/via_texstate.c index fd9a943322f..daf7212e7eb 100644 --- a/src/mesa/drivers/dri/unichrome/via_texstate.c +++ b/src/mesa/drivers/dri/unichrome/via_texstate.c @@ -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; } |