[Mesa-dev] [PATCH 2/4] st/mesa: implement AllocTextureImageBuffer() driver hook

Eric Anholt eric at anholt.net
Thu Sep 29 23:55:14 PDT 2011


On Thu, 29 Sep 2011 20:54:42 -0600, Brian Paul <brianp at vmware.com> wrote:
> On 09/29/2011 08:37 PM, Eric Anholt wrote:
> > On Thu, 29 Sep 2011 14:24:46 -0600, Brian Paul<brian.e.paul at gmail.com>  wrote:
> >> From: Brian Paul<brianp at vmware.com>
> >>
> >> This hasn't been needed so far since none of the core Mesa code paths
> >> that call ctx->Driver.AllocTextureImageBuffer() are used with the
> >> state tracker.  That will change in upcoming patches.
> >> Note that this function duplicates some code seen in the st_TexImage()
> >> function.  That can be cleaned up later.
> >
> > I'll note that I found it useful within our driver to have
> > AllocTextureImageBuffer succeed even if there was data that hadn't been
> > Free()d.
> >
> > If in general Alloc just freed existing memory (or reused it if it was
> > well-sized already), we wouldn't need to be so careful about
> > FreeTextureImageBuffer()ing in mipmap gen or teximage.  Just a thought.
> 
> I'd rather leave it as-is for now.  I'll revisit this in the future, 
> no doubt.
> 
> BTW, one thing I have in the back of my mind is to someday try to 
> remove the Alloc/FreeTextureImageBuffer() hooks and instead use a 
> (de)allocator system based on complete mipmaps (see 
> GL_EXT_texture_storage).  I have a patch for that extension that I'm 
> sitting on until after the current batch of changes is finished.

I'm very interested!
-------------- 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/20110929/3a7de4de/attachment.pgp>


More information about the mesa-dev mailing list