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.63k stars 402 forks source link

Support texel buffers for images on device memory with private (device-only) storage #2209

Open billhollings opened 2 months ago

billhollings commented 2 months ago

Vulkan supports creating a VkDeviceMemory on device-only storage (MTLStorageModePrivate), binding a VkImage and VkBuffer on the same memory offset, and then expecting changes in each resource to automatically propagate to the other.

MoltenVK supports this for host-accessible storage by creating a MTLBuffer in the MVKDeviceMemory and then creating the MVKImage as a texel buffer on that MTLBuffer.

This should also be supported for device-only storage as well.

This issue causes the following CTS tests to fail (among others no doubt):

dEQP-VK.image.host_image_copy.identical_memory_layout.linear.r8g8b8a8_unorm
dEQP-VK.image.host_image_copy.identical_memory_layout.linear.r32g32b32a32_sfloat
dEQP-VK.image.host_image_copy.identical_memory_layout.linear.r16_unorm
dEQP-VK.image.host_image_copy.identical_memory_layout.linear.r16g16_uint
dEQP-VK.image.host_image_copy.identical_memory_layout.linear.r16_sfloat