From acc2a310d0cfc82fc9d35cf0eaefbff923b829db Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 21:43:19 +0200 Subject: [PATCH] Change debug category for shader generator to pgraphnodes --- panda/src/pgraphnodes/shaderGenerator.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 488fe84c95..bb08db38a6 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -538,7 +538,7 @@ create_shader_attrib(const string &txt) { if (_shadows && _dlights[i]->_shadow_caster) { PT(Texture) tex = update_shadow_buffer(_dlights_np[i]); if (tex == NULL) { - pgraph_cat.error() << "Failed to create shadow buffer for DirectionalLight '" << _dlights[i]->get_name() << "'!\n"; + pgraphnodes_cat.error() << "Failed to create shadow buffer for DirectionalLight '" << _dlights[i]->get_name() << "'!\n"; } shattr = DCAST(ShaderAttrib, shattr)->set_shader_input(InternalName::make("dlighttex", i), tex); } else { @@ -553,7 +553,7 @@ create_shader_attrib(const string &txt) { if (_shadows && _slights[i]->_shadow_caster) { PT(Texture) tex = update_shadow_buffer(_slights_np[i]); if (tex == NULL) { - pgraph_cat.error() << "Failed to create shadow buffer for Spotlight '" << _slights[i]->get_name() << "'!\n"; + pgraphnodes_cat.error() << "Failed to create shadow buffer for Spotlight '" << _slights[i]->get_name() << "'!\n"; } shattr = DCAST(ShaderAttrib, shattr)->set_shader_input(InternalName::make("slighttex", i), tex); } else { @@ -635,9 +635,10 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { analyze_renderstate(rs); reset_register_allocator(); - if (pgraph_cat.is_debug()) { - pgraph_cat.debug() - << "Generating shader for render state " << *rs << "\n"; + if (pgraphnodes_cat.is_debug()) { + pgraphnodes_cat.debug() + << "Generating shader for render state " << rs << ":\n"; + rs->write(pgraphnodes_cat.debug(false), 2); } // These variables will hold the results of register allocation. @@ -999,7 +1000,7 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { text << "\t texcoord" << i << ".w = 1.0f;\n"; break; default: - pgraph_cat.error() << "Unsupported TexGenAttrib mode\n"; + pgraphnodes_cat.error() << "Unsupported TexGenAttrib mode\n"; text << "\t float4 texcoord" << i << " = float4(0, 0, 0, 0);\n"; } } else { @@ -1572,10 +1573,10 @@ combine_mode_as_string(CPT(TextureStage) stage, TextureStage::CombineMode c_mode text << combine_source_as_string(stage, 1, alpha, alpha, texindex); break; case TextureStage::CM_dot3_rgb: - pgraph_cat.error() << "TextureStage::CombineMode DOT3_RGB not yet supported in per-pixel mode.\n"; + pgraphnodes_cat.error() << "TextureStage::CombineMode DOT3_RGB not yet supported in per-pixel mode.\n"; break; case TextureStage::CM_dot3_rgba: - pgraph_cat.error() << "TextureStage::CombineMode DOT3_RGBA not yet supported in per-pixel mode.\n"; + pgraphnodes_cat.error() << "TextureStage::CombineMode DOT3_RGBA not yet supported in per-pixel mode.\n"; break; case TextureStage::CM_replace: default: // Not sure if this is correct as default value. @@ -1695,7 +1696,7 @@ texture_type_as_string(Texture::TextureType ttype) { return "2DARRAY"; break; default: - pgraph_cat.error() << "Unsupported texture type!\n"; + pgraphnodes_cat.error() << "Unsupported texture type!\n"; return "2D"; } }