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:

committed by
Marge Bot

parent
0708f92b37
commit
16caad4038
@@ -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;
|
||||
|
Reference in New Issue
Block a user