mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
ac/nir: remove kill_pointsize and kill_layer options from lowering passes
The outputs are removed by a separate pass. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
This commit is contained in:
parent
42ad7543b8
commit
028591aead
7 changed files with 6 additions and 40 deletions
|
|
@ -194,8 +194,6 @@ typedef struct {
|
|||
bool use_gfx12_xfb_intrinsic;
|
||||
bool has_gs_invocations_query;
|
||||
bool has_gs_primitives_query;
|
||||
bool kill_pointsize;
|
||||
bool kill_layer;
|
||||
bool force_vrs;
|
||||
bool compact_primitives;
|
||||
/* Skip culling dependent on the viewport state, which is frustum culling and small prim
|
||||
|
|
@ -263,8 +261,6 @@ ac_nir_lower_legacy_vs(nir_shader *nir,
|
|||
bool has_param_exports,
|
||||
bool export_primitive_id,
|
||||
bool disable_streamout,
|
||||
bool kill_pointsize,
|
||||
bool kill_layer,
|
||||
bool force_vrs);
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -278,8 +274,6 @@ typedef struct {
|
|||
const uint8_t *param_offsets;
|
||||
bool has_param_exports;
|
||||
bool disable_streamout;
|
||||
bool kill_pointsize;
|
||||
bool kill_layer;
|
||||
bool force_vrs;
|
||||
} ac_nir_lower_legacy_gs_options;
|
||||
|
||||
|
|
|
|||
|
|
@ -96,15 +96,10 @@ ac_nir_create_gs_copy_shader(const nir_shader *gs_nir, ac_nir_lower_legacy_gs_op
|
|||
ac_nir_clamp_vertex_color_outputs(&b, out);
|
||||
|
||||
if (stream == 0) {
|
||||
uint64_t export_outputs = b.shader->info.outputs_written | VARYING_BIT_POS;
|
||||
if (options->kill_pointsize)
|
||||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
if (options->kill_layer)
|
||||
export_outputs &= ~VARYING_BIT_LAYER;
|
||||
|
||||
ac_nir_export_position(&b, options->gfx_level, options->export_clipdist_mask, false,
|
||||
options->write_pos_to_clipvertex, options->pack_clip_cull_distances,
|
||||
!options->has_param_exports, options->force_vrs, export_outputs,
|
||||
!options->has_param_exports, options->force_vrs,
|
||||
b.shader->info.outputs_written | VARYING_BIT_POS,
|
||||
out, NULL);
|
||||
|
||||
if (options->has_param_exports) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ ac_nir_lower_legacy_vs(nir_shader *nir,
|
|||
bool has_param_exports,
|
||||
bool export_primitive_id,
|
||||
bool disable_streamout,
|
||||
bool kill_pointsize,
|
||||
bool kill_layer,
|
||||
bool force_vrs)
|
||||
{
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
|
|
@ -72,14 +70,9 @@ ac_nir_lower_legacy_vs(nir_shader *nir,
|
|||
/* This should be after streamout and before exports. */
|
||||
ac_nir_clamp_vertex_color_outputs(&b, &out);
|
||||
|
||||
uint64_t export_outputs = nir->info.outputs_written | VARYING_BIT_POS;
|
||||
if (kill_pointsize)
|
||||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
if (kill_layer)
|
||||
export_outputs &= ~VARYING_BIT_LAYER;
|
||||
|
||||
ac_nir_export_position(&b, gfx_level, export_clipdist_mask, false, write_pos_to_clipvertex,
|
||||
pack_clip_cull_distances, !has_param_exports, force_vrs, export_outputs,
|
||||
pack_clip_cull_distances, !has_param_exports, force_vrs,
|
||||
nir->info.outputs_written | VARYING_BIT_POS,
|
||||
&out, NULL);
|
||||
|
||||
if (has_param_exports) {
|
||||
|
|
|
|||
|
|
@ -1721,10 +1721,6 @@ ac_nir_lower_ngg_nogs(nir_shader *shader, const ac_nir_lower_ngg_options *option
|
|||
|
||||
uint64_t export_outputs = shader->info.outputs_written | VARYING_BIT_POS;
|
||||
export_outputs &= ~VARYING_BIT_EDGE; /* edge flags are never exported via pos with NGG */
|
||||
if (options->kill_pointsize)
|
||||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
if (options->kill_layer)
|
||||
export_outputs &= ~VARYING_BIT_LAYER;
|
||||
|
||||
/* If streamout is enabled, export positions after streamout. This increases streamout performance
|
||||
* for up to 4 vec4 xfb outputs on GFX12 because the streamout code doesn't have go through
|
||||
|
|
|
|||
|
|
@ -445,12 +445,6 @@ ngg_gs_emit_output(nir_builder *b, nir_def *max_num_out_vtx, nir_def *max_num_ou
|
|||
|
||||
nir_if *if_export_vertex = nir_push_if(b, if_process_vertex->condition.ssa);
|
||||
{
|
||||
uint64_t export_outputs = b->shader->info.outputs_written | VARYING_BIT_POS;
|
||||
if (s->options->kill_pointsize)
|
||||
export_outputs &= ~VARYING_BIT_PSIZ;
|
||||
if (s->options->kill_layer)
|
||||
export_outputs &= ~VARYING_BIT_LAYER;
|
||||
|
||||
ac_nir_export_position(b, s->options->hw_info->gfx_level,
|
||||
s->options->export_clipdist_mask,
|
||||
s->options->dont_export_cull_distances,
|
||||
|
|
@ -458,7 +452,7 @@ ngg_gs_emit_output(nir_builder *b, nir_def *max_num_out_vtx, nir_def *max_num_ou
|
|||
s->options->pack_clip_cull_distances,
|
||||
!s->options->has_param_exports,
|
||||
s->options->force_vrs,
|
||||
export_outputs, &s->out, NULL);
|
||||
b->shader->info.outputs_written | VARYING_BIT_POS, &s->out, NULL);
|
||||
|
||||
if (s->options->has_param_exports && !s->options->hw_info->has_attr_ring)
|
||||
ac_nir_export_parameters(b, s->options->vs_output_param_offset,
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_graphics_stat
|
|||
NIR_PASS(_, stage->nir, ac_nir_lower_legacy_vs, gfx_level,
|
||||
stage->info.outinfo.clip_dist_mask | stage->info.outinfo.cull_dist_mask, false, false,
|
||||
stage->info.outinfo.vs_output_param_offset, stage->info.outinfo.param_exports,
|
||||
stage->info.outinfo.export_prim_id, false, false, false, stage->info.force_vrs_per_vertex);
|
||||
stage->info.outinfo.export_prim_id, false, stage->info.force_vrs_per_vertex);
|
||||
|
||||
} else {
|
||||
ac_nir_lower_legacy_gs_options options = {
|
||||
|
|
|
|||
|
|
@ -1125,8 +1125,6 @@ static void si_lower_ngg(struct si_shader *shader, nir_shader *nir,
|
|||
.vs_output_param_offset = temp_info->vs_output_param_offset,
|
||||
.has_param_exports = shader->info.nr_param_exports,
|
||||
.export_clipdist_mask = clip_cull_dist_mask,
|
||||
.kill_pointsize = key->ge.opt.kill_pointsize,
|
||||
.kill_layer = key->ge.opt.kill_layer,
|
||||
.force_vrs = sel->screen->options.vrs2x2,
|
||||
.use_gfx12_xfb_intrinsic = !nir->info.use_aco_amd,
|
||||
.skip_viewport_state_culling = sel->info.writes_viewport_index,
|
||||
|
|
@ -1567,8 +1565,6 @@ static void run_late_optimization_and_lowering_passes(struct si_nir_shader_ctx *
|
|||
shader->info.nr_param_exports,
|
||||
shader->key.ge.mono.u.vs_export_prim_id,
|
||||
!shader->info.num_streamout_vec4s,
|
||||
key->ge.opt.kill_pointsize,
|
||||
key->ge.opt.kill_layer,
|
||||
sel->screen->options.vrs2x2);
|
||||
}
|
||||
progress = true;
|
||||
|
|
@ -1602,8 +1598,6 @@ static void run_late_optimization_and_lowering_passes(struct si_nir_shader_ctx *
|
|||
.param_offsets = ctx->temp_info.vs_output_param_offset,
|
||||
.has_param_exports = shader->info.nr_param_exports,
|
||||
.disable_streamout = !shader->info.num_streamout_vec4s,
|
||||
.kill_pointsize = key->ge.opt.kill_pointsize,
|
||||
.kill_layer = key->ge.opt.kill_layer,
|
||||
.force_vrs = sel->screen->options.vrs2x2,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue