Fix empty bind group to not be static due to WebGPU issues

This commit is contained in:
2026-04-03 17:07:14 +02:00
parent 0e161c6ec1
commit 7193f8dcab
@@ -670,13 +670,8 @@ void GPUPipelineStateWebGPU::InitLayout(const GPUContextBindingsWebGPU& bindings
if (!bindGroupLayout)
{
// Firefox and Safari have a bug that causes pipeline creation to fail when bind group layout is empty (no entries) and used in the pipeline layout
static WGPUBindGroupLayout EmptyBindGroup = nullptr;
if (!EmptyBindGroup)
{
WGPUBindGroupLayoutDescriptor bindGroupLayoutDesc = WGPU_BIND_GROUP_LAYOUT_DESCRIPTOR_INIT;
EmptyBindGroup = wgpuDeviceCreateBindGroupLayout(_device->Device, &bindGroupLayoutDesc);
}
bindGroupLayout = EmptyBindGroup;
WGPUBindGroupLayoutDescriptor bindGroupLayoutDesc = WGPU_BIND_GROUP_LAYOUT_DESCRIPTOR_INIT;
bindGroupLayout = wgpuDeviceCreateBindGroupLayout(_device->Device, &bindGroupLayoutDesc);
}
BindGroupLayouts[groupIndex] = bindGroupLayout;
}