slang
slang copied to clipboard
Cpature/Replay: Design a unique file name mechanism when trying to dump the shader files
In current capture system, we intercept the ISlangFileSystemExt interface by using our own so that we can dump the shaders files loaded by slang.
But there is a potential problem in this simple way.
Some client application might design more complicated usage of file system. For example, the client engine could implement the include file system themselves, and will synthesize the shader file in their c++ code based on the configurations.
Take an example: There are two shader files: A.slang and B.slang.
A.slang:
#include "generated.slang"
// some shader code
B.slang:
#include "generated.slang"
// some shader code
The client engine compiles A.slang
and B.slang
separately into two different target code.
Based on the engine configuration, generated.slang
is synthesized by the engine code. So the content could be totally different for A.slang
and B.slang
.
In this situation, we want to dump 2 different generated.slang
for A.slang
and B.slang
. But we don't have such mechanism yet.