From 195df4f811d774286644ccda58c202fb5a8f7b3d Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Tue, 28 Nov 2017 17:39:32 +0100 Subject: [PATCH] numgroup removed but introduce a reto compatibility bug in Program serializer hope nobody use it --- include/osg/Program | 10 ------- src/osg/Program.cpp | 30 +-------------------- src/osgWrappers/serializers/osg/Program.cpp | 28 ------------------- 3 files changed, 1 insertion(+), 67 deletions(-) diff --git a/include/osg/Program b/include/osg/Program index 36aa7ed2f..e9e26829f 100644 --- a/include/osg/Program +++ b/include/osg/Program @@ -103,10 +103,6 @@ class OSG_EXPORT Program : public osg::StateAttribute void setParameter( GLenum pname, GLint value ); GLint getParameter( GLenum pname ) const; - /** Set/get compute shader work groups */ - void setComputeGroups( GLint numGroupsX, GLint numGroupsY, GLint numGroupsZ ); - void getComputeGroups( GLint& numGroupsX, GLint& numGroupsY, GLint& numGroupsZ ) const; - /** Add an attribute location binding. */ void addBindAttribLocation( const std::string& name, GLuint index ); @@ -439,12 +435,6 @@ class OSG_EXPORT Program : public osg::StateAttribute GLint _geometryInputType; GLint _geometryOutputType; - - /** Parameter maintained with glDispatchCompute */ - GLint _numGroupsX; - GLint _numGroupsY; - GLint _numGroupsZ; - /**TransformFeedBack**/ GLenum _feedbackmode; std::vector _feedbackout; diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index f42fe3826..b41d27b81 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -92,8 +92,7 @@ void Program::ProgramBinary::assign(unsigned int size, const unsigned char* data Program::Program() : _geometryVerticesOut(1), _geometryInputType(GL_TRIANGLES), - _geometryOutputType(GL_TRIANGLE_STRIP), - _numGroupsX(0), _numGroupsY(0), _numGroupsZ(0), _feedbackmode(GL_SEPARATE_ATTRIBS) + _geometryOutputType(GL_TRIANGLE_STRIP), _feedbackmode(GL_SEPARATE_ATTRIBS) { } @@ -133,10 +132,6 @@ Program::Program(const Program& rhs, const osg::CopyOp& copyop): _geometryInputType = rhs._geometryInputType; _geometryOutputType = rhs._geometryOutputType; - _numGroupsX = rhs._numGroupsX; - _numGroupsY = rhs._numGroupsY; - _numGroupsZ = rhs._numGroupsZ; - _feedbackmode=rhs._feedbackmode; _feedbackout=rhs._feedbackout; } @@ -173,15 +168,6 @@ int Program::compare(const osg::StateAttribute& sa) const if( _geometryOutputType < rhs._geometryOutputType ) return -1; if( rhs._geometryOutputType < _geometryOutputType ) return 1; - if( _numGroupsX < rhs._numGroupsX ) return -1; - if( rhs._numGroupsX < _numGroupsX ) return 1; - - if( _numGroupsY < rhs._numGroupsY ) return -1; - if( rhs._numGroupsY < _numGroupsY ) return 1; - - if( _numGroupsZ < rhs._numGroupsZ ) return -1; - if( rhs._numGroupsZ < _numGroupsZ ) return 1; - if(_feedbackout0 && numY>0 && numZ>0; -} - -static bool readComputeGroups( osgDB::InputStream& is, osg::Program& attr ) -{ - GLint numX = 0, numY = 0, numZ = 0; - is >> numX >> numY >> numZ; - attr.setComputeGroups( numX, numY, numZ ); - return true; -} - -static bool writeComputeGroups( osgDB::OutputStream& os, const osg::Program& attr ) -{ - GLint numX = 0, numY = 0, numZ = 0; - attr.getComputeGroups( numX, numY, numZ ); - os << numX << numY << numZ << std::endl; - return true; -} static bool checkBindUniformBlock( const osg::Program& node ) { @@ -190,11 +167,6 @@ REGISTER_OBJECT_WRAPPER( Program, ADD_USER_SERIALIZER( GeometryInputType ); // _geometryInputType ADD_USER_SERIALIZER( GeometryOutputType ); // _geometryOutputType - { - UPDATE_TO_VERSION_SCOPED( 95 ) - ADD_USER_SERIALIZER( ComputeGroups ); // _numGroupsX/Y/Z - } - { UPDATE_TO_VERSION_SCOPED( 116 ) ADD_USER_SERIALIZER( FeedBackVaryingsName );