Open soltanmm opened 2 years ago
This is a bit of a gray issue. From the point of shader translation - it doesn't care. The lack of readable texture storages can be seen as a limitation from the pipeline interface side, and all those validations happen on wgpu side. However, from the practical point of view, it would be better to get an error at shader module creation instead of the pipeline creation. So we should add this check to Naga.
AFAICT, according to Resource Layout Compatibility, WGSL does not consider write-only storage buffers to be part of the resource interface.
Naga 0.8.5 appears to validate the following fragment of module-scope WGSL:
Behavior on
master
-as-of-this-post is similar. Inserting the following module-scope WGSL fragment intests/in/access.wgsl
results in a passingcargo test
:But trying to actually use such a binding through
wgpu
results in errors like:Because it's making the reasonable assumption that the shader wanted something readable.