aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-16 14:48:54 +0200
committermarha <marha@users.sourceforge.net>2012-08-16 14:48:54 +0200
commit4aac32998c2b173b84aec0b020aa086fef4b1423 (patch)
tree3ffcb971bcc2f01929f60f8f704996544b69b2e1 /mesalib/src/mesa/swrast
parent9ddf44af81782451cee798e06749ce3067a14a41 (diff)
downloadvcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.gz
vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.bz2
vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.zip
libxcb xserver mesa git update 16 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r--mesalib/src/mesa/swrast/s_texfilter.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c
index 51c899208..3c2aae913 100644
--- a/mesalib/src/mesa/swrast/s_texfilter.c
+++ b/mesalib/src/mesa/swrast/s_texfilter.c
@@ -3345,34 +3345,33 @@ sample_lambda_1d_array(struct gl_context *ctx,
/**
- * 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;
}
}
@@ -3384,9 +3383,9 @@ static inline GLfloat
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) {
@@ -3429,13 +3428,13 @@ shadow_compare4(GLenum function, GLfloat coord,
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;
}
}
@@ -3483,7 +3482,6 @@ sample_depth_texture( struct gl_context *ctx,
const GLint depth = img->Depth;
const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT)
? 3 : 2;
- GLfloat ambient;
GLenum function;
GLfloat result;
@@ -3497,8 +3495,6 @@ sample_depth_texture( struct gl_context *ctx,
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) ?
@@ -3522,7 +3518,7 @@ sample_depth_texture( struct gl_context *ctx,
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:
@@ -3617,7 +3613,7 @@ sample_depth_texture( struct gl_context *ctx,
result = shadow_compare4(function, depthRef,
depth00, depth01, depth10, depth11,
- ambient, wi, wj);
+ wi, wj);
switch (tObj->DepthMode) {
case GL_LUMINANCE: