|
|
@@ -92,11 +92,18 @@ bool Shader::Load(Deserializer& source)
|
|
|
if (!ProcessSource(psSourceCode_, psSourceCodeLength_, path + fileName + ".frag"))
|
|
|
return false;
|
|
|
|
|
|
- // If variations had already been created, release them
|
|
|
+ // If variations had already been created, release them and set new source code
|
|
|
+ /// \todo Should also update defines
|
|
|
for (HashMap<StringHash, SharedPtr<ShaderVariation> >::Iterator i = vsVariations_.Begin(); i != vsVariations_.End(); ++i)
|
|
|
+ {
|
|
|
i->second_->Release();
|
|
|
+ i->second_->SetSourceCode(vsSourceCode_, vsSourceCodeLength_);
|
|
|
+ }
|
|
|
for (HashMap<StringHash, SharedPtr<ShaderVariation> >::Iterator i = psVariations_.Begin(); i != psVariations_.End(); ++i)
|
|
|
+ {
|
|
|
i->second_->Release();
|
|
|
+ i->second_->SetSourceCode(psSourceCode_, psSourceCodeLength_);
|
|
|
+ }
|
|
|
|
|
|
SetMemoryUse(sizeof(Shader) + 2 * sizeof(ShaderParser) + (vsVariations_.Size() + psVariations_.Size()) *
|
|
|
sizeof(ShaderVariation));
|