Skip to content

PDB output non-deterministic when using array of resources #8171

Description

@simco50

Description
We're seeing cases where compiling the same shader multiple times, produces non-identical PDB files.

An simple repro to demonstrate: https://godbolt.org/z/aT3M6z76a
It seems to be related to array of resources.

Steps to Reproduce

Code:

// shader.hlsl
Texture2D<float4> inMaps[16];
RWTexture2D<float4> Output;

[numthreads(1,1,1)]
void CSMain(uint3 threadID : SV_DispatchThreadID)
{
    Output[threadID.xy] = inMaps[0][threadID.xy];
    Output[threadID.xy] = inMaps[1][threadID.xy];
    Output[threadID.xy] = inMaps[2][threadID.xy];
    Output[threadID.xy] = inMaps[3][threadID.xy];
    Output[threadID.xy] = inMaps[4][threadID.xy];
    Output[threadID.xy] = inMaps[5][threadID.xy];
    Output[threadID.xy] = inMaps[6][threadID.xy];
}

Commandline:
dxc shader.hlsl -T cs_6_6 -E CSMain -Zi -Fd debug.pdb

The PDB contents are identical.
And doing a dumpbin...
dxc -dumpbin debug.pdb > dumpbin.txt

Actual Behavior
The bit after inMaps_texture_2d seems different each time (as seen also in Compiler Explorer)
%inMaps_texture_2d43 = call %dx.types.Handle

Environment

  • DXC version: dxcompiler.dll: 1.9 - 1.8.2505.32 (b106a961d); dxil.dll: 1.9(1.8.2505.32)
  • Host Operating System: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type

    Projects

    Status
    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions