Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created July 5, 2013 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahrl/5931110 to your computer and use it in GitHub Desktop.
Save kahrl/5931110 to your computer and use it in GitHub Desktop.
diff --git a/src/client.cpp b/src/client.cpp
index 5e682aa..ccd2034 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2850,6 +2850,7 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font)
m_tsrc->rebuildImagesAndTextures();
// Rebuild shaders
+ infostream<<"- Rebuilding shaders"<<std::endl;
m_shsrc->rebuildShaders();
// Update node aliases
diff --git a/src/shader.cpp b/src/shader.cpp
index 9cef7f3..58042e6 100644
--- a/src/shader.cpp
+++ b/src/shader.cpp
@@ -585,8 +585,10 @@ void ShaderSource::rebuildShaders()
// Recreate shaders
for(u32 i=0; i<m_shaderinfo_cache.size(); i++){
ShaderInfo *info = &m_shaderinfo_cache[i];
- *info = generate_shader(info->name, m_device,
- m_shader_callback, &m_sourcecache);
+ if(info->name != ""){
+ *info = generate_shader(info->name, m_device,
+ m_shader_callback, &m_sourcecache);
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment