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

Method find_uniform_variable

source/runtime_api.cpp:87–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87reshade::api::effect_uniform_variable reshade::runtime::find_uniform_variable(const char *effect_name_in, const char *variable_name_in) const
88{
89 if (is_loading() || variable_name_in == nullptr)
90 return { 0 };
91
92 const std::filesystem::path effect_name = effect_name_in != nullptr ? std::filesystem::u8path(effect_name_in) : std::filesystem::path();
93 const std::string_view variable_name(variable_name_in);
94
95 for (const effect &effect : _effects)
96 {
97 if (effect_name_in != nullptr && effect.source_file.filename() != effect_name)
98 continue;
99
100 for (const uniform &variable : effect.uniforms)
101 {
102 if (variable.name == variable_name)
103 return { reinterpret_cast<uintptr_t>(&variable) };
104 }
105
106 if (effect_name_in != nullptr)
107 break;
108 }
109
110 return { 0 };
111}
112
113void reshade::runtime::get_uniform_variable_type(api::effect_uniform_variable handle, api::format *out_base_type, uint32_t *out_rows, uint32_t *out_columns, uint32_t *out_array_length) const
114{

Callers 1

Calls 1

is_loadingFunction · 0.85

Tested by

no test coverage detected