mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
ac/nir/cull: rename skip_viewport_culling -> skip_viewport_state_culling
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34016>
This commit is contained in:
parent
bc27ad8064
commit
0f97dc707d
6 changed files with 12 additions and 12 deletions
|
|
@ -163,7 +163,7 @@ typedef struct {
|
|||
/* Skip culling dependent on the viewport state, which is frustum culling and small prim
|
||||
* culling. Set this when the shader writes the viewport index.
|
||||
*/
|
||||
bool skip_viewport_culling;
|
||||
bool skip_viewport_state_culling;
|
||||
/* Use the point-triangle intersection to cull small triangles. */
|
||||
bool use_point_tri_intersection;
|
||||
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ call_accept_func(nir_builder *b, nir_def *accepted, ac_nir_cull_accepted accept_
|
|||
|
||||
static nir_def *
|
||||
ac_nir_cull_triangle(nir_builder *b,
|
||||
bool skip_viewport_culling,
|
||||
bool skip_viewport_state_culling,
|
||||
bool use_point_tri_intersection,
|
||||
nir_def *initially_accepted,
|
||||
nir_def *pos[3][4],
|
||||
|
|
@ -308,7 +308,7 @@ ac_nir_cull_triangle(nir_builder *b,
|
|||
accepted = nir_iand(b, accepted, nir_inot(b, w_info->all_w_negative_or_zero_or_nan));
|
||||
accepted = nir_iand(b, accepted, nir_inot(b, cull_face_triangle(b, pos, w_info)));
|
||||
|
||||
if (skip_viewport_culling) {
|
||||
if (skip_viewport_state_culling) {
|
||||
call_accept_func(b, accepted, accept_func, state);
|
||||
return accepted;
|
||||
}
|
||||
|
|
@ -475,7 +475,7 @@ cull_small_primitive_line(nir_builder *b, nir_def *pos[3][4],
|
|||
|
||||
static nir_def *
|
||||
ac_nir_cull_line(nir_builder *b,
|
||||
bool skip_viewport_culling,
|
||||
bool skip_viewport_state_culling,
|
||||
nir_def *initially_accepted,
|
||||
nir_def *pos[3][4],
|
||||
position_w_info *w_info,
|
||||
|
|
@ -485,7 +485,7 @@ ac_nir_cull_line(nir_builder *b,
|
|||
nir_def *accepted = initially_accepted;
|
||||
accepted = nir_iand(b, accepted, nir_inot(b, w_info->all_w_negative_or_zero_or_nan));
|
||||
|
||||
if (skip_viewport_culling) {
|
||||
if (skip_viewport_state_culling) {
|
||||
call_accept_func(b, accepted, accept_func, state);
|
||||
return accepted;
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ ac_nir_cull_line(nir_builder *b,
|
|||
|
||||
nir_def *
|
||||
ac_nir_cull_primitive(nir_builder *b,
|
||||
bool skip_viewport_culling,
|
||||
bool skip_viewport_state_culling,
|
||||
bool use_point_tri_intersection,
|
||||
nir_def *initially_accepted,
|
||||
nir_def *pos[3][4],
|
||||
|
|
@ -524,10 +524,10 @@ ac_nir_cull_primitive(nir_builder *b,
|
|||
analyze_position_w(b, pos, num_vertices, &w_info);
|
||||
|
||||
if (num_vertices == 3) {
|
||||
return ac_nir_cull_triangle(b, skip_viewport_culling, use_point_tri_intersection,
|
||||
return ac_nir_cull_triangle(b, skip_viewport_state_culling, use_point_tri_intersection,
|
||||
initially_accepted, pos, &w_info, accept_func, state);
|
||||
} else if (num_vertices == 2) {
|
||||
return ac_nir_cull_line(b, skip_viewport_culling, initially_accepted, pos, &w_info,
|
||||
return ac_nir_cull_line(b, skip_viewport_state_culling, initially_accepted, pos, &w_info,
|
||||
accept_func, state);
|
||||
} else {
|
||||
unreachable("point culling not implemented");
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ ac_nir_map_io_location(unsigned location,
|
|||
|
||||
nir_def *
|
||||
ac_nir_cull_primitive(nir_builder *b,
|
||||
bool skip_viewport_culling,
|
||||
bool skip_viewport_state_culling,
|
||||
bool use_point_tri_intersection,
|
||||
nir_def *initially_accepted,
|
||||
nir_def *pos[3][4],
|
||||
|
|
|
|||
|
|
@ -1193,7 +1193,7 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
|
|||
}
|
||||
|
||||
/* See if the current primitive is accepted */
|
||||
ac_nir_cull_primitive(b, s->options->skip_viewport_culling, s->options->use_point_tri_intersection,
|
||||
ac_nir_cull_primitive(b, s->options->skip_viewport_state_culling, s->options->use_point_tri_intersection,
|
||||
accepted_by_clipdist, pos, s->options->num_vertices_per_primitive,
|
||||
cull_primitive_accepted, s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ ngg_gs_cull_primitive(nir_builder *b, nir_def *tid_in_tg, nir_def *max_vtxcnt,
|
|||
/* TODO: support clipdist culling in GS */
|
||||
nir_def *accepted_by_clipdist = nir_imm_true(b);
|
||||
|
||||
nir_def *accepted = ac_nir_cull_primitive(b, s->options->skip_viewport_culling,
|
||||
nir_def *accepted = ac_nir_cull_primitive(b, s->options->skip_viewport_state_culling,
|
||||
s->options->use_point_tri_intersection,
|
||||
accepted_by_clipdist, pos,
|
||||
s->num_vertices_per_primitive, NULL, NULL);
|
||||
|
|
|
|||
|
|
@ -1806,7 +1806,7 @@ static void si_lower_ngg(struct si_shader *shader, nir_shader *nir)
|
|||
.kill_layer = key->ge.opt.kill_layer,
|
||||
.force_vrs = sel->screen->options.vrs2x2,
|
||||
.use_gfx12_xfb_intrinsic = !nir->info.use_aco_amd,
|
||||
.skip_viewport_culling = sel->info.writes_viewport_index,
|
||||
.skip_viewport_state_culling = sel->info.writes_viewport_index,
|
||||
.use_point_tri_intersection = sel->screen->info.num_cu / sel->screen->info.num_se >= 12,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue