Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running with profile glspirv on mac results in unfriendly failure (crash) #67

Open
mcclure opened this issue May 16, 2024 · 0 comments
Open

Comments

@mcclure
Copy link

mcclure commented May 16, 2024

We are developing with FNA in C#. In a particular situation, we had a reason to want to force Core profile. Our understanding is in order to run in Core profile, Mojoshader must run with profile "glspirv"

When we tried this, the application failed with a segfault (on one run, we were able to trap it in a debugger reading from a NULL pointer in what appeared to be a mojoshader stack; on repeat runs, I can only get dotnet to terminate with error code 139, indicating a segfault).

Expected behavior

If glspirv is unsupported on some platforms, failure should look like an error printout followed by an exit with error code, not an actual crash.

I am only mostly sure this is happening in mojoshader. If this is actually an FNA bug I could file over there.

Repro

The error may be easily reproduced by taking any FNA test program and adding these lines before creating the Game object.

SDL2.SDL.SDL_SetHint("FNA3D_FORCE_DRIVER", "OpenGL");
SDL2.SDL.SDL_SetHint("FNA3D_OPENGL_FORCE_CORE_PROFILE", "1");
SDL2.SDL.SDL_SetHint("FNA3D_MOJOSHADER_PROFILE", "glspirv");

However, here is the test program (courtesy Love Conquers All Games) I've been using:

test-core-profile.zip

This zip contains prebuilt binaries of FNA3D incorporating mojoshader 7b7e5fd.

To run this, unzip it, and then from the project directory:

rm -r external/FNA && git clone --depth 1 --branch 24.05 --recurse-submodules https://github.com/FNA-XNA/FNA.git external/FNA
cd helloworld
dotnet run

In our tests, this works fine on Linux, but results in the crash on Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant