I have an issue with 3D ProceduralTextures where the uniforms layer
and layerNum
usually (but not always) result in WebGL: INVALID_OPERATION: uniform1i: location is not from the associated program
. This doesn’t happen in WebGPU and this is why the “3D Procedural Textures” visualization test is currently disabled for WebGPU.
Here’s a Playground. When you run it, you will sometimes see the error (and the output will be wrong) and sometimes everything will be fine.
I think the WebGL error itself may occur if the shader doesn’t reference the uniform (or if it’s been optimized away) so I’m less concerned about that and more with the non-deterministic output.