Merge branch 'name_shaders' into 'master'

Append filename to shader names

See merge request OpenMW/openmw!930
pull/3094/head
psi29a 4 years ago
commit 7b6fc1a1f1

@ -335,9 +335,10 @@ namespace Shader
osg::ref_ptr<osg::Shader> shader (new osg::Shader(shaderType));
shader->setShaderSource(shaderSource);
// Assign a unique name to allow the SharedStateManager to compare shaders efficiently
// Assign a unique prefix to allow the SharedStateManager to compare shaders efficiently.
// Append shader source filename for debugging.
static unsigned int counter = 0;
shader->setName(std::to_string(counter++));
shader->setName(Misc::StringUtils::format("%u %s", counter++, templateName));
shaderIt = mShaders.insert(std::make_pair(std::make_pair(templateName, defines), shader)).first;
}

Loading…
Cancel
Save