summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915/i915_texstate.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-10-10 15:26:28 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-10-10 15:26:28 +0100
commit3a3801c1431203fc4dca24d56577995ae2e78956 (patch)
tree7ec341b78ecc62dc1a238392aff828c363148d69 /src/mesa/drivers/dri/i915/i915_texstate.c
parentd7f1cb5b5a134b63227d5746a2dd1f05597c5c2f (diff)
parent7216679c1998b49ff5b08e6b43f8d5779415bf54 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/glapi/descrip.mms src/mesa/shader/grammar/descrip.mms
Diffstat (limited to 'src/mesa/drivers/dri/i915/i915_texstate.c')
-rw-r--r--src/mesa/drivers/dri/i915/i915_texstate.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index ae42b102db..d1b0dcdf31 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -307,10 +307,21 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
}
- state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
- tObj->_BorderChan[1],
- tObj->_BorderChan[2],
- tObj->_BorderChan[3]);
+ if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) {
+ /* GL specs that border color for depth textures is taken from the
+ * R channel, while the hardware uses A. Spam R into all the channels
+ * for safety.
+ */
+ state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
+ tObj->_BorderChan[0],
+ tObj->_BorderChan[0],
+ tObj->_BorderChan[0]);
+ } else {
+ state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0],
+ tObj->_BorderChan[1],
+ tObj->_BorderChan[2],
+ tObj->_BorderChan[3]);
+ }
I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE);