diff options
author | 2025-02-06 08:45:34 +0100 | |
---|---|---|
committer | 2025-02-06 08:45:34 +0100 | |
commit | c1bddc67a1c66c932fad038913ca49bbcc34b059 (patch) | |
tree | d0006d5df8422394fc73af699ae8805cfe80882b /src/osd/modules/render/bgfx/shadermanager.cpp | |
parent | 11cd46119a8d8fb0963011bf8a0f0affce317eda (diff) |
emscripten: fixes to get bgfx working (#13255)
* Emscripten: Fixes to get BGFX working
* Move emscripten specific setup into an #elif statement
* Fix indentation
* emscripten: remove no longer link option DEMANGLE_SUPPORT
Diffstat (limited to 'src/osd/modules/render/bgfx/shadermanager.cpp')
-rw-r--r-- | src/osd/modules/render/bgfx/shadermanager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/shadermanager.cpp b/src/osd/modules/render/bgfx/shadermanager.cpp index 763a744e4aa..282029cb96a 100644 --- a/src/osd/modules/render/bgfx/shadermanager.cpp +++ b/src/osd/modules/render/bgfx/shadermanager.cpp @@ -83,6 +83,15 @@ std::string shader_manager::make_path_string(const osd_options &options, const s { std::string shader_path(options.bgfx_path()); shader_path += PATH_SEPARATOR "shaders" PATH_SEPARATOR; + +#if defined(SDLMAME_EMSCRIPTEN) + // Hard-code renderer type to OpenGL ES for emscripten builds since the + // bgfx::getRendererType() is called here before BGFX has been + // initialized and therefore gives the wrong renderer type (Noop). + shader_path += "essl" PATH_SEPARATOR; + return shader_path; +#endif + switch (bgfx::getRendererType()) { case bgfx::RendererType::Noop: |