Change debug category for shader generator to pgraphnodes

This commit is contained in:
rdb 2015-07-28 21:43:19 +02:00
parent b9d45ccc04
commit acc2a310d0

View File

@ -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";
}
}