[Mesa-dev] [PATCH 6/6] intel: Detile stencil buffer only if necessary

Eric Anholt eric at anholt.net
Tue Nov 15 18:16:12 PST 2011

On Sun, 13 Nov 2011 22:32:15 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> In intel_map_renderbuffer_s8(), detile and copy the stencil buffer into
> the temporary buffer only if the renderbuffer is mapped in read mode. If
> the caller never going to read the bits but just clobber them, then it's
> wasted effort to detile the stencil buffer.
> CC: Eric Anholt <eric at anholt.net>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>

I don't think this is correct.

Imagine something that isn't writing all of the pixels, but definitely
isn't reading data before writing.  It might sensibly ask for
GL_WRITE_BIT but not GL_READ_BIT, and then all the pixels it doesn't
write get trashed when the whole rectangle is written back out.

If the mode contained GL_MAP_INVALIDATE_RANGE_BIT (basically,
interpreting the mode argument like GL_ARB_map_buffer_range, which was
my intent if not Brian's), this would be reasonable.
-------------- 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/20111115/6e6cff20/attachment.pgp>

More information about the mesa-dev mailing list