mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
radeonsi/gfx10: don't declare any LDS for NGG if it's not used
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
parent
65e5c1942a
commit
17164d4e27
2 changed files with 21 additions and 6 deletions
|
|
@ -6141,16 +6141,19 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
|
|||
* Add an extra dword per vertex to ensure an odd stride, which
|
||||
* avoids bank conflicts for SoA accesses.
|
||||
*/
|
||||
declare_esgs_ring(ctx);
|
||||
if (!gfx10_is_ngg_passthrough(shader))
|
||||
declare_esgs_ring(ctx);
|
||||
|
||||
/* This is really only needed when streamout and / or vertex
|
||||
* compaction is enabled.
|
||||
*/
|
||||
LLVMTypeRef asi32 = LLVMArrayType(ctx->i32, 8);
|
||||
ctx->gs_ngg_scratch = LLVMAddGlobalInAddressSpace(ctx->ac.module,
|
||||
asi32, "ngg_scratch", AC_ADDR_SPACE_LDS);
|
||||
LLVMSetInitializer(ctx->gs_ngg_scratch, LLVMGetUndef(asi32));
|
||||
LLVMSetAlignment(ctx->gs_ngg_scratch, 4);
|
||||
if (sel->so.num_outputs && !ctx->gs_ngg_scratch) {
|
||||
LLVMTypeRef asi32 = LLVMArrayType(ctx->i32, 8);
|
||||
ctx->gs_ngg_scratch = LLVMAddGlobalInAddressSpace(ctx->ac.module,
|
||||
asi32, "ngg_scratch", AC_ADDR_SPACE_LDS);
|
||||
LLVMSetInitializer(ctx->gs_ngg_scratch, LLVMGetUndef(asi32));
|
||||
LLVMSetAlignment(ctx->gs_ngg_scratch, 4);
|
||||
}
|
||||
}
|
||||
|
||||
/* For GFX9 merged shaders:
|
||||
|
|
|
|||
|
|
@ -785,6 +785,18 @@ si_get_main_shader_part(struct si_shader_selector *sel,
|
|||
return &sel->main_shader_part;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
gfx10_is_ngg_passthrough(struct si_shader *shader)
|
||||
{
|
||||
struct si_shader_selector *sel = shader->selector;
|
||||
|
||||
return sel->type != PIPE_SHADER_GEOMETRY &&
|
||||
!sel->so.num_outputs &&
|
||||
!sel->info.writes_edgeflag &&
|
||||
(sel->type != PIPE_SHADER_VERTEX ||
|
||||
!shader->key.mono.u.vs_export_prim_id);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
si_shader_uses_bindless_samplers(struct si_shader_selector *selector)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue