On Sat,  3 Dec 2011 10:07:36 -0700, Brian Paul <bri...@vmware.com> wrote:
> Implemented in terms of renderbuffer mapping/unmapping and format
> packing/unpacking functions.
> 
> The swrast and state tracker code for implementing accumulation are
> unused and will be removed in the next commit.

> +   ctx->Driver.MapRenderbuffer(ctx, accRb, x, y, width, height,
> +                               GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
> +                               &accMap, &accRowStride);
> +
> +   if (!accMap) {
> +      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
> +      return;
> +   }
> +
> +   if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) {
> +      const GLshort clearR = FLOAT_TO_SHORT(ctx->Accum.ClearColor[0]);
> +      const GLshort clearG = FLOAT_TO_SHORT(ctx->Accum.ClearColor[1]);
> +      const GLshort clearB = FLOAT_TO_SHORT(ctx->Accum.ClearColor[2]);
> +      const GLshort clearA = FLOAT_TO_SHORT(ctx->Accum.ClearColor[3]);
> +      GLshort *firstRow = (GLshort *) accMap;
> +      GLuint i, j;

> +      /* and memcpy the first row to the other rows to clear them */
> +      for (j = 1; j < height; j++) {
> +         memcpy(accMap, firstRow, 4 * width * sizeof(GLshort));
> +         accMap += accRowStride;
> +      }

memcpy out of a renderbuffer mapping is likely to be worst-case
performance for a GPU driver.  Could we get a temporary instead?

Also, looks like we have no testing of accum in piglit at all.

Attachment: pgp9TO87Ywggp.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to