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

Issues with native atomics #2172

Closed
js6i opened this issue Mar 6, 2024 · 0 comments · Fixed by #2173
Closed

Issues with native atomics #2172

js6i opened this issue Mar 6, 2024 · 0 comments · Fixed by #2173
Labels

Comments

@js6i
Copy link
Collaborator

js6i commented Mar 6, 2024

The only Metal pixel formats that support MTLTextureUsageShaderAtomic are R32Int, R32UInt and RG32UInt. Currently other textures can be assigned that usage, causing an assertion. That's fallout from #2164.

First case is buffer views. We should only add atomic usage to the supported formats. VK_EXT_shader_atomic_float needs to be handled in some other way - maybe we could just use the old emulated path. However, we don't know the format when setting up the layout, which maybe is a problem in some cases..

Second is images which support integer views, but the base pixel format does not support atomics. My initial idea was to make the base Metal texture be integer instead, and return views on that, which seems to work, but I'm a bit worried about it breaking something, and we could instead try just not setting MTLTextureUsageShaderAtomic - that's wrong by the docs, but in my testing, Metal does not seem to sound any alarms.

This issue was initially reported here.

@billhollings @cdavis5e

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

Successfully merging a pull request may close this issue.

2 participants