textureLoad
and textureStore
need bounds checks
#1080
Labels
Milestone
textureLoad
and textureStore
need bounds checks
#1080
For several of our back ends, the implementations of WGSL's
textureStore
andtextureLoad
exhibit undefined behavior if coordinates, array indices, sample indices in multisampled texels, or mip levels are out of bounds. This means that, to prevent undefined behavior on the web, Naga must be able to inject bounds checks into the generated code when used by WebGPU.This can probably use the same
IndexBoundsCheckPolicy
enum as used for array/vector/matrix accesses now. However, Naga should let clients control the image bounds check policy separately: some devices can check image bounds themselves, presumably more efficiently than Naga can, and in those cases we should leave it to the driver.Back ends needing work (add specific issues / PRs as filed):
The text was updated successfully, but these errors were encountered: