Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] Define-only include files are missing in -fspv-debug=vulkan-with-source #6907

Closed
Goshido opened this issue Sep 9, 2024 · 1 comment · Fixed by #6935
Closed

[SPIR-V] Define-only include files are missing in -fspv-debug=vulkan-with-source #6907

Goshido opened this issue Sep 9, 2024 · 1 comment · Fixed by #6935
Assignees
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Milestone

Comments

@Goshido
Copy link

Goshido commented Sep 9, 2024

Description

It looks like the SPIR-V backend doesn't include debug information for include files that only have definitions but no code. You should be able to see that in the RenderDoc's shader viewer/editor. It doesn't have source tabs for any such include files.

Without those files it is impossible for RenderDoc to recompile the edited shaders.

Steps to Reproduce

This setup:

// test.hlsl
#define OUT_COL float4(1, 0, 1, 1)
// source.hlsl
#include "test.hlsl"

float4 main() : SV_Target0 {
  return OUT_COL;
}

built with

dxc                                                 ^
    -spirv                                          ^
    -fspv-debug=vulkan-with-source source.hlsl      ^
    -T ps_6_0                                       ^
    -Fo test.spv

only includes the source of source.hlsl in the output, as verified with spirv-dis.

If you make a small change:

// test.hlsl
#define OUT_COL float4(1, 0, 1, 1)

void helper() { }
// source.hlsl
#include "test.hlsl"

float4 main() : SV_Target0 {
  helper();
  return OUT_COL;
}

Then the same build works correctly and includes the test.hlsl source.

Expected result

Compilation success. DXC produces SPIR-V binaries with all include files.

Actual Behavior

SPIR-V binary missing source code for #define only include files.

Environment

  • git submodule update --init has been invoked before build
  • hctbuild build parameters: -official -rel -x64 -vs2022 -speak-up -no-dxilconv -spirv
  • Visual Studio 2022 Community components were up to date.
  • Windows 11 Pro 64-bit (22621.1992, Version 22H2)
  • dxc.exe v1.8.2407.10013 executable, commit SHA-1 a2a220bc616ca28848ec0af77ad33a09f92fa43a

Would you kindly help?

P.S. Original issue was observed in RenderDoc's issue #3425 and described in details.

@Goshido Goshido added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Sep 9, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Sep 10, 2024
@s-perron s-perron self-assigned this Sep 13, 2024
@s-perron s-perron added this to the Next Release milestone Sep 13, 2024
@Goshido
Copy link
Author

Goshido commented Sep 28, 2024

Fixed in DirectX Shader Compiler 1.8.2407.10091 75ff50caa046a054747ae15b5c1910a4c8aa1917. Thx! 👍

image_2024-09-28_10-17-38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Projects
Status: Done
Status: Triaged
Development

Successfully merging a pull request may close this issue.

3 participants