Hello!
I've been playing around with the new GPU backend for the SDL_Renderer, thanks for all the hard work on this!
I was unable to load the MSL shaders as they were.
Error output when trying to load the shaders
ERROR: Creating MTLLibrary failed: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:33:1: error: expected unqualified-id <U+0014><U+0002> ^ " UserInfo={NSLocalizedDescription=program_source:33:1: error: expected unqualified-id <U+0014><U+0002> ^ }
Now the error seems to point out unexpected characters at the end of the file.
Opening the .metal files that are generated from spirv-cross there were 2 seemingly blank lines. Removing them manually and re-creating the header file without recompiling using spirv-cross fixed the issue..
Another solution to the problem was to compile the metal source to metallib and changing the shader format to SDL_GPU_SHADERFORMAT_METALLIB.
Hello! I've been playing around with the new GPU backend for the SDL_Renderer, thanks for all the hard work on this!
I was unable to load the MSL shaders as they were.
Error output when trying to load the shaders
ERROR: Creating MTLLibrary failed: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:33:1: error: expected unqualified-id <U+0014><U+0002> ^ " UserInfo={NSLocalizedDescription=program_source:33:1: error: expected unqualified-id <U+0014><U+0002> ^ }
Now the error seems to point out unexpected characters at the end of the file. Opening the .metal files that are generated from spirv-cross there were 2 seemingly blank lines. Removing them manually and re-creating the header file without recompiling using spirv-cross fixed the issue..
Another solution to the problem was to compile the metal source to metallib and changing the shader format to SDL_GPU_SHADERFORMAT_METALLIB.
I'll post my fork and the changes that I made to compile the shaders to metallib instead https://github.com/coffeechriph/SDL/compare/main...coffeechriph:SDL:patch-1
Thanks