mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 23:00:11 +01:00
radeonsi: enable WQM in PS prolog when needed
WQM is needed when the PS prolog computes a VGPR that is consumed by a shader
with (implicit or explicit) derivatives.
Depends on http://reviews.llvm.org/D20839 / LLVM r272063 for this to be
effective (otherwise it's just a no-op).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95130
Cc: 12.0 <mesa-dev@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit b42bc90b6a)
This commit is contained in:
parent
0386f956b3
commit
bb4195ca26
2 changed files with 10 additions and 0 deletions
|
|
@ -7238,6 +7238,12 @@ static bool si_compile_ps_prolog(struct si_screen *sscreen,
|
|||
linear_sample[i], base + 10 + i, "");
|
||||
}
|
||||
|
||||
/* Tell LLVM to insert WQM instruction sequence when needed. */
|
||||
if (key->ps_prolog.wqm) {
|
||||
LLVMAddTargetDependentFunctionAttr(func,
|
||||
"amdgpu-ps-wqm-outputs", "");
|
||||
}
|
||||
|
||||
/* Compile. */
|
||||
LLVMBuildRet(gallivm->builder, ret);
|
||||
radeon_llvm_finalize_module(&ctx.radeon_bld);
|
||||
|
|
@ -7388,6 +7394,9 @@ static bool si_shader_select_ps_parts(struct si_screen *sscreen,
|
|||
prolog_key.ps_prolog.colors_read = info->colors_read;
|
||||
prolog_key.ps_prolog.num_input_sgprs = shader->info.num_input_sgprs;
|
||||
prolog_key.ps_prolog.num_input_vgprs = shader->info.num_input_vgprs;
|
||||
prolog_key.ps_prolog.wqm = info->uses_derivatives &&
|
||||
(prolog_key.ps_prolog.colors_read ||
|
||||
prolog_key.ps_prolog.states.force_persample_interp);
|
||||
|
||||
if (info->colors_read) {
|
||||
unsigned *color = shader->selector->color_attr_index;
|
||||
|
|
|
|||
|
|
@ -355,6 +355,7 @@ union si_shader_part_key {
|
|||
unsigned colors_read:8; /* color input components read */
|
||||
unsigned num_interp_inputs:5; /* BCOLOR is at this location */
|
||||
unsigned face_vgpr_index:5;
|
||||
unsigned wqm:1;
|
||||
char color_attr_index[2];
|
||||
char color_interp_vgpr_index[2]; /* -1 == constant */
|
||||
} ps_prolog;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue