ac/llvm: Implement load_num_subgroups for NGG shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
This commit is contained in:
Timur Kristóf 2021-09-09 16:19:37 +02:00 committed by Marge Bot
parent 1a95d43e55
commit c9f8be9d58
1 changed files with 2 additions and 0 deletions

View File

@ -3075,6 +3075,8 @@ static LLVMValueRef visit_load_num_subgroups(struct ac_nir_context *ctx)
if (ctx->stage == MESA_SHADER_COMPUTE) {
return LLVMBuildAnd(ctx->ac.builder, ac_get_arg(&ctx->ac, ctx->args->tg_size),
LLVMConstInt(ctx->ac.i32, 0x3f, false), "");
} else if (ctx->args->merged_wave_info.used) {
return ac_unpack_param(&ctx->ac, ac_get_arg(&ctx->ac, ctx->args->merged_wave_info), 28, 4);
} else {
return LLVMConstInt(ctx->ac.i32, 1, false);
}