Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are atomic operations allowed on writeonly memory? #174

Open
ianromanick opened this issue Jan 11, 2022 · 1 comment
Open

Are atomic operations allowed on writeonly memory? #174

ianromanick opened this issue Jan 11, 2022 · 1 comment
Assignees

Comments

@ianromanick
Copy link

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.

@pdaniell-nv pdaniell-nv added this to the Needs Action/PR milestone Jan 19, 2022
@pdaniell-nv
Copy link
Contributor

We discussed this in the 2022-01-19 meeting. The built in atomic functions should not be allowed on readonly or writeonly memory. We'll clarify the spec to explicitly forbid them, but being careful to not contradict the Vulkan memory model extension which has atomicRead and atomicWrite which would be allowed on readonly and writeonly respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants