KhronosGroup / MoltenVK

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.63k stars 402 forks source link

macOS fullscreen causes clear color to show strange pattern #2215

Closed chapatt closed 2 months ago

chapatt commented 2 months ago

I noticed a strange artifact when pressing the "fullscreen" button (the green one, third from the left) on my application on macOS: the clear color has this pattern. I tried it on the vkcube app (precompiled, bundled with the lunarg sdk), and it does the same. When an external display is attached, it works correctly (both on the internal and external displays).

Expected behavior: solid background color Observed behavior: sawtooth pattern

Screenshot 2024-04-23 at 11 50 55 PM

System info: Vulkan SDK versions tested: 1.3.250.0 and 1.3.280.1 Apple MacBook Air - Retina, 13-inch, 2020 1.1 GHz Dual-Core Intel Core i3 Intel Iris Plus Graphics 1536 MB 8 GB 3733 MHz LPDDR4X macOS Ventura 13.3.1

billhollings commented 2 months ago

I'm not able to replicate this on a 2017 MacBook Pro with Intel Quad Core & Intel HD 630 GPU on macOS Ventura 13.6.6 (and no external monitor attached). The background color is smooth in fullscreen.

And if the behaviour changes depending on whether you have an external monitor attached, I don't know if there is anything we can do within MoltenVK to make any difference. It seems like something to do with your underlying graphics driver or hardware.

Do you see anything like this with other applications?

chapatt commented 2 months ago

This test application I wrote exhibits the same behavior (see attached). Though I don't manually manage the graphics drivers in this environment, I can upgrade to macOS Sonoma 14.4.1 to see if any of the changes there fix it.

Screenshot 2024-04-25 at 11 42 31 AM Screenshot 2024-04-25 at 11 46 53 AM
billhollings commented 2 months ago

Do you see anything like this with other applications?

This test application I wrote exhibits the same behavior

I meant do you see this behaviour when you go full-screen on non-MoltenVK applications, such as native Metal games, or even desktop apps.

chapatt commented 2 months ago

Do you see anything like this with other applications?

This test application I wrote exhibits the same behavior

I meant do you see this behaviour when you go full-screen on non-MoltenVK applications, such as native Metal games, or even desktop apps.

I see what you mean now: I had never seen it before. Interestingly, I just built and ran this Metal test app from Apple (https://developer.apple.com/documentation/metal/using_a_render_pipeline_to_render_primitives), and it has the same issue. This can certainly be closed as a Metal/driver bug. Sorry to bother you :)

Screenshot 2024-04-25 at 2 05 22 PM
billhollings commented 2 months ago

I see what you mean now: I had never seen it before. Interestingly, I just built and ran this Metal test app from Apple (https://developer.apple.com/documentation/metal/using_a_render_pipeline_to_render_primitives), and it has the same issue. This can certainly be closed as a Metal/driver bug. Sorry to bother you :)

No worries about the false alarm. And thanks for being diligent about testing alternatives.