mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-19 19:50:24 +01:00
ac/nir: Add done arg to ac_nir_export_position.
This prepares for a workaround where we won't need to add
the done flag to the last export in this function, because
it will be added in a subsequent call to the same function.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
(cherry picked from commit 838d886d90)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25157>
This commit is contained in:
parent
9a012e05dc
commit
156a26826e
4 changed files with 14 additions and 9 deletions
|
|
@ -414,7 +414,7 @@
|
|||
"description": "ac/nir: Add done arg to ac_nir_export_position.",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ ac_nir_export_position(nir_builder *b,
|
|||
uint32_t clip_cull_mask,
|
||||
bool no_param_export,
|
||||
bool force_vrs,
|
||||
bool done,
|
||||
uint64_t outputs_written,
|
||||
nir_ssa_def *(*outputs)[4])
|
||||
{
|
||||
|
|
@ -252,10 +253,13 @@ ac_nir_export_position(nir_builder *b,
|
|||
}
|
||||
}
|
||||
|
||||
/* Specify that this is the last export */
|
||||
nir_intrinsic_instr *final_exp = exp[exp_num - 1];
|
||||
unsigned final_exp_flags = nir_intrinsic_flags(final_exp);
|
||||
nir_intrinsic_set_flags(final_exp, final_exp_flags | AC_EXP_FLAG_DONE);
|
||||
|
||||
if (done) {
|
||||
/* Specify that this is the last export */
|
||||
const unsigned final_exp_flags = nir_intrinsic_flags(final_exp);
|
||||
nir_intrinsic_set_flags(final_exp, final_exp_flags | AC_EXP_FLAG_DONE);
|
||||
}
|
||||
|
||||
/* If a shader has no param exports, rasterization can start before
|
||||
* the shader finishes and thus memory stores might not finish before
|
||||
|
|
@ -624,7 +628,7 @@ ac_nir_create_gs_copy_shader(const nir_shader *gs_nir,
|
|||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
|
||||
ac_nir_export_position(&b, gfx_level, clip_cull_mask, !has_param_exports,
|
||||
force_vrs, export_outputs, outputs.data);
|
||||
force_vrs, true, export_outputs, outputs.data);
|
||||
|
||||
if (has_param_exports) {
|
||||
ac_nir_export_parameters(&b, param_offsets,
|
||||
|
|
@ -731,7 +735,7 @@ ac_nir_lower_legacy_vs(nir_shader *nir,
|
|||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
|
||||
ac_nir_export_position(&b, gfx_level, clip_cull_mask, !has_param_exports,
|
||||
force_vrs, export_outputs, outputs.data);
|
||||
force_vrs, true, export_outputs, outputs.data);
|
||||
|
||||
if (has_param_exports) {
|
||||
ac_nir_export_parameters(&b, param_offsets,
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ ac_nir_export_position(nir_builder *b,
|
|||
uint32_t clip_cull_mask,
|
||||
bool no_param_export,
|
||||
bool force_vrs,
|
||||
bool done,
|
||||
uint64_t outputs_written,
|
||||
nir_ssa_def *(*outputs)[4]);
|
||||
|
||||
|
|
|
|||
|
|
@ -2505,7 +2505,7 @@ ac_nir_lower_ngg_nogs(nir_shader *shader, const ac_nir_lower_ngg_options *option
|
|||
ac_nir_export_position(b, options->gfx_level,
|
||||
options->clipdist_enable_mask,
|
||||
!options->has_param_exports,
|
||||
options->force_vrs,
|
||||
options->force_vrs, true,
|
||||
export_outputs, state.outputs);
|
||||
|
||||
if (options->has_param_exports) {
|
||||
|
|
@ -3035,7 +3035,7 @@ ngg_gs_export_vertices(nir_builder *b, nir_ssa_def *max_num_out_vtx, nir_ssa_def
|
|||
ac_nir_export_position(b, s->options->gfx_level,
|
||||
s->options->clipdist_enable_mask,
|
||||
!s->options->has_param_exports,
|
||||
s->options->force_vrs,
|
||||
s->options->force_vrs, true,
|
||||
export_outputs, s->outputs);
|
||||
|
||||
nir_pop_if(b, if_vtx_export_thread);
|
||||
|
|
@ -4332,7 +4332,7 @@ emit_ms_finale(nir_builder *b, lower_ngg_ms_state *s)
|
|||
ms_emit_arrayed_outputs(b, invocation_index, per_vertex_outputs, s);
|
||||
|
||||
ac_nir_export_position(b, s->gfx_level, s->clipdist_enable_mask,
|
||||
!s->has_param_exports, false,
|
||||
!s->has_param_exports, false, true,
|
||||
s->per_vertex_outputs, s->outputs);
|
||||
|
||||
/* Export generic attributes on GFX10.3
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue