Ian Romanick wrote:
> On Thu, 2009-01-29 at 08:27 -0800, Brian Paul wrote:
>> Module: Mesa
>> Branch: master
>> Commit: 2897cee99fb877e1f3cd9a881a61418c9c31867f
>> URL:    
>> http://cgit.freedesktop.org/mesa/mesa/commit/?id=2897cee99fb877e1f3cd9a881a61418c9c31867f
>>
>> Author: Brian Paul <[email protected]>
>> Date:   Thu Jan 29 09:20:18 2009 -0700
>>
>> mesa: fix a render to texture FBO validation bug
>>
>> When glTexImage() is called we need to re-validate any FBOs that point to
>> the texture (i.e. render-to-texture) since changing the texture's size/format
>> will effect FBO completeness.
> 
> If only fundamental attributes (like size or format) of GL objects were
> immutable... sigh...
> 
>> We don't keep a list of all FBOs rendering into each texture (which would be
>> a bit messy) so we check all FBOs in existance.  To optimize this, the
>> gl_texture_object->_RenderToTexture flag is used to avoid checking textures
>> that have never been used as renderbuffers.  So, we only walk over all FBOs
>> (there's usually only a few) when glTexImage() modifies a RTT texture.
> 
> How difficult would it be to change this to a count?  Increment the
> count each time the texture is attached to an FBO, and decrement it when
> the texture is detached.  With just a flag, a texture that was once
> attached to an FBO but no longer is will trigger the revalidation.

I considered using a counter, but it would be a bit more work to make 
sure it's incremented/decremented correctly at all the right places.  I 
don't have time right now to dig into that.

I think the flag is OK in general.  My hunch is that after a texture has 
  been rendered to, it'll be uncommon for the teximage to be frequently 
replaced with glTexImage().

Note that glTex[Copy]SubImage() does not need to trigger FBO 
re-validation since those calls can't change the texture format/size.

-Brian

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to