summaryrefslogtreecommitdiff
path: root/src/gpu/sampler_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/sampler_cache.h')
-rw-r--r--src/gpu/sampler_cache.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gpu/sampler_cache.h b/src/gpu/sampler_cache.h
index b3fdb19..7d88109 100644
--- a/src/gpu/sampler_cache.h
+++ b/src/gpu/sampler_cache.h
@@ -9,6 +9,7 @@ struct WGPUSamplerImpl;
typedef struct WGPUSamplerImpl* WGPUSampler;
#include "platform/platform.h"
+#include "util/fatal_error.h"
struct SamplerSpec {
WGPUAddressMode u, v;
@@ -39,10 +40,8 @@ class SamplerCache {
}
WGPUSampler get_or_create(WGPUDevice device, const SamplerSpec& spec) {
- // Headless mode: skip sampler creation
- if (device == nullptr) {
- return nullptr;
- }
+ // Headless mode: skip sampler creation (compiled out in STRIP_ALL)
+ HEADLESS_RETURN_VAL_IF_NULL(device, nullptr);
auto it = cache_.find(spec);
if (it != cache_.end())