Don't rebuild the dummy shader (less SourceShaderCache warning spam)
authorKahrl <kahrl@gmx.net>
Fri, 5 Jul 2013 02:24:05 +0000 (04:24 +0200)
committerKahrl <kahrl@gmx.net>
Fri, 5 Jul 2013 02:24:05 +0000 (04:24 +0200)
Also write something about rebuilding shaders to infostream in
Client::afterContentReceived()

src/client.cpp
src/shader.cpp

index 5e682aaa32350c6a41144785aedc0ea0ed6c5c23..ccd2034fcba428832dcb01aed83f42f59b78a005 100644 (file)
@@ -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
index 9cef7f353d321a22cc08fe592ab643324afd4fca..58042e6515a43c95e0743a3d4baf4dfcf89ff2bd 100644 (file)
@@ -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);
+               }
        }
 }