asahi: Dirty track VBOs + blend const separately

We're staging everything anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
Alyssa Rosenzweig 2023-08-11 17:07:59 -04:00 committed by Marge Bot
parent 24238cc507
commit 581514d925
3 changed files with 18 additions and 7 deletions

View file

@ -2622,6 +2622,15 @@ agx_encode_state(struct agx_batch *batch, uint8_t *out, bool is_lines,
agx_update_descriptors(batch, ctx->vs, PIPE_SHADER_VERTEX);
agx_update_descriptors(batch, ctx->fs, PIPE_SHADER_FRAGMENT);
if (IS_DIRTY(VERTEX)) {
agx_upload_vbos(batch);
}
if (IS_DIRTY(BLEND_COLOR)) {
memcpy(batch->uniforms.blend_constant, &ctx->blend_color,
sizeof(ctx->blend_color));
}
if (IS_DIRTY(VS) || IS_DIRTY(FS) || IS_DIRTY(VERTEX) ||
IS_DIRTY(BLEND_COLOR)) {

View file

@ -707,6 +707,7 @@ agx_transfer(struct pipe_transfer *p)
return (struct agx_transfer *)p;
}
void agx_upload_vbos(struct agx_batch *batch);
void agx_upload_uniforms(struct agx_batch *batch);
uint64_t agx_upload_stage_uniforms(struct agx_batch *batch, uint64_t textures,

View file

@ -50,6 +50,14 @@ agx_vertex_buffer_ptr(struct agx_batch *batch, unsigned vbo)
}
}
void
agx_upload_vbos(struct agx_batch *batch)
{
u_foreach_bit(vbo, batch->ctx->vb_mask) {
batch->uniforms.vbo_base[vbo] = agx_vertex_buffer_ptr(batch, vbo);
}
}
void
agx_upload_uniforms(struct agx_batch *batch)
{
@ -61,10 +69,6 @@ agx_upload_uniforms(struct agx_batch *batch)
batch->uniforms.tables[AGX_SYSVAL_TABLE_ROOT] = root_ptr.gpu;
batch->uniforms.sample_mask = ctx->sample_mask;
u_foreach_bit(vbo, ctx->vb_mask) {
batch->uniforms.vbo_base[vbo] = agx_vertex_buffer_ptr(batch, vbo);
}
if (ctx->streamout.key.active) {
batch->uniforms.xfb = ctx->streamout.params;
@ -76,9 +80,6 @@ agx_upload_uniforms(struct agx_batch *batch)
}
}
memcpy(batch->uniforms.blend_constant, &ctx->blend_color,
sizeof(ctx->blend_color));
memcpy(root_ptr.cpu, &batch->uniforms, sizeof(batch->uniforms));
}