mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
libagx: add statistic increment kernel
for TCS Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30382>
This commit is contained in:
parent
0708f92b37
commit
16caad4038
4 changed files with 22 additions and 0 deletions
|
|
@ -1588,6 +1588,12 @@ agx_nir_tess_setup_indirect(nir_builder *b, const void *data)
|
|||
libagx_tess_setup_indirect(b, params, with_counts, point_mode);
|
||||
}
|
||||
|
||||
void
|
||||
agx_nir_increment_statistic(nir_builder *b, const void *data)
|
||||
{
|
||||
libagx_increment_statistic(b, nir_load_preamble(b, 1, 64, .base = 0));
|
||||
}
|
||||
|
||||
void
|
||||
agx_nir_increment_cs_invocations(nir_builder *b, const void *data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ unsigned agx_tcs_output_stride(const struct nir_shader *nir);
|
|||
|
||||
void agx_nir_tess_setup_indirect(struct nir_builder *b, const void *data);
|
||||
|
||||
void agx_nir_increment_statistic(struct nir_builder *b, const void *data);
|
||||
|
||||
void agx_nir_increment_cs_invocations(struct nir_builder *b, const void *data);
|
||||
|
||||
struct agx_increment_ia_counters_key {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@ libagx_copy_xfb_counters(constant struct libagx_xfb_counter_copy *push)
|
|||
*(push->dest[i]) = push->src[i] ? *(push->src[i]) : 0;
|
||||
}
|
||||
|
||||
void
|
||||
libagx_increment_statistic(constant struct libagx_increment_params *p)
|
||||
{
|
||||
*(p->statistic) += p->delta;
|
||||
}
|
||||
|
||||
void
|
||||
libagx_increment_cs_invocations(constant struct libagx_cs_invocation_params *p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@ struct libagx_xfb_counter_copy {
|
|||
GLOBAL(uint32_t) src[4];
|
||||
};
|
||||
|
||||
struct libagx_increment_params {
|
||||
/* Pointer to the invocation statistic */
|
||||
GLOBAL(uint32_t) statistic;
|
||||
|
||||
/* Value to increment by */
|
||||
uint32_t delta;
|
||||
};
|
||||
|
||||
struct libagx_cs_invocation_params {
|
||||
/* Pointer to the indirect dispatch grid */
|
||||
GLOBAL(uint32_t) grid;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue