MCPcopy Create free account
hub / github.com/crosire/reshade / define_name

Method define_name

source/effect_codegen_glsl.cpp:646–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644
645 template <naming naming_type = naming::general>
646 void define_name(const id id, std::string name)
647 {
648 assert(!name.empty());
649 if constexpr (naming_type != naming::expression)
650 if (name[0] == '_')
651 return; // Filter out names that may clash with automatic ones
652 if constexpr (naming_type != naming::reserved)
653 name = escape_name(std::move(name));
654 if constexpr (naming_type == naming::general)
655 if (std::find_if(_names.begin(), _names.end(),
656 [&name](const auto &names_it) { return names_it.second == name; }) != _names.end())
657 name += '_' + std::to_string(id); // Append a numbered suffix if the name already exists
658 _names[id] = std::move(name);
659 }
660
661 uint32_t semantic_to_location(const std::string &semantic, uint32_t max_attributes = 1)
662 {

Callers

nothing calls this directly

Calls 2

escape_nameFunction · 0.85
to_stringFunction · 0.85

Tested by

no test coverage detected