tests/hlsl: Add a test for UAV InterlockedExchange().

This commit is contained in:
Conor McCarthy 2024-03-04 15:23:27 +10:00 committed by Alexandre Julliard
parent 7e4fee658b
commit 1c73ac668f
Notes: Alexandre Julliard 2024-04-23 22:57:34 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/684

View File

@ -3,9 +3,9 @@ shader model >= 5.0
[uav 1] [uav 1]
format r32 uint format r32 uint
size (buffer, 7) size (buffer, 9)
0xd 5 6 0x10 4 4 7 0xd 5 6 0x10 4 4 7 2 0
[compute shader todo] [compute shader todo]
RWBuffer<uint> u : register(u1); RWBuffer<uint> u : register(u1);
@ -15,6 +15,7 @@ uniform uint4 v;
[numthreads(3, 1, 1)] [numthreads(3, 1, 1)]
void main() void main()
{ {
uint old;
InterlockedAnd(u[0], v.x); InterlockedAnd(u[0], v.x);
InterlockedCompareStore(u[1], v.y, v.x); InterlockedCompareStore(u[1], v.y, v.x);
InterlockedAdd(u[2], v.x); InterlockedAdd(u[2], v.x);
@ -22,6 +23,8 @@ void main()
InterlockedMax(u[4], v.x); InterlockedMax(u[4], v.x);
InterlockedMin(u[5], v.x); InterlockedMin(u[5], v.x);
InterlockedXor(u[6], v.x); InterlockedXor(u[6], v.x);
InterlockedExchange(u[7], v.x, old);
InterlockedAdd(u[8], old == 2);
} }
[test] [test]
@ -34,6 +37,8 @@ probe uav 1 (3) rui (0x13)
probe uav 1 (4) rui (4) probe uav 1 (4) rui (4)
probe uav 1 (5) rui (3) probe uav 1 (5) rui (3)
probe uav 1 (6) rui (4) probe uav 1 (6) rui (4)
probe uav 1 (7) rui (3)
probe uav 1 (8) rui (1)
uniform 0 uint4 1 2 0 0 uniform 0 uint4 1 2 0 0
todo(sm<6) dispatch 2 1 1 todo(sm<6) dispatch 2 1 1
@ -44,6 +49,8 @@ probe uav 1 (3) rui (0x13)
probe uav 1 (4) rui (4) probe uav 1 (4) rui (4)
probe uav 1 (5) rui (1) probe uav 1 (5) rui (1)
probe uav 1 (6) rui (4) probe uav 1 (6) rui (4)
probe uav 1 (7) rui (1)
probe uav 1 (8) rui (1)
[uav 2] [uav 2]