I forgot to mention about two more important things :

1.
Textures may be bound as "image units" using bindImageToUnit() method
  ( "image unit" is defined in ARB_shader_image_load_store. 
   Do not mistake it with osg::Image ).
  In current implementation the "image unit" binding function is 
  called only when texture parameters are dirty ( function glBindImageTexture()
  is called in osg::Texture::applyTexParameters() ).
  The problem arises when two different textures use the same "image unit",
  because when the second one is called and the texture parameters were not 
dirty,
  then "image unit binding" points to previously bounded texture ( that is not
  bound anymore, because glBindTexture() for current texture was called ). 
  As a result - the shader that uses imageLoad()/imageStore()/imageAtomic*()
  functions does not work ( and it does not report errors on current drivers ).
  For me it looks like glBindImageTexture() should be called for particular
  texture always when glBindTexture() is called. Or maybe "image unit binding"
  should be implemented as osg::StateAttribute ? 
  As for now I call dirtyTextureParams() each frame on each osg::TextureBuffer
  that uses bindImageToUnit() method.

2.
I implemented glMemoryBarrier() as a osg::Drawable::DrawCallback for now,
  but glMemoryBarrier() shouldn't be implemented this way. I am not able 
  to predict all possible situations and contexts in which glMemoryBarrier() 
  should be called. Should it be another osg::StateAttribute ? Or maybe
  special kind of osg::Drawable descendant ? Or maybe just a osg::Program
  method that calls glMemoryProgram() while binding it ?

-- 
Pawel Ksiezopolski

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58202#58202





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to