Merge pull request #2008 from danginsburg/issue_2006_2

Fix crash in Dota 2 on macOS < 10.15 - closes #2006
This commit is contained in:
Bill Hollings 2023-09-07 11:16:46 -04:00 committed by GitHub
commit 473ea0c2f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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