nir: Add ability to count emitted GS primitives.
Add an option to nir_lower_gs_intrinsics which tells it to track the number of emitted primitives, not just vertices. Additionally, also make it per-stream. Also rename the set_vertex_count intrinsic to set_vertex_and_primitive_count. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>
This commit is contained in:
@@ -3149,7 +3149,7 @@ fs_visitor::nir_emit_gs_intrinsic(const fs_builder &bld,
|
||||
emit_gs_end_primitive(instr->src[0]);
|
||||
break;
|
||||
|
||||
case nir_intrinsic_set_vertex_count:
|
||||
case nir_intrinsic_set_vertex_and_primitive_count:
|
||||
bld.MOV(this->final_gs_vertex_count, get_nir_src(instr->src[0]));
|
||||
break;
|
||||
|
||||
|
@@ -692,7 +692,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
|
||||
}
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_GEOMETRY)
|
||||
OPT(nir_lower_gs_intrinsics, false);
|
||||
OPT(nir_lower_gs_intrinsics, 0);
|
||||
|
||||
/* See also brw_nir_trig_workarounds.py */
|
||||
if (compiler->precise_trig &&
|
||||
|
@@ -78,7 +78,7 @@ vec4_gs_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
|
||||
gs_end_primitive();
|
||||
break;
|
||||
|
||||
case nir_intrinsic_set_vertex_count:
|
||||
case nir_intrinsic_set_vertex_and_primitive_count:
|
||||
this->vertex_count =
|
||||
retype(get_nir_src(instr->src[0], 1), BRW_REGISTER_TYPE_UD);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user