summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-12-01 00:15:41 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-12-01 00:15:41 +0000
commit31e739a18931fa48454f172818245b0927c8910f (patch)
treebc728bd645e0cecc17a0cc9a2df4031e6357f90f /src/mesa/swrast/s_span.c
parent94ae2b4f25ba142da6b7c16a376156473f0d43e7 (diff)
get depthBits from the current drawbuffer
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 1cf743ae483..681d4eba11c 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -58,7 +58,7 @@ void
_swrast_span_default_z( GLcontext *ctx, struct sw_span *span )
{
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
- if (ctx->Visual.depthBits <= 16)
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F);
else
span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F);
@@ -311,7 +311,7 @@ _swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span )
ASSERT((span->interpMask & SPAN_Z) &&
!(span->arrayMask & SPAN_Z));
- if (ctx->Visual.depthBits <= 16) {
+ if (ctx->DrawBuffer->Visual.depthBits <= 16) {
GLfixed zval = span->z;
GLuint *z = span->array->z;
for (i = 0; i < n; i++) {
@@ -803,7 +803,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
}
/* Depth bounds test */
- if (ctx->Depth.BoundsTest && ctx->Visual.depthBits > 0) {
+ if (ctx->Depth.BoundsTest && ctx->DrawBuffer->Visual.depthBits > 0) {
if (!_swrast_depth_bounds_test(ctx, span)) {
return;
}