mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 03:20:09 +01:00
radv: add lowering support for load_provoking_vtx_in_prim_amd when dynamic
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19168>
This commit is contained in:
parent
8d8aa05fd2
commit
d81cccbb77
1 changed files with 17 additions and 12 deletions
|
|
@ -334,20 +334,25 @@ lower_abi_instr(nir_builder *b, nir_instr *instr, void *state)
|
|||
}
|
||||
break;
|
||||
case nir_intrinsic_load_provoking_vtx_in_prim_amd: {
|
||||
unsigned provoking_vertex = 0;
|
||||
if (s->pl_key->vs.provoking_vtx_last) {
|
||||
if (stage == MESA_SHADER_VERTEX) {
|
||||
provoking_vertex = radv_get_num_vertices_per_prim(s->pl_key) - 1;
|
||||
} else if (stage == MESA_SHADER_GEOMETRY) {
|
||||
provoking_vertex = b->shader->info.gs.vertices_in - 1;
|
||||
} else {
|
||||
/* TES won't use this intrinsic, because it can get primitive id directly
|
||||
* instead of using this intrinsic to pass primitive id by LDS.
|
||||
*/
|
||||
unreachable("load_provoking_vtx_in_prim_amd is only supported in VS and GS");
|
||||
if (s->pl_key->dynamic_provoking_vtx_mode) {
|
||||
replacement = ac_nir_load_arg(b, &s->args->ac, s->args->ngg_provoking_vtx);
|
||||
} else {
|
||||
unsigned provoking_vertex = 0;
|
||||
if (s->pl_key->vs.provoking_vtx_last) {
|
||||
if (stage == MESA_SHADER_VERTEX) {
|
||||
provoking_vertex = radv_get_num_vertices_per_prim(s->pl_key) - 1;
|
||||
} else if (stage == MESA_SHADER_GEOMETRY) {
|
||||
provoking_vertex = b->shader->info.gs.vertices_in - 1;
|
||||
} else {
|
||||
/* TES won't use this intrinsic, because it can get primitive id directly
|
||||
* instead of using this intrinsic to pass primitive id by LDS.
|
||||
*/
|
||||
unreachable("load_provoking_vtx_in_prim_amd is only supported in VS and GS");
|
||||
}
|
||||
}
|
||||
|
||||
replacement = nir_imm_int(b, provoking_vertex);
|
||||
}
|
||||
replacement = nir_imm_int(b, provoking_vertex);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_atomic_add_gs_emit_prim_count_amd:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue