Do note that I'm not the most comfortable with C, so I may have made some beginner mistakes with this PR.
This PR also comes bundled with a couple tiny other changes I made while doing this refactor, notably
SDL_ShaderCross_GetShaderFormats has been split in two, and the returned formats are accurate to what is actually possible to generate given the loaded compilers
SDL_ShaderCross_INTERNAL_CompileDXC takes in an encoding parameter, however it is left unexposed past that, since FXC cannot handle it. Maybe its something worth allowing in the future with a safety check on the FXC path? I don't think its particularly uncommon to want to use unicode characters in comments and such.
Refactored SDL_ShaderCross_INTERNAL_CompileDXC to create a new IDxcCompiler3 every call, allowing the function to be thread-safe. Maybe this could be made thread-local in the future to allow re-use, if supported by the C compiler.
Closes #7
Do note that I'm not the most comfortable with C, so I may have made some beginner mistakes with this PR.
This PR also comes bundled with a couple tiny other changes I made while doing this refactor, notably
SDL_ShaderCross_GetShaderFormats
has been split in two, and the returned formats are accurate to what is actually possible to generate given the loaded compilersSDL_ShaderCross_INTERNAL_CompileDXC
takes in anencoding
parameter, however it is left unexposed past that, since FXC cannot handle it. Maybe its something worth allowing in the future with a safety check on the FXC path? I don't think its particularly uncommon to want to use unicode characters in comments and such.SDL_ShaderCross_INTERNAL_CompileDXC
to create a newIDxcCompiler3
every call, allowing the function to be thread-safe. Maybe this could be made thread-local in the future to allow re-use, if supported by the C compiler.