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

DISubprogram not attached to function directly #6955

Open
czw831024 opened this issue Oct 10, 2024 · 2 comments
Open

DISubprogram not attached to function directly #6955

czw831024 opened this issue Oct 10, 2024 · 2 comments
Labels
bug Bug, regression, crash
Milestone

Comments

@czw831024
Copy link
Contributor

We found that ray tracing shaders from D3D12RaytracingRealTimeDenoisedAmbientOcclusion in MSFT's DirectX-Graphics-Samples from Github don't have DISubprogram s attached to their corresponding functions in DXIL. For example, in Pathtracer.hlsl

define void @MyMissShader_RadianceRay() {
%WorldRayDirection.i = call float @dx.op.worldRayDirection.f32(i32 148, i8 0) #3, !dbg !344
%WorldRayDirection1.i = call float @dx.op.worldRayDirection.f32(i32 148, i8 1) #3, !dbg !344
%WorldRayDirection2.i = call float @dx.op.worldRayDirection.f32(i32 148, i8 2) #3, !dbg !344
%1 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 0, i32 0, i32 12, i1 false), !dbg !362
%2 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 3, i32 0, i32 0, i1 false), !dbg !362
...

!481 = !DISubprogram(name: "MyMissShader_RadianceRay", linkageName: "\01?MyMissShader_RadianceRay@@YAXUPathtracerRayPayload@@@z", scope: !1, file: !1, line: 536, type: !482, isLocal: false, isDefinition: true, scopeLine: 537, flags: DIFlagPrototyped, isOptimized: false, function: void (%struct.PathtracerRayPayload*)* @"\01?MyMissShader_RadianceRay@@YAXUPathtracerRayPayload@@@z")

We expect something like

define void @MyMissShader_RadianceRay() !dbg !481{

to connect the DISubprogram and its function directly.

To compile the shader and reproduce, you can modify the following command, which I got from the build

D:\Codes\MSFT\DirectX-Graphics-Samples\Samples\Desktop\D3D12Raytracing\src\D3D12RaytracingRealTimeDenoisedAmbientOcclusion>D:\Downloads\dxc_2024_07_31\bin\x64\dxc.exe /I"D:\Codes\MSFT\DirectX-Graphics-Samples\Samples\Desktop\D3D12Raytracing\src\D3D12RaytracingRealTimeDenoisedAmbientOcclusion\" /I"D:\Codes\MSFT\DirectX-Graphics-Samples\Samples\Desktop\D3D12Raytracing\src\D3D12RaytracingRealTimeDenoisedAmbientOcclusion\" /IRTAO/shaders /ISampleCore/shaders /ISampleCore/shaders/util /nologo /T lib_6_3 /Fh "obj\x64\Debug\CompiledShaders\Pathtracer.hlsl.h" /Vn "g_pPathtracer" /Zi /Zpr -Qembed_debug -HV 2021 SampleCore\Shaders\Pathtracer.hlsl

@czw831024 czw831024 added bug Bug, regression, crash needs-triage Awaiting triage labels Oct 10, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Oct 15, 2024
@damyanp
Copy link
Member

damyanp commented Oct 15, 2024

From our initial look at this we think that this is working as expected. Is there some functionality not working as a result of this?

@AdamJMiles, @jeffnn - do you have any insights as to whether or not this is a bug?

@damyanp damyanp added this to the Dormant milestone Oct 15, 2024
@damyanp
Copy link
Member

damyanp commented Oct 15, 2024

Oops, meant to tag @adam-yang in this. But other Adam if you have any insights they'd also be appreciated :)

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

No branches or pull requests

2 participants