r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_buffers.c
index bb85ee577754c107d0ee7802372a5c9c8b711080..35f2dd64909eda10423a0b38f45d42d002301078 100644 (file)
@@ -80,7 +80,10 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
    else {
       ASSERT(span.array->ChanType == GL_FLOAT);
       for (i = 0; i < width; i++) {
-         COPY_4V(span.array->rgba[i], ctx->Color.ClearColor);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][0], ctx->Color.ClearColor[0]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][1], ctx->Color.ClearColor[1]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][2], ctx->Color.ClearColor[2]);
+         CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][3], ctx->Color.ClearColor[3]);
       }
    }
 
@@ -293,18 +296,15 @@ clear_color_buffers(GLcontext *ctx)
 /**
  * Called via the device driver's ctx->Driver.Clear() function if the
  * device driver can't clear one or more of the buffers itself.
- * \param mask  bitfield of BUFER_BIT_* values indicating which renderbuffers
- *              are to be cleared.
+ * \param buffers  bitfield of BUFFER_BIT_* values indicating which
+ *                 renderbuffers are to be cleared.
  * \param all  if GL_TRUE, clear whole buffer, else clear specified region.
  */
 void
-_swrast_Clear(GLcontext *ctx, GLbitfield mask,
-             GLboolean all, GLint x, GLint y, GLint width, GLint height)
+_swrast_Clear(GLcontext *ctx, GLbitfield buffers)
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
 
-   (void) all; (void) x; (void) y; (void) width; (void) height;
-
 #ifdef DEBUG_FOO
    {
       const GLbitfield legalBits =
@@ -319,25 +319,25 @@ _swrast_Clear(GLcontext *ctx, GLbitfield mask,
          BUFFER_BIT_AUX1 |
          BUFFER_BIT_AUX2 |
          BUFFER_BIT_AUX3;
-      assert((mask & (~legalBits)) == 0);
+      assert((buffers & (~legalBits)) == 0);
    }
 #endif
 
    RENDER_START(swrast,ctx);
 
    /* do software clearing here */
-   if (mask) {
-      if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
+   if (buffers) {
+      if (buffers & ctx->DrawBuffer->_ColorDrawBufferMask[0]) {
          clear_color_buffers(ctx);
       }
-      if (mask & BUFFER_BIT_DEPTH) {
+      if (buffers & BUFFER_BIT_DEPTH) {
          _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
       }
-      if (mask & BUFFER_BIT_ACCUM) {
+      if (buffers & BUFFER_BIT_ACCUM) {
          _swrast_clear_accum_buffer(ctx,
                        ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
       }
-      if (mask & BUFFER_BIT_STENCIL) {
+      if (buffers & BUFFER_BIT_STENCIL) {
          _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
       }
    }