Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/HLSL/HLSignatureLower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,8 @@ void HLSignatureLower::GenerateDxilComputeAndNodeCommonInputs() {
DXASSERT(funcAnnotation, "must find annotation for entry function");
auto &funcProps = HLM.GetDxilFunctionProps(Entry);
IRBuilder<> Builder(Entry->getEntryBlock().getFirstInsertionPt());
Builder.SetCurrentDebugLocation(
Entry->getEntryBlock().getFirstNonPHIOrDbg()->getDebugLoc());

for (Argument &arg : Entry->args()) {
DxilParameterAnnotation &paramAnnotation =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// RUN: %dxc -T cs_6_5 -E CSMain -O0 -Zi -enable-16bit-types %s | FileCheck %s

// CHECK-LABEL: @CSMain()
// CHECK: %{{[0-9]+}} = call i32 @dx.op.threadId.i32(i32 {{[0-9]+}}, i32 {{[0-9]+}}), !dbg [[DBG_MD:![0-9]+]]
// CHECK: [[SUBPGM:![0-9]+]] = !DISubprogram(name: "CSMain"
// CHECK: [[DBG_MD]] = !DILocation(line: 21, column: 15, scope: [[SUBPGM]])

RWBuffer<float> u0 : register(u0);
RWBuffer<float> u1 : register(u1);

static float my_var;
static float my_var2;

void foo() {
my_var2 = my_var * 2;
}

[RootSignature("DescriptorTable(UAV(u0,numDescriptors=2))")]
[numthreads(64,1,1)]
void CSMain(uint3 dtid : SV_DispatchThreadID) {
my_var = u0[dtid.x];
foo();
u1[dtid.x] = my_var2;
}