Closed bryanedds closed 2 months ago
Did some quick tinkering, and on Linux, it is indeed that easy... maybe.
After exporing MESA_LOADER_DRIVER_OVERRIDE=zink
, you can then confirm that it's on Zink by doing glxinfo | grep 'renderer string'
, which will confirm that it's on Zink.
On my AMD machine, it now crashes without an error message here:
Shader.CreateShaderFromStrs() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Shader.fs:line 34
Shader.CreateShaderFromFilePath() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Shader.fs:line 63
Filter.CreateFilterBoxShader()
GlRenderer3d.make()
RendererInline.Nu.RendererProcess.Start()
WorldModule3.World.tryMake.Static()
WorldModule3.World.run.Static()
Program.main()
Sadly, this isn't as far as it was making it before, which was here:
Gl.GetTextureHandleARB() at /home/rei/.config/JetBrains/Rider2024.1/resharper-host/DecompilerCache/decompiler/414ce548b1474721b05451b5df65cc5022d800/8a/8896862c/Gl.cs:line 25,810
Texture.TryCreateTextureHandle() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Texture.fs:line 373
Texture.CreateTextureHandle()
Framebuffer.TryCreateShadowBuffers()
GlRenderer3d.make()
RendererInline.Nu.RendererProcess.Start()
WorldModule3.World.tryMake.Static()
WorldModule3.World.run.Static()
Program.main()
So we can't be sure if it's an improvement or not, or if this is insurmountable again.
Getting Zink working on Windows seems to be a whole other thing, so I'll have to investigate further.
This is probably a good starting point for getting Zink on windows.
The only reasonable approach remaining was to rip out bindless texture utilization. But it is done and can be tested on other AMD machines.
EDIT: We spent many months trying to get AMD's opengl drivers to work with our renderer once we switched over to bindless textures. Here's where I landed at before giving up -
https://github.com/bryanedds/Nu/blob/536a4028a6eae17d7eac01d58f1c2019293b590f/Nu/Nu.Gaia/Assets/Default/PhysicallyBasedDeferredLightMapping.glsl#L68