KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.76k stars 419 forks source link

Enable use of native texture atomics. #2164

Closed js6i closed 7 months ago

js6i commented 7 months ago

This commit conditionally skips the emulated image atomics paths if native texture atomics are available and a configuration option is set.

Apart from unlocking some potential performance benefits from not having to force some textures to be linear, it also makes texture atomics work with argument buffers.

js6i commented 7 months ago

Apart from #2168, I found a second issue when testing another patch - the validation layer complains about MTLTextureUsageShaderAtomic when the pixel format isn't an integer, which currently triggers for buffer views, and images in the _mutableFormat case. Maybe I was not overly tentative after all.

Perhaps, for image views, we could force the primary pixel format of the texture to be an integer, and then make views on that..

@billhollings

billhollings commented 7 months ago

Apart from #2168, I found a second issue when testing another patch - the validation layer complains about MTLTextureUsageShaderAtomic when the pixel format isn't an integer, which currently triggers for buffer views, and images in the _mutableFormat case. Maybe I was not overly tentative after all.

Perhaps, for image views, we could force the primary pixel format of the texture to be an integer, and then make views on that..

@billhollings

Can you open an issue tracker for this second valuation issue?