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.74k
stars
418
forks
source link
Move CPU/GPU timestamp correlation to vkGetPhysicalDeviceProperties() #1983
It turns out that MTLDevice sampleTimestamps:gpuTimestamp: executes synchronously with other queue activities, and can block GPU execution if it is called frequently.
Move timestamp correlation to the execution of vkGetPhysicalDeviceProperties() so it is called only on demand by the app.
Furthermore, MTLDevice sampleTimestamps:gpuTimestamp: should only be invoked if all of these conditions are met (otherwise the VkPhysicalDeviceLimits::timestampPeriod should be set to 1.0):
CPU is not Apple Silicon (!supportsMTLGPUFamily(Apple1)).
It turns out that
MTLDevice sampleTimestamps:gpuTimestamp:
executes synchronously with other queue activities, and can block GPU execution if it is called frequently.Move timestamp correlation to the execution of
vkGetPhysicalDeviceProperties()
so it is called only on demand by the app.Furthermore,
MTLDevice sampleTimestamps:gpuTimestamp:
should only be invoked if all of these conditions are met (otherwise theVkPhysicalDeviceLimits::timestampPeriod
should be set to1.0
):!supportsMTLGPUFamily(Apple1)
).MVKPhysicalDevice::_timestampMTLCounterSet
exists.MVKPhysicalDeviceMetalFeatures::counterSamplingPoints
is empty.