amber icon indicating copy to clipboard operation
amber copied to clipboard

Add ability to convert a Recipe back to a text representation

Open dj2 opened this issue 6 years ago • 4 comments

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.

dj2 avatar May 23 '19 19:05 dj2

@afd

dj2 avatar May 23 '19 19:05 dj2

+1 to the request to write out SPIR-V disassembly.

dneto0 avatar Jun 19 '19 15:06 dneto0

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.

dj2 avatar Jul 25 '19 23:07 dj2

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.

dj2 avatar Jul 26 '19 23:07 dj2