From c0a276e85023927cd056a28a028523ff709b8492 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 29 Nov 2017 10:11:35 +0000 Subject: [PATCH] Added back in serializer support for comput dispatch groups to retain backwards compatibility. --- src/osgWrappers/serializers/osg/Program.cpp | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/osgWrappers/serializers/osg/Program.cpp b/src/osgWrappers/serializers/osg/Program.cpp index 13195c87d..74e0342c3 100644 --- a/src/osgWrappers/serializers/osg/Program.cpp +++ b/src/osgWrappers/serializers/osg/Program.cpp @@ -121,6 +121,25 @@ static bool writeFeedBackMode( osgDB::OutputStream& os, const osg::Program& attr os << attr.getTransformFeedBackMode()<< std::endl; return true; } +// _numGroupsX/Y/Z +static bool checkComputeGroups( const osg::Program& attr ) +{ + return false; +} + +static bool readComputeGroups( osgDB::InputStream& is, osg::Program& attr ) +{ + GLint numX = 0, numY = 0, numZ = 0; + is >> numX >> numY >> numZ; + return true; +} + +static bool writeComputeGroups( osgDB::OutputStream& os, const osg::Program& attr ) +{ + GLint numX = 0, numY = 0, numZ = 0; + os << numX << numY << numZ << std::endl; + return true; +} static bool checkBindUniformBlock( const osg::Program& node ) { @@ -167,6 +186,16 @@ 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( 153 ) + REMOVE_SERIALIZER( ComputeGroups ); + } + { UPDATE_TO_VERSION_SCOPED( 116 ) ADD_USER_SERIALIZER( FeedBackVaryingsName );