9313750f0a
This patch adds an alternative path for devices/OSs which do not support native texture atomics in Metal. Support is encapsulated within the backend, ensuring any allocated texture with the USAGE_ATOMIC flag is allocated with a backing buffer, upon which atomic operations happen. The shader generation is also changed for the atomic case, which instructs the backend to insert additional buffer bind-points for the buffer resource. As Metal also only supports buffer-backed textures for textureBuffers or 2D textures, TextureArrays and 3D textures are emulated within a 2D texture, with sample locations being indirected. All usage of atomic textures MUST now utilise the correct atomic texture types in the high level shader and GPUShaderCreateInfo declarations. Authored by Apple: Michael Parkin-White Pull Request: https://projects.blender.org/blender/blender/pulls/115956