anv: Implement vkCmdDispatchBase

This is part of the device groups extension/feature but it's a decent
chunk of work in its own right so it's worth breaking into its own
patch.  The mechanism we use is fairly straightforward: we just push the
base work group id into the shader and add it to the work group id we
get from dispatch.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
Jason Ekstrand
2017-10-03 15:23:07 -07:00
parent ff9db1a4cc
commit dfe18be09e
9 changed files with 165 additions and 6 deletions

View File

@@ -688,6 +688,12 @@ anv_push_constant_value(struct anv_push_constants *data, uint32_t param)
switch (param) {
case BRW_PARAM_BUILTIN_ZERO:
return 0;
case BRW_PARAM_BUILTIN_BASE_WORK_GROUP_ID_X:
return data->base_work_group_id[0];
case BRW_PARAM_BUILTIN_BASE_WORK_GROUP_ID_Y:
return data->base_work_group_id[1];
case BRW_PARAM_BUILTIN_BASE_WORK_GROUP_ID_Z:
return data->base_work_group_id[2];
default:
unreachable("Invalid param builtin");
}