Open schell opened 4 hours ago
@jimblandy had mentioned later in the matrix channel that in order to properly support this, we may need to do something similar to the atomics upgrade.
What that means is storing the pointer to the image during parsing and then doing a late-pass over the generated module to inspect how that image is used (read or write or readwrite), and then updating the type accordingly.
Description As I wrote about here and as far as I can tell, it's not possible to write to textures in
wgpu
if your shader is SPIR-V.This seems to be because the
OpTypeImage
passed toOpImageWrite
must have its "Sampled" parameter set to2
:...
I think
naga
's spv frontend erroneously assumes that2
in this case means read AND write instead of "one of readonly, writeonly or readwrite", as is implied by only having one value for all of them in the SPIR-V spec.Repro steps Working on it...
Expected vs observed behavior I expect to be able to build my shader pipeline and write to storage textures.
Instead, I got this error:
I should note that simply marking my texture as read+write is not an option as that is a native-only feature and I target web.