Drastic differences between OpenGL and Vulkan on MacOS in MonoGame 3.8.5

I’m trying to migrate the Vulkan backend to be able to take advantage of native shader compiling on both Mac and Linux. I’d like to avoid installing external tools for this, in no small part because of Wine’s impending removal on MacOS (related MonoGame issue; I know that issue is talking about refactoring shader compilation code in MonoGame, but even if we get native OpenGL shader compilation, I don’t think it’ll come before September 1st).

Anyway, this is what I’m seeing in OpenGL:

And this is what I’m seeing with Vulkan:

And this gets printed out in the log:

Vulkan instance version: 1.2.296
Selected GPU: Apple M1
Supported Vulkan API version: 1.2.296
VK_EXT_custom_border_color is not supported by this driver!
VK_GOOGLE_hlsl_functionality1 is not supported by this driver!
VK_GOOGLE_user_type is not supported by this driver!

Now, I have seen some Vulkan-related issues on GitHub, but I’m not sure they’re exactly the same problem. For example, #9425 is only reported for Windows and #9430 is about swapchain and resizing issues (I think that might be why there’s a border of cornflower blue on my game).

I’ve tested the game on Linux as well, and while there were other issues, they weren’t this bad. That leads me to think that I have something set up wrong on Mac, and that it’s not (entirely) an issue with my rendering code.

For what it’s worth, that pink rectangle (board, in-game) is three RenderTargets overlaid on each other target before being drawn on the screen. I use a lot of render targets because there’s a lot of stuff in the game that doesn’t change a lot, and re-rendering it each frame could prove expensive. I do have RenderTargetUsage.PreserveContents set on the topmost render target, which is where I think a lot of the artifacts are coming from. While Vulkan visual artifacts when switching RenderTargets · Issue #9425 · MonoGame/MonoGame · GitHub reports a similar issue, running that project doesn’t yield the same errors that the reporter is seeing.

It would be a good idea to submit a GitHub Issue for this. They’re setup to handle Bug Reports much better than loose posts in the forums.

Hi, I have low-level Vulkan experience, and I can tell you that this error is caused by the fact that MonoGame implemented an extension or feature in its backend that your M1 GPU driver doesn’t support.

You have two options:

  1. In some cases, you can disable the unsupported functionality so your game doesn’t try to use it. This can sometimes be done through the GraphicsDevice, but I’d recommend asking ChatGPT how to disable it in MonoGame.

  2. Another option is to check whether there’s a way to make it work even if your driver doesn’t natively support it, possibly by installing additional software or compatibility layers. You can also ask ChatGPT about that.

the log you shared, those messages indicate that your Apple M1 Vulkan driver (MoltenVK) doesn’t support those specific Vulkan extensions. By themselves, they are just warnings and don’t necessarily explain why your game is failing.

If MonoGame (or one of the libraries you’re using) actually requires one of those extensions without providing a fallback, then that could indeed be the cause of the problem.

I’d recommend checking the complete error log after those messages.