summaryrefslogtreecommitdiff
path: root/src/gpu
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-11 19:34:34 +0100
committerskal <pascal.massimino@gmail.com>2026-02-11 19:34:34 +0100
commit3530fcd7414ea24c8916adc1e490f71c02ac96f1 (patch)
treee94769ad3ce10dff875034d4096f9663d48cb2b9 /src/gpu
parentba16f44c689e0bde3c50052c247c234029c9a816 (diff)
fix: Release cached samplers before WGPU shutdown
SamplerCache singleton never released samplers, causing device to retain references at shutdown. Add clear() method and call before fixture cleanup. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/sampler_cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/sampler_cache.h b/src/gpu/sampler_cache.h
index 0f012a8..5df3958 100644
--- a/src/gpu/sampler_cache.h
+++ b/src/gpu/sampler_cache.h
@@ -58,4 +58,11 @@ public:
return {WGPUAddressMode_ClampToEdge, WGPUAddressMode_ClampToEdge,
WGPUFilterMode_Linear, WGPUFilterMode_Linear, 1};
}
+
+ void clear() {
+ for (auto& pair : cache_) {
+ wgpuSamplerRelease(pair.second);
+ }
+ cache_.clear();
+ }
};