2024-02-12 21:11:57 -08:00
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
2024-08-01 16:13:31 -07:00
|
|
|
format r32-sint uav-load
|
|
|
|
format r32-uint uav-load
|
2024-02-12 21:11:57 -08:00
|
|
|
|
|
|
|
[uav 1]
|
2024-08-01 18:03:46 -07:00
|
|
|
format r32-uint
|
2024-03-03 21:23:27 -08:00
|
|
|
size (buffer, 9)
|
2024-02-12 21:11:57 -08:00
|
|
|
|
2024-03-03 21:23:27 -08:00
|
|
|
0xd 5 6 0x10 4 4 7 2 0
|
2024-02-12 21:11:57 -08:00
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
RWBuffer<uint> u : register(u1);
|
|
|
|
|
|
|
|
uniform uint4 v;
|
|
|
|
|
|
|
|
[numthreads(3, 1, 1)]
|
|
|
|
void main()
|
|
|
|
{
|
2024-03-03 21:23:27 -08:00
|
|
|
uint old;
|
2024-02-12 21:11:57 -08:00
|
|
|
InterlockedAnd(u[0], v.x);
|
|
|
|
InterlockedCompareStore(u[1], v.y, v.x);
|
|
|
|
InterlockedAdd(u[2], v.x);
|
|
|
|
InterlockedOr(u[3], v.x);
|
|
|
|
InterlockedMax(u[4], v.x);
|
|
|
|
InterlockedMin(u[5], v.x);
|
|
|
|
InterlockedXor(u[6], v.x);
|
2024-03-03 21:23:27 -08:00
|
|
|
InterlockedExchange(u[7], v.x, old);
|
|
|
|
InterlockedAdd(u[8], old == 2);
|
2024-02-12 21:11:57 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 uint4 3 5 0 0
|
2024-02-12 21:34:11 -08:00
|
|
|
todo(sm<6) dispatch 1 1 1
|
2024-02-12 21:11:57 -08:00
|
|
|
probe uav 1 (0) rui (1)
|
|
|
|
probe uav 1 (1) rui (3)
|
|
|
|
probe uav 1 (2) rui (15)
|
|
|
|
probe uav 1 (3) rui (0x13)
|
|
|
|
probe uav 1 (4) rui (4)
|
|
|
|
probe uav 1 (5) rui (3)
|
|
|
|
probe uav 1 (6) rui (4)
|
2024-03-03 21:23:27 -08:00
|
|
|
probe uav 1 (7) rui (3)
|
|
|
|
probe uav 1 (8) rui (1)
|
2024-02-12 21:11:57 -08:00
|
|
|
|
|
|
|
uniform 0 uint4 1 2 0 0
|
2024-02-12 21:34:11 -08:00
|
|
|
todo(sm<6) dispatch 2 1 1
|
2024-02-12 21:11:57 -08:00
|
|
|
probe uav 1 (0) rui (1)
|
|
|
|
probe uav 1 (1) rui (3)
|
|
|
|
probe uav 1 (2) rui (21)
|
|
|
|
probe uav 1 (3) rui (0x13)
|
|
|
|
probe uav 1 (4) rui (4)
|
|
|
|
probe uav 1 (5) rui (1)
|
|
|
|
probe uav 1 (6) rui (4)
|
2024-03-03 21:23:27 -08:00
|
|
|
probe uav 1 (7) rui (1)
|
|
|
|
probe uav 1 (8) rui (1)
|
2024-02-12 21:11:57 -08:00
|
|
|
|
|
|
|
|
|
|
|
[uav 2]
|
2024-08-01 18:03:46 -07:00
|
|
|
format r32-sint
|
2024-02-12 21:11:57 -08:00
|
|
|
size (buffer, 2)
|
|
|
|
|
|
|
|
-3 1
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
RWBuffer<int> u : register(u2);
|
|
|
|
|
|
|
|
uniform int4 i;
|
|
|
|
|
|
|
|
[numthreads(3, 1, 1)]
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
InterlockedMax(u[0], i.x);
|
|
|
|
InterlockedMin(u[1], i.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 int4 1 -3 0 0
|
2024-02-12 21:32:50 -08:00
|
|
|
todo(sm<6) dispatch 1 1 1
|
2024-02-12 21:11:57 -08:00
|
|
|
probe uav 2 (0) ri (1)
|
|
|
|
probe uav 2 (1) ri (-3)
|
|
|
|
|
|
|
|
uniform 0 int4 -3 1 0 0
|
2024-02-12 21:32:50 -08:00
|
|
|
todo(sm<6) dispatch 1 1 1
|
2024-02-12 21:11:57 -08:00
|
|
|
probe uav 2 (0) ri (1)
|
|
|
|
probe uav 2 (1) ri (-3)
|
2024-03-03 21:24:41 -08:00
|
|
|
|
|
|
|
|
|
|
|
[uav 1]
|
2024-08-01 18:03:46 -07:00
|
|
|
format r32-uint
|
2024-03-03 21:24:41 -08:00
|
|
|
size (2d, 9, 1)
|
|
|
|
|
|
|
|
0xd 5 6 0x10 4 4 7 2 0
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
RWTexture2D<uint> u : register(u1);
|
|
|
|
|
|
|
|
uniform uint4 v;
|
|
|
|
|
|
|
|
[numthreads(3, 1, 1)]
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
uint old;
|
|
|
|
InterlockedAnd(u[uint2(0, 0)], v.x);
|
|
|
|
InterlockedCompareStore(u[uint2(1, 0)], v.y, v.x);
|
|
|
|
InterlockedAdd(u[uint2(2, 0)], v.x);
|
|
|
|
InterlockedOr(u[uint2(3, 0)], v.x);
|
|
|
|
InterlockedMax(u[uint2(4, 0)], v.x);
|
|
|
|
InterlockedMin(u[uint2(5, 0)], v.x);
|
|
|
|
InterlockedXor(u[uint2(6, 0)], v.x);
|
|
|
|
InterlockedExchange(u[uint2(7, 0)], v.x, old);
|
|
|
|
InterlockedAdd(u[uint2(8, 0)], old == 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 uint4 3 5 0 0
|
|
|
|
todo(sm<6) dispatch 1 1 1
|
|
|
|
probe uav 1 (0) rui (1)
|
|
|
|
probe uav 1 (1) rui (3)
|
|
|
|
probe uav 1 (2) rui (15)
|
|
|
|
probe uav 1 (3) rui (0x13)
|
|
|
|
probe uav 1 (4) rui (4)
|
|
|
|
probe uav 1 (5) rui (3)
|
|
|
|
probe uav 1 (6) rui (4)
|
|
|
|
probe uav 1 (7) rui (3)
|
|
|
|
probe uav 1 (8) rui (1)
|
2024-03-03 21:51:10 -08:00
|
|
|
|
|
|
|
|
|
|
|
[compute shader todo]
|
|
|
|
RWTexture2D<int> u : register(u2);
|
|
|
|
|
|
|
|
uniform int4 i;
|
|
|
|
|
|
|
|
[numthreads(3, 1, 1)]
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
InterlockedMax(u[uint2(0, 0)], i.x);
|
|
|
|
InterlockedMin(u[uint2(1, 0)], i.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 int4 1 -3 0 0
|
|
|
|
todo(sm<6) dispatch 1 1 1
|
|
|
|
probe uav 2 (0) ri (1)
|
|
|
|
probe uav 2 (1) ri (-3)
|
|
|
|
|
|
|
|
uniform 0 int4 -3 1 0 0
|
|
|
|
todo(sm<6) dispatch 1 1 1
|
|
|
|
probe uav 2 (0) ri (1)
|
|
|
|
probe uav 2 (1) ri (-3)
|