Uniform control flow webgpu

same code works in webgl ,error in webgpu. uniform control flow
what is the real reason

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

cf Texture sampler and non uniform control flow


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