agx: Check that we don't push too much

Currently we don't have a good mechanism for this other than being
careful... assert() at least. The long term plan is to lift the
UBO/VBO lowerings into NIR, making the sysval requirements visible in
the NIR. (And possibly moving to a descriptor set model to better match
Vulkan? I need to talk to jekstrand about what we want to do here long
term.)

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:26:58 -04:00
parent c74d6c4f9e
commit 2d63864e03
+2
View File
@@ -52,6 +52,7 @@ agx_indexed_sysval(agx_context *ctx, enum agx_push_type type,
unsigned base = ctx->push_base;
ctx->push_base += length;
assert(ctx->push_base <= AGX_NUM_UNIFORMS);
ctx->out->push[ctx->out->push_ranges++] = (struct agx_push) {
.type = type,
@@ -82,6 +83,7 @@ agx_vbo_base(agx_context *ctx, unsigned vbo)
unsigned base = ctx->push_base;
ctx->push_base += 4;
assert(ctx->push_base <= AGX_NUM_UNIFORMS);
ctx->out->push[ctx->out->push_ranges++] = (struct agx_push) {
.type = AGX_PUSH_VBO_BASE,