Commit a5244b32 authored by Janis Born's avatar Janis Born
Browse files

also load geometry shaders (.gsh) with ShaderProgramControlAutoFiles

parent 0be9b454
......@@ -22,6 +22,8 @@ SharedShader ShaderControlFile::create(void)
if(extension == "vsh")
mType = GL_VERTEX_SHADER;
else if(extension == "gsh")
mType = GL_GEOMETRY_SHADER;
else if(extension == "fsh")
mType = GL_FRAGMENT_SHADER;
else
......
......@@ -18,6 +18,8 @@ SharedShaderProgram ShaderProgramControlAutoFiles::create(void)
SharedShaderProgram shaderProgram(new ShaderProgram());
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".vsh").type(GL_VERTEX_SHADER)))
shaderProgram->attachShader(shader);
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".gsh").type(GL_GEOMETRY_SHADER)))
shaderProgram->attachShader(shader);
if(ConstSharedShader shader = ShaderFileManager::the()->get(ShaderControlFile(mFilename + ".fsh").type(GL_FRAGMENT_SHADER)))
shaderProgram->attachShader(shader);
......@@ -35,6 +37,7 @@ bool ShaderProgramControlAutoFiles::update(SharedShaderProgram& shaderProgram)
{
bool update = false;
update |= ShaderFileManager::the()->update(mFilename + ".vsh");
update |= ShaderFileManager::the()->update(mFilename + ".gsh");
update |= ShaderFileManager::the()->update(mFilename + ".fsh");
if(update)
return shaderProgram->link();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment