[Mesa-dev] [PATCH] meta: rework dest image allocation in mipmap generation code

Eric Anholt eric at anholt.net
Thu Dec 15 08:03:29 PST 2011


On Wed, 14 Dec 2011 14:38:52 -0700, Brian Paul <brianp at vmware.com> wrote:
> On 12/14/2011 02:13 PM, Eric Anholt wrote:
> > On Tue, 13 Dec 2011 18:07:05 -0700, Brian Paul<brian.e.paul at gmail.com>  wrote:
> >> From: Brian Paul<brianp at vmware.com>
> >>
> >> This fixes two things:
> >> 1. If the texture object was created with glTexStorage2D, the call
> >>     to _mesa_TexImage2D() would generate INVALID_OPERATION since the
> >>     texture is marked as immutable.
> >> 2. _mesa_TexImage2D() always frees any existing texture image memory
> >>     before allocating new memory.  That's inefficient since the existing
> >>     image is usually the right size already.  Now we only make the call
> >>     when necessary.
> >>
> >> v2: use _mesa_TexImage() in prepare_dest_image() to make sure side-effects
> >> of changing a texture image are observed (like FBO completeness).
> >
> > Should this live in main/mipmap.c?  It looks like
> > generate_mipmap_uncompressed() needs it.
> 
> I think the broader question is are we updating fbo completeness when 
> we change any texture image by mipmap generation, right?
> 
> We're probably missing that in a few places.
> 
> How about I look into that after this meta fix?  R-b?

If you put the function in main/mipmap.c where you're about to move it
to when you look at it after the meta fix :)
-------------- 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/20111215/9ba3b769/attachment.pgp>


More information about the mesa-dev mailing list