Shader cross-compiler #34
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "TheSpydog/Refresh:shadercompiler"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This PR adds a shader cross-compiler program (written in C#) that uses glslc and spirv-cross to compile GLSL source files to a custom, Refresh-specific shader blob format that contains shader code for various backends.
The goal is that whenever you want to compile your shaders, you just run this program (either via
refreshc
ordotnet run
), passing in the path to the GLSL source file. You can specify which backends you want to support via flags (--vulkan
, for instance), and it will generate a .refresh blob file for Refresh to consume.This can also be extended via C# defines and the
partial class
system. An example is the PS5 shader implementation, whose logic is squirreled away in the NDA'd repository but can be called in sequence with the rest of the shader cross-compile logic. This way, we don't have to run two separate programs to compile our shaders to all supported platforms.Refresh handles all the parsing of the file format in Refresh_CreateShaderModule, so individual backends do not need to concern themselves with the particulars.
WIP: Shader cross-compilerto Shader cross-compiler