# Uniform control flow webgpu

**URL:** <https://forum.babylonjs.com/t/uniform-control-flow-webgpu/51576>\
**Category:** Questions\
**Created:** [June 25, 2024, 1:35am UTC](https://forum.babylonjs.com/t/uniform-control-flow-webgpu/51576 "2024-06-25T01:35:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![troy](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@troy](https://forum.babylonjs.com/u/troy)\
**Post date:** [June 25, 2024, 1:35am UTC](https://forum.babylonjs.com/t/uniform-control-flow-webgpu/51576/1 "2024-06-25T01:35:29Z")

</div>

same code works in webgl ,error in webgpu. uniform control flow  
[https://playground.babylonjs.com/#DAC1WM#373](https://playground.babylonjs.com/#DAC1WM#373)  
[https://playground.babylonjs.com/#DAC1WM#372](https://playground.babylonjs.com/#DAC1WM#372)  
what is the real reason

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 25, 2024, 7:50am UTC](https://forum.babylonjs.com/t/uniform-control-flow-webgpu/51576/2 "2024-06-25T07:50:45Z")

</div>

Basically you are sampling a texture from a non uniform control flow (inside an if statement)

cf [Texture sampler and non uniform control flow](https://forum.babylonjs.com/t/texture-sampler-and-non-uniform-control-flow/46084)

TLDR:

Add `#define DISABLE_UNIFORMITY_ANALYSIS` to your shader code, or find a way to sample the texture from a uniform control flow.
