[Mesa-dev] [PATCH 2/3] swrast: rewrite color buffer clearing to use Map/UnmapRenderbuffer()

Eric Anholt eric at anholt.net
Mon Dec 12 09:38:32 PST 2011


On Sat, 10 Dec 2011 12:00:53 -0700, Brian Paul <brianp at vmware.com> wrote:
> -   /* Note that masking will change the color values, but only the
> -    * channels for which the write mask is GL_FALSE.  The channels
> -    * which which are write-enabled won't get modified.
> -    */
> -   for (i = 0; i < height; i++) {
> -      span.x = x;
> -      span.y = y + i;
> -      _swrast_mask_rgba_span(ctx, rb, &span, buf);
> -      /* write masked row */
> -      rb->PutRow(ctx, rb, width, x, y + i, span.array->rgba, NULL);
> +   if (doMasking) {
> +      /* Convert the boolean mask to a color */

I think this would be more informative as

/* Convert the boolean mask to a color value that will be packed to
 * produce the bitmask for the renderbuffer's format.
 */

but overall, this looks like a pretty nice (if tricky) way to handle all
these formats.  Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111212/071a23e9/attachment.pgp>


More information about the mesa-dev mailing list