summaryrefslogtreecommitdiff
path: root/src/gpu/bind_group_builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/bind_group_builder.h')
-rw-r--r--src/gpu/bind_group_builder.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/bind_group_builder.h b/src/gpu/bind_group_builder.h
index 55b7291..3b25ba9 100644
--- a/src/gpu/bind_group_builder.h
+++ b/src/gpu/bind_group_builder.h
@@ -93,6 +93,10 @@ class BindGroupLayoutBuilder {
}
WGPUBindGroupLayout build(WGPUDevice device) {
+ // Headless mode: skip bind group layout creation
+ if (device == nullptr) {
+ return nullptr;
+ }
WGPUBindGroupLayoutDescriptor desc{};
desc.entryCount = entries_.size();
desc.entries = entries_.data();
@@ -130,6 +134,10 @@ class BindGroupBuilder {
}
WGPUBindGroup build(WGPUDevice device, WGPUBindGroupLayout layout) {
+ // Headless mode: skip bind group creation
+ if (device == nullptr) {
+ return nullptr;
+ }
WGPUBindGroupDescriptor desc{};
desc.layout = layout;
desc.entryCount = entries_.size();