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

Slang generates not spec compliant sequence of NonSemantic.DebugInfo instructions #5859

Closed
kleints opened this issue Dec 13, 2024 · 8 comments

Comments

@kleints
Copy link

kleints commented Dec 13, 2024

For very long shaders, when the source strings are split up in DebugSource and DebugSourceContinued, Slang produces a sequence of instructions that is not following the spec for DebugSourceContinued. That says: "The previous instruction must be a DebugSource or DebugSourceContinued instruction.". However, for the first DebugSource/DebugSourceContinued the DebugCompilationUnit instruction is interleaved.

For example:
%4 = OpExtInst %void %2 DebugSource %5 %1
%10 = OpExtInst %void %2 DebugCompilationUnit %uint_100 %uint_5 %4 %uint_11
%51 = OpExtInst %void %2 DebugSourceContinued %50
%53 = OpExtInst %void %2 DebugSourceContinued %52
%67 = OpExtInst %void %2 DebugSourceContinued %66

@csyonghe
Copy link
Collaborator

I tried this with a simple shader and unable to reproduce the interleaving. The interleaving could have been introduced by spirv-opt instead of slang. Have you tried -O0 to disable spirv-opt?

@csyonghe
Copy link
Collaborator

We will need a reproducer to proceed with this issue.

@bmillsNV bmillsNV closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@cheneym2
Copy link
Collaborator

I filed a Khronos issue with a minimal repro: KhronosGroup/SPIRV-Tools#5950

@csyonghe
Copy link
Collaborator

We should try a top of tree build of spirv-opt and see if that addresses the issue.

@cheneym2
Copy link
Collaborator

The release I used is only days old. 1.4.304.0 from 1/13/2025

@cheneym2
Copy link
Collaborator

Oh, my mistake. While the SDK is from 1/13/2025, the Spirv-tools binaries are from 12/5/2024, so there is a bigger gap, and in fact the change that fixed this issue was identified as one that was submitted on 12/13/2024.

@cheneym2
Copy link
Collaborator

Confirmed it is fixed at TOT

cheneym2 added a commit to cheneym2/slang that referenced this issue Jan 21, 2025
@cheneym2
Copy link
Collaborator

Update slang to use newer spirv-tools: #6145

cheneym2 added a commit to cheneym2/slang that referenced this issue Jan 21, 2025
cheneym2 added a commit to cheneym2/slang that referenced this issue Jan 21, 2025
cheneym2 added a commit to cheneym2/slang that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants