Problem with binding texture_2d

Hello friends,

Whenever I add a binding for texture_2d (binding #4 in my Playground code below), I got the error :

Number of entries (6) did not match the expected number of entries (5) for [BindGroupLayout (unlabeled)].
Expected layout: [{ binding: 0, visibility: ShaderStage::Compute, buffer: {type: BufferBindingType::Uniform, minBindingSize: 12, hasDynamicOffset: 0} }, { binding: 1, visibility: ShaderStage::Compute, buffer: {type: BufferBindingType::ReadOnlyStorage, minBindingSize: 4, hasDynamicOffset: 0} }, { binding: 2, visibility: ShaderStage::Compute, buffer: {type: BufferBindingType::ReadOnlyStorage, minBindingSize: 4, hasDynamicOffset: 0} }, { binding: 3, visibility: ShaderStage::Compute, buffer: {type: BufferBindingType::Storage, minBindingSize: 4, hasDynamicOffset: 0} }, { binding: 4, visibility: ShaderStage::Compute, texture: {sampleType: TextureSampleType::UnfilterableFloat, viewDimension: 2, multisampled: 0} }]

  • While validating [BindGroupDescriptor] against [BindGroupLayout (unlabeled)]
  • While calling [Device “BabylonWebGPUDevice9”].CreateBindGroup([BindGroupDescriptor]).

Can you help me resolve this issue please ?

Texture binding | Babylon.js Playground

Thanks

Welcome aboard!

By default, a sampler will be bound for a texture when you call ComputeShader.setTexture. If you don’t want this behavior, you should pass false for the 3rd parameter:

1 Like

Thank you, Evgeni_Popov

You saved my day !