瀏覽代碼

gobj: Rename conflicting ShaderType since GCC doesn't like it

rdb 4 年之前
父節點
當前提交
d7717727e7
共有 3 個文件被更改,包括 11 次插入8 次删除
  1. 7 3
      panda/src/gobj/shader.I
  2. 4 4
      panda/src/gobj/shader.h
  3. 0 1
      panda/src/shaderpipeline/shaderModuleGlsl.h

+ 7 - 3
panda/src/gobj/shader.I

@@ -15,9 +15,11 @@
 
 /**
  * Return the Shader's filename for the given shader type.
+ *
+ * @deprecated Access the filename of the individual modules instead.
  */
 INLINE Filename Shader::
-get_filename(ShaderType type) const {
+get_filename(DeprecatedShaderType type) const {
   if (_filename._separate && type != ST_none) {
     switch (type) {
       case ST_vertex:
@@ -53,9 +55,11 @@ get_filename(ShaderType type) const {
 /**
  * Sets the Shader's filename for the given shader type.  Useful for
  * associating a shader created with Shader.make with a name for diagnostics.
+ *
+ * @deprecated Access the filename of the individual modules instead.
  */
 INLINE void Shader::
-set_filename(ShaderType type, const Filename &filename) {
+set_filename(DeprecatedShaderType type, const Filename &filename) {
   _filename._separate = true;
   switch (type) {
   case ST_vertex:
@@ -88,7 +92,7 @@ set_filename(ShaderType type, const Filename &filename) {
  * @deprecated
  */
 INLINE const std::string &Shader::
-get_text(ShaderType type) const {
+get_text(DeprecatedShaderType type) const {
   if (_text._separate) {
     nassertr(type != ST_none || !_text._shared.empty(), _text._shared);
     switch (type) {

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

@@ -58,7 +58,7 @@ PUBLISHED:
     SL_SPIR_V,
   };
 
-  enum ShaderType {
+  enum DeprecatedShaderType {
     ST_none = 0,
     ST_vertex,
     ST_fragment,
@@ -104,9 +104,9 @@ PUBLISHED:
                          std::string tess_evaluation = "");
   static PT(Shader) make_compute(ShaderLanguage lang, std::string body);
 
-  INLINE Filename get_filename(ShaderType type = ST_none) const;
-  INLINE void set_filename(ShaderType type, const Filename &filename);
-  INLINE const std::string &get_text(ShaderType type = ST_none) const;
+  INLINE Filename get_filename(DeprecatedShaderType type = ST_none) const;
+  INLINE void set_filename(DeprecatedShaderType type, const Filename &filename);
+  INLINE const std::string &get_text(DeprecatedShaderType type = ST_none) const;
   INLINE bool get_error_flag() const;
   INLINE ShaderLanguage get_language() const;
   INLINE int get_used_capabilities() const;

+ 0 - 1
panda/src/shaderpipeline/shaderModuleGlsl.h

@@ -32,7 +32,6 @@ public:
   Filename get_filename_from_index(int index) const;
 
 protected:
-  Shader::ShaderType _shader_type;
   std::string _raw_source;
 
   typedef pvector<Filename> Filenames;