[Mesa-dev] [PATCH 01/17] swrast: Directly map the stencil buffer in read_stencil_pixels.

Brian Paul brianp at vmware.com
Tue Nov 1 17:54:41 PDT 2011


On 11/01/2011 05:17 PM, Eric Anholt wrote:
> This avoids going through the wrapper that has to rewrite the data for
> packed depth/stencil.  This isn't done in _swrast_read_stencil_span
> because we don't want to map/unmap for each span.
>
> v2: Move the unpack code to format_unpack.c.
> ---
>   src/mesa/main/format_unpack.c |   58 +++++++++++++++++++++++++++++++++++++++++
>   src/mesa/main/format_unpack.h |    4 +++
>   src/mesa/swrast/s_readpix.c   |   16 ++++++++---
>   3 files changed, 74 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
> index fbda031..6295238 100644
> --- a/src/mesa/main/format_unpack.c
> +++ b/src/mesa/main/format_unpack.c
> @@ -1480,4 +1480,62 @@ _mesa_unpack_uint_z_row(gl_format format, GLuint n,
>      }
>   }
>
> +static void
> +unpack_ubyte_s_S8(const void *src, GLubyte *dst, GLuint n)
> +{
> +   memcpy(dst, src, n);
> +}
>
> +static void
> +unpack_ubyte_s_Z24_S8(const void *src, GLubyte *dst, GLuint n)
> +{
> +   int i;
> +   const GLuint *src32 = src;
> +
> +   for (i = 0; i<  n; i++)
> +      dst[i] = src32[i]&  0xff;
> +}

I know you hate this kind of thing, but I think MSVC is going to 
complain about comparisons between signed and unsigned types in the i 
< n expression because 'i' is int and not GLuint like 'n'.

Same thing in patch 02/17.

-Brian


More information about the mesa-dev mailing list