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

[Mac OS] Shader compilation fails #124

Open
douira opened this issue Mar 3, 2022 · 12 comments
Open

[Mac OS] Shader compilation fails #124

douira opened this issue Mar 3, 2022 · 12 comments
Labels
bug help wanted major bug Bugs stopping things from working at all

Comments

@douira
Copy link

douira commented Mar 3, 2022

Describe the bug
The latest release release-331 crashes with the following error:

[...]
INFO|PluginManager|Registered 0 plugin instances 
 INFO|PluginManager|Enabled 0 plugins! 
 INFO|Alex|Startup time: 00:00:40.2538415 
Unhandled exception. System.InvalidOperationException: Shader Compilation Failed
   at Microsoft.Xna.Framework.Graphics.Shader.GetShaderHandle()
   at Microsoft.Xna.Framework.Graphics.ShaderProgramCache.Link(Shader vertexShader, Shader pixelShader, Shader hullShader, Shader domainShader, Shader geometryShader, Shader computeShader)
   at Microsoft.Xna.Framework.Graphics.ShaderProgramCache.GetProgram(Shader vertexShader, Shader pixelShader, Shader hullShader, Shader domainShader, Shader geometryShader, Shader computeShader)
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ActivateShaderProgram()
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformApplyState(Boolean applyShaders)
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformDrawIndexedPrimitives(PrimitiveType primitiveType, Int32 baseVertex, Int32 startIndex, Int32 primitiveCount)
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType primitiveType, Int32 baseVertex, Int32 startIndex, Int32 primitiveCount)
   at Alex.Graphics.Models.ModelMeshPart.Draw(GraphicsDevice graphicsDevice, Effect effect)
   at Alex.Graphics.Models.Model.Draw(Matrix world, Matrix view, Matrix projection, Matrix[] matrices, Effect effect)
   at Alex.Entities.Entity.Render(IRenderArgs renderArgs, Boolean useCulling)
   at Alex.Gui.Elements.Context3D.GuiEntityModelView.EntityDrawable.DrawContext3D(IRenderArgs args, IGuiRenderer guiRenderer)
   at Alex.Gui.Elements.Context3D.GuiContext3DElement.OnDraw(GuiSpriteBatch graphics, GameTime gameTime)
   at RocketUI.RocketElement.Draw(GuiSpriteBatch graphics, GameTime gameTime)
   at RocketUI.RocketElement.ForEachChild(Action`1 childAction)
   at RocketUI.RocketElement.Draw(GuiSpriteBatch graphics, GameTime gameTime)
   at RocketUI.GuiManager.Draw(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.SortingFilteringCollection`1.ForEachFilteredItem[TUserData](Action`2 action, TUserData userData)
   at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at Alex.Program.LaunchGame(LaunchSettings launchSettings)
   at Alex.Program.Main(String[] args)
zsh: abort

Additionally a section of the window flickers red/black before it crashes. Resizing the window by any amount stops that.

To Reproduce
Steps to reproduce the behavior:

  1. Start the binary and wait for it to crash after downloading assets.

Expected behavior
It should not crash. (and also not flicker)

Screenshots
The window does appear but then disappears after the crash.
Screenshot 2022-03-03 at 19 14 05
The area in the window that is black flickers between black and red every frame.

Some time before the crash but after resizing to make the flickering go away:
Screenshot 2022-03-03 at 19 17 15

Desktop (please complete the following information):

  • OS: macOS 12.2.1 (Monterey)
  • Platform: x64 (CPU: Intel i7 6700K)
  • GPU: AMD Radeon RX 6900 XT
  • Build number: 1.0.0-8919d98

If possible, I would also like to know where Alex stores the downloaded assets and other data.

@douira douira added the bug label Mar 3, 2022
@kennyvv
Copy link
Member

kennyvv commented Mar 7, 2022

Hi @douira ,
Thanks for the bug report!
I sadly don't have a mac available to test on, so it will probably take me a while before i can work on fixing this.
Secondly, to answer your question, the assets are stored under your user folder.

On a linux system this would be "~/.config/Alex", i think it's the same on a mac. It's the equivalent of the %appdata% folder on a windows machine.

@kennyvv kennyvv added help wanted major bug Bugs stopping things from working at all labels Mar 7, 2022
@douira
Copy link
Author

douira commented Mar 7, 2022

Thanks for looking into it. If you want me to test something, I can try to help. I suspect this issue has something to do with Apple's implementation of OpenGL on macOS. Additionally, it only has support for OpenGL 4.1.

It's the equivalent of the %appdata% folder on a windows machine.

On macOS the equivalent of the %appdata% folder is ~/Library/Application Support/Alex. That's also where Minecraft stores it's application data (in it's own folder minecraft). Putting it in .config is ok but a little unusual since one wouldn't expect it to be there on macOS.

@kennyvv kennyvv changed the title Crashes on macOS after asset download because of failed shader compilation [Mac OS] Shader compilation fails Mar 8, 2022
@kennyvv
Copy link
Member

kennyvv commented Mar 13, 2022

The latest release has a new version of the library responsible for shader compilation, so if you could test this again, that would be great! Tho i'm not very hopeful it's gonna be fixed

@douira
Copy link
Author

douira commented Mar 27, 2022

I tried it again now and it still fails on shader compilation.

@hackedXD
Copy link

hackedXD commented Apr 3, 2022

same thing for me ;)

@kennyvv
Copy link
Member

kennyvv commented Apr 14, 2022

Small update, i have a machine i can test this on now. So i will be looking into the issue as soon as i've got time to do so!

@ghost
Copy link

ghost commented Apr 15, 2022

I wanted to say that I get seemingly the same problem on Guix (Linux). I’m using Mesa (as opposed to CUDA) for OpenGL.

@kennyvv
Copy link
Member

kennyvv commented Apr 16, 2022

I have a decent idea of what the issue is, just need to take the time to fix it.

It seems like it's todo with the OpenGL version used for the shaders, as i did manage to get it to run when swapping them out for different ones.

@devgocri
Copy link

When would there be a fix to this?

@Declan-Reid
Copy link

Any update on this?

@onion108
Copy link

Any update?

@Declan-Reid
Copy link

I think this might have died. Very sad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted major bug Bugs stopping things from working at all
Projects
None yet
Development

No branches or pull requests

6 participants