Renamed osg::ComputeDispatch to osg::DispatchCompute to make sure the nameing between GL and OSG is consistent i.e glDispatchCompute -> osg::DispatchCompute

Updated AUTHORS.txt, NEWS.txt and README.txt for CMakeLists.txt for 3.6.0 release
This commit is contained in:
Robert Osfield
2018-04-07 17:59:55 +01:00
parent 7c7a904315
commit 7ab1208c65
10 changed files with 99 additions and 90 deletions

View File

@@ -10,7 +10,7 @@
#include <osg/StateAttributeCallback>
#include <osg/Texture2D>
#include <osg/Geometry>
#include <osg/ComputeDispatch>
#include <osg/DispatchCompute>
#include <osgDB/ReadFile>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
@@ -167,7 +167,7 @@ class ComputeNode : public osg::PositionAttitudeTransform
public:
osg::ref_ptr<osg::ComputeDispatch> _computeDispatch;
osg::ref_ptr<osg::DispatchCompute> _DispatchCompute;
osg::ref_ptr<osg::Program> _computeProgram;
osg::ref_ptr<osg::Shader> _computeShader; //compute and write position data in SSBO
@@ -205,8 +205,8 @@ public:
_vertexShaderSourcePath = "shaders/osgssboVertexShader.vs";
_geometryShaderSourcePath = "shaders/osgssboGeometryShader.gs";
_fragmentShaderSourcePath = "shaders/osgssboFragmentShader.fs";
_computeDispatch=new osg::ComputeDispatch();
addChild(_computeDispatch);
_DispatchCompute=new osg::DispatchCompute();
addChild(_DispatchCompute);
}
};
@@ -625,7 +625,7 @@ void ComputeNode::initComputingSetup()
{
_computeProgram = new osg::Program;
_computeDispatch->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
_DispatchCompute->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
_computeShader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath);
_computeProgram->addShader(_computeShader.get());

View File

@@ -21,7 +21,7 @@
#include <osg/Texture2D>
#include <osg/BindImageTexture>
#include <osg/ComputeDispatch>
#include <osg/DispatchCompute>
#include <osg/Geode>
#include <osgDB/ReadFile>
#include <osgGA/StateSetManipulator>
@@ -65,7 +65,7 @@ int main( int argc, char** argv )
// Create a node for outputting to the texture.
// It is OK to have just an empty node here, but seems inbuilt uniforms like osg_FrameTime won't work then.
// TODO: maybe we can have a custom drawable which also will implement glMemoryBarrier?
osg::ref_ptr<osg::Node> sourceNode = new osg::ComputeDispatch(512/16, 512/16, 1 );
osg::ref_ptr<osg::Node> sourceNode = new osg::DispatchCompute(512/16, 512/16, 1 );
sourceNode->setDataVariance( osg::Object::DYNAMIC );
sourceNode->getOrCreateStateSet()->setAttributeAndModes( computeProg.get() );
sourceNode->getOrCreateStateSet()->addUniform( new osg::Uniform("targetTex", (int)0) );