From 9952483f2bc294439a42a5cdd9489084f22cdc0d Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Sat, 27 Sep 2025 14:16:57 +0100 Subject: [PATCH] Make D3D12_Groupshared test deterministic --- util/test/demos/d3d12/d3d12_groupshared.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/test/demos/d3d12/d3d12_groupshared.cpp b/util/test/demos/d3d12/d3d12_groupshared.cpp index b1b6546ae..7ad094ccb 100644 --- a/util/test/demos/d3d12/d3d12_groupshared.cpp +++ b/util/test/demos/d3d12/d3d12_groupshared.cpp @@ -86,8 +86,10 @@ void main(uint3 gid : SV_GroupThreadID) outval.z = GetGSMValue(gid.x ^ 1); // do calculation with our neighbour - gsmData[gid.x] = (1.0f + GetGSMValue(gid.x)) * (1.0f + GetGSMValue(gid.x ^ 1)); + float value = (1.0f + GetGSMValue(gid.x)) * (1.0f + GetGSMValue(gid.x ^ 1)); + GroupMemoryBarrierWithGroupSync(); + gsmData[gid.x] = value; GroupMemoryBarrierWithGroupSync(); // fourth write, our neighbour should be identical to our value