Add more exhaustive test for barrier handling.

This commit is contained in:
Hans-Kristian Arntzen 2018-01-09 12:26:46 +01:00
parent 166eed8c18
commit 27ad8c0922
6 changed files with 276 additions and 0 deletions

View File

@ -0,0 +1,26 @@
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
void comp_main()
{
DeviceMemoryBarrier();
DeviceMemoryBarrier();
DeviceMemoryBarrier();
DeviceMemoryBarrier();
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
DeviceMemoryBarrierWithGroupSync();
}
[numthreads(4, 1, 1)]
void main()
{
comp_main();
}

View File

@ -10,5 +10,19 @@ void main()
groupMemoryBarrier();
memoryBarrierShared();
barrier();
memoryBarrier();
memoryBarrierShared();
barrier();
memoryBarrierImage();
memoryBarrierShared();
barrier();
memoryBarrierBuffer();
memoryBarrierShared();
barrier();
groupMemoryBarrier();
memoryBarrierShared();
barrier();
memoryBarrierShared();
barrier();
}

View File

@ -0,0 +1,81 @@
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
void barrier_shared()
{
DeviceMemoryBarrier();
}
void full_barrier()
{
DeviceMemoryBarrier();
}
void image_barrier()
{
DeviceMemoryBarrier();
}
void buffer_barrier()
{
DeviceMemoryBarrier();
}
void group_barrier()
{
DeviceMemoryBarrier();
}
void barrier_shared_exec()
{
DeviceMemoryBarrierWithGroupSync();
}
void full_barrier_exec()
{
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
}
void image_barrier_exec()
{
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
}
void buffer_barrier_exec()
{
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
}
void group_barrier_exec()
{
DeviceMemoryBarrier();
DeviceMemoryBarrierWithGroupSync();
}
void exec_barrier()
{
DeviceMemoryBarrierWithGroupSync();
}
void comp_main()
{
barrier_shared();
full_barrier();
image_barrier();
buffer_barrier();
group_barrier();
barrier_shared_exec();
full_barrier_exec();
image_barrier_exec();
buffer_barrier_exec();
group_barrier_exec();
exec_barrier();
}
[numthreads(4, 1, 1)]
void main()
{
comp_main();
}

View File

@ -26,6 +26,40 @@ void group_barrier()
groupMemoryBarrier();
}
void barrier_shared_exec()
{
memoryBarrierShared();
barrier();
}
void full_barrier_exec()
{
memoryBarrier();
memoryBarrierShared();
barrier();
}
void image_barrier_exec()
{
memoryBarrierImage();
memoryBarrierShared();
barrier();
}
void buffer_barrier_exec()
{
memoryBarrierBuffer();
memoryBarrierShared();
barrier();
}
void group_barrier_exec()
{
groupMemoryBarrier();
memoryBarrierShared();
barrier();
}
void exec_barrier()
{
memoryBarrierShared();
@ -39,6 +73,11 @@ void main()
image_barrier();
buffer_barrier();
group_barrier();
barrier_shared_exec();
full_barrier_exec();
image_barrier_exec();
buffer_barrier_exec();
group_barrier_exec();
exec_barrier();
}

View File

@ -0,0 +1,79 @@
#version 310 es
layout(local_size_x = 4) in;
void barrier_shared()
{
memoryBarrierShared();
}
void full_barrier()
{
memoryBarrier();
}
void image_barrier()
{
memoryBarrierImage();
}
void buffer_barrier()
{
memoryBarrierBuffer();
}
void group_barrier()
{
groupMemoryBarrier();
}
void barrier_shared_exec()
{
memoryBarrierShared();
barrier();
}
void full_barrier_exec()
{
memoryBarrier();
barrier();
}
void image_barrier_exec()
{
memoryBarrierImage();
barrier();
}
void buffer_barrier_exec()
{
memoryBarrierBuffer();
barrier();
}
void group_barrier_exec()
{
groupMemoryBarrier();
barrier();
}
void exec_barrier()
{
barrier();
}
void main()
{
barrier_shared();
full_barrier();
image_barrier();
buffer_barrier();
group_barrier();
barrier_shared_exec();
full_barrier_exec();
image_barrier_exec();
buffer_barrier_exec();
group_barrier_exec();
exec_barrier();
}

View File

@ -26,6 +26,36 @@ void group_barrier()
groupMemoryBarrier();
}
void barrier_shared_exec()
{
memoryBarrierShared();
barrier();
}
void full_barrier_exec()
{
memoryBarrier();
barrier();
}
void image_barrier_exec()
{
memoryBarrierImage();
barrier();
}
void buffer_barrier_exec()
{
memoryBarrierBuffer();
barrier();
}
void group_barrier_exec()
{
groupMemoryBarrier();
barrier();
}
void exec_barrier()
{
barrier();
@ -38,5 +68,12 @@ void main()
image_barrier();
buffer_barrier();
group_barrier();
barrier_shared_exec();
full_barrier_exec();
image_barrier_exec();
buffer_barrier_exec();
group_barrier_exec();
exec_barrier();
}