[Mesa-dev] [PATCH 4/4] intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
Eric Anholt
eric at anholt.net
Mon Jun 13 09:55:57 PDT 2011
On Sun, 12 Jun 2011 22:36:04 -0700, Chad Versace <chad at chad-versace.us> wrote:
> On Tue, 7 Jun 2011 11:47:14 -0700, Eric Anholt <eric at anholt.net> wrote:
> > We were mapping the renderbuffer once, then walking over all the
> > buffers to map just the texture ones using the other texture mapping
> > function that handled the x/y offset to the image in the region. But
> > then we would go and overwrite *those* mappings with the original
> > mappings for depth/stencil, which was wrong.
> >
> > Instead, just walk over the attachments once and map the attachments.
> > Wasn't that easy?
> > ---
> > src/mesa/drivers/dri/intel/intel_span.c | 87 ++++++++----------------------
> > 1 files changed, 23 insertions(+), 64 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
> > index 8978129..92a7586 100644
> > --- a/src/mesa/drivers/dri/intel/intel_span.c
> > +++ b/src/mesa/drivers/dri/intel/intel_span.c
> > @@ -239,9 +200,8 @@ intelSpanRenderStart(struct gl_context * ctx)
> > }
> > }
> >
> > - intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_TRUE);
> > - if (ctx->ReadBuffer != ctx->DrawBuffer)
> > - intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_TRUE);
> > + intel_framebuffer_map(intel, ctx->DrawBuffer);
> > + intel_framebuffer_map(intel, ctx->ReadBuffer);
> > }
>
> I think this hunk should be:
>
> @@ -239,9 +200,8 @@ intelSpanRenderStart(struct gl_context * ctx)
> }
> }
>
> - intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_TRUE);
> + intel_framebuffer_map(intel, ctx->DrawBuffer);
> - if (ctx->ReadBuffer != ctx->DrawBuffer)
> - intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_TRUE);
> + intel_framebuffer_map(intel, ctx->ReadBuffer);
> }
>
> There's no reason to re-map the read buffer if we've already done so.
Nice catch. I like it.
-------------- 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/20110613/c9861a09/attachment.pgp>
More information about the mesa-dev
mailing list