diff options
author | Nicolai Hähnle <[email protected]> | 2017-11-17 13:40:18 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-03 15:51:12 -0400 |
commit | e86256c51229c135bc4861018c16b9a8f1c255a6 (patch) | |
tree | b32bd5018a10842bb2df4e69c93a05d8dc7acdf0 /src/gallium | |
parent | 4063ea95e9fbb644033e9ba074b32b49a035a58a (diff) |
radeonsi/gfx10: distinguish between merged shaders and multi-part shaders
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index fdb4346f7fd..b6410c62448 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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); |