-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -559,6 +559,9 @@ void *SDL_ShaderCross_CompileDXILFromHLSL( | |
const SDL_ShaderCross_HLSL_Info *info, | ||
size_t *size) | ||
{ | ||
#if SDL_PLATFORM_GDK | ||
return SDL_ShaderCross_INTERNAL_CompileUsingDXC(info, false, size); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
flibitijibibo
Author
Collaborator
|
||
#else | ||
// Roundtrip to SPIR-V to support things like Structured Buffers. | ||
size_t spirvSize; | ||
void *spirv = SDL_ShaderCross_CompileSPIRVFromHLSL( | ||
|
@@ -594,6 +597,7 @@ void *SDL_ShaderCross_CompileDXILFromHLSL( | |
&translatedHlslInfo, | ||
false, | ||
size); | ||
#endif | ||
} | ||
|
||
void *SDL_ShaderCross_CompileSPIRVFromHLSL( | ||
|
The reason we do a roundtrip is that HLSL features like RWStructuredBuffer require declarations in the buffer that would be troublesome to expose in SDL. The SPIRV-Cross roundtrip converts the RWStructuredBuffer to a byte-addressed buffer which doesn't require these declarations. With this change if the client uses this feature in a shader it will break their application on Xbox.
We might want to have a think about how to work around this or at the very least document that using certain HLSL features requires offline compilation on Xbox.