Skip to content

[Debug info] discard has slightly wrong debug location #8746

Description

@hbystuff

Version: dxcompiler.dll 1.9(5402-0d3ee6b5)(1.9.0.5402) - 1.9.0.5402 (0d3ee6b55-dirty)
Repro: discard_location.zip

dxc -T ps_6_0 -Zi -Qembed_debug -Od -Fc dis

card_location.ll discard_location.hlsl
 5  float4 main(float2 uv : TEXCOORD0) : SV_Target
 6  {
 7      if (uv.x < 0.1)
 8      {
 9          discard;                     // line 9, col 9
10      }
11
12      if (uv.x < 0.2)
13          discard;                     // line 13, col 9
14
15      if (uv.x < 0.3) discard;         // line 15, col 21
16
17      discard;                         // line 17, col 5
18
19      return float4(uv, 0, 1);
20  }

Actual

call void @dx.op.discard(i32 82, i1 true), !dbg !57   ; line:8  col:5
call void @dx.op.discard(i32 82, i1 true), !dbg !62   ; line:12 col:9
call void @dx.op.discard(i32 82, i1 true), !dbg !65   ; line:15 col:9
call void @dx.op.discard(i32 82, i1 true), !dbg !66   ; line:15 col:16

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions