microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3k stars 671 forks source link

[SPIR-V] SPIRV missing certain #includes #4284

Closed phradsky closed 1 week ago

phradsky commented 2 years ago

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.

SteveUrquhart commented 1 month ago

This was fixed by https://github.com/microsoft/DirectXShaderCompiler/pull/6094