-
Notifications
You must be signed in to change notification settings - Fork 664
Tool to extract single entry point from spirv file #1993
Description
I'm trying figure out the quickest way to deal with optimizing a large amount of shaders. Currently I emit each shader as a separate spirv file and optimize each and output to glsl. This can take a lot of time in my applications since we have a permutation problem of shaders. The idea I had to address this (which could be wrong) was to put all of the shaders together in one spirv file with different entry points for each. This would in theory make the optimizer quicker (might not be true to the aggressive inlining) and then I would output each individual entry point using spirv-cross to glsl.
The problem is that spirv-cross doesn't have a way to identify what types/structs are actually used in an entry point's static call graph, causing large bloat in the output file which can take a large amount of time to write out. See KhronosGroup/SPIRV-Cross#727 for my conversation with spirv-cross.
If I can prune a spirv file in advance so it only contains the code relevant to one entry point then this might be a good compromise but I don't see any options in the optimizer or any other tool that does this.