Added mapping of GLSL file extension to shader Type.

This commit is contained in:
Robert Osfield 2017-11-29 12:22:03 +00:00
parent 306275d230
commit 03434b20cf

View File

@ -203,11 +203,15 @@ class ReaderWriterGLSL : public osgDB::ReaderWriter
{
// set type based on filename extension, where possible
if (ext == "frag") shader->setType(osg::Shader::FRAGMENT);
if (ext == "fs") shader->setType(osg::Shader::FRAGMENT);
if (ext == "vert") shader->setType(osg::Shader::VERTEX);
if (ext == "vs") shader->setType(osg::Shader::VERTEX);
if (ext == "geom") shader->setType(osg::Shader::GEOMETRY);
if (ext == "gs") shader->setType(osg::Shader::GEOMETRY);
if (ext == "tctrl") shader->setType(osg::Shader::TESSCONTROL);
if (ext == "teval") shader->setType(osg::Shader::TESSEVALUATION);
if (ext == "compute") shader->setType(osg::Shader::COMPUTE);
if (ext == "cs") shader->setType(osg::Shader::COMPUTE);
}
}
return rr;