Browse Source

Fix some errors with shader object labels

rdb 11 years ago
parent
commit
e7c08ec2fe
2 changed files with 8 additions and 8 deletions
  1. 6 6
      panda/src/gobj/shader.I
  2. 2 2
      panda/src/gobj/shader.h

+ 6 - 6
panda/src/gobj/shader.I

@@ -12,16 +12,16 @@
 //
 ////////////////////////////////////////////////////////////////////
 
+
 ////////////////////////////////////////////////////////////////////
 //     Function: Shader::get_filename
-//       Access: Public
+//       Access: Published
 //  Description: Return the Shader's filename for the given shader
 //               type.
 ////////////////////////////////////////////////////////////////////
-INLINE const Filename Shader::
+INLINE Filename Shader::
 get_filename(const ShaderType &type) const {
-  if (_filename->_separate) {
-    nassertr(type != ST_none || !_filename->_shared.empty(), "");
+  if (_filename->_separate && type == ST_none) {
     switch (type) {
       case ST_vertex:
         return _filename->_vertex;
@@ -51,7 +51,7 @@ get_filename(const ShaderType &type) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: Shader::get_text
-//       Access: Public
+//       Access: Published
 //  Description: Return the Shader's text for the given shader type.
 ////////////////////////////////////////////////////////////////////
 INLINE const string &Shader::
@@ -146,7 +146,7 @@ have_shader_utilization() {
 //  Description: Returns the shader language in which this shader
 //               was written.
 ////////////////////////////////////////////////////////////////////
-INLINE const Shader::ShaderLanguage Shader::
+INLINE Shader::ShaderLanguage Shader::
 get_language() const {
   return _language;
 }

+ 2 - 2
panda/src/gobj/shader.h

@@ -94,10 +94,10 @@ PUBLISHED:
                          const string &tess_evaluation = "");
   static PT(Shader) make_compute(const ShaderLanguage &lang, const string &body);
 
-  INLINE const Filename get_filename(const ShaderType &type = ST_none) const;
+  INLINE Filename get_filename(const ShaderType &type = ST_none) const;
   INLINE const string &get_text(const ShaderType &type = ST_none) const;
   INLINE const bool get_error_flag() const;
-  INLINE const ShaderLanguage get_language() const;
+  INLINE ShaderLanguage get_language() const;
 
   INLINE static ShaderUtilization get_shader_utilization();
   INLINE static void set_shader_utilization(ShaderUtilization utl);