From 17d7028b9e5c04daf26ed1a5d8ba4fb72301d337 Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Tue, 21 Feb 2023 18:31:17 +0800 Subject: [PATCH] Only use pmr unordered_set --- src/gfx/pmr/{set.hpp => unordered_set.hpp} | 4 ++-- src/gfx/render_graph.hpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) rename src/gfx/pmr/{set.hpp => unordered_set.hpp} (56%) diff --git a/src/gfx/pmr/set.hpp b/src/gfx/pmr/unordered_set.hpp similarity index 56% rename from src/gfx/pmr/set.hpp rename to src/gfx/pmr/unordered_set.hpp index 7c36082788b..c961e128b3b 100644 --- a/src/gfx/pmr/set.hpp +++ b/src/gfx/pmr/unordered_set.hpp @@ -3,11 +3,11 @@ #include "wrapper.hpp" #include -#include +#include #if !HAVE_CXX_17_MEMORY_RESOURCE namespace shards::pmr { -template > using set = std::set>; +template , typename Equal = std::equal_to> using unordered_set = std::unordered_set>; } #endif diff --git a/src/gfx/render_graph.hpp b/src/gfx/render_graph.hpp index 3c40395407a..43d471eb68c 100644 --- a/src/gfx/render_graph.hpp +++ b/src/gfx/render_graph.hpp @@ -8,7 +8,7 @@ #include "texture_cache.hpp" #include "fmt.hpp" #include "worker_memory.hpp" -#include "pmr/set.hpp" +#include "pmr/unordered_set.hpp" #include "pmr/vector.hpp" #include "gfx_wgpu.hpp" #include @@ -520,7 +520,7 @@ struct RenderGraphEvaluator { allocator_type allocator; // Keeps track of texture that have been written to at least once - shards::pmr::set writtenTextures; + shards::pmr::unordered_set writtenTextures; // Resolved texture handles for indexed by frame index inside nodes struct ResolvedFrameTexture { @@ -547,7 +547,8 @@ struct RenderGraphEvaluator { return frameTextures[frameIndex].texture; } - WGPUTextureView getTextureView(const TextureContextData &textureData, uint8_t faceIndex, uint8_t mipIndex, size_t frameCounter) { + WGPUTextureView getTextureView(const TextureContextData &textureData, uint8_t faceIndex, uint8_t mipIndex, + size_t frameCounter) { if (textureData.externalView) return textureData.externalView; TextureViewDesc desc{