On Sun, 18 Dec 2011 20:08:21 -0700, Brian Paul <[email protected]> wrote: > Stop using deprecated renderbuffer PutRow() function. Note that we > aren't using Map/UnmapRenderbuffer() yet because this call is inside > a swrast_render_start/finish() pair. > --- > src/mesa/swrast/s_drawpix.c | 64 > ++++++++++++++++++++++++++++++++----------- > 1 files changed, 48 insertions(+), 16 deletions(-) > > diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c > index 4a661a0..19b43f6 100644 > --- a/src/mesa/swrast/s_drawpix.c > +++ b/src/mesa/swrast/s_drawpix.c > @@ -551,6 +551,49 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint > y, > > > /** > + * Draw depth+stencil values into a MESA_FORAMT_Z24_S8 or MESA_FORMAT_S8_Z24 > + * renderbuffer. No masking, zooming, scaling, etc. > + */ > +static void > +fast_draw_depth_stencil(struct gl_context *ctx, GLint x, GLint y, > + GLsizei width, GLsizei height, > + const struct gl_pixelstore_attrib *unpack, > + const GLvoid *pixels) > +{
> + for (i = 0; i < height; i++) {
> + if (rb->Format == MESA_FORMAT_Z24_S8) {
> + memcpy(dst, src, width * 4);
> + }
> + else {
> + /* swap Z24_S8 -> S8_Z24 */
> + GLuint j, *dst4 = (GLuint *) dst, *src4 = (GLuint *) src;
> + for (j = 0; j < width; j++) {
> + dst4[j] = (src4[j] << 24) | (src4[j] >> 8);
> + }
> + }
Reuse _mesa_pack_uint_24_8_depth_stencil_row() here? Other than that,
looks good. Patch 15 is also
Reviewed-by: Eric Anholt <[email protected]>
pgpArI4FOfE9T.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
