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> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574>
This commit is contained in:
parent
8a32614a18
commit
838d886d90
3 changed files with 13 additions and 8 deletions
|
|
@ -210,6 +210,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_def *(*outputs)[4])
|
||||
{
|
||||
|
|
@ -342,10 +343,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
|
||||
|
|
@ -714,7 +718,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,
|
||||
|
|
@ -821,7 +825,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,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,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_def *(*outputs)[4]);
|
||||
|
||||
|
|
|
|||
|
|
@ -2506,7 +2506,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) {
|
||||
|
|
@ -3036,7 +3036,7 @@ ngg_gs_export_vertices(nir_builder *b, nir_def *max_num_out_vtx, nir_def *tid_in
|
|||
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);
|
||||
|
|
@ -4334,7 +4334,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
Add a link
Reference in a new issue