Fix crash in Dota 2 on macOS < 10.15 - closes #2006

This commit is contained in:
Dan Ginsburg 2023-08-31 09:13:26 -04:00
parent fd418aa7fe
commit 6acdd9fb91

View File

@ -1573,6 +1573,7 @@ VkResult MVKPhysicalDevice::getQueueFamilyProperties(uint32_t* pCount,
void MVKPhysicalDevice::updateTimestampsAndPeriod() {
if (_properties.vendorID == kAppleVendorId) { return; }
if ([_mtlDevice respondsToSelector: @selector(sampleTimestamps:gpuTimestamp:)]) {
MTLTimestamp earlierCPUTs = _prevCPUTimestamp;
MTLTimestamp earlierGPUTs = _prevGPUTimestamp;
[_mtlDevice sampleTimestamps: &_prevCPUTimestamp gpuTimestamp: &_prevGPUTimestamp];
@ -1587,6 +1588,7 @@ void MVKPhysicalDevice::updateTimestampsAndPeriod() {
_properties.limits.timestampPeriod = ((1.0 - a) * _properties.limits.timestampPeriod) + (a * tsPeriod);
}
}
}
#pragma mark Memory models