radeonsi/gfx10: distinguish between merged shaders and multi-part shaders

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Nicolai Hähnle 2017-11-17 13:40:18 +01:00 committed by Marek Olšák
parent 4063ea95e9
commit e86256c512
1 changed files with 10 additions and 3 deletions

View File

@ -83,7 +83,8 @@ static bool llvm_type_is_64bit(struct si_shader_context *ctx,
return false;
}
static bool is_merged_shader(struct si_shader_context *ctx)
/** Whether the shader runs as a combination of multiple API shaders */
static bool is_multi_part_shader(struct si_shader_context *ctx)
{
if (ctx->screen->info.chip_class <= GFX8)
return false;
@ -94,6 +95,12 @@ static bool is_merged_shader(struct si_shader_context *ctx)
ctx->type == PIPE_SHADER_GEOMETRY;
}
/** Whether the shader runs on a merged HW stage (LSHS or ESGS) */
static bool is_merged_shader(struct si_shader_context *ctx)
{
return ctx->shader->key.as_ngg || is_multi_part_shader(ctx);
}
void si_init_function_info(struct si_function_info *fninfo)
{
fninfo->num_params = 0;
@ -6543,7 +6550,7 @@ static void si_build_wrapper_function(struct si_shader_context *ctx,
/* Merged shaders are executed conditionally depending
* on the number of enabled threads passed in the input SGPRs. */
if (is_merged_shader(ctx) && part == 0) {
if (is_multi_part_shader(ctx) && part == 0) {
LLVMValueRef ena, count = initial[3];
count = LLVMBuildAnd(builder, count,
@ -6605,7 +6612,7 @@ static void si_build_wrapper_function(struct si_shader_context *ctx,
ret = ac_build_call(&ctx->ac, parts[part], in, num_params);
if (is_merged_shader(ctx) &&
if (is_multi_part_shader(ctx) &&
part + 1 == next_shader_first_part) {
lp_build_endif(&if_state);