agx: Make push_count public

The driver needs to plumb this information into the hardware. It will
also make it easier to preserve across preamble/main function in a
moment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18813>
This commit is contained in:
Alyssa Rosenzweig
2022-09-25 19:58:06 -04:00
parent 2d63864e03
commit af74e746cd
3 changed files with 9 additions and 11 deletions

View File

@@ -153,6 +153,7 @@ union agx_varyings {
};
struct agx_shader_info {
unsigned push_count;
unsigned push_ranges;
struct agx_push push[AGX_MAX_PUSH_RANGES];
union agx_varyings varyings;

View File

@@ -374,9 +374,6 @@ typedef struct {
struct agx_shader_info *out;
struct agx_shader_key *key;
/* Place to start pushing new values */
unsigned push_base;
/* Maximum block index */
unsigned num_blocks;

View File

@@ -48,11 +48,11 @@ agx_indexed_sysval(agx_context *ctx, enum agx_push_type type,
/* Otherwise, push */
assert(ctx->out->push_ranges < AGX_MAX_PUSH_RANGES);
ctx->push_base = ALIGN_POT(ctx->push_base, agx_size_align_16(size));
ctx->out->push_count = ALIGN_POT(ctx->out->push_count, agx_size_align_16(size));
unsigned base = ctx->push_base;
ctx->push_base += length;
assert(ctx->push_base <= AGX_NUM_UNIFORMS);
unsigned base = ctx->out->push_count;
ctx->out->push_count += length;
assert(ctx->out->push_count <= AGX_NUM_UNIFORMS);
ctx->out->push[ctx->out->push_ranges++] = (struct agx_push) {
.type = type,
@@ -79,11 +79,11 @@ agx_vbo_base(agx_context *ctx, unsigned vbo)
/* Otherwise, push */
assert(ctx->out->push_ranges < AGX_MAX_PUSH_RANGES);
ctx->push_base = ALIGN_POT(ctx->push_base, 4);
ctx->out->push_count = ALIGN_POT(ctx->out->push_count, 4);
unsigned base = ctx->push_base;
ctx->push_base += 4;
assert(ctx->push_base <= AGX_NUM_UNIFORMS);
unsigned base = ctx->out->push_count;
ctx->out->push_count += 4;
assert(ctx->out->push_count <= AGX_NUM_UNIFORMS);
ctx->out->push[ctx->out->push_ranges++] = (struct agx_push) {
.type = AGX_PUSH_VBO_BASE,