diff --git a/src/gfx/drawable_processors/mesh_drawable_processor.hpp b/src/gfx/drawable_processors/mesh_drawable_processor.hpp index 667372c01b3..e35dce81920 100644 --- a/src/gfx/drawable_processors/mesh_drawable_processor.hpp +++ b/src/gfx/drawable_processors/mesh_drawable_processor.hpp @@ -9,6 +9,7 @@ #include "../texture_placeholder.hpp" #include "drawable_processor_helpers.hpp" #include "pmr/list.hpp" +#include "pmr/unordered_map.hpp" #include "texture_cache.hpp" #include "worker_memory.hpp" #include @@ -417,9 +418,9 @@ struct MeshDrawableProcessor final : public IDrawableProcessor { PreparedGroupData &preparedGroupData = prepareData->groups.value(); WGPUBindGroupLayout drawBindGroupLayout = cachedPipeline.bindGroupLayouts[PipelineBuilder::getDrawBindGroupIndex()]; - auto cachedBindGroups = allocator->new_object>(); + auto cachedBindGroups = allocator->new_object>(); for (size_t index = 0; index < preparedGroupData.groups.size(); ++index) { - shards::pmr::map &cache = *cachedBindGroups; + shards::pmr::unordered_map &cache = *cachedBindGroups; auto &group = preparedGroupData.groups[index]; auto &groupData = preparedGroupData.groupData[index]; diff --git a/src/gfx/renderer_types.hpp b/src/gfx/renderer_types.hpp index c3955639060..399100a3142 100644 --- a/src/gfx/renderer_types.hpp +++ b/src/gfx/renderer_types.hpp @@ -20,10 +20,12 @@ #include "sized_item_pool.hpp" #include "worker_memory.hpp" #include "pmr/wrapper.hpp" -#include "pmr/map.hpp" +#include "pmr/unordered_map.hpp" #include "pmr/string.hpp" #include +#include #include +#include #include #include #include @@ -119,15 +121,20 @@ struct RenderTargetLayout { struct ParameterStorage final : public IParameterCollector { using allocator_type = shards::pmr::PolymorphicAllocator<>; - struct KeyLess { + struct KeyEqual { using is_transparent = std::true_type; template bool operator()(const T &a, const U &b) const { - return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end()); + return std::string_view(a) == std::string_view(b); } }; - shards::pmr::map basic; - shards::pmr::map textures; + struct KeyHash { + using is_transparent = std::true_type; + template size_t operator()(const U &b) const { return std::hash{}(b); } + }; + + shards::pmr::unordered_map basic; + shards::pmr::unordered_map textures; using IParameterCollector::setParam; using IParameterCollector::setTexture;