Since 8.3.1 I have had no luck getting MGFXC to work with Wine on MacOS (x64).
The steps I’m taking:
Install .NET 6 SDK & Runtimes
Install MGFXC Dotnet tool
Install Wine64 & update to 6.0
Run mgfxc_wine_setup.sh helper script
mgfxc test.fx test.fx.out /Profile:OpenGL
Compilation has never succeeded but have seen it fail in various different ways:
Exits silently, doesn’t compile (most common)
Wine fails to find c:/windows/system32/dotnet.exe (it’s there, I’ve checked!)
I believe this approach worked well using 8.3 (but shaders compiled on 8.3 are not compatible with 8.3.1).
I’ve also failed with similar results on Ubuntu x64 and ARM64. The only success I’ve had was from using Windows (Bootcamped on Mac x64), which suggests the issue lies in compatibility with Wine.
Has anyone had any luck using 8.3.1 version MGFXC with Wine?
I spent about 6 hours trying to fix this under Ubuntu and and couldn’t get it to work (I was pretty frustrated by the end, as you might imagine). I’m using a virtual machine to build my shaders now
It seems to be some kind of issue with wine trying to run dotnet as a 32-bit application instead of a 64-bit one for some reason I couldn’t decipher. It fails to find c:/windows/system32/dotnet.exe because it’s actually looking for c:/windows/syswow64/dotnet.exe. Even once I got the 64-bit dotnet executable to run by installing it somewhere else it would still think it’s in 32-bit mode, so MGFXC just instantly crashed anyways.
Even copy and pasting those exact commands my shaders still wont build. I have no idea how to debug this because it seems to be something external to monogame, and even messing with WineHelper.cs in MonoGame.Effect.Compiler I couldn’t make any progress.
I updated to Ubuntu 22.04 at the same time I updated to monogame 3.8.1, maybe it’s an issue with specific wine versions?
I think I figured it out! Not sure why I didn’t check this earlier but for some reason the mgfxc_wine_setup.sh downloads the 32-bit version of dotnet than puts it in the 64-bit system32! Let me know if this works for you; delete ~/.winemonogame then replace line 32 of mgfxc_wine_setup.sh with
I’m having trouble getting it to work though. It appears that all the steps go through, but when I actually go to compile shaders (after the Setup Wine step), I get mgfxc: command not found
I noticed that the actual shader compilation is not in the script. Is it in a build action for you?