Metal: Disable usage attachment for atomic buffer textures #119785

Merged
Jeroen Bakker merged 1 commits from Jason-Fielder/blender:MetalAtomicFallbackTextureAssertFix into main 2024-04-11 10:46:34 +02:00
1 changed files with 7 additions and 1 deletions

View File

@ -2192,8 +2192,14 @@ void gpu::MTLTexture::prepare_internal()
* bandwidth implications for lossless compression and is considered best-practice.
*
* Attachment usage also required for depth-stencil attachment targets, for depth-update support.
* NOTE: Emulated atomic textures cannot support render-target usage. For clearing, the backing
* buffer is cleared instead.
*/
gpu_image_usage_flags_ |= GPU_TEXTURE_USAGE_ATTACHMENT;
if (!((gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_ATOMIC) &&
!MTLBackend::get_capabilities().supports_texture_atomics))
{
gpu_image_usage_flags_ |= GPU_TEXTURE_USAGE_ATTACHMENT;
}
/* Derive maximum number of mip levels by default.
* TODO(Metal): This can be removed if max mip counts are specified upfront. */