The following compiles successfully when generating spirv, but groupshared uint testing = 0; will NOT be always initialized to zero. If I switch the compile mode to DXIL, I will get the warning: Initializer of external global will be ignored
http://shader-playground.timjones.io/46e4c2aa215eef693bea5e82cc6c3f8a
groupshared uint testing = 0;
[numthreads(1, 1, 1)]
void cs_main(uint local_thread_id_flat : SV_GroupIndex) {
if (testing > 0) {
printf("aaa");
}
}