summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2014-06-27 09:40:10 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2014-06-30 12:02:25 -0700
commit4000c0112a49c28793844f454278b50e00943173 (patch)
treed398a8d1ecc3ae5f81b0f8259f68e549de2d279c /src/mesa/swrast
parent7577cdd8300068bdf1eda426951d7141450283aa (diff)
downloadexternal_mesa3d-4000c0112a49c28793844f454278b50e00943173.zip
external_mesa3d-4000c0112a49c28793844f454278b50e00943173.tar.gz
external_mesa3d-4000c0112a49c28793844f454278b50e00943173.tar.bz2
Remove the ATI_envmap_bumpmap extension
As far as I can tell, the Intel mesa driver is the only driver in the world still supporting this legacy extension. If someone wants to do bump mapping, they can use shaders. Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1] Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> [v2] Reviewed-by: Ian Romanick <idr@freedesktop.org> [v3]
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texcombine.c77
-rw-r--r--src/mesa/swrast/s_texfetch.c1
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h16
3 files changed, 1 insertions, 93 deletions
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index c1a152a..def5eb1 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -429,16 +429,6 @@ texture_combine( struct gl_context *ctx, GLuint unit,
arg1[i][BCOMP]) * scaleRGB;
}
break;
- case GL_BUMP_ENVMAP_ATI:
- /* this produces a fixed rgba color, and the coord calc is done elsewhere */
- for (i = 0; i < n; i++) {
- /* rgba result is 0,0,0,1 */
- rgba[i][RCOMP] = 0.0;
- rgba[i][GCOMP] = 0.0;
- rgba[i][BCOMP] = 0.0;
- rgba[i][ACOMP] = 1.0;
- }
- goto end; /* no alpha processing */
default:
_mesa_problem(ctx, "invalid combine mode");
}
@@ -653,78 +643,13 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
}
}
- /* First must sample all bump maps */
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- if (texUnit->_Current &&
- texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) {
- const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
- span->array->attribs[VARYING_SLOT_TEX0 + unit];
- float4_array targetcoords =
- span->array->attribs[VARYING_SLOT_TEX0 +
- ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0];
-
- const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
- GLfloat *lambda = span->array->lambda[unit];
- float4_array texels = get_texel_array(swrast, unit);
- GLuint i;
- GLfloat rotMatrix00 = ctx->Texture.Unit[unit].RotMatrix[0];
- GLfloat rotMatrix01 = ctx->Texture.Unit[unit].RotMatrix[1];
- GLfloat rotMatrix10 = ctx->Texture.Unit[unit].RotMatrix[2];
- GLfloat rotMatrix11 = ctx->Texture.Unit[unit].RotMatrix[3];
-
- /* adjust texture lod (lambda) */
- if (span->arrayMask & SPAN_LAMBDA) {
- if (texUnit->LodBias + samp->LodBias != 0.0F) {
- /* apply LOD bias, but don't clamp yet */
- const GLfloat bias = CLAMP(texUnit->LodBias + samp->LodBias,
- -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias);
- GLuint i;
- for (i = 0; i < span->end; i++) {
- lambda[i] += bias;
- }
- }
-
- if (samp->MinLod != -1000.0 ||
- samp->MaxLod != 1000.0) {
- /* apply LOD clamping to lambda */
- const GLfloat min = samp->MinLod;
- const GLfloat max = samp->MaxLod;
- GLuint i;
- for (i = 0; i < span->end; i++) {
- GLfloat l = lambda[i];
- lambda[i] = CLAMP(l, min, max);
- }
- }
- }
-
- /* Sample the texture (span->end = number of fragments) */
- swrast->TextureSample[unit]( ctx, samp,
- ctx->Texture.Unit[unit]._Current,
- span->end, texcoords, lambda, texels );
-
- /* manipulate the span values of the bump target
- not sure this can work correctly even ignoring
- the problem that channel is unsigned */
- for (i = 0; i < span->end; i++) {
- targetcoords[i][0] += (texels[i][0] * rotMatrix00 + texels[i][1] *
- rotMatrix01) / targetcoords[i][3];
- targetcoords[i][1] += (texels[i][0] * rotMatrix10 + texels[i][1] *
- rotMatrix11) / targetcoords[i][3];
- }
- }
- }
-
/*
* Must do all texture sampling before combining in order to
* accomodate GL_ARB_texture_env_crossbar.
*/
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- if (texUnit->_Current &&
- texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) {
+ if (texUnit->_Current) {
const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
span->array->attribs[VARYING_SLOT_TEX0 + unit];
const struct gl_texture_object *curObj = texUnit->_Current;
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index 90a514c..e508368 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -210,7 +210,6 @@ texfetch_funcs[] =
},
FETCH_FUNCS(YCBCR),
FETCH_FUNCS(YCBCR_REV),
- FETCH_FUNCS(DUDV8),
/* Array unorm formats */
FETCH_FUNCS(A_UNORM8),
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index d48e39b..deda592 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -888,22 +888,6 @@ FETCH(RGBA_UINT32)(const struct swrast_texture_image *texImage,
}
-/**
- * This format by definition produces 0,0,0,1 as rgba values,
- * however we'll return the dudv values as rg and fix up elsewhere.
- */
-static void
-FETCH(DUDV8)(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2);
- texel[RCOMP] = BYTE_TO_FLOAT(src[0]);
- texel[GCOMP] = BYTE_TO_FLOAT(src[1]);
- texel[BCOMP] = 0;
- texel[ACOMP] = 0;
-}
-
-
static void
FETCH(R_SNORM8)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)