Skip to content

Commit 1b5543e

Browse files
committed
Fix D3D12 Compute Derivative Tests
Use groupId for the output buffer index to match the python Only output results for workgroup 1,0,0 Do not reset test failing to false in check_compute_derivative_tests()
1 parent 411cb89 commit 1b5543e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ void SetOutput(float4 val)
17581758
17591759
void Init(float4 val)
17601760
{
1761-
flatId = tid.z * GROUP_SIZE_X * GROUP_SIZE_Y + tid.y * GROUP_SIZE_X + tid.x;
1761+
flatId = gid.z * GROUP_SIZE_X * GROUP_SIZE_Y + gid.y * GROUP_SIZE_X + gid.x;
17621762
SetOutput(val);
17631763
}
17641764
@@ -1771,6 +1771,10 @@ groupshared uint3 gsmUint3[1024];
17711771
[numthreads(GROUP_SIZE_X, GROUP_SIZE_Y, 1)]
17721772
void main(uint3 inDTID : SV_DispatchThreadID, uint3 inGID : SV_GroupThreadID, uint3 inGroup : SV_GroupID)
17731773
{
1774+
// Only want the workgroup (1,0,0) to output results
1775+
if ((inGroup.x != 1) || (inGroup.y != 0) || (inGroup.z != 0))
1776+
return;
1777+
17741778
float4 testResult = float4(0,0,0,0);
17751779
tid = inDTID;
17761780
gid = inGID;

util/test/tests/D3D12/D3D12_Shader_Debug_Zoo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def check_compute_derivative_tests(self):
2727
a for a in comp_dim.children if a.flags & rd.ActionFlags.Dispatch]
2828

2929
for test, action in enumerate(compute_tests):
30-
failed = False
3130
self.controller.SetFrameEvent(action.eventId, False)
3231
pipe = self.controller.GetPipelineState()
3332
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)

0 commit comments

Comments
 (0)