Tests for VK_KHR_shader_subgroup_uniform_control_flow
authorAlan Baker <alanbaker@google.com>
Tue, 2 Jun 2020 19:49:54 +0000 (15:49 -0400)
committerAlexander Galazin <alexander.galazin@arm.com>
Tue, 15 Jun 2021 19:22:35 +0000 (21:22 +0200)
* Updates Amber a version that supports VK_EXT_subgroup_size_control
* Change Amber testcases to use the asm option's SPIR-V version for
glslang compiles

Components: Vulkan

VK-GL-CTS Issue: 2395

New tests: dEQP-VK.subgroups.subgroup_uniform_control_flow.*

Change-Id: I4140385d6326d6b99e259fcd77e807f33b778031
(cherry picked from commit 74f61853ec0a94aeed6fa9443beeeb2c67b99070)

177 files changed:
AndroidGen.mk
android/cts/master/vk-master-2021-03-01/subgroups.txt
android/cts/master/vk-master/subgroups.txt
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/discard/subgroup_reconverge_discard00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge20.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial00.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial01.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial02.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial03.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial04.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial05.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial06.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial07.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial08.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial09.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial10.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial11.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial12.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial13.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial14.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial15.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial16.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial17.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial18.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial19.amber [new file with mode: 0644]
external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial20.amber [new file with mode: 0644]
external/vulkancts/modules/vulkan/subgroups/CMakeLists.txt
external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.cpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.hpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTests.cpp
external/vulkancts/mustpass/master/vk-default/subgroups.txt

index 156ce78..39fcfa4 100644 (file)
@@ -428,6 +428,7 @@ LOCAL_SRC_FILES := \
        external/vulkancts/modules/vulkan/ssbo/vktSSBOCornerCase.cpp \
        external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp \
        external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutTests.cpp \
+       external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.cpp \
        external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp \
        external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp \
        external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp \
index 99f0e07..5f647fe 100644 (file)
@@ -4910,3 +4910,172 @@ dEQP-VK.subgroups.size_control.framebuffer.fragment_required_subgroup_size_min
 dEQP-VK.subgroups.size_control.ray_tracing.allow_varying_subgroup_size
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_max
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_min
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.discard.subgroup_reconverge_discard00
index 5958a94..5c8074b 100644 (file)
@@ -20894,3 +20894,172 @@ dEQP-VK.subgroups.size_control.framebuffer.fragment_required_subgroup_size_min
 dEQP-VK.subgroups.size_control.ray_tracing.allow_varying_subgroup_size
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_max
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_min
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.discard.subgroup_reconverge_discard00
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/discard/subgroup_reconverge_discard00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/discard/subgroup_reconverge_discard00.amber
new file mode 100644 (file)
index 0000000..0e2565b
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER vertex vtex_shader GLSL TARGET_ENV spv1.3
+#version 430
+layout(location = 0) in vec3 position;
+void main() {
+  gl_Position = vec4(position, 1.0);
+}
+END
+
+SHADER fragment compare_shader GLSL TARGET_ENV spv1.3
+#version 430
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+
+layout(location = 0) out int compare;
+layout(location = 1) out vec4 out1;
+layout(location = 2) out vec4 out2;
+void main() [[subgroup_uniform_control_flow]] {
+  bool inbounds = (gl_FragCoord.x < 128 || gl_FragCoord.y < 128);
+  bool elect = subgroupElect();
+  if (elect) {
+    out1 = vec4(1.0, 0, 0, 1.0);
+  } else if (inbounds) {
+    out2 = vec4(0, 1.0, 0, 1.0);
+  } else {
+    discard;
+  }
+
+  bool a = (!inbounds && elect);
+  bool b = subgroupElect() == elect;
+  compare = (b && !a) ? 1 : -1;
+}
+END
+
+SHADER fragment expect_shader GLSL TARGET_ENV spv1.3
+#version 430
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+
+layout(location = 0) out int expect;
+void main() {
+  bool inbounds = (gl_FragCoord.x < 128 || gl_FragCoord.y < 128);
+  expect = inbounds ? 1 : -1;
+}
+END
+
+BUFFER position_buf DATA_TYPE vec3<float> DATA
+-1 -1 0
+-1  1 0
+ 1 -1 0
+END
+
+BUFFER expect DATA_TYPE int32 SIZE 65536 FILL -1
+BUFFER compare DATA_TYPE int32 SIZE 65536 FILL -1
+BUFFER out1 DATA_TYPE vec4<float> SIZE 65536 FILL -1
+BUFFER out2 DATA_TYPE vec4<float> SIZE 65536 FILL -1
+
+PIPELINE graphics compare_pipe
+  ATTACH vtex_shader
+  ATTACH compare_shader
+
+  VERTEX_DATA position_buf LOCATION 0
+  BIND BUFFER compare AS color LOCATION 0
+  BIND BUFFER out1 AS color LOCATION 1
+  BIND BUFFER out2 AS color LOCATION 2
+  FRAMEBUFFER_SIZE 256 256
+END
+
+PIPELINE graphics expect_pipe
+  ATTACH vtex_shader
+  ATTACH expect_shader
+
+  VERTEX_DATA position_buf LOCATION 0
+  BIND BUFFER expect AS color LOCATION 0
+  FRAMEBUFFER_SIZE 256 256
+END
+
+RUN expect_pipe DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 3
+RUN compare_pipe DRAW_ARRAY AS TRIANGLE_LIST START_IDX 0 COUNT 3
+EXPECT compare EQ_BUFFER expect
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge00.amber
new file mode 100644 (file)
index 0000000..43b69f0
--- /dev/null
@@ -0,0 +1,76 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge01.amber
new file mode 100644 (file)
index 0000000..07b1c9f
--- /dev/null
@@ -0,0 +1,75 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge02.amber
new file mode 100644 (file)
index 0000000..729c3b0
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge03.amber
new file mode 100644 (file)
index 0000000..8fcb22a
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge04.amber
new file mode 100644 (file)
index 0000000..37d2b3c
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge05.amber
new file mode 100644 (file)
index 0000000..8293bde
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge06.amber
new file mode 100644 (file)
index 0000000..bac9f63
--- /dev/null
@@ -0,0 +1,83 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge07.amber
new file mode 100644 (file)
index 0000000..49f92cf
--- /dev/null
@@ -0,0 +1,82 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge08.amber
new file mode 100644 (file)
index 0000000..f24a3c1
--- /dev/null
@@ -0,0 +1,79 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge09.amber
new file mode 100644 (file)
index 0000000..3e73a32
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge10.amber
new file mode 100644 (file)
index 0000000..ca8eeae
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge11.amber
new file mode 100644 (file)
index 0000000..4725a77
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge12.amber
new file mode 100644 (file)
index 0000000..252ffed
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge13.amber
new file mode 100644 (file)
index 0000000..f2d9f3b
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge14.amber
new file mode 100644 (file)
index 0000000..85df8ae
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 3:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge15.amber
new file mode 100644 (file)
index 0000000..8bea02b
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 3:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge16.amber
new file mode 100644 (file)
index 0000000..2e0a06b
--- /dev/null
@@ -0,0 +1,89 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[256 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[256 * 0 + idx] = cmp_val;
+  compare.x[256 * 1 + idx] = cmp_val;
+  compare.x[256 * 2 + idx] = cmp_val;
+  compare.x[256 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 1024 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 1024 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge17.amber
new file mode 100644 (file)
index 0000000..0c26b82
--- /dev/null
@@ -0,0 +1,80 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge18.amber
new file mode 100644 (file)
index 0000000..fd5bf53
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge19.amber
new file mode 100644 (file)
index 0000000..8e4460b
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) == 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge20.amber
new file mode 100644 (file)
index 0000000..1a1ac26
--- /dev/null
@@ -0,0 +1,133 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+            if (c_val == 1) return;
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+          if (c_val == 1) return;
+        }
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 != 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 != 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 != 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 != 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial00.amber
new file mode 100644 (file)
index 0000000..0110d8c
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial01.amber
new file mode 100644 (file)
index 0000000..a8192eb
--- /dev/null
@@ -0,0 +1,75 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial02.amber
new file mode 100644 (file)
index 0000000..61b03b7
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial03.amber
new file mode 100644 (file)
index 0000000..88374f3
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial04.amber
new file mode 100644 (file)
index 0000000..4235658
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial05.amber
new file mode 100644 (file)
index 0000000..7696ff9
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial06.amber
new file mode 100644 (file)
index 0000000..39dc720
--- /dev/null
@@ -0,0 +1,83 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial07.amber
new file mode 100644 (file)
index 0000000..5d7d960
--- /dev/null
@@ -0,0 +1,82 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial08.amber
new file mode 100644 (file)
index 0000000..c328aa8
--- /dev/null
@@ -0,0 +1,79 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial09.amber
new file mode 100644 (file)
index 0000000..0b713bc
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial10.amber
new file mode 100644 (file)
index 0000000..9ba73ca
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial11.amber
new file mode 100644 (file)
index 0000000..5a7a895
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial12.amber
new file mode 100644 (file)
index 0000000..a37a6fa
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial13.amber
new file mode 100644 (file)
index 0000000..e0c1356
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial14.amber
new file mode 100644 (file)
index 0000000..e4f4386
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 2:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial15.amber
new file mode 100644 (file)
index 0000000..8ae8a3c
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial16.amber
new file mode 100644 (file)
index 0000000..50e0545
--- /dev/null
@@ -0,0 +1,89 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[238 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[238 * 0 + idx] = cmp_val;
+  compare.x[238 * 1 + idx] = cmp_val;
+  compare.x[238 * 2 + idx] = cmp_val;
+  compare.x[238 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 952 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 952 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial17.amber
new file mode 100644 (file)
index 0000000..0de1d56
--- /dev/null
@@ -0,0 +1,80 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial18.amber
new file mode 100644 (file)
index 0000000..7222c33
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial19.amber
new file mode 100644 (file)
index 0000000..5c5dfb8
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) != 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large/subgroup_reconverge_partial20.amber
new file mode 100644 (file)
index 0000000..501ccfa
--- /dev/null
@@ -0,0 +1,132 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+        }
+        if (c_val == 1) return;
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 == 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 == 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 == 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 == 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge00.amber
new file mode 100644 (file)
index 0000000..0ae99ef
--- /dev/null
@@ -0,0 +1,89 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge01.amber
new file mode 100644 (file)
index 0000000..767ddb0
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge02.amber
new file mode 100644 (file)
index 0000000..e2d474b
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge03.amber
new file mode 100644 (file)
index 0000000..b887b01
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge04.amber
new file mode 100644 (file)
index 0000000..88005be
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge05.amber
new file mode 100644 (file)
index 0000000..ecac2ac
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge06.amber
new file mode 100644 (file)
index 0000000..282e2f4
--- /dev/null
@@ -0,0 +1,96 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge07.amber
new file mode 100644 (file)
index 0000000..05b6b27
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge08.amber
new file mode 100644 (file)
index 0000000..a822676
--- /dev/null
@@ -0,0 +1,92 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge09.amber
new file mode 100644 (file)
index 0000000..71ace70
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge10.amber
new file mode 100644 (file)
index 0000000..2f4046a
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge11.amber
new file mode 100644 (file)
index 0000000..2602632
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge12.amber
new file mode 100644 (file)
index 0000000..6437aa1
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge13.amber
new file mode 100644 (file)
index 0000000..8b20be3
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge14.amber
new file mode 100644 (file)
index 0000000..1e50894
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 3:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge15.amber
new file mode 100644 (file)
index 0000000..d97de82
--- /dev/null
@@ -0,0 +1,108 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 3:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge16.amber
new file mode 100644 (file)
index 0000000..e5dd9f6
--- /dev/null
@@ -0,0 +1,102 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[256 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[256 * 0 + idx] = cmp_val;
+  compare.x[256 * 1 + idx] = cmp_val;
+  compare.x[256 * 2 + idx] = cmp_val;
+  compare.x[256 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 1024 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 1024 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge17.amber
new file mode 100644 (file)
index 0000000..df04b7d
--- /dev/null
@@ -0,0 +1,93 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge18.amber
new file mode 100644 (file)
index 0000000..289db96
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge19.amber
new file mode 100644 (file)
index 0000000..a98062c
--- /dev/null
@@ -0,0 +1,101 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) == 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge20.amber
new file mode 100644 (file)
index 0000000..d548218
--- /dev/null
@@ -0,0 +1,146 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+            if (c_val == 1) return;
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+          if (c_val == 1) return;
+        }
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 != 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 != 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 != 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 != 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 256 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 256 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 256 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial00.amber
new file mode 100644 (file)
index 0000000..ba85bae
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial01.amber
new file mode 100644 (file)
index 0000000..406d6c1
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial02.amber
new file mode 100644 (file)
index 0000000..e2023a5
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial03.amber
new file mode 100644 (file)
index 0000000..0adf65a
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial04.amber
new file mode 100644 (file)
index 0000000..49e0a8f
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial05.amber
new file mode 100644 (file)
index 0000000..15e3993
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial06.amber
new file mode 100644 (file)
index 0000000..528ed04
--- /dev/null
@@ -0,0 +1,96 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial07.amber
new file mode 100644 (file)
index 0000000..320f3b0
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial08.amber
new file mode 100644 (file)
index 0000000..14dec83
--- /dev/null
@@ -0,0 +1,92 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial09.amber
new file mode 100644 (file)
index 0000000..6135c06
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial10.amber
new file mode 100644 (file)
index 0000000..dac4613
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial11.amber
new file mode 100644 (file)
index 0000000..ca94818
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial12.amber
new file mode 100644 (file)
index 0000000..64034c5
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial13.amber
new file mode 100644 (file)
index 0000000..11d8458
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial14.amber
new file mode 100644 (file)
index 0000000..21401a9
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 2:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial15.amber
new file mode 100644 (file)
index 0000000..fed37db
--- /dev/null
@@ -0,0 +1,108 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial16.amber
new file mode 100644 (file)
index 0000000..8f9f046
--- /dev/null
@@ -0,0 +1,102 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[238 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[238 * 0 + idx] = cmp_val;
+  compare.x[238 * 1 + idx] = cmp_val;
+  compare.x[238 * 2 + idx] = cmp_val;
+  compare.x[238 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 952 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 952 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial17.amber
new file mode 100644 (file)
index 0000000..f3fc051
--- /dev/null
@@ -0,0 +1,93 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial18.amber
new file mode 100644 (file)
index 0000000..1413507
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial19.amber
new file mode 100644 (file)
index 0000000..68858bd
--- /dev/null
@@ -0,0 +1,101 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) != 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/large_control/subgroup_reconverge_partial20.amber
new file mode 100644 (file)
index 0000000..54f7e6f
--- /dev/null
@@ -0,0 +1,145 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+        }
+        if (c_val == 1) return;
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 == 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 == 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 2, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 == 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 == 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge00.amber
new file mode 100644 (file)
index 0000000..5a0ab48
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge01.amber
new file mode 100644 (file)
index 0000000..37876f3
--- /dev/null
@@ -0,0 +1,75 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge02.amber
new file mode 100644 (file)
index 0000000..6146ec4
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge03.amber
new file mode 100644 (file)
index 0000000..1dc0989
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge04.amber
new file mode 100644 (file)
index 0000000..d4b7e10
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge05.amber
new file mode 100644 (file)
index 0000000..d360571
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge06.amber
new file mode 100644 (file)
index 0000000..48a2abc
--- /dev/null
@@ -0,0 +1,83 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge07.amber
new file mode 100644 (file)
index 0000000..a08aa1e
--- /dev/null
@@ -0,0 +1,82 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge08.amber
new file mode 100644 (file)
index 0000000..73f6ea4
--- /dev/null
@@ -0,0 +1,79 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge09.amber
new file mode 100644 (file)
index 0000000..238382e
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge10.amber
new file mode 100644 (file)
index 0000000..e3703d9
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge11.amber
new file mode 100644 (file)
index 0000000..fecc662
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge12.amber
new file mode 100644 (file)
index 0000000..c2a5027
--- /dev/null
@@ -0,0 +1,85 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge13.amber
new file mode 100644 (file)
index 0000000..099ec06
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge14.amber
new file mode 100644 (file)
index 0000000..6fd2d3a
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 3:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge15.amber
new file mode 100644 (file)
index 0000000..a8af9c3
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 3:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge16.amber
new file mode 100644 (file)
index 0000000..f4cb52d
--- /dev/null
@@ -0,0 +1,89 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[128 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[128 * 0 + idx] = cmp_val;
+  compare.x[128 * 1 + idx] = cmp_val;
+  compare.x[128 * 2 + idx] = cmp_val;
+  compare.x[128 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 512 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 512 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge17.amber
new file mode 100644 (file)
index 0000000..f087daa
--- /dev/null
@@ -0,0 +1,80 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge18.amber
new file mode 100644 (file)
index 0000000..43358a1
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge19.amber
new file mode 100644 (file)
index 0000000..9dee434
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) == 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge20.amber
new file mode 100644 (file)
index 0000000..98e53c1
--- /dev/null
@@ -0,0 +1,133 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+            if (c_val == 1) return;
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+          if (c_val == 1) return;
+        }
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 != 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 != 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 != 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 != 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial00.amber
new file mode 100644 (file)
index 0000000..556e85a
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial01.amber
new file mode 100644 (file)
index 0000000..bcd7ed3
--- /dev/null
@@ -0,0 +1,75 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial02.amber
new file mode 100644 (file)
index 0000000..0269761
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial03.amber
new file mode 100644 (file)
index 0000000..209e5ff
--- /dev/null
@@ -0,0 +1,77 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial04.amber
new file mode 100644 (file)
index 0000000..ded4cb0
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial05.amber
new file mode 100644 (file)
index 0000000..2503600
--- /dev/null
@@ -0,0 +1,78 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial06.amber
new file mode 100644 (file)
index 0000000..651720c
--- /dev/null
@@ -0,0 +1,83 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial07.amber
new file mode 100644 (file)
index 0000000..c903cf7
--- /dev/null
@@ -0,0 +1,82 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial08.amber
new file mode 100644 (file)
index 0000000..12d3116
--- /dev/null
@@ -0,0 +1,79 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial09.amber
new file mode 100644 (file)
index 0000000..e25f709
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial10.amber
new file mode 100644 (file)
index 0000000..a8f4f5f
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial11.amber
new file mode 100644 (file)
index 0000000..78182d2
--- /dev/null
@@ -0,0 +1,87 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial12.amber
new file mode 100644 (file)
index 0000000..72ffef0
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial13.amber
new file mode 100644 (file)
index 0000000..05a8b1f
--- /dev/null
@@ -0,0 +1,86 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial14.amber
new file mode 100644 (file)
index 0000000..a42947c
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 2:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial15.amber
new file mode 100644 (file)
index 0000000..fe50de2
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial16.amber
new file mode 100644 (file)
index 0000000..6cac3a8
--- /dev/null
@@ -0,0 +1,89 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[119 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[119 * 0 + idx] = cmp_val;
+  compare.x[119 * 1 + idx] = cmp_val;
+  compare.x[119 * 2 + idx] = cmp_val;
+  compare.x[119 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 476 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 476 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial17.amber
new file mode 100644 (file)
index 0000000..c471d4d
--- /dev/null
@@ -0,0 +1,80 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial18.amber
new file mode 100644 (file)
index 0000000..0c57096
--- /dev/null
@@ -0,0 +1,84 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial19.amber
new file mode 100644 (file)
index 0000000..c88d65e
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) != 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small/small_subgroup_reconverge_partial20.amber
new file mode 100644 (file)
index 0000000..e829840
--- /dev/null
@@ -0,0 +1,132 @@
+#!amber
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+        }
+        if (c_val == 1) return;
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 == 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 == 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 == 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 == 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge00.amber
new file mode 100644 (file)
index 0000000..23853d0
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge01.amber
new file mode 100644 (file)
index 0000000..302f48d
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge02.amber
new file mode 100644 (file)
index 0000000..b6c3d50
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge03.amber
new file mode 100644 (file)
index 0000000..8d3f899
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge04.amber
new file mode 100644 (file)
index 0000000..8df481b
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge05.amber
new file mode 100644 (file)
index 0000000..74b4d93
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge06.amber
new file mode 100644 (file)
index 0000000..ee36010
--- /dev/null
@@ -0,0 +1,96 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge07.amber
new file mode 100644 (file)
index 0000000..a58761f
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge08.amber
new file mode 100644 (file)
index 0000000..3710b59
--- /dev/null
@@ -0,0 +1,92 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge09.amber
new file mode 100644 (file)
index 0000000..a55b894
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge10.amber
new file mode 100644 (file)
index 0000000..5865c4b
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge11.amber
new file mode 100644 (file)
index 0000000..654a008
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge12.amber
new file mode 100644 (file)
index 0000000..7829a60
--- /dev/null
@@ -0,0 +1,98 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge13.amber
new file mode 100644 (file)
index 0000000..e5e44cb
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 != 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge14.amber
new file mode 100644 (file)
index 0000000..3976894
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 3:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge15.amber
new file mode 100644 (file)
index 0000000..2131beb
--- /dev/null
@@ -0,0 +1,108 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 3:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge16.amber
new file mode 100644 (file)
index 0000000..02e1409
--- /dev/null
@@ -0,0 +1,102 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[128 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 == 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[128 * 0 + idx] = cmp_val;
+  compare.x[128 * 1 + idx] = cmp_val;
+  compare.x[128 * 2 + idx] = cmp_val;
+  compare.x[128 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 512 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 512 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge17.amber
new file mode 100644 (file)
index 0000000..5cf736a
--- /dev/null
@@ -0,0 +1,93 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge18.amber
new file mode 100644 (file)
index 0000000..171bf32
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge19.amber
new file mode 100644 (file)
index 0000000..211f01a
--- /dev/null
@@ -0,0 +1,101 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) == 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 != 0)
+      return;
+
+    if (c_val % 2 == 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge20.amber
new file mode 100644 (file)
index 0000000..0e4de98
--- /dev/null
@@ -0,0 +1,146 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+            if (c_val == 1) return;
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+          if (c_val == 1) return;
+        }
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 != 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 != 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 != 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 != 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 != 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 1 0 0 0
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial00.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial00.amber
new file mode 100644 (file)
index 0000000..6be6213
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      c.c[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial01.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial01.amber
new file mode 100644 (file)
index 0000000..2aff40d
--- /dev/null
@@ -0,0 +1,88 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    do {
+      c.c[idx] = d.d[idx];
+    } while (!subgroupElect());
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial02.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial02.amber
new file mode 100644 (file)
index 0000000..14af11b
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    while (true) {
+      atomicAdd(c.c[0], 1);
+      if (subgroupElect())
+        break;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial03.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial03.amber
new file mode 100644 (file)
index 0000000..64f2f5a
--- /dev/null
@@ -0,0 +1,90 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0) {
+      d.d[idx] += 4;
+    } else {
+      c.c[idx]++;
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial04.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial04.amber
new file mode 100644 (file)
index 0000000..391b188
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial05.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial05.amber
new file mode 100644 (file)
index 0000000..181ec89
--- /dev/null
@@ -0,0 +1,91 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+  } else {
+    c.c[idx]++;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial06.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial06.amber
new file mode 100644 (file)
index 0000000..0deba8b
--- /dev/null
@@ -0,0 +1,96 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (c.c[idx] > 5)
+    return;
+
+  while (true) {
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial07.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial07.amber
new file mode 100644 (file)
index 0000000..68a3228
--- /dev/null
@@ -0,0 +1,95 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  while (true) {
+    if (c.c[idx] > 5)
+      return;
+    if (d.d[idx]++ > idx)
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial08.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial08.amber
new file mode 100644 (file)
index 0000000..8b90873
--- /dev/null
@@ -0,0 +1,92 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (uint i = 0; i < c.c[idx]; ++i) {
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    atomicAdd(d.d[idx], 1);
+    if (i == gl_SubgroupID % 4)
+      break;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial09.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial09.amber
new file mode 100644 (file)
index 0000000..70e4177
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial10.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial10.amber
new file mode 100644 (file)
index 0000000..0113715
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      break;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial11.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial11.amber
new file mode 100644 (file)
index 0000000..34332f0
--- /dev/null
@@ -0,0 +1,100 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] >= 10)
+      continue;
+
+    if (a.a[idx] == 0)
+      atomicAdd(d.d[idx], 2);
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 238 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 238 FILL 1
+BUFFER d DATA_TYPE uint32 SIZE 238 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 238 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial12.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial12.amber
new file mode 100644 (file)
index 0000000..7d5dcb3
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[gl_SubgroupID] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      d.d[idx] = gl_SubgroupID;
+      break;
+    default:
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial13.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial13.amber
new file mode 100644 (file)
index 0000000..85048b6
--- /dev/null
@@ -0,0 +1,99 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  if (a.a[idx] % 2 == 0)
+    return;
+
+  switch (c.c[idx]) {
+    case 0:
+    case 1:
+      atomicAdd(d.d[idx], 1);
+      break;
+    default:
+      d.d[idx] = gl_SubgroupID;
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID;
+
+  c.c[idx] = gl_SubgroupID % 4;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial14.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial14.amber
new file mode 100644 (file)
index 0000000..a03f1c0
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      // fallthrough...
+    case 2:
+      return;
+    default:
+      atomicExchange(d.d[0], gl_SubgroupID);
+      break;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 128 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 128 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 128 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial15.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial15.amber
new file mode 100644 (file)
index 0000000..89d3b15
--- /dev/null
@@ -0,0 +1,108 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  switch (a.a[idx]) {
+    case 0:
+      atomicAdd(d.d[idx], 1);
+      break;
+    case 2:
+      return;
+    default:
+      switch (c.c[idx]) {
+        case 0:
+        case 1:
+          atomicExchange(d.d[0], gl_SubgroupID);
+          break;
+        case 2:
+          c.c[idx]++;
+          break;
+        default:
+          atomicAdd(d.d[1], 32);
+          break;
+      }
+      b.b[idx] = subgroupElect() ? 1 : 0;
+      break;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  a.a[idx] = gl_SubgroupID % 4;
+
+  c.c[idx] = gl_SubgroupID;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial16.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial16.amber
new file mode 100644 (file)
index 0000000..02fb2a1
--- /dev/null
@@ -0,0 +1,102 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  for (int i = 0; i < c.c[0]; ++i) {
+    atomicAdd(d.d[idx], 1);
+    if (a.a[idx] < 10) {
+      if (a.a[idx] == 0)
+        atomicAdd(d.d[idx], 2);
+      b.b[119 * i + idx] = subgroupElect() ? 1 : 0;
+    }
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = 50;
+  if (gl_SubgroupID % 2 != 0) {
+    if (gl_SubgroupInvocationID == 0)
+      a_val = 0;
+    else
+      a_val = 5;
+  }
+  a.a[idx] = a_val;
+
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[119 * 0 + idx] = cmp_val;
+  compare.x[119 * 1 + idx] = cmp_val;
+  compare.x[119 * 2 + idx] = cmp_val;
+  compare.x[119 * 3 + idx] = cmp_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER b DATA_TYPE uint32 SIZE 476 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 476 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial17.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial17.amber
new file mode 100644 (file)
index 0000000..02ae8ee
--- /dev/null
@@ -0,0 +1,93 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) volatile buffer C { uint c[]; } c;
+layout(set=0, binding=3) coherent buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+  if (gl_SubgroupInvocationID == 0) {
+    c.c[idx] += 4;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  } else {
+    c.c[idx]++;
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+  }
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 0
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial18.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial18.amber
new file mode 100644 (file)
index 0000000..117961e
--- /dev/null
@@ -0,0 +1,97 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  if (!subgroupAllEqual(c_val)) {
+    atomicAdd(d.d[0], 1);
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial19.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial19.amber
new file mode 100644 (file)
index 0000000..6fac8ab
--- /dev/null
@@ -0,0 +1,101 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint c_val = c.c[idx];
+  bool test = (c_val % 2) != 0;
+  if (subgroupAny(test)) {
+    atomicAdd(d.d[0], 1);
+    if (a.a[gl_SubgroupID] % 2 == 0)
+      return;
+
+    if (c_val % 2 != 0) {
+      atomicAdd(d.d[idx], gl_SubgroupID);
+    }
+    b.b[idx] = subgroupElect() ? 1 : 0;
+  }
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = subgroupElect() ? 1 : 0;
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    a_val = 4;
+  }
+  compare.x[idx] = a_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[gl_SubgroupID] % 2 == 0) {
+    c_val = 10;
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
diff --git a/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial20.amber b/external/vulkancts/data/vulkan/amber/subgroup_uniform_control_flow/small_control/small_subgroup_reconverge_partial20.amber
new file mode 100644 (file)
index 0000000..76238f2
--- /dev/null
@@ -0,0 +1,145 @@
+#!amber
+
+DEVICE_FEATURE SubgroupSizeControl.subgroupSizeControl
+DEVICE_FEATURE SubgroupSizeControl.computeFullSubgroups
+
+SHADER compute test GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_vote : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+#extension GL_EXT_subgroup_uniform_control_flow : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer B { uint b[]; } b;
+layout(set=0, binding=2) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+[[subgroup_uniform_control_flow]]
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint a_val = a.a[idx];
+  if (a_val < 128) {
+    uint c_val = c.c[idx];
+    switch (c_val) {
+      case 0:
+        atomicAdd(d.d[idx], 1);
+        break;
+      case 1:
+      case 2:
+        if (a_val > 4) {
+          uint val = a_val;
+          for (uint i = 0; i < 4; ++i) {
+            val = atomicExchange(d.d[0], val);
+          }
+        } else if (a_val == 3) {
+          atomicAdd(d.d[1], gl_SubgroupID);
+        } else {
+          atomicAdd(d.d[2], gl_SubgroupInvocationID);
+        }
+        if (c_val == 1) return;
+        break;
+      default:
+        if (a.a[gl_SubgroupID] % 2 == 0) return;
+        atomicExchange(d.d[idx], c_val);
+        break;
+    }
+  } else if (a_val < 192) {
+    atomicExchange(d.d[idx], a_val);
+    uint c_val = c.c[idx];
+    if (subgroupAny(c_val == 0)) {
+      return;
+    } else {
+      uint val = atomicAdd(d.d[idx], gl_SubgroupInvocationID);
+      while (!subgroupElect()) {
+        val = atomicExchange(d.d[0], val);
+      }
+      if (val > 10) {
+        atomicAnd(d.d[idx], 0xff00ff00);
+      }
+    }
+  } else {
+    if (a.a[gl_SubgroupID] % 2 == 0) return;
+  }
+
+  b.b[idx] = subgroupElect() ? 1 : 0;
+}
+END
+
+SHADER compute fill GLSL TARGET_ENV spv1.3
+#version 450 core
+#extension GL_KHR_shader_subgroup_basic : enable
+#extension GL_KHR_shader_subgroup_ballot : enable
+layout(local_size_x = 119, local_size_y = 1, local_size_z = 1) in;
+
+layout(set=0, binding=0) coherent buffer A { uint a[]; } a;
+layout(set=0, binding=1) coherent buffer C { uint c[]; } c;
+layout(set=0, binding=2) coherent buffer COMPARE { uint x[]; } compare;
+
+void main()
+{
+  uint idx = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+  uint cmp_val = subgroupElect() ? 1 : 0;
+  if (gl_SubgroupID % 2 == 0) {
+    cmp_val = 4;
+  }
+  compare.x[idx] = cmp_val;
+
+  uint c_val = c.c[idx];
+  if (a.a[idx] < 128) {
+    if (gl_SubgroupID % 2 == 0) {
+      c_val = 1;
+    } else {
+      c_val = gl_SubgroupInvocationID % 4;
+      if (c_val == 1) c_val += 4;
+    }
+  } else if (a.a[idx] < 192) {
+    if (gl_SubgroupInvocationID == 0 && gl_SubgroupID % 2 == 0) {
+      c_val = 0;
+    } else {
+      c_val = c_val + 1;
+    }
+  }
+  c.c[idx] = c_val;
+}
+END
+
+BUFFER a DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER b DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER c DATA_TYPE uint32 SIZE 119 SERIES_FROM 0 INC_BY 1
+BUFFER d DATA_TYPE uint32 SIZE 119 FILL 4
+BUFFER compare DATA_TYPE uint32 SIZE 119 FILL 4
+
+PIPELINE compute fill_pipe
+  ATTACH fill
+  SUBGROUP fill
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER compare AS storage DESCRIPTOR_SET 0 BINDING 2
+END
+
+PIPELINE compute test_pipe
+  ATTACH test
+  SUBGROUP test
+    FULLY_POPULATED on
+    REQUIRED_SIZE MIN
+  END
+
+  BIND BUFFER a AS storage DESCRIPTOR_SET 0 BINDING 0
+  BIND BUFFER b AS storage DESCRIPTOR_SET 0 BINDING 1
+  BIND BUFFER c AS storage DESCRIPTOR_SET 0 BINDING 2
+  BIND BUFFER d AS storage DESCRIPTOR_SET 0 BINDING 3
+END
+
+RUN fill_pipe 1 1 1
+RUN test_pipe 1 1 1
+
+EXPECT compare IDX 0 EQ 4 4 4 4
+EXPECT b EQ_BUFFER compare
+
index 68acef5..e672eb2 100644 (file)
@@ -37,14 +37,19 @@ set(DEQP_VK_SUBGROUPS_SRCS
   vktSubgroupsBallotMasksTests.hpp
   vktSubgroupsSizeControlTests.cpp
   vktSubgroupsSizeControlTests.hpp
+  vktSubgroupUniformControlFlowTests.cpp
+  vktSubgroupUniformControlFlowTests.hpp
   )
 
 set(DEQP_VK_SUBGROUPS_LIBS
+  libamber
   tcutil
   vkutil
   )
 
 PCH(DEQP_VK_SUBGROUPS_SRCS ../pch.cpp)
+include_directories("../amber")
+include_directories("../../../../amber/src/include")
 
 add_library(deqp-vk-subgroups STATIC ${DEQP_VK_SUBGROUPS_SRCS})
 target_link_libraries(deqp-vk-subgroups ${DEQP_VK_SUBGROUPS_LIBS})
diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.cpp
new file mode 100644 (file)
index 0000000..1d57215
--- /dev/null
@@ -0,0 +1,371 @@
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2020 Google LLC
+ * Copyright (c) 2020 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Test new features in VK_KHR_shader_subgroup_uniform_control_flow
+ *//*--------------------------------------------------------------------*/
+
+#include <amber/amber.h>
+
+#include "tcuDefs.hpp"
+
+#include "vkDefs.hpp"
+#include "vkDeviceUtil.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
+#include "vktSubgroupUniformControlFlowTests.hpp"
+#include "vktTestGroupUtil.hpp"
+
+namespace vkt
+{
+namespace subgroups
+{
+namespace
+{
+
+struct Case
+{
+       Case(const char*        b, const char* d,       bool sw,        bool use_ssc,   vk::VkShaderStageFlagBits s, vk::VkSubgroupFeatureFlagBits o) :
+               basename(b),
+               description(d),
+               small_workgroups(sw),
+               use_subgroup_size_control(use_ssc),
+               stage(s)
+       {
+               operation = (vk::VkSubgroupFeatureFlagBits)(o | vk::VK_SUBGROUP_FEATURE_BASIC_BIT);
+       }
+       const char* basename;
+       const char* description;
+       bool small_workgroups;
+       bool use_subgroup_size_control;
+       vk::VkShaderStageFlagBits stage;
+       vk::VkSubgroupFeatureFlagBits operation;
+};
+
+struct CaseGroup
+{
+       CaseGroup(const char*   the_data_dir, const char*       the_subdir) : data_dir(the_data_dir),   subdir(the_subdir) { }
+       void add(const char*    basename,       const char*     description,    bool small_workgroups,  bool use_subgroup_size_control, vk::VkShaderStageFlagBits stage, vk::VkSubgroupFeatureFlagBits operation = vk::VK_SUBGROUP_FEATURE_BASIC_BIT)
+       {
+               cases.push_back(Case(basename, description, small_workgroups, use_subgroup_size_control, stage, operation));
+       }
+
+       const char*     data_dir;
+       const char*     subdir;
+       std::vector<Case>       cases;
+};
+
+class SubgroupUniformControlFlowTestCase : public cts_amber::AmberTestCase
+{
+public:
+       SubgroupUniformControlFlowTestCase(tcu::TestContext&    testCtx,
+                                                                          const char*  name,
+                                                                          const char*  description,
+                                                                          const std::string&   readFilename,
+                                                                          bool small_workgroups,
+                                                                          bool use_subgroup_size_control,
+                                                                          vk::VkShaderStageFlagBits stage,
+                                                                          vk::VkSubgroupFeatureFlagBits operation) :
+               cts_amber::AmberTestCase(testCtx, name, description, readFilename),
+               m_small_workgroups(small_workgroups),
+               m_use_subgroup_size_control(use_subgroup_size_control),
+               m_stage(stage),
+               m_operation(operation)
+       { }
+
+       virtual void checkSupport(Context&      ctx) const;     // override
+private:
+       bool    m_small_workgroups;
+       bool    m_use_subgroup_size_control;
+       vk::VkShaderStageFlagBits       m_stage;
+       vk::VkSubgroupFeatureFlagBits   m_operation;
+};
+
+void SubgroupUniformControlFlowTestCase::checkSupport(Context& ctx) const
+{
+       // Check required extensions.
+       ctx.requireDeviceFunctionality("VK_KHR_shader_subgroup_uniform_control_flow");
+       if (m_use_subgroup_size_control)
+       {
+               ctx.requireDeviceFunctionality("VK_EXT_subgroup_size_control");
+       }
+
+       vk::VkPhysicalDeviceSubgroupProperties subgroupProperties;
+       subgroupProperties.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
+       subgroupProperties.pNext = DE_NULL;
+
+       vk::VkPhysicalDeviceProperties2 properties2;
+       properties2.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+       properties2.pNext = &subgroupProperties;
+
+       ctx.getInstanceInterface().getPhysicalDeviceProperties2(ctx.getPhysicalDevice(), &properties2);
+
+       vk::VkPhysicalDeviceSubgroupSizeControlFeaturesEXT subgroupSizeControlFeatures;
+       subgroupSizeControlFeatures.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT;
+       subgroupSizeControlFeatures.pNext = DE_NULL;
+
+       vk::VkPhysicalDeviceFeatures2 features2;
+       features2.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+       features2.pNext = &subgroupSizeControlFeatures;
+
+       ctx.getInstanceInterface().getPhysicalDeviceFeatures2(ctx.getPhysicalDevice(), &features2);
+
+       // Check that the stage supports the required subgroup operations.
+       if ((m_stage & subgroupProperties.supportedStages) == 0)
+       {
+               TCU_THROW(NotSupportedError, "Device does not support subgroup operations in this stage");
+       }
+       if ((m_operation & subgroupProperties.supportedOperations) != m_operation)
+       {
+               TCU_THROW(NotSupportedError, "Device does not support required operations");
+       }
+
+       // For the compute shader tests, there are variants for implementations
+       // that support the subgroup size control extension and variants for those
+       // that do not. It is expected that computeFullSubgroups must be set for
+       // these tests if the extension is supported so tests are only supported
+       // for the extension appropriate version.
+       if (m_stage == vk::VK_SHADER_STAGE_COMPUTE_BIT)
+       {
+               if (m_use_subgroup_size_control)
+               {
+                       if (subgroupSizeControlFeatures.computeFullSubgroups != VK_TRUE)
+                       {
+                               TCU_THROW(NotSupportedError, "Implementation does not support subgroup size control");
+                       }
+               }
+               else
+               {
+                       if (subgroupSizeControlFeatures.computeFullSubgroups == VK_TRUE)
+                       {
+                               TCU_THROW(NotSupportedError, "These tests are not enabled for subgroup size control implementations");
+                       }
+               }
+       }
+
+       // The are large and small variants of the tests. The large variants
+       // require 256 invocations in a workgroup.
+       if (!m_small_workgroups)
+       {
+               vk::VkPhysicalDeviceProperties properties;
+               ctx.getInstanceInterface().getPhysicalDeviceProperties(ctx.getPhysicalDevice(), &properties);
+               if (properties.limits.maxComputeWorkGroupInvocations < 256)
+               {
+                       TCU_THROW(NotSupportedError, "Device supported fewer than 256 invocations per workgroup");
+               }
+       }
+}
+
+void addTestsForAmberFiles(tcu::TestCaseGroup* tests, CaseGroup group)
+{
+       tcu::TestContext&       testCtx = tests->getTestContext();
+       const std::string       data_dir(group.data_dir);
+       const std::string       subdir(group.subdir);
+       const std::string       category = data_dir + "/" + subdir;
+       std::vector<Case> cases(group.cases);
+
+       for (unsigned i = 0; i < cases.size(); ++i)
+       {
+               const std::string file = std::string(cases[i].basename) + ".amber";
+               std::string readFilename("vulkan/amber/");
+               readFilename.append(category);
+               readFilename.append("/");
+               readFilename.append(file);
+               SubgroupUniformControlFlowTestCase*     testCase =
+                       new SubgroupUniformControlFlowTestCase(testCtx,
+                                                                                                       cases[i].basename,
+                                                                                                       cases[i].description,
+                                                                                                       readFilename,
+                                                                                                       cases[i].small_workgroups,
+                                                                                                       cases[i].use_subgroup_size_control,
+                                                                                                       cases[i].stage,
+                                                                                                       cases[i].operation);
+               DE_ASSERT(testCase != DE_NULL);
+               tests->addChild(testCase);
+       }
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createSubgroupUniformControlFlowTests(tcu::TestContext&    testCtx)
+{
+       // There are four main groups of tests. Each group runs the same set of base
+       // shaders with minor variations. The groups are with or without compute full
+       // subgroups and a larger or smaller number of invocations. For each group of
+       // tests, shaders test either odd or even subgroups reconverge after
+       // diverging, without reconverging the whole workgroup. For the _partial
+       // tests, the workgroup is launched without a full final subgroup (not enough
+       // invocations).
+       //
+       // It is assumed that if an implementation does not support the compute full
+       // subgroups feature, that it will always launch full subgroups. Therefore,
+       // any given implementation only runs half of the tests. Implementations that
+       // do not support compute full subgroups cannot support the tests that enable
+       // it, while implementations that do support the feature will (likely) not
+       // pass the tests that do not enable the feature.
+
+       de::MovePtr<tcu::TestCaseGroup> uniformControlFlowTests(new     tcu::TestCaseGroup(testCtx,     "subgroup_uniform_control_flow", "VK_KHR_shader_subgroup_uniform_control_flow tests"));
+
+       // Location of the Amber script files under data/vulkan/amber source tree.
+       const char* data_dir = "subgroup_uniform_control_flow";
+       const char*     large_dir = "large";
+       const char*     small_dir = "small";
+       const char*     large_control_dir = "large_control";
+       const char* small_control_dir = "small_control";
+
+       std::vector<bool> controls = {false, true};
+       for (unsigned c = 0; c < controls.size(); ++c)
+       {
+               // Full subgroups.
+               bool small = false;
+               bool control = controls[c];
+               vk::VkShaderStageFlagBits stage = vk::VK_SHADER_STAGE_COMPUTE_BIT;
+               const char*     subdir = (control ? large_control_dir : large_dir);
+               CaseGroup group(data_dir, subdir);
+               group.add("subgroup_reconverge00", "if/else diverge", small, control, stage);
+               group.add("subgroup_reconverge01", "do while diverge", small, control, stage);
+               group.add("subgroup_reconverge02", "while true with break", small, control, stage);
+               group.add("subgroup_reconverge03", "if/else diverge, volatile", small, control, stage);
+               group.add("subgroup_reconverge04", "early return and if/else diverge", small, control, stage);
+               group.add("subgroup_reconverge05", "early return and if/else volatile", small, control, stage);
+               group.add("subgroup_reconverge06", "while true with volatile conditional break and early return", small, control, stage);
+               group.add("subgroup_reconverge07", "while true return and break", small, control, stage);
+               group.add("subgroup_reconverge08", "for loop atomics with conditional break", small, control, stage);
+               group.add("subgroup_reconverge09", "diverge in for loop", small, control, stage);
+               group.add("subgroup_reconverge10", "diverge in for loop and break", small, control, stage);
+               group.add("subgroup_reconverge11", "diverge in for loop and continue", small, control, stage);
+               group.add("subgroup_reconverge12", "early return, divergent switch", small, control, stage);
+               group.add("subgroup_reconverge13", "early return, divergent switch more cases", small, control, stage);
+               group.add("subgroup_reconverge14", "divergent switch, some subgroups terminate", small, control, stage);
+               group.add("subgroup_reconverge15", "switch in switch", small, control, stage);
+               group.add("subgroup_reconverge16", "for loop unequal iterations", small, control, stage);
+               group.add("subgroup_reconverge17", "if/else with nested returns", small, control, stage);
+               group.add("subgroup_reconverge18", "if/else subgroup all equal", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("subgroup_reconverge19", "if/else subgroup any nested return", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("subgroup_reconverge20", "deeply nested", small, control, stage);
+               const char*     group_name = (control ? "large_full_control" : "large_full");
+               uniformControlFlowTests->addChild(createTestGroup(testCtx, group_name,
+                                                                                                                 "Large Full subgroups",
+                                                                                                                 addTestsForAmberFiles, group));
+
+               // Partial subgroup.
+               group = CaseGroup(data_dir, subdir);
+               group.add("subgroup_reconverge_partial00", "if/else diverge", small, control, stage);
+               group.add("subgroup_reconverge_partial01", "do while diverge", small, control, stage);
+               group.add("subgroup_reconverge_partial02", "while true with break", small, control, stage);
+               group.add("subgroup_reconverge_partial03", "if/else diverge, volatile", small, control, stage);
+               group.add("subgroup_reconverge_partial04", "early return and if/else diverge", small, control, stage);
+               group.add("subgroup_reconverge_partial05", "early return and if/else volatile", small, control, stage);
+               group.add("subgroup_reconverge_partial06", "while true with volatile conditional break and early return", small, control, stage);
+               group.add("subgroup_reconverge_partial07", "while true return and break", small, control, stage);
+               group.add("subgroup_reconverge_partial08", "for loop atomics with conditional break", small, control, stage);
+               group.add("subgroup_reconverge_partial09", "diverge in for loop", small, control, stage);
+               group.add("subgroup_reconverge_partial10", "diverge in for loop and break", small, control, stage);
+               group.add("subgroup_reconverge_partial11", "diverge in for loop and continue", small, control, stage);
+               group.add("subgroup_reconverge_partial12", "early return, divergent switch", small, control, stage);
+               group.add("subgroup_reconverge_partial13", "early return, divergent switch more cases", small, control, stage);
+               group.add("subgroup_reconverge_partial14", "divergent switch, some subgroups terminate", small, control, stage);
+               group.add("subgroup_reconverge_partial15", "switch in switch", small, control, stage);
+               group.add("subgroup_reconverge_partial16", "for loop unequal iterations", small, control, stage);
+               group.add("subgroup_reconverge_partial17", "if/else with nested returns", small, control, stage);
+               group.add("subgroup_reconverge_partial18", "if/else subgroup all equal", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("subgroup_reconverge_partial19", "if/else subgroup any nested return", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("subgroup_reconverge_partial20", "deeply nested", small, control, stage);
+               group_name = (control ? "large_partial_control" : "large_partial");
+               uniformControlFlowTests->addChild(createTestGroup(testCtx, group_name,
+                                                                                                                 "Large Partial subgroups",
+                                                                                                                 addTestsForAmberFiles, group));
+       }
+
+       for (unsigned c = 0; c < controls.size(); ++c)
+       {
+               // Full subgroups.
+               bool small = true;
+               bool control = controls[c];
+               vk::VkShaderStageFlagBits stage = vk::VK_SHADER_STAGE_COMPUTE_BIT;
+               const char*     subdir = (control ? small_control_dir : small_dir);
+               CaseGroup group(data_dir, subdir);
+               group.add("small_subgroup_reconverge00", "if/else diverge", small, control, stage);
+               group.add("small_subgroup_reconverge01", "do while diverge", small, control, stage);
+               group.add("small_subgroup_reconverge02", "while true with break", small, control, stage);
+               group.add("small_subgroup_reconverge03", "if/else diverge, volatile", small, control, stage);
+               group.add("small_subgroup_reconverge04", "early return and if/else diverge", small, control, stage);
+               group.add("small_subgroup_reconverge05", "early return and if/else volatile", small, control, stage);
+               group.add("small_subgroup_reconverge06", "while true with volatile conditional break and early return", small, control, stage);
+               group.add("small_subgroup_reconverge07", "while true return and break", small, control, stage);
+               group.add("small_subgroup_reconverge08", "for loop atomics with conditional break", small, control, stage);
+               group.add("small_subgroup_reconverge09", "diverge in for loop", small, control, stage);
+               group.add("small_subgroup_reconverge10", "diverge in for loop and break", small, control, stage);
+               group.add("small_subgroup_reconverge11", "diverge in for loop and continue", small, control, stage);
+               group.add("small_subgroup_reconverge12", "early return, divergent switch", small, control, stage);
+               group.add("small_subgroup_reconverge13", "early return, divergent switch more cases", small, control, stage);
+               group.add("small_subgroup_reconverge14", "divergent switch, some subgroups terminate", small, control, stage);
+               group.add("small_subgroup_reconverge15", "switch in switch", small, control, stage);
+               group.add("small_subgroup_reconverge16", "for loop unequal iterations", small, control, stage);
+               group.add("small_subgroup_reconverge17", "if/else with nested returns", small, control, stage);
+               group.add("small_subgroup_reconverge18", "if/else subgroup all equal", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("small_subgroup_reconverge19", "if/else subgroup any nested return", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("small_subgroup_reconverge20", "deeply nested", small, control, stage);
+               const char*     group_name = (control ? "small_full_control" : "small_full");
+               uniformControlFlowTests->addChild(createTestGroup(testCtx, group_name,
+                                                                                                                 "Small Full subgroups",
+                                                                                                                 addTestsForAmberFiles, group));
+
+               // Partial subgroup.
+               group = CaseGroup(data_dir, subdir);
+               group.add("small_subgroup_reconverge_partial00", "if/else diverge", small, control, stage);
+               group.add("small_subgroup_reconverge_partial01", "do while diverge", small, control, stage);
+               group.add("small_subgroup_reconverge_partial02", "while true with break", small, control, stage);
+               group.add("small_subgroup_reconverge_partial03", "if/else diverge, volatile", small, control, stage);
+               group.add("small_subgroup_reconverge_partial04", "early return and if/else diverge", small, control, stage);
+               group.add("small_subgroup_reconverge_partial05", "early return and if/else volatile", small, control, stage);
+               group.add("small_subgroup_reconverge_partial06", "while true with volatile conditional break and early return", small, control, stage);
+               group.add("small_subgroup_reconverge_partial07", "while true return and break", small, control, stage);
+               group.add("small_subgroup_reconverge_partial08", "for loop atomics with conditional break", small, control, stage);
+               group.add("small_subgroup_reconverge_partial09", "diverge in for loop", small, control, stage);
+               group.add("small_subgroup_reconverge_partial10", "diverge in for loop and break", small, control, stage);
+               group.add("small_subgroup_reconverge_partial11", "diverge in for loop and continue", small, control, stage);
+               group.add("small_subgroup_reconverge_partial12", "early return, divergent switch", small, control, stage);
+               group.add("small_subgroup_reconverge_partial13", "early return, divergent switch more cases", small, control, stage);
+               group.add("small_subgroup_reconverge_partial14", "divergent switch, some subgroups terminate", small, control, stage);
+               group.add("small_subgroup_reconverge_partial15", "switch in switch", small, control, stage);
+               group.add("small_subgroup_reconverge_partial16", "for loop unequal iterations", small, control, stage);
+               group.add("small_subgroup_reconverge_partial17", "if/else with nested returns", small, control, stage);
+               group.add("small_subgroup_reconverge_partial18", "if/else subgroup all equal", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("small_subgroup_reconverge_partial19", "if/else subgroup any nested return", small, control, stage, vk::VK_SUBGROUP_FEATURE_VOTE_BIT);
+               group.add("small_subgroup_reconverge_partial20", "deeply nested", small, control, stage);
+               group_name = (control ? "small_partial_control" : "small_partial");
+               uniformControlFlowTests->addChild(createTestGroup(testCtx, group_name,
+                                                                                                                 "Small Partial subgroups",
+                                                                                                                 addTestsForAmberFiles, group));
+       }
+
+       // Discard test
+       CaseGroup group(data_dir, "discard");
+       group.add("subgroup_reconverge_discard00", "discard test", true, false, vk::VK_SHADER_STAGE_FRAGMENT_BIT);
+       uniformControlFlowTests->addChild(createTestGroup(testCtx, "discard",
+                                                                                                               "Discard tests",
+                                                                                                               addTestsForAmberFiles, group));
+
+       return uniformControlFlowTests.release();
+}
+
+} // subgroups
+} // vkt
diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.hpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupUniformControlFlowTests.hpp
new file mode 100644 (file)
index 0000000..854f243
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef _VKTSUBGROUPUNIFORMCONTROLFLOWTESTS_HPP
+#define _VKTSUBGROUPUNIFORMCONTROLFLOWTESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2020 Google LLC
+ * Copyright (c) 2020 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief VK_KHR_shader_subgroup_uniform_control_flow tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+namespace subgroups
+{
+
+tcu::TestCaseGroup*    createSubgroupUniformControlFlowTests (tcu::TestContext& testCtx);
+
+} // subgroups
+} // vkt
+
+#endif // _VKTSUBGROUPUNIFORMCONTROLFLOWTESTS_HPP
index d327005..6aed26f 100755 (executable)
@@ -38,6 +38,7 @@
 #include "vktSubgroupsShapeTests.hpp"
 #include "vktSubgroupsBallotMasksTests.hpp"
 #include "vktSubgroupsSizeControlTests.hpp"
+#include "vktSubgroupUniformControlFlowTests.hpp"
 #include "vktTestGroupUtil.hpp"
 
 namespace vkt
@@ -67,6 +68,7 @@ void createChildren(tcu::TestCaseGroup* subgroupsTests)
        subgroupsTests->addChild(createSubgroupsShapeTests(testCtx));
        subgroupsTests->addChild(createSubgroupsBallotMasksTests(testCtx));
        subgroupsTests->addChild(createSubgroupsSizeControlTests(testCtx));
+       subgroupsTests->addChild(createSubgroupUniformControlFlowTests(testCtx));
 }
 
 } // anonymous
index 5958a94..5c8074b 100644 (file)
@@ -20894,3 +20894,172 @@ dEQP-VK.subgroups.size_control.framebuffer.fragment_required_subgroup_size_min
 dEQP-VK.subgroups.size_control.ray_tracing.allow_varying_subgroup_size
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_max
 dEQP-VK.subgroups.size_control.ray_tracing.required_subgroup_size_min
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_full_control.subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.large_partial_control.subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_full_control.small_subgroup_reconverge20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial00
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial01
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial02
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial03
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial04
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial05
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial06
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial07
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial08
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial09
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial10
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial11
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial12
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial13
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial14
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial15
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial16
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial17
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial18
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial19
+dEQP-VK.subgroups.subgroup_uniform_control_flow.small_partial_control.small_subgroup_reconverge_partial20
+dEQP-VK.subgroups.subgroup_uniform_control_flow.discard.subgroup_reconverge_discard00