From 51d0c1c5e225186a279bcdf15b7dbf68745301db Mon Sep 17 00:00:00 2001 From: amarpMSFT Date: Mon, 25 Mar 2024 10:34:22 -0700 Subject: [PATCH] HelloWorkGraphs shader tweak (#862) * error printing fixes * helloWorkGraph shader tweak --- .../src/HelloWorkGraphs/D3D12HelloWorkGraphs.hlsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Samples/Desktop/D3D12HelloWorld/src/HelloWorkGraphs/D3D12HelloWorkGraphs.hlsl b/Samples/Desktop/D3D12HelloWorld/src/HelloWorkGraphs/D3D12HelloWorkGraphs.hlsl index 49301089a..d2550c158 100644 --- a/Samples/Desktop/D3D12HelloWorld/src/HelloWorkGraphs/D3D12HelloWorkGraphs.hlsl +++ b/Samples/Desktop/D3D12HelloWorld/src/HelloWorkGraphs/D3D12HelloWorkGraphs.hlsl @@ -80,7 +80,7 @@ void firstNode( } // -------------------------------------------------------------------------------------------------------------------------------- -// seconcNode is thread launch, so one thread per input record. +// secondNode is thread launch, so one thread per input record. // // Logs to the UAV and then sends a task to thirdNode // -------------------------------------------------------------------------------------------------------------------------------- @@ -121,7 +121,7 @@ void thirdNode( // flushing the current work. if (threadIndex >= inputData.Count()) return; - + for (uint i = 0; i < c_numEntryRecords; i++) { g_sum[i] = 0; @@ -141,6 +141,6 @@ void thirdNode( for (uint l = 0; l < c_numEntryRecords; l++) { uint recordIndex = c_numEntryRecords + l; - UAV[recordIndex] = g_sum[l]; + InterlockedAdd(UAV[recordIndex],g_sum[l]); } -} \ No newline at end of file +}