nir,ac,radv: add primitive count add intrinsics

radeonsi use shader buffer, but radv use gds for the query
result storage.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
This commit is contained in:
Qiang Yu
2022-06-16 15:54:54 +08:00
committed by Marge Bot
parent e18f76d890
commit a119a6464f
5 changed files with 72 additions and 18 deletions

View File

@@ -34,6 +34,12 @@
#define AC_LLVM_MAX_OUTPUTS (VARYING_SLOT_VAR31 + 1)
enum ac_prim_count {
ac_prim_count_gs_emit,
ac_prim_count_gen,
ac_prim_count_xfb,
};
/* Document the shader ABI during compilation. This is what allows radeonsi and
* radv to share a compiler backend.
*/
@@ -69,6 +75,9 @@ struct ac_shader_abi {
void (*emit_vertex_with_counter)(struct ac_shader_abi *abi, unsigned stream,
LLVMValueRef vertexidx, LLVMValueRef *addrs);
void (*atomic_add_prim_count)(struct ac_shader_abi *abi, unsigned stream,
LLVMValueRef prim_count, enum ac_prim_count count_type);
LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi,
unsigned driver_location, unsigned component,
unsigned num_components, unsigned vertex_index,