On https://codelabs.developers.google.com/your-first-webgpu-app?hl=pt-br#7
There was a snippet
// Create the bind group layout and pipeline layout.
const bindGroupLayout = device.createBindGroupLayout({
label: "Cell Bind Group Layout",
entries: [{
binding: 0,
visibility: GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE,
buffer: {} // Grid uniform buffer
}, {
binding: 1,
visibility: GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE,
buffer: { type: "read-only-storage"} // Cell state input buffer
}, {
binding: 2,
visibility: GPUShaderStage.COMPUTE,
buffer: { type: "storage"} // Cell state output buffer
}]
});
I had to change the visibility on binding 0 and 1 from GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE to GPUShaderStage.FRAGMENT | GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE.
On https://codelabs.developers.google.com/your-first-webgpu-app?hl=pt-br#7 There was a snippet // Create the bind group layout and pipeline layout. const bindGroupLayout = device.createBindGroupLayout({ label: "Cell Bind Group Layout", entries: [{ binding: 0, visibility: GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE, buffer: {} // Grid uniform buffer }, { binding: 1, visibility: GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE, buffer: { type: "read-only-storage"} // Cell state input buffer }, { binding: 2, visibility: GPUShaderStage.COMPUTE, buffer: { type: "storage"} // Cell state output buffer }] });
I had to change the
visibility
on binding 0 and 1 fromGPUShaderStage.VERTEX | GPUShaderStage.COMPUTE
toGPUShaderStage.FRAGMENT | GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE
.