Closed TheSpydog closed 1 week ago
Honestly I wouldn't say this is overkill necessarily; we were planning on skipping D3D12 until the memory manager is in, and since we're strapped for resources we might actually get Shader Model 7 first anyway... precompiled blobs won't be affected either, so unless someone does all that extra D3D work we won't be missing out on anything.
Fair points, and in the event that we do set up D3D12's memory manager in the near-ish future, we'll still need to rework shadercross integration anyway since this was still using the old single-header version. (Which is now deleted by this PR!)
I think this is ready for review now. Wasn't totally sure how to select the shader format so I went with preprocessor checks, since it's only Apple platforms that need special handling.
This is a quickly-slapped-together proof of concept for using MojoShader's MSL emitter for the SDLGPU driver rather than going through SPIRV -> ShaderCross. The code organization and OS detection logic (particularly that it only checks for Mac and not iOS/tvOS) could be massively improved, so marking this as a draft for now.
I also removed ShaderCross references entirely from mojoshader_sdlgpu but that's definitely overkill. We'll need it for at least D3D12, but we could dynamically load it instead via
SDL_LoadObject
.The only change on the emitter side was changing the hardcoded uniform buffer index
16
to0
to match SDL's binding order requirements.