Skip to content

Commit

Permalink
Only use pmr unordered_set
Browse files Browse the repository at this point in the history
  • Loading branch information
guusw committed Feb 21, 2023
1 parent 4473e51 commit 17d7028
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/gfx/pmr/set.hpp → src/gfx/pmr/unordered_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#include "wrapper.hpp"
#include <functional>
#include <set>
#include <unordered_set>

#if !HAVE_CXX_17_MEMORY_RESOURCE
namespace shards::pmr {
template <typename K, typename Less = std::less<K>> using set = std::set<K, Less, PolymorphicAllocator<K>>;
template <typename K, typename Hasher = std::hash<K>, typename Equal = std::equal_to<K>> using unordered_set = std::unordered_set<K, Hasher, Equal, PolymorphicAllocator<K>>;
}
#endif

Expand Down
7 changes: 4 additions & 3 deletions src/gfx/render_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <compare>
Expand Down Expand Up @@ -520,7 +520,7 @@ struct RenderGraphEvaluator {
allocator_type allocator;

// Keeps track of texture that have been written to at least once
shards::pmr::set<Texture *> writtenTextures;
shards::pmr::unordered_set<Texture *> writtenTextures;

// Resolved texture handles for indexed by frame index inside nodes
struct ResolvedFrameTexture {
Expand All @@ -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{
Expand Down

0 comments on commit 17d7028

Please sign in to comment.