Shader translation library for SDL's GPU API.
  • C 42.4%
  • Perl 37.8%
  • CMake 18.7%
  • Shell 0.6%
  • Python 0.4%
  • Other 0.1%
Find a file
2026-04-24 18:39:30 +02:00
.github build-scripts: bump pre-built DirectXShaderCompiler binaries to 2026_02_20 2026-03-01 19:31:08 +01:00
.vscode Rename to SDL_shadercross 2024-11-13 15:19:03 -08:00
build-scripts build-scripts: bump pre-built DirectXShaderCompiler binaries to 2026_02_20 2026-03-01 19:31:08 +01:00
cmake Synchronize shared SDL cmake/wikiheaders sources 2025-11-29 00:01:59 +01:00
external dxc: add a few cherry-picked DirectXShaderCompiler submodule fixes 2026-04-24 18:39:30 +02:00
include/SDL3_shadercross Fix documentation for SDL_SHADERCROSS_PROP_SHADER_CULL_UNUSED_BINDINGS_BOOLEAN (#186) 2026-04-07 09:50:20 -07:00
src Only reflect spirv for active variables (#205) 2026-04-10 09:58:21 -07:00
test Fix property type suffixes (#180) 2025-09-20 12:04:07 -07:00
VisualC-GDK Add Xbox GDK project files 2024-12-20 13:09:50 -05:00
.gitignore Rename to SDL_shadercross 2024-11-13 15:19:03 -08:00
.gitmodules Use DirectXShaderCompiler 1.8.2502 with backported CMake 4.0 support (#153) 2025-06-11 20:16:48 +00:00
.wikiheaders-options cmake: generate and install man pages (#119) 2025-03-10 23:39:19 +01:00
CMakeLists.txt cmake: format fixes (use tab) 2026-04-11 20:02:04 +02:00
LICENSE.txt Formally add the zlib license 2024-10-04 15:02:30 -04:00
README.txt Rename to SDL_shadercross 2024-11-13 15:19:03 -08:00

SDL_shadercross

This is a library for translating shaders to different formats, intended for use with SDL's GPU API.
It takes SPIRV or HLSL as the source and outputs DXBC, DXIL, SPIRV, MSL, or HLSL.

This library can perform runtime translation and conveniently returns compiled SDL GPU shader objects from HLSL or SPIRV source.
This library also provides a command line interface for offline translation of shaders.

For SPIRV translation, this library depends on SPIRV-Cross: https://github.com/KhronosGroup/SPIRV-Cross
spirv-cross-c-shared.dll (or your platform's equivalent) can be obtained in the Vulkan SDK: https://vulkan.lunarg.com/
For compiling to DXIL, dxcompiler.dll and dxil.dll (or your platform's equivalent) are required.
DXIL dependencies can be obtained here: https://github.com/microsoft/DirectXShaderCompiler/releases
It is strongly recommended that you ship SPIRV-Cross and DXIL dependencies along with your application.
For compiling to DXBC, d3dcompiler_47 is shipped with Windows. Other platforms require vkd3d-utils.

This library is under the zlib license, see LICENSE.txt for details.