I am not sure if this is even supposed to be possible. I am trying to convert something like the ping pong webgpu example to TSL. No matter what I try, I cannot use textureLoad
to read from a StorageTexture, I always get an error such as:
texture-load.html:1 Error while parsing WGSL: :43:13 error: no matching call to 'textureLoad(texture_2d<f32>, vec2<i32>)'
I tried with a regular DataTexture
and textureLoad
does work with this.
Can anyone chime in here who maybe knows a bit more than me about this kind of thing? I’ve been messing with this stuff for days. I’m starting to think that textureLoad
in TSL is not an equivalent for the textureLoad
WGSL command, or perhaps it is but there is something missing that would be required for it to read from a storage texture.
If anyone has an example of ping/pong storage texture read/write using TSL Fn
rather than wgslFn
I would love to see. Generally, any pointers or additional info would also be greatly appreciated