From dc6ccc27a1abdc0d87209eb0d94632660261a036 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 2 Jul 2009 15:12:17 +0000 Subject: [PATCH] Fix compile errors for build with Cg enabled --- panda/src/gobj/shader.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index e44ae982be..2770ae74ee 100755 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1126,10 +1126,7 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, ShaderType typ CGprogram prog; CGerror err; const char *compiler_args[100]; - const string text; - if (!_text->_separate) { - text = _text->_shared; - } + const string text = get_text(type); int nargs = 0; int active, ultimate; @@ -1138,25 +1135,16 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, ShaderType typ case ST_vertex: active = caps._active_vprofile; ultimate = caps._ultimate_vprofile; - if (_text->_separate) { - text = _text._vertex; - } break; case ST_fragment: active = caps._active_fprofile; ultimate = caps._ultimate_fprofile; - if (_text->_separate) { - text = _text._fragment; - } break; case ST_geometry: active = caps._active_gprofile; ultimate = caps._ultimate_gprofile; - if (_text->_separate) { - text = _text._geometry; - } break; }; @@ -1239,15 +1227,15 @@ cg_compile_shader(const ShaderCaps &caps) { return false; } - if (!_text->_separate || !_text._vertex.empty()) { + if (!_text->_separate || !_text->_vertex.empty()) { _cg_vprogram = cg_compile_entry_point("vshader", caps, ST_vertex); } - if (!_text->_separate || !_text._fragment.empty()) { + if (!_text->_separate || !_text->_fragment.empty()) { _cg_fprogram = cg_compile_entry_point("fshader", caps, ST_fragment); } - if ((_text->_separate && !_text._geometry.empty()) || (!_text->_separate && _text.find("gshader") != -1)) { + if ((_text->_separate && !_text->_geometry.empty()) || (!_text->_separate && _text->_shared.find("gshader") != -1)) { _cg_gprogram = cg_compile_entry_point("gshader", caps, ST_geometry); }