Update MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
Make fallback screen names consistent.
This commit is contained in:
parent
a97ba52dbf
commit
dae20de48a
@ -615,14 +615,12 @@ void MVKSwapchain::initSurfaceImages(const VkSwapchainCreateInfoKHR* pCreateInfo
|
|||||||
if (mtlLayer) {
|
if (mtlLayer) {
|
||||||
NSString* screenName = @"Main Screen";
|
NSString* screenName = @"Main Screen";
|
||||||
#if MVK_MACOS && !MVK_MACCAT
|
#if MVK_MACOS && !MVK_MACCAT
|
||||||
// To prevent deadlocks, avoid dispatching to the main thread at the cost of a less informative log.
|
// To prevent deadlocks, avoid dispatching screenMVK to the main thread at the cost of a less informative log.
|
||||||
if (NSThread.currentThread.isMainThread) {
|
if (NSThread.isMainThread) {
|
||||||
auto* screen = mtlLayer.screenMVK;
|
auto* screen = mtlLayer.screenMVK;
|
||||||
if ([screen respondsToSelector:@selector(localizedName)]) {
|
if ([screen respondsToSelector:@selector(localizedName)]) {
|
||||||
screenName = screen.localizedName;
|
screenName = screen.localizedName;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
screenName = @"?";
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
MVKLogInfo("Created %d swapchain images with size (%d, %d) and contents scale %.1f in layer %s (%p) on screen %s.",
|
MVKLogInfo("Created %d swapchain images with size (%d, %d) and contents scale %.1f in layer %s (%p) on screen %s.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user