KhronosGroup / KhronosGroup/GLSL
Are atomic operations allowed on writeonly memory?
- Dominant language
- JavaScript
- Stars
- 458
- Forks
- 114
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
The spec is unclear whether memory decorated with `writeonly` can be passed to, for example, `atomicAdd`. The atomic operations are specifically described to read then write the memory in question, so it seem reasonable that either `writeonly` or `readonly` should be invalid. Section 8.11 (Atomic Memory Functions) goes to some effort to say that `restrict`, `coherent`, and `volatile` are valid, but it makes no mention of `readonly` or `writeonly`.
However, we have discovered that the GIANTS Editor does this in many of its shaders, and closed-source drivers from both AMD and NVIDIA accept the shaders.
See also https://gitlab.freedesktop.org/mesa/mesa/-/issues/5842.
Contributor guide
Assessment
This issue has not been assessed yet.