diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2008-07-18 22:39:12 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2008-07-18 22:39:12 +0800 |
commit | 97eb33529ae2f96220eec5238d8d0e9a07ce91d5 (patch) | |
tree | cf7ddd47f3647142126132b93df6774bf50bb537 | |
parent | 5ce5cc93d51bc784a54aa4f51298715fa2c8d5aa (diff) |
intel: fix texture border issue (bug #16697)
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_texstate.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fallback.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex_validate.c | 5 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 08c561e42c..d4f8670818 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -738,7 +738,10 @@ static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit ) } /* Fallback if there's a texture border */ - if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) { + if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 || + ((tObj->Image[0][tObj->BaseLevel]->_BaseFormat == GL_DEPTH_COMPONENT) && + ((tObj->WrapS == GL_CLAMP_TO_BORDER) || + (tObj->WrapT == GL_CLAMP_TO_BORDER)))) { return GL_FALSE; } diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 86464b2ec5..944717024a 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -79,8 +79,11 @@ static GLboolean do_check_fallback(struct brw_context *brw) if (texUnit->_ReallyEnabled) { struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current); struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel]; - if (texImage->Border) - return GL_TRUE; + if (texImage->Border || + ((texImage->_BaseFormat == GL_DEPTH_COMPONENT) && + ((texImage->TexObject->WrapS == GL_CLAMP_TO_BORDER) || + (texImage->TexObject->WrapT == GL_CLAMP_TO_BORDER)))) + return GL_TRUE; } } diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index 775b689da3..7c3a3a0779 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -176,7 +176,10 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, /* Fallback case: */ - if (firstImage->Border) { + if (firstImage->Border || + ((firstImage->_BaseFormat == GL_DEPTH_COMPONENT) && + ((tObj->WrapS == GL_CLAMP_TO_BORDER) || + (tObj->WrapT == GL_CLAMP_TO_BORDER)))) { if (intelObj->mt) { intel_miptree_destroy(intel, intelObj->mt); intelObj->mt = NULL; |