Hello David and Daniel,

David Kabala wrote:
> ---------- Forwarded message ----------
> From: *Daniel Guilliams* <dani...@iastate.edu <mailto:dani...@iastate.edu>>
> Date: Wed, Jun 2, 2010 at 1:44 PM
> Subject: Fwd: OSGSharePtrGraphOp patch
> To: dkab...@iastate.edu <mailto:dkab...@iastate.edu>
> 
> -------- Original Message --------
> Subject:      OSGSharePtrGraphOp patch
> Date:         Tue, 25 May 2010 15:21:53 -0500
> From:         Daniel Guilliams <dani...@iastate.edu> 
> <mailto:dani...@iastate.edu>
> To:   opensg-users@lists.sourceforge.net 
> <mailto:opensg-users@lists.sourceforge.net>

hm, I've not seen this message show up on the list, apologies if I 
missed it.

> There was an issue in OSGSharePtrGraphOp.cpp, in the function shareFC(). 
> The editField() function was being called for all single non-pointer 
> fields, which caused them to be added to the changed list, thus calling 
> their changed() functions for those fields.
> 
> This was causing undesirable behavior in some cases. (in my instance, 
> ContribCgFXMaterial's effectString field was being shown as changed, 
> even though it wasn't.  This meant the whole material was 
> re-initialized, which un-did all of the manual parameter setting I had 
> done to it.)
 >
> The patch is attatched.  It simply skips all non-pointer fields.

thanks! I've committed the patch, r2433.
While the patch makes sense in and of itself, I think the CgFXMaterial 
is buggy if it looses parameters when the effect string is changed. 
Looking at the code a bit there are a some things that don't look quite 
right to me: CgFXMaterial::changed calls resolveLinks() when the effect 
string is changed. ResolveLinks() is meant to be called by the system 
when a container's ref count drops to zero so that it gives up all 
references to other containers. On side effect of calling it the way 
CgFXMaterial does is that all attachments get removed ;(
A second problem is that processEffectString() seems to be intended to 
be called at most once, otherwise a CGContext is leaked.

So while the patch may help with Daniel's problem, there may be 
additional problems down the road and the CgFXMaterial could use a 
little TLC; I'm not sure when I'll be able to take a look at it, but 
perhaps someone feels motivated ;)

        Cheers,
                Carsten


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to