mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
ac/nir: Move ac_nir_lower_ngg_mesh to separate file.
Along with it, move some functions to the prerast utils file. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32966>
This commit is contained in:
parent
c1eb006695
commit
736f61fa80
5 changed files with 1495 additions and 1471 deletions
|
|
@ -174,6 +174,11 @@ ac_nir_gs_shader_query(nir_builder *b,
|
|||
nir_def *vertex_count[4],
|
||||
nir_def *primitive_count[4]);
|
||||
|
||||
nir_def *
|
||||
ac_nir_pack_ngg_prim_exp_arg(nir_builder *b, unsigned num_vertices_per_primitives,
|
||||
nir_def *vertex_indices[3], nir_def *is_null_prim,
|
||||
enum amd_gfx_level gfx_level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
1463
src/amd/common/ac_nir_lower_ngg_mesh.c
Normal file
1463
src/amd/common/ac_nir_lower_ngg_mesh.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -801,3 +801,26 @@ ac_nir_gs_shader_query(nir_builder *b,
|
|||
nir_pop_if(b, if_shader_query);
|
||||
return true;
|
||||
}
|
||||
|
||||
nir_def *
|
||||
ac_nir_pack_ngg_prim_exp_arg(nir_builder *b, unsigned num_vertices_per_primitives,
|
||||
nir_def *vertex_indices[3], nir_def *is_null_prim,
|
||||
enum amd_gfx_level gfx_level)
|
||||
{
|
||||
nir_def *arg = nir_load_initial_edgeflags_amd(b);
|
||||
|
||||
for (unsigned i = 0; i < num_vertices_per_primitives; ++i) {
|
||||
assert(vertex_indices[i]);
|
||||
arg = nir_ior(b, arg, nir_ishl_imm(b, vertex_indices[i],
|
||||
(gfx_level >= GFX12 ? 9u : 10u) * i));
|
||||
}
|
||||
|
||||
if (is_null_prim) {
|
||||
if (is_null_prim->bit_size == 1)
|
||||
is_null_prim = nir_b2i32(b, is_null_prim);
|
||||
assert(is_null_prim->bit_size == 32);
|
||||
arg = nir_ior(b, arg, nir_ishl_imm(b, is_null_prim, 31u));
|
||||
}
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ amd_common_files = files(
|
|||
'ac_nir_lower_tess_io_to_mem.c',
|
||||
'ac_nir_lower_tex.c',
|
||||
'ac_nir_lower_ngg.c',
|
||||
'ac_nir_lower_ngg_mesh.c',
|
||||
'ac_nir_lower_ps_early.c',
|
||||
'ac_nir_lower_ps_late.c',
|
||||
'ac_nir_lower_sin_cos.c',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue