Compiled with "dxc.exe -spirv -Zi -T ps_6_0 main.hlsl", it produces the attached "spirv.txt".
Note that it correctly contains the "inc_a.hlsl" source code, but lacks "inc_common.hlsl".
When recompiling such a shader in RenderDoc capture replay, for example,
it cannot possibly succeed as one of the original files, "inc_common.hlsl", is missing altogether from SPIRV.
Hi!
Not all #include directives are reflected into "OpSource" in SPIRV, which prevents recompilation/edit with tools such as RenderDoc.
Attached is a minimal repro: spirv_includes_minimal_repro.zip
Compiled with "dxc.exe -spirv -Zi -T ps_6_0 main.hlsl", it produces the attached "spirv.txt". Note that it correctly contains the "inc_a.hlsl" source code, but lacks "inc_common.hlsl".
When recompiling such a shader in RenderDoc capture replay, for example, it cannot possibly succeed as one of the original files, "inc_common.hlsl", is missing altogether from SPIRV.