amber
amber copied to clipboard
Add ability to convert a Recipe back to a text representation
Currently you can pass in compiled shaders into a recipe to use during rendering. We'd like the ability to modify buffers to use during rendering. When those are done, the script being run isn't necessarily the script that was start with. We'd like the ability to take a given recipe and turn it back into an Amberscript file.
For shaders, we'd attempt to write out the spirv-asm for the shader, in the case where disassembly fails we'd write the shader as HEX data.
@afd
+1 to the request to write out SPIR-V disassembly.
Thinking about this, the implementation is going to be a bit tricky. We can have different compile options per pipeline which means, we should have different spriv disassembly results per pipeline. So, a single shader may need to be output n times, once per pipeline.
This means we're going to have to rename the shaders as we output them to accommodate.
This also has ramifications for buffers. We don't store the starting state for buffers, so if you dump the script after the execution you'll get the ending buffer not the starting buffer as you probably want.
Either the user must dump the script before running (which is wasteful in the case where there is no issues and we don't care about having the text version) or we start storing the before state of buffers. We'd probably want to store if it's a FILL or other type and what data used used to create it. For DATA buffers we should store the initial data.