[osg-submissions] SharedStateManager updated for all DataVariance modes
Terry Welsh
mogumbo at gmail.com
Tue Jul 1 17:01:10 PDT 2008
It sounded like nobody was opposed to this update, so here is the
code. I didn't change the value of SHARE_ALL for the sake of backward
compatibility even though it probably should be different. I still
consider that possibility open for discussion.
Per Robert's suggestion, the default share mode was SHARE_TEXTURES and
is now SHARE_STATIC_TEXTURES | SHARE_UNSPECIFIED_TEXTURES. I'm not
sure why textures were the default share mode instead of StateSets.
Maybe the original author will comment on that? I kept SHARE_TEXTURES
equal to SHARE_STATIC_TEXTURES for backward compatibility, and did the
same for StateSets.
After doing this I think SharedStateManager could be expanded a lot,
but I don't know how much it would help performance. For example, you
could share individual StateAttributes instead of whole StateSets.
More specifically, a StateSet is not equal to another StateSet if only
its texture is different. Seems like there would be a lot of
opportunities in typical OSG usage to share most attributes in
StateSets that only differ by their texture.
- Terry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SharedStateManager.tar.gz
Type: application/x-gzip
Size: 3287 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080701/60760945/attachment.bin>
More information about the osg-submissions
mailing list