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

Remove unused "mNormal" uniform to fix crash on GLES2 with shaders #13843

Merged
merged 1 commit into from Sep 24, 2023

Conversation

grorp
Copy link
Member

@grorp grorp commented Sep 24, 2023

Fixes #13841.

Clients with video_driver = ogles2 and enable_shaders = true (the defaults on Android) sometimes crash with the following error:

ERROR[Main]: /mt/src/client/shader.cpp:121: virtual void MainShaderConstantSetter::onSetConstants(video::IMaterialRendererServices *): An engine assumption 'normal.makeInverse()' failed.

I have no minimal reproducible example for triggering the crash, but you can trigger it by playing the "Murder" minigame as seen on the "[Minigames] A.E.S." server.

The crash occurs in the code that is responsible for calculating the value of the mNormal shader uniform on GLES2. I have no idea what's going on there, maybe the math is wrong, but: The uniform is unused, and it looks like it has been unused since its introduction in #10506.

Since mNormal is unused, I simply removed it. That fixes the crash.

To do

This PR is a Ready for Review.

How to test

  1. Compile Minetest with ENABLE_GLES2=TRUE and put video_driver = ogles2 and enable_shaders = true into your minetest.conf.

    OR

    Use an Android build.

  2. Join the "[Minigames] A.E.S." server on the public serverlist with three clients and play the "Murder" minigame.

  3. Verify that none of your clients crash during the game.

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sfan5 sfan5 merged commit ff87be6 into minetest:master Sep 24, 2023
13 checks passed
@grorp grorp deleted the fix-gles2-crash branch December 18, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client crash caused by normal.makeInverse() assertion on GLES2 with shaders
2 participants