[Mesa-dev] [PATCH 04/24] intel: Use MapRenderbuffer in spans setup.
Chad Versace
chad at chad-versace.us
Fri Oct 28 16:58:59 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch will break depthstencil renderbuffers on gen7. Comments below.
On 10/28/2011 12:49 PM, Eric Anholt wrote:
> ---
> src/mesa/drivers/dri/intel/intel_span.c | 33 +++++++++---------------------
> 1 files changed, 10 insertions(+), 23 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
> index bdc4a0e..ecccd30 100644
> --- a/src/mesa/drivers/dri/intel/intel_span.c
> +++ b/src/mesa/drivers/dri/intel/intel_span.c
> @@ -221,7 +221,10 @@ intel_offset_S8(uint32_t stride, uint32_t x, uint32_t y)
> void
> intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
> {
> + struct gl_context *ctx = &intel->ctx;
> struct intel_renderbuffer *irb = intel_renderbuffer(rb);
> + GLubyte *map;
> + int stride;
>
> if (!irb)
> return;
> @@ -231,25 +234,11 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
> if (irb->wrapped_depth)
> intel_renderbuffer_map(intel, irb->wrapped_depth);
> if (irb->wrapped_stencil)
> intel_renderbuffer_map(intel, irb->wrapped_stencil);
Here we map the real depth and stencil renderbuffers individually.
[snip]
> + ctx->Driver.MapRenderbuffer(ctx, rb, 0, 0, rb->Width, rb->Height,
> + GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
> + &map, &stride);
> + rb->Data = map;
And here, the mappings done above are ignored and we set rb->Data = NULL.
To avoid regressing gen7, we need to copy the s8 bits in
irb->wrapped_stencil->Data into irb->wrapped_depth->Data, then unmap
irb->wrapped_stencil and set rb->Data = irb->wrapped_depth->Data.
- --
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJOq0HCAAoJEAIvNt057x8iRcgP/2MO6cCyqO4DJmireTzUF+s/
3bb5psTo5KcPLGJAWj5ILRUQ38XVP6zyNYvBwSjYFa5BgY4He/rudsPNVyd+l12u
LSmn7910wvWIwdLRr0XlGBfnXh29yOhaC+mou7Km3uuiBL8hPrwUvU6P/RSO/FPv
YpeNMJlYvmr2OUWaWNG388s0EDwbvn9B/uDJZu1VUbyJiXBdZgB4CyYH1RExJ93O
2BI4DyzzicgxSXdHO+nDh3LI/8GP+30DqNZP6tpXNm/oRC/3tEPyNfiZzNemS64E
qnIPsQwfX84W/BAp9DbrVmWR7Ikylvp44IeVih62DuiqX3KV5aUteZHRriSCcgbJ
xiUKaPR0M99Dm3Rflg1qlcKXqQZs0oEVkCBD/UzANXFNSembgC9Lk/5E1ovUMFST
9nveKeytP06xVvvYbUJS0tw6TNoNAjwlGZEPn6C9KSXW4nclCXJrwaVP6UbdHULe
l2U+3Vyl32Mrh14SziblKGk4JpcyYijRzG8jQbh34xEMjz22tjAF4ipC2ld6k9v3
A3nY2J4gF7fi9sZHuBRXqMNh0UpD/abKnHp0N7HW8fRL7gTGgvWCtsliQnNMgN4f
niIaAb9dMBxDMKBkrrgxB4NGZZHxD0bQmI+PzdHQw9F56iLYIk4PARZesYwmICss
ydwp/fqevXzfqyf0IA84
=TeYG
-----END PGP SIGNATURE-----
More information about the mesa-dev
mailing list