summaryrefslogtreecommitdiff
path: root/src/gpu/sampler_cache.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-14 15:14:25 +0100
committerskal <pascal.massimino@gmail.com>2026-02-14 15:14:25 +0100
commit8ce27b7e15f0fc65c8ee78950c7501660b936178 (patch)
tree391f32111b9a30a0156709b6c1ed2fae7b435d57 /src/gpu/sampler_cache.h
parente38be0dbf5816338ff97e2ee2f9adfff2902dc2b (diff)
style: Apply clang-format to codebase
Diffstat (limited to 'src/gpu/sampler_cache.h')
-rw-r--r--src/gpu/sampler_cache.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/sampler_cache.h b/src/gpu/sampler_cache.h
index 5df3958..7149921 100644
--- a/src/gpu/sampler_cache.h
+++ b/src/gpu/sampler_cache.h
@@ -16,10 +16,14 @@ struct SamplerSpec {
uint16_t anisotropy;
bool operator<(const SamplerSpec& o) const {
- if (u != o.u) return u < o.u;
- if (v != o.v) return v < o.v;
- if (mag != o.mag) return mag < o.mag;
- if (min != o.min) return min < o.min;
+ if (u != o.u)
+ return u < o.u;
+ if (v != o.v)
+ return v < o.v;
+ if (mag != o.mag)
+ return mag < o.mag;
+ if (min != o.min)
+ return min < o.min;
return anisotropy < o.anisotropy;
}
};
@@ -28,7 +32,7 @@ class SamplerCache {
std::map<SamplerSpec, WGPUSampler> cache_;
SamplerCache() = default;
-public:
+ public:
static SamplerCache& Get() {
static SamplerCache instance;
return instance;
@@ -36,7 +40,8 @@ public:
WGPUSampler get_or_create(WGPUDevice device, const SamplerSpec& spec) {
auto it = cache_.find(spec);
- if (it != cache_.end()) return it->second;
+ if (it != cache_.end())
+ return it->second;
WGPUSamplerDescriptor desc{};
desc.addressModeU = spec.u;