From 101e61504eed61d1d16c097e06e43875079f2144 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 11 Apr 2009 18:05:57 +0000 Subject: [PATCH] Fix "too complex" issue with custom profile --- panda/src/gobj/shader.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 3c0bbc754e..0f06438206 100755 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1371,9 +1371,10 @@ cg_compile_for(const ShaderCaps &caps, // If the compile routine used the ultimate profile instead of the // active one, it means the active one isn't powerful enough to // compile the shader. + // This does not apply when a custom profile is set. - if ((cgGetProgramProfile(_cg_vprogram) != caps._active_vprofile)|| - (cgGetProgramProfile(_cg_fprogram) != caps._active_fprofile)) { + if ((_cg_vprofile == CG_PROFILE_UNKNOWN && cgGetProgramProfile(_cg_vprogram) != caps._active_vprofile) || + (_cg_fprofile == CG_PROFILE_UNKNOWN && cgGetProgramProfile(_cg_fprogram) != caps._active_fprofile)) { gobj_cat.error() << "Cg program too complex for driver: " << get_filename() << ". Try choosing a different profile.\n"; return false;