Reworks the $Core::commonShaderPath variable usage to be a static variable in ShaderGen for efficiency(only one getVariable when shadergen is initialized), as well as implements the ability to set a default value, and ensures that it tries to set a path even if the pref variable is missing which is important for ported projects from older builds.

This commit is contained in:
Areloch 2017-07-24 00:40:27 -05:00
parent 3d7c1bbbf7
commit 7567ca10c3
17 changed files with 65 additions and 55 deletions

View file

@ -70,7 +70,7 @@ MODULE_END;
TerrainFeatGLSL::TerrainFeatGLSL()
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
: mTorqueDep(ShaderGen::smCommonShaderPath + String("/gl/torque.glsl" ))
{
addDependency( &mTorqueDep );
}
@ -293,8 +293,8 @@ U32 TerrainBaseMapFeatGLSL::getOutputTargets( const MaterialFeatureData &fd ) co
}
TerrainDetailMapFeatGLSL::TerrainDetailMapFeatGLSL()
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.glsl" ))
: mTorqueDep(ShaderGen::smCommonShaderPath + String("/gl/torque.glsl" )),
mTerrainDep(ShaderGen::smCommonShaderPath + String("/terrain/terrain.glsl" ))
{
addDependency( &mTorqueDep );
@ -662,8 +662,8 @@ U32 TerrainDetailMapFeatGLSL::getOutputTargets( const MaterialFeatureData &fd )
TerrainMacroMapFeatGLSL::TerrainMacroMapFeatGLSL()
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.glsl" ))
: mTorqueDep(ShaderGen::smCommonShaderPath + String("/gl/torque.glsl" )),
mTerrainDep(ShaderGen::smCommonShaderPath + String("/terrain/terrain.glsl" ))
{
addDependency( &mTorqueDep );