From 3530fcd7414ea24c8916adc1e490f71c02ac96f1 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 11 Feb 2026 19:34:34 +0100 Subject: 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 --- src/gpu/sampler_cache.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gpu') 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(); + } }; -- cgit v1.2.3