Hi Mikhail,

Thanks for the close observation.  I made a mistake when amending the
code and left in the  && !textureObjectValid(state) that should have
removed.   This code was there as part of interim development that I
decided not to follow up.

Could you do an svn update and check again.

Cheers,
Robert.

On Fri, Dec 3, 2010 at 2:45 PM, Mikhail I. Izmestev
<[email protected]> wrote:
> 03.12.2010 17:22, Robert Osfield wrote:
>>
>> Hi Thomas,
>>
>>> I'm not sure of what form this method needs to take yet.. will do some
>>> further thinking on the topic.
>>
>> I have settled upon a new SubloadCallback method:
>>
>>         class OSG_EXPORT SubloadCallback : public Referenced
>>         {
>>             public:
>>
>>                 virtual bool textureObjectValid(const Texture2D&
>> texture, State&  state) const
>>                 {
>>                     return texture.textureObjectValid(state);
>>                 }
>>
>>                ...
>>
>>         };
>>
>> And a new Texture2D helper method,
>> Texture2D::textureObjectValid(State&) that can be used by the
>> SubloadCallback as above with the default implementation, or by
>> osg::Texture2D::apply() itself to tell whether any modifications to
>> the Texture2D's Image will mean that the TextureObject needs
>> discarding and a new one to be created.
>
> Your latest changes caused very often call of computeInternalFormat,
> computeRequiredTextureDimensions and textureObject->match methods.
> In previous code this methods called only when getModifiedCount(contextID)
> != _image->getModifiedCount().
>
> Maybe would be better something like that:
> Index: src/osg/Texture2D.cpp
> ===================================================================
> --- src/osg/Texture2D.cpp       (revision 11982)
> +++ src/osg/Texture2D.cpp       (working copy)
> @@ -160,7 +160,7 @@
>
>     // get the texture object for the current contextID.
>     TextureObject* textureObject = getTextureObject(contextID);
> -    if (textureObject && !textureObjectValid(state))
> +    if (textureObject)
>     {
>         bool textureObjectInvalidated = false;
>         if (_subloadCallback.valid())
>
>
> Mikhail.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to