Open4
C-WebGL: MesaのOpenGL ESをWindows上で使う
mesa-dist-win https://github.com/pal1000/mesa-dist-win にはMesaが入っているので、VulkanだけではなくOpenGLやOpenGL ESの実装もある。Vulkanはダメだったけど、こっちは大丈夫だった。
コピーするDLL
libglapi.dll
libgallium_wgl.dll
libGLESv2.dll
libEGL.dll
の4つ(+ pdb)と、
dxil.dll
をコピーしてやる必要があった。
dxil.dllが無いとクラッシュする
libgallium_wgl.dll!dxil_get_validator_version(dxil_validator * val=0x0000000000000000) Line 367 C++ Symbols loaded.
libgallium_wgl.dll!compile_nir(d3d12_context * ctx=0x000001b715b01010, d3d12_shader_selector * sel, d3d12_shader_key * key=0x0000000eed8fddc0, nir_shader * nir=0x000001b713573360) Line 177 C++ Symbols loaded.
libgallium_wgl.dll!select_shader_variant(d3d12_selection_context * sel_ctx=0x0000000eed8fe720, d3d12_shader_selector * sel=0x000001b7151345f0, d3d12_shader_selector * prev=0x0000000000000000, d3d12_shader_selector * next=0x0000000000000000) Line 1372 C++ Symbols loaded.
libgallium_wgl.dll!d3d12_create_shader_impl(d3d12_context * ctx=0x000001b715b01010, d3d12_shader_selector * sel=0x000001b7151345f0, nir_shader * nir=0x000001b713574c20, d3d12_shader_selector * prev=0x0000000000000000, d3d12_shader_selector * next=0x0000000000000000) Line 1533 C++ Symbols loaded.
libgallium_wgl.dll!d3d12_create_shader(d3d12_context * ctx=0x000001b715b01010, pipe_shader_type stage, const pipe_shader_state * shader) Line 1587 C++ Symbols loaded.
libgallium_wgl.dll!st_create_nir_shader(st_context * st, pipe_shader_state * state=0x0000000eed8fea20) Line 543 C Symbols loaded.
libgallium_wgl.dll!st_create_common_variant(st_context * st=0x000001b71421d5b0, gl_program * prog=0x000001b715144ba0, const st_common_variant_key * key=0x0000000eed8feea8) Line 764 C Symbols loaded.
libgallium_wgl.dll!st_get_common_variant(st_context * st=0x000001b71421d5b0, gl_program * prog=0x000001b715144ba0, const st_common_variant_key * key=0x0000000eed8feea8) Line 814 C Symbols loaded.
[Inline Frame] libgallium_wgl.dll!st_precompile_shader_variant(st_context *) Line 1288 C Symbols loaded.
libgallium_wgl.dll!st_finalize_program(st_context * st=0x000001b71421d5b0, gl_program * prog=0x000001b715144ba0) Line 1366 C Symbols loaded.
libgallium_wgl.dll!st_link_nir(gl_context * ctx=0x000001b7141c4e80, gl_shader_program * shader_program) Line 956 C++ Symbols loaded.
libgallium_wgl.dll!st_link_shader(gl_context * ctx, gl_shader_program * prog=0x000001b7159e0d30) Line 108 C++ Symbols loaded.
libgallium_wgl.dll!_mesa_glsl_link_shader(gl_context * ctx=0x000001b7141c4e80, gl_shader_program * prog=0x000001b7159e0d30) Line 91 C++ Symbols loaded.
[Inline Frame] libgallium_wgl.dll!link_program(gl_context *) Line 1332 C Symbols loaded.
libgallium_wgl.dll!link_program_error(gl_context * ctx=0x000001b7141c4e80, gl_shader_program * shProg=0x000001b7159e0d30) Line 1443 C Symbols loaded.
> test-imgui-win32.exe!cwgl_linkProgram(cwgl_ctx_s * ctx=0x000001b714211340, cwgl_Program_s * program=0x000001b715a375a0) Line 264 C Symbols loaded.
test-imgui-win32.exe!ImGui_ImplCwgl_Init(cwgl_ctx_s * ctx=0x000001b714211340) Line 69 C++ Symbols loaded.
test-imgui-win32.exe!YFRM_ENTRYPOINT(int ac=0x00000001, char * * av=0x000001b710d26040) Line 40 C++ Symbols loaded.
test-imgui-win32.exe!SDL_main(int ac=0x00000001, char * * av=0x000001b710d26040) Line 8 C Symbols loaded.
test-imgui-win32.exe!main_getcmdline() Line 80 C Symbols loaded.
test-imgui-win32.exe!WinMain(HINSTANCE__ * hInst=0x00007ff6fb4e0000, HINSTANCE__ * hPrev=0x0000000000000000, char * szCmdLine=0x000001b710ce6e68, int sw=0x0000000a) Line 110 C Symbols loaded.
test-imgui-win32.exe!invoke_main() Line 107 C++ Symbols loaded.
test-imgui-win32.exe!__scrt_common_main_seh() Line 288 C++ Symbols loaded.
test-imgui-win32.exe!__scrt_common_main() Line 331 C++ Symbols loaded.
test-imgui-win32.exe!WinMainCRTStartup(void * __formal=0x0000000eed6f7000) Line 17 C++ Symbols loaded.
kernel32.dll!BaseThreadInitThunk() Unknown Symbols loaded.
ntdll.dll!RtlUserThreadStart() Unknown Symbols loaded.
これはMesaのGitLabに既に起票されていて、既に修正 https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22141 されているようだ。
インポートライブラリだけバイナリコミットする
.def
から生成するとか色々考えたけど、まぁ直接コミットしちゃって良いかということでバイナリを置いた。
これをリンクする。