Skip to content
Permalink
Browse files

shader: //Cg profile should only affect the current shader

Fixes #863
  • Loading branch information
rdb committed Jan 31, 2020
1 parent dbb6554 commit e13e9851f260ecf5d9b4402f21a577b2c340c5aa
Showing with 6 additions and 4 deletions.
  1. +6 −4 panda/src/gobj/shader.cxx
@@ -2461,9 +2461,10 @@ read(const ShaderFile &sfile, BamCacheRecord *record) {
// Determine which language the shader is written in.
if (_language == SL_Cg) {
#ifdef HAVE_CG
cg_get_profile_from_header(_default_caps);
ShaderCaps caps = _default_caps;
cg_get_profile_from_header(caps);

if (!cg_analyze_shader(_default_caps)) {
if (!cg_analyze_shader(caps)) {
shader_cat.error()
<< "Shader encountered an error.\n";
return false;
@@ -2551,9 +2552,10 @@ load(const ShaderFile &sbody, BamCacheRecord *record) {
// Determine which language the shader is written in.
if (_language == SL_Cg) {
#ifdef HAVE_CG
cg_get_profile_from_header(_default_caps);
ShaderCaps caps = _default_caps;
cg_get_profile_from_header(caps);

if (!cg_analyze_shader(_default_caps)) {
if (!cg_analyze_shader(caps)) {
shader_cat.error()
<< "Shader encountered an error.\n";
return false;

0 comments on commit e13e985

Please sign in to comment.
You can’t perform that action at this time.