struct rX00_fragment_program_code *code;
/* Optional transformations and features. */
struct r300_fragment_program_external_state state;
- unsigned enable_shadow_ambient;
/* Register corresponding to the depthbuffer. */
unsigned OutputDepth;
/* Registers corresponding to the four colorbuffers. */
{
struct rc_src_register reg = { 0, 0, 0, 0, 0, 0 };
- if (compiler->enable_shadow_ambient) {
- reg.File = RC_FILE_CONSTANT;
- reg.Index = rc_constants_add_state(&compiler->Base.Program.Constants,
- RC_STATE_SHADOW_AMBIENT, tmu);
- reg.Swizzle = RC_SWIZZLE_WWWW;
- } else {
- reg.File = RC_FILE_NONE;
- reg.Swizzle = RC_SWIZZLE_0000;
- }
-
- reg.Swizzle = combine_swizzles(reg.Swizzle,
+ reg.File = RC_FILE_NONE;
+ reg.Swizzle = combine_swizzles(RC_SWIZZLE_0000,
compiler->state.unit[tmu].texture_swizzle);
return reg;
}
_mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
samp->MaxAnisotropy);
}
- if (ctx->Extensions.ARB_shadow_ambient) {
- _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
- samp->CompareFailValue);
- }
if (ctx->Extensions.ARB_shadow) {
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
samp->CompareMode);
{ "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
{ "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 },
{ "GL_ARB_shading_language_100", o(ARB_shading_language_100), GLL, 2003 },
- { "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL, 2001 },
{ "GL_ARB_shadow", o(ARB_shadow), GLL, 2001 },
{ "GL_ARB_sync", o(ARB_sync), GL, 2003 },
{ "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GLL, 2000 },
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
ctx->Extensions.ARB_shadow = GL_TRUE;
- ctx->Extensions.ARB_shadow_ambient = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
GLenum CompareMode; /**< GL_ARB_shadow */
GLenum CompareFunc; /**< GL_ARB_shadow */
- GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */
GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */
GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */
};
GLboolean ARB_shader_texture_lod;
GLboolean ARB_shading_language_100;
GLboolean ARB_shadow;
- GLboolean ARB_shadow_ambient;
GLboolean ARB_sync;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_buffer_object;
sampObj->MaxAnisotropy = 1.0F;
sampObj->CompareMode = GL_NONE;
sampObj->CompareFunc = GL_LEQUAL;
- sampObj->CompareFailValue = 0.0;
sampObj->sRGBDecode = GL_DECODE_EXT;
sampObj->CubeMapSeamless = GL_FALSE;
}
obj->Sampler.MaxAnisotropy = 1.0;
obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */
obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */
- obj->Sampler.CompareFailValue = 0.0F; /* ARB_shadow_ambient */
obj->DepthMode = GL_LUMINANCE;
obj->Sampler.CubeMapSeamless = GL_FALSE;
obj->Swizzle[0] = GL_RED;
dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
dest->Sampler.CompareMode = src->Sampler.CompareMode;
dest->Sampler.CompareFunc = src->Sampler.CompareFunc;
- dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue;
dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
dest->DepthMode = src->DepthMode;
dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode;
}
return GL_FALSE;
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (ctx->Extensions.ARB_shadow_ambient) {
- if (texObj->Sampler.CompareFailValue != params[0]) {
- flush(ctx);
- texObj->Sampler.CompareFailValue = CLAMP(params[0], 0.0F, 1.0F);
- return GL_TRUE;
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)");
- }
- return GL_FALSE;
-
case GL_TEXTURE_LOD_BIAS:
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
if (texObj->Sampler.LodBias != params[0]) {
goto invalid_pname;
*params = obj->Sampler.MaxAnisotropy;
break;
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (!ctx->Extensions.ARB_shadow_ambient)
- goto invalid_pname;
- *params = obj->Sampler.CompareFailValue;
- break;
case GL_GENERATE_MIPMAP_SGIS:
*params = (GLfloat) obj->GenerateMipmap;
break;
goto invalid_pname;
*params = (GLint) obj->Sampler.MaxAnisotropy;
break;
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (!ctx->Extensions.ARB_shadow_ambient)
- goto invalid_pname;
- *params = (GLint) FLOAT_TO_INT(obj->Sampler.CompareFailValue);
- break;
case GL_GENERATE_MIPMAP_SGIS:
*params = (GLint) obj->GenerateMipmap;
break;
value[3] = ctx->Pixel.AlphaBias;
return;
- case STATE_SHADOW_AMBIENT:
- {
- const int unit = (int) state[2];
- const struct gl_texture_object *texObj
- = ctx->Texture.Unit[unit]._Current;
- const struct gl_sampler_object *samp =
- _mesa_get_samplerobj(ctx, unit);
- if (texObj) {
- value[0] =
- value[1] =
- value[2] =
- value[3] = samp->CompareFailValue;
- }
- }
- return;
-
case STATE_FB_SIZE:
value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
return _NEW_MODELVIEW;
case STATE_TEXRECT_SCALE:
- case STATE_SHADOW_AMBIENT:
case STATE_ROT_MATRIX_0:
case STATE_ROT_MATRIX_1:
return _NEW_TEXTURE;
case STATE_PT_BIAS:
append(dst, "PTbias");
break;
- case STATE_SHADOW_AMBIENT:
- append(dst, "CompareFailValue");
- break;
case STATE_FB_SIZE:
append(dst, "FbSize");
break;
STATE_LIGHT_HALF_VECTOR, /* object vs eye space */
STATE_PT_SCALE, /**< Pixel transfer RGBA scale */
STATE_PT_BIAS, /**< Pixel transfer RGBA bias */
- STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */
STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */
STATE_FB_WPOS_Y_TRANSFORM, /**< (1, 0, -1, height) if a FBO is bound, (-1, height, 1, 0) otherwise */
STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */
/**
- * Compare texcoord against depth sample. Return 1.0 or the ambient value.
+ * Compare texcoord against depth sample. Return 1.0 or 0.0 value.
*/
static inline GLfloat
-shadow_compare(GLenum function, GLfloat coord, GLfloat depthSample,
- GLfloat ambient)
+shadow_compare(GLenum function, GLfloat coord, GLfloat depthSample)
{
switch (function) {
case GL_LEQUAL:
- return (coord <= depthSample) ? 1.0F : ambient;
+ return (coord <= depthSample) ? 1.0F : 0.0F;
case GL_GEQUAL:
- return (coord >= depthSample) ? 1.0F : ambient;
+ return (coord >= depthSample) ? 1.0F : 0.0F;
case GL_LESS:
- return (coord < depthSample) ? 1.0F : ambient;
+ return (coord < depthSample) ? 1.0F : 0.0F;
case GL_GREATER:
- return (coord > depthSample) ? 1.0F : ambient;
+ return (coord > depthSample) ? 1.0F : 0.0F;
case GL_EQUAL:
- return (coord == depthSample) ? 1.0F : ambient;
+ return (coord == depthSample) ? 1.0F : 0.0F;
case GL_NOTEQUAL:
- return (coord != depthSample) ? 1.0F : ambient;
+ return (coord != depthSample) ? 1.0F : 0.0F;
case GL_ALWAYS:
return 1.0F;
case GL_NEVER:
- return ambient;
+ return 0.0F;
case GL_NONE:
return depthSample;
default:
_mesa_problem(NULL, "Bad compare func in shadow_compare");
- return ambient;
+ return 0.0F;
}
}
shadow_compare4(GLenum function, GLfloat coord,
GLfloat depth00, GLfloat depth01,
GLfloat depth10, GLfloat depth11,
- GLfloat ambient, GLfloat wi, GLfloat wj)
+ GLfloat wi, GLfloat wj)
{
- const GLfloat d = (1.0F - (GLfloat) ambient) * 0.25F;
+ const GLfloat d = 0.25F;
GLfloat luminance = 1.0F;
switch (function) {
case GL_ALWAYS:
return 1.0F;
case GL_NEVER:
- return ambient;
+ return 0.0F;
case GL_NONE:
/* ordinary bilinear filtering */
return lerp_2d(wi, wj, depth00, depth10, depth01, depth11);
default:
_mesa_problem(NULL, "Bad compare func in sample_compare4");
- return ambient;
+ return 0.0F;
}
}
const GLint depth = img->Depth;
const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT)
? 3 : 2;
- GLfloat ambient;
GLenum function;
GLfloat result;
tObj->Target == GL_TEXTURE_2D_ARRAY_EXT ||
tObj->Target == GL_TEXTURE_CUBE_MAP);
- ambient = samp->CompareFailValue;
-
/* XXXX if samp->MinFilter != samp->MagFilter, we're ignoring lambda */
function = (samp->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) ?
depthRef = CLAMP(texcoords[i][compare_coord], 0.0F, 1.0F);
- result = shadow_compare(function, depthRef, depthSample, ambient);
+ result = shadow_compare(function, depthRef, depthSample);
switch (tObj->DepthMode) {
case GL_LUMINANCE:
result = shadow_compare4(function, depthRef,
depth00, depth01, depth10, depth11,
- ambient, wi, wj);
+ wi, wj);
switch (tObj->DepthMode) {
case GL_LUMINANCE: