mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Fixed a bug in shader caching
This commit is contained in:
parent
ef0189651e
commit
e02fcbbb21
@ -861,6 +861,8 @@ cg_compile_shader(const ShaderCaps &caps) {
|
|||||||
|
|
||||||
_cg_context = cgCreateContext();
|
_cg_context = cgCreateContext();
|
||||||
|
|
||||||
|
gobj_cat.debug() << "Compiling Shader: \n" << _text << "\n";
|
||||||
|
|
||||||
if (_cg_context == 0) {
|
if (_cg_context == 0) {
|
||||||
gobj_cat.error() << "could not create a Cg context object.\n";
|
gobj_cat.error() << "could not create a Cg context object.\n";
|
||||||
return false;
|
return false;
|
||||||
@ -1159,6 +1161,7 @@ Shader(const Filename &filename, const string &text) :
|
|||||||
_filename(filename),
|
_filename(filename),
|
||||||
_text(text),
|
_text(text),
|
||||||
_header(""),
|
_header(""),
|
||||||
|
_loaded(false),
|
||||||
_error_flag(true),
|
_error_flag(true),
|
||||||
_parse(0)
|
_parse(0)
|
||||||
{
|
{
|
||||||
@ -1232,6 +1235,7 @@ load(const Filename &file) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
PT(Shader) result = new Shader(file, body);
|
PT(Shader) result = new Shader(file, body);
|
||||||
|
result->_loaded = true;
|
||||||
_load_table[file] = result;
|
_load_table[file] = result;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user