1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-16 16:20:53 +00:00

Merge branch 'name_shaders' into 'master'

Append filename to shader names

See merge request OpenMW/openmw!930
This commit is contained in:
psi29a 2021-06-19 00:16:36 +00:00
commit 7b6fc1a1f1

View File

@ -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;
}