Browse Source

ShaderGenerator: print out generated shader in spam output mode

rdb 6 years ago
parent
commit
0ba1235d35
1 changed files with 5 additions and 0 deletions
  1. 5 0
      panda/src/pgraphnodes/shaderGenerator.cxx

+ 5 - 0
panda/src/pgraphnodes/shaderGenerator.cxx

@@ -1684,6 +1684,11 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
   }
   }
   text << "}\n";
   text << "}\n";
 
 
+  if (pgraphnodes_cat.is_spam()) {
+    pgraphnodes_cat.spam() << "Generated shader:\n"
+      << text.str() << "\n";
+  }
+
   // Insert the shader into the shader attrib.
   // Insert the shader into the shader attrib.
   PT(Shader) shader = Shader::make(text.str(), Shader::SL_Cg);
   PT(Shader) shader = Shader::make(text.str(), Shader::SL_Cg);
   nassertr(shader != nullptr, nullptr);
   nassertr(shader != nullptr, nullptr);