Open
Description
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)
). MVKPhysicalDevice::_timestampMTLCounterSet
exists.MVKPhysicalDeviceMetalFeatures::counterSamplingPoints
is empty.