mamedev / mame

MAME
https://www.mamedev.org/
Other
7.79k stars 1.96k forks source link

Since 0.242 missing dx9 bgfx shaders on Linux cause bgfx to fail to initialize #9506

Open belegdol opened 2 years ago

belegdol commented 2 years ago

With 0.241, it was enough to ship essl, glsl and spirv shaders on Linux. With 0.242, missing dx9 shader causes an initialisation error:

BGFX: Unable to load required shaders. Please update the /home/julas/Pobrane/mame/bgfx/ folder or adjust your bgfx_path setting.

Strangely enough, dx11 and metal can be missing. While I could work around the issue by shipping dx9 shader in my RPM package, it seems wrong to have to ship non-working shaders.

belegdol commented 2 years ago

It appears that the issue is caused by the fact that dx9 is the default shader for the no renderer case: https://github.com/mamedev/mame/blob/ea30ec72f44ca373ceafbe9eab4c2897da0329c9/src/osd/modules/render/bgfx/shadermanager.cpp#L85 Moving noop to opengl makes the problem go away, but I am quite sure this is not a proper fix.

belegdol commented 2 years ago

It also appears that the shaders needed by -bgfx_backend are not checked. If I delete spirv shaders leaving dx9 in place and specify -bgfx_backend vulkan, mame will crash on startup.