source a .spv file instead of asm
seanbaxter opened this issue · comments
How do I source a .spv file directly in the amber script? I don't want to dump the SPIRV-ASM into the script because the module is too enormous for that.
You can write it in as SPIRV-HEX.
If you mean load an external file, that doesn't exist at this point as it hasn't been a high priority for folks.
https://gist.github.com/seanbaxter/84bc81ec1f9142374dc7ed249d7aba27
I tried SPIRV-HEX here. Amber enters an infinite loop in shader_compiler.cc:194. If I'm using it wrongly, that's because there are no scripts in tests/ that show how to use it.
Yes, the hex format hasn't really been used, so there are possibly bugs down that path. You can see the test file at https://github.com/google/amber/blob/main/src/shader_compiler_test.cc#L31 which shows the format it's expecting. We have an open issue to write documentation for the HEX format.
I used xxd -ps to generate hex. I don't think it will even print a format that accords with what's in amber.
I believe the values were from the -x
flag to GLSLang. I can't help you with xdd -ps
as I have not used it in a long time.