# Problem with binding texture\_2d

**URL:** <https://forum.babylonjs.com/t/problem-with-binding-texture-2d/55509>\
**Category:** Questions\
**Tags:** textures\
**Created:** [December 22, 2024, 7:38am UTC](https://forum.babylonjs.com/t/problem-with-binding-texture-2d/55509 "2024-12-22T07:38:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoai\_Duc](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hoai_duc/32/44428_2.png) [@Hoai\_Duc](https://forum.babylonjs.com/u/Hoai_Duc)\
**Post date:** [December 22, 2024, 7:38am UTC](https://forum.babylonjs.com/t/problem-with-binding-texture-2d/55509/1 "2024-12-22T07:38:21Z")

</div>

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](https://playground.babylonjs.com/#VACDY3#9)

Thanks

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 22, 2024, 3:35pm UTC](https://forum.babylonjs.com/t/problem-with-binding-texture-2d/55509/2 "2024-12-22T15:35:23Z")

</div>

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:

> **[Babylon.js Playground](https://playground.babylonjs.com/#VACDY3%2310)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![Hoai\_Duc](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hoai_duc/32/44428_2.png) [@Hoai\_Duc](https://forum.babylonjs.com/u/Hoai_Duc)\
**Post date:** [December 23, 2024, 1:36am UTC](https://forum.babylonjs.com/t/problem-with-binding-texture-2d/55509/3 "2024-12-23T01:36:47Z")

</div>

Thank you, [Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)

You saved my day !
