TsundereStation/dep
LibretroAdmin 2523b0ddc8 dep, common/vulkan, core, build: remove dep/glslang and the Vulkan ShaderCompiler infrastructure
Final patch in the glslang-elimination series. After this lands the
runtime glslang library and the wrapper that drove it are completely
gone from the project on the Vulkan side; the only path that still
performs runtime shader compilation is the Windows-only D3D11 / D3D12
backend, which uses Microsoft's own d3dcompiler.dll and has no
glslang relationship.

Build fix: src/core/gpu_hw_vulkan.cpp:395 still called
Vulkan::ShaderCompiler::DeinitializeGlslang() from
DestroyResources(), which broke after the previous patch dropped
the transitive include of shader_compiler.h via shader_cache.h.
Since CompileShader() is unreachable from anywhere in the build
glslang's lazy InitializeGlslang() inside CompileShader never fires
either, so the matching Deinit was already a no-op. Drop the call.

Removed:
  - src/common/vulkan/shader_compiler.cpp + shader_compiler.h
    (the Vulkan glslang -> SPIR-V wrapper). The whole API
    (ShaderCompiler::Type, CompileShader, InitializeGlslang,
    DeinitializeGlslang, SPIRVCodeVector, SPIRVCodeType) had no
    callers after the patch-15 batch FS / VS conversion.
  - dep/glslang/ (~4.4 MiB, ~110 source files including the
    MachineIndependent parser, the Pp preprocessor, the
    SPIRV serialiser, the StandAlone resource limits, and the
    Windows / Unix OSDependent abstraction). Last consumer was
    src/common/vulkan/shader_compiler.cpp.
  - The stale 'shader_compiler.h' include in
    src/common/vulkan/util.cpp (never used anything from the
    header; kept compiling only because it pulled in transitively
    reachable types via shader_compiler -> types.h).
  - Makefile.libretro: GLSLANG_DIR variable, -I$(GLSLANG_DIR) entry
    in INCFLAGS, vulkan/shader_compiler.cpp from the SOURCES_CXX
    list, the entire 'dep/glslang' block (~43 source files), and
    the OS-specific OSDependent ifeq.
  - src/common/CMakeLists.txt: vulkan/shader_compiler.cpp and
    vulkan/shader_compiler.h from the common target, and glslang
    from the target_link_libraries(common ...) call.
  - dep/CMakeLists.txt: add_subdirectory(glslang).

Also refreshed a couple of stale glslang-mentioning comments in
gpu_hw_vulkan.cpp's GetBatchFragmentShader / GetBatchPipeline slow-
path documentation - the multi-thread reasoning is unchanged but it
is no longer 'glslang lock-free' since there is no glslang.

Smoke tests:
  - g++ -fsyntax-only on the Vulkan common TUs touched here.
  - Tree-wide grep for 'glslang' / 'GLSLANG' / 'ShaderCompiler' /
    'shader_compiler' across src/, dep/CMakeLists.txt, and
    Makefile.libretro: every remaining hit is either the D3D11
    backend's own (still-live) ShaderCompiler namespace, or
    historical comments in embedded_shaders.{h,cpp} /
    shader_cache.{h,cpp} that explain why the pre-baked path
    exists. The latter are documentation, not code dependencies.

Library size impact:
  - dep/glslang/ tree removal: ~101,000 lines of C++ vendored
    third-party code deleted from the repo.
  - Linked output: the Vulkan-side glslang+SPIRV code paths were
    contributing roughly 700-900 KiB to the stripped libretro
    core on x86_64 release builds (varies by toolchain). After
    this patch the Vulkan backend's binary contribution is just
    the embedded SPIR-V .inc payload (~2.5 MiB) plus the small
    EmbeddedShaders / ShaderCache / Util / etc. wrappers - a net
    reduction overall.

Test priority:
  - Routine smoke under all three precompile modes (Disabled / Lazy /
    Enabled). Nothing changes functionally vs the previous patch -
    the only behavioural delta is that vkCreateShaderModule no
    longer goes through Vulkan::ShaderCompiler. Visual output and
    perf characteristics should be byte-identical.
  - Build verification on each supported toolchain: MSYS2 MinGW
    on Windows, the macOS qb / xcodeproj path, Linux GCC and
    Clang, plus the libnx and emscripten paths if those are still
    being exercised. The Makefile and CMake changes are mechanical
    but worth a cold build on each.
  - On first launch after this lands, vulkan_pipelines.bin should
    continue to grow / persist correctly and the legacy 0-byte
    vulkan_shaders.bin / 1-byte vulkan_shaders.idx files from
    pre-patch-16 builds should already be gone (cleaned up by the
    patch-16 Open() sweep that landed last cycle).

This closes the glslang-elimination series. Subsequent patches in
this area can focus on the corresponding work for other backends -
the OpenGL backend's runtime glslang path is still live, and the
D3D11 / D3D12 backends still ship their own runtime d3dcompiler
flow - but those are separate efforts.
2026-05-18 02:21:53 +02:00
..
glad Build: Unify MSBuild options in props files 2021-07-10 21:45:10 +10:00
libchdr Update libchdr. 2026-03-12 21:17:40 +00:00
libretro-common Add missing file 2024-05-19 21:04:44 +02:00
openbios Make OpenBIOS a built-in fallback. 2026-03-28 10:43:30 +00:00
stb Remove VRAM dumping. 2026-03-12 21:54:32 +00:00
vixl Build: Unify MSBuild options in props files 2021-07-10 21:45:10 +10:00
vulkan-loader GPU/Vulkan: Add complete VK_EXT_debug_utils API entry points 2021-08-01 10:56:56 -07:00
xbyak Remove some unused xbyak code 2022-09-12 20:12:20 +02:00
xxhash Build: Unify MSBuild options in props files 2021-07-10 21:45:10 +10:00
CMakeLists.txt dep, common/vulkan, core, build: remove dep/glslang and the Vulkan ShaderCompiler infrastructure 2026-05-18 02:21:53 +02:00