diff --git a/cocos/renderer/backend/Program.h b/cocos/renderer/backend/Program.h index 4ac6ccc01f..fceb28f8f4 100644 --- a/cocos/renderer/backend/Program.h +++ b/cocos/renderer/backend/Program.h @@ -99,7 +99,7 @@ public: * Get active vertex attributes. * @return Active vertex attributes. key is active attribute name, Value is corresponding attribute info. */ - virtual hlookup::string_map getActiveAttributes() const = 0; + virtual const hlookup::string_map getActiveAttributes() const = 0; /** * Get vertex shader. diff --git a/cocos/renderer/backend/metal/ProgramMTL.h b/cocos/renderer/backend/metal/ProgramMTL.h index a8af638c31..c6c0be6b95 100644 --- a/cocos/renderer/backend/metal/ProgramMTL.h +++ b/cocos/renderer/backend/metal/ProgramMTL.h @@ -94,7 +94,7 @@ public: * Get active vertex attributes. * @return Active vertex attributes. key is active attribute name, Value is corresponding attribute info. */ - hlookup::string_map getActiveAttributes() const override; + const hlookup::string_map getActiveAttributes() const override; /** * Get maximum vertex location. diff --git a/cocos/renderer/backend/metal/ProgramMTL.mm b/cocos/renderer/backend/metal/ProgramMTL.mm index d252ce63bb..3bbe43cae4 100644 --- a/cocos/renderer/backend/metal/ProgramMTL.mm +++ b/cocos/renderer/backend/metal/ProgramMTL.mm @@ -118,7 +118,7 @@ int ProgramMTL::getMaxFragmentLocation() const return _fragmentShader->getMaxLocation(); } -hlookup::string_map ProgramMTL::getActiveAttributes() const +const hlookup::string_map ProgramMTL::getActiveAttributes() const { return _vertexShader->getAttributeInfo(); } diff --git a/cocos/renderer/backend/opengl/ProgramGL.cpp b/cocos/renderer/backend/opengl/ProgramGL.cpp index 7a8702a93e..1c2f8b4317 100644 --- a/cocos/renderer/backend/opengl/ProgramGL.cpp +++ b/cocos/renderer/backend/opengl/ProgramGL.cpp @@ -210,7 +210,7 @@ bool ProgramGL::getAttributeLocation(std::string_view attributeName, unsigned in return true; } -hlookup::string_map ProgramGL::getActiveAttributes() const +const hlookup::string_map ProgramGL::getActiveAttributes() const { hlookup::string_map attributes; diff --git a/cocos/renderer/backend/opengl/ProgramGL.h b/cocos/renderer/backend/opengl/ProgramGL.h index e6489bc7e4..d433e94c7d 100644 --- a/cocos/renderer/backend/opengl/ProgramGL.h +++ b/cocos/renderer/backend/opengl/ProgramGL.h @@ -128,7 +128,7 @@ public: * Get active vertex attributes. * @return Active vertex attributes. key is active attribute name, Value is corresponding attribute info. */ - virtual hlookup::string_map getActiveAttributes() const override; + virtual const hlookup::string_map getActiveAttributes() const override; /** * Get uniform buffer size in bytes that can hold all the uniforms.