update some tests for visual bit depths to use renderbuffers
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 25 Apr 2006 22:55:19 +0000 (22:55 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 25 Apr 2006 22:55:19 +0000 (22:55 +0000)
src/mesa/swrast/s_buffers.c
src/mesa/swrast/s_triangle.c

index 9dace65860ad06d3a07963df797fc623598534d4..57f23ee829b3f7558ac82aca865dc14cf543a41d 100644 (file)
@@ -169,8 +169,8 @@ clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
 
    ASSERT(!ctx->Visual.rgbMode);
 
-   ASSERT((ctx->Color.IndexMask & ((1 << ctx->Visual.indexBits) - 1))
-          == (GLuint) ((1 << ctx->Visual.indexBits) - 1));
+   ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1))
+          == (GLuint) ((1 << rb->IndexBits) - 1));
 
    ASSERT(rb->PutMonoRow);
 
@@ -221,7 +221,8 @@ clear_color_buffers(GLcontext *ctx)
       }
    }
    else {
-      const GLuint indexBits = (1 << ctx->Visual.indexBits) - 1;
+      struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+      const GLuint indexBits = (1 << rb->IndexBits) - 1;
       if ((ctx->Color.IndexMask & indexBits) == indexBits) {
          masking = GL_FALSE;
       }
index f27037234592b8187c0d9499933bfea5d70de2e3..a1cbd881a73e9fd15f949d8b4a925900a0678878 100644 (file)
@@ -914,7 +914,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span,
       return;                                                          \
    }
 #define RENDER_SPAN( span )                                            \
-   if (ctx->Visual.depthBits <= 16) {                                  \
+   if (rb->DepthBits <= 16) {                                          \
       GLuint i;                                                                \
       const GLushort *zRow = (const GLushort *)                                \
          rb->GetPointer(ctx, rb, span.x, span.y);                      \
@@ -1110,7 +1110,7 @@ _swrast_choose_triangle( GLcontext *ctx )
                        && ctx->Depth.Mask == GL_TRUE)
                       || swrast->_RasterMask == TEXTURE_BIT)
                   && ctx->Polygon.StippleFlag == GL_FALSE
-                   && ctx->Visual.depthBits <= 16) {
+                   && ctx->DrawBuffer->Visual.depthBits <= 16) {
                  if (swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)) {
                     USE(simple_z_textured_triangle);
                  }