From af74e746cd328138c83896ed9eb24b919f7164f4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 25 Sep 2022 19:58:06 -0400 Subject: [PATCH] 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 Part-of: --- src/asahi/compiler/agx_compile.h | 1 + src/asahi/compiler/agx_compiler.h | 3 --- src/asahi/compiler/agx_uniforms.c | 16 ++++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index 6dc8b99fe69..aa89699dc3a 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -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; diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 932c39c1c2c..f676002d8a5 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -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; diff --git a/src/asahi/compiler/agx_uniforms.c b/src/asahi/compiler/agx_uniforms.c index 7a29f250ebd..bd8f0a1edd6 100644 --- a/src/asahi/compiler/agx_uniforms.c +++ b/src/asahi/compiler/agx_uniforms.c @@ -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,