sysval = nir_imm_int(b, 0);
break;
+ case SYSTEM_VALUE_GLOBAL_GROUP_SIZE: {
+ nir_ssa_def *group_size = build_local_group_size(b);
+ nir_ssa_def *num_work_groups = nir_load_num_work_groups(b);
+ sysval = nir_imul(b, group_size, num_work_groups);
+ break;
+ }
+
default:
break;
}
ENUM(SYSTEM_VALUE_WORK_GROUP_ID),
ENUM(SYSTEM_VALUE_NUM_WORK_GROUPS),
ENUM(SYSTEM_VALUE_LOCAL_GROUP_SIZE),
+ ENUM(SYSTEM_VALUE_GLOBAL_GROUP_SIZE),
ENUM(SYSTEM_VALUE_DEVICE_INDEX),
ENUM(SYSTEM_VALUE_VIEW_INDEX),
ENUM(SYSTEM_VALUE_VERTEX_CNT),
SYSTEM_VALUE_WORK_GROUP_ID,
SYSTEM_VALUE_NUM_WORK_GROUPS,
SYSTEM_VALUE_LOCAL_GROUP_SIZE,
+ SYSTEM_VALUE_GLOBAL_GROUP_SIZE,
/*@}*/
/** Required for VK_KHR_device_group */
*location = FRAG_RESULT_STENCIL;
vtn_assert(*mode == nir_var_shader_out);
break;
+ case SpvBuiltInGlobalSize:
+ *location = SYSTEM_VALUE_GLOBAL_GROUP_SIZE;
+ set_mode_system_value(b, mode);
+ break;
default:
vtn_fail("unsupported builtin");
}