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

Method reorder_techniques

source/runtime.cpp:3262–3294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3260}
3261
3262void reshade::runtime::reorder_techniques(std::vector<size_t> &&technique_indices)
3263{
3264 assert(technique_indices.size() == _techniques.size() && technique_indices.size() == _technique_sorting.size() &&
3265 std::all_of(technique_indices.cbegin(), technique_indices.cend(),
3266 [this](size_t technique_index) {
3267 return std::find(_technique_sorting.cbegin(), _technique_sorting.cend(), technique_index) != _technique_sorting.cend();
3268 }));
3269
3270#if RESHADE_ADDON
3271 if (!is_loading())
3272 {
3273 std::vector<api::effect_technique> techniques(technique_indices.size());
3274 std::transform(technique_indices.cbegin(), technique_indices.cend(), techniques.begin(),
3275 [this](size_t technique_index) {
3276 return api::effect_technique { reinterpret_cast<uint64_t>(&_techniques[technique_index]) };
3277 });
3278
3279 if (invoke_addon_event<addon_event::reshade_reorder_techniques>(this, techniques.size(), techniques.data()))
3280 return;
3281
3282 for (size_t i = 0; i < techniques.size(); i++)
3283 {
3284 const auto tech = reinterpret_cast<technique *>(techniques[i].handle);
3285 if (tech == nullptr)
3286 return;
3287
3288 technique_indices[i] = tech - _techniques.data();
3289 }
3290 }
3291#endif
3292
3293 _technique_sorting = std::move(technique_indices);
3294}
3295
3296void reshade::runtime::load_effects(bool force_load_all)
3297{

Callers 1

Calls 1

is_loadingFunction · 0.85

Tested by

no test coverage detected