From ffb3eb80ae5c763c12d277caf6e96d12287c8a42 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 4 May 2011 10:42:40 +0000 Subject: [PATCH] better debug output --- panda/src/gobj/shader.cxx | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 0762eeb7cb..bd5de618b9 100755 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1473,6 +1473,26 @@ cg_compile_shader(const ShaderCaps &caps) { return false; } + // DEBUG: output the generated program + if (gobj_cat.is_debug()) { + const char *vertex_program; + const char *pixel_program; + const char *geometry_program; + + if (_cg_vprogram != 0) { + vertex_program = cgGetProgramString (_cg_vprogram, CG_COMPILED_PROGRAM); + gobj_cat.debug() << vertex_program << "\n"; + } + if (_cg_fprogram != 0) { + pixel_program = cgGetProgramString (_cg_fprogram, CG_COMPILED_PROGRAM); + gobj_cat.debug() << pixel_program << "\n"; + } + if (_cg_gprogram != 0) { + geometry_program = cgGetProgramString (_cg_gprogram, CG_COMPILED_PROGRAM); + gobj_cat.debug() << geometry_program << "\n"; + } + } + return true; } @@ -1578,26 +1598,6 @@ cg_analyze_shader(const ShaderCaps &caps) { _ptr_spec[i]._info._id = _ptr_spec[i]._id; } - // DEBUG: output the generated program - if (gobj_cat.is_debug()) { - const char *vertex_program; - const char *pixel_program; - const char *geometry_program; - - if (_cg_vprogram != 0) { - vertex_program = cgGetProgramString (_cg_vprogram, CG_COMPILED_PROGRAM); - gobj_cat.debug() << vertex_program << "\n"; - } - if (_cg_fprogram != 0) { - pixel_program = cgGetProgramString (_cg_fprogram, CG_COMPILED_PROGRAM); - gobj_cat.debug() << pixel_program << "\n"; - } - if (_cg_gprogram != 0) { - geometry_program = cgGetProgramString (_cg_gprogram, CG_COMPILED_PROGRAM); - gobj_cat.debug() << geometry_program << "\n"; - } - } - // // The following code is present to work around a bug in the Cg compiler. // // It does not generate correct code for shadow map lookups when using arbfp1. // // This is a particularly onerous limitation, given that arbfp1 is the only