| 1 |
|
| 2 |
Instructions to rebuild imgui_impl_sdlgpu3_shaders.h |
| 3 |
(You don't need to copy this folder if you are using the backend as-is) |
| 4 |
|
| 5 |
1) Compile the raw shader files to SPIRV: |
| 6 |
|
| 7 |
glslc -o vertex.spv -c shader.vert |
| 8 |
glslc -o fragment.spv -c shader.frag |
| 9 |
|
| 10 |
|
| 11 |
2) Build SDL_shadercross (https://github.com/libsdl-org/SDL_shadercross) |
| 12 |
|
| 13 |
|
| 14 |
3-A) Compiling for the Vulkan Driver: |
| 15 |
|
| 16 |
Nothing to do, you just need the previous vertex.spv/fragment.spv, proceed to step 4 |
| 17 |
|
| 18 |
|
| 19 |
3-B) Compiling for the DirectX 12 Driver: |
| 20 |
|
| 21 |
./shadercross vertex.spv -s SPIRV -d DXBC -t vertex -e main -o vertex.dxbc |
| 22 |
./shadercross fragment.spv -s SPIRV -d DXBC -t fragment -e main -o fragment.dxbc |
| 23 |
|
| 24 |
Proceed to step 4 |
| 25 |
|
| 26 |
|
| 27 |
3-C) Compiling for Metal (On windows you'll need the Metal Developer Tools for Windows, on linux you might use wine, but I never tested it): |
| 28 |
|
| 29 |
./shadercross vertex.spv -s SPIRV -d MSL -t vertex -e main -o vertex.metal |
| 30 |
./shadercross fragment.spv -s SPIRV -d MSL -t fragment -e main -o fragment.metal |
| 31 |
|
| 32 |
xcrun -sdk macosx metal -o vertex.ir -c vertex.metal |
| 33 |
xcrun -sdk macosx metal -o fragment.ir -c fragment.metal |
| 34 |
xcrun -sdk macosx metallib -o vertex.metallib -c vertex.ir |
| 35 |
xcrun -sdk macosx metallib -o fragment.metallib -c fragment.ir |
| 36 |
|
| 37 |
Proceed to step 4 |
| 38 |
|
| 39 |
|
| 40 |
4) Use a tool like https://notisrac.github.io/FileToCArray/ or misc/fonts/binary_to_compressed_c.cpp in imgui repository to convert the file to a uint8_t array. |