Bill Hollings 607aaff4c1 On macOS Apple Silicon, avoid managed-memory textures, and resource syncs.
Like their iOS/tvOS counterparts, macOS Apple Silicon GPUs support
using Shared memory for textures, and do not require resource
synchronization, even with Managed memory. This change treats
macOS Apple Silicon the same as iOS & tvOS.

- MVKPhysicalDevice add _hasUnifiedMemory & _isAppleGPU flags.
- MVKDeviceTrackingMixin add isUnifiedMemoryGPU() & isAppleGPU().
- Do not advertise host-visible-but-not-host-coherent
  Vulkan memory type on macOS Apple Silicon.
- Replace mvkMTLStorageModeFromVkMemoryPropertyFlags() with
  MVKPhysicalDevice::getMTLStorageModeFromVkMemoryPropertyFlags(),
  and return Shared instead of Managed for Apple Silicon,
  even if coherency is not requested.
- On unified memory devices, avoid needless calls to didModifyRange:,
  synchronizeResource:, and synchronizeTexture:slice:level:.
2024-04-29 17:13:17 -04:00
..