From 893425a607a63a83e8a4c13fd963367c8d174678 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Tue, 26 Mar 2019 10:31:54 -0700 Subject: freedreno/ir3: Push UBOs to constant file We have a rather big constant file and it seems that the best way to use it is to upload all UBOs and lower UBO access the load_uniform. Signed-off-by: Kristian H. Kristensen Reviewed-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gallium/drivers/freedreno/ir3') diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index 4481c544217..2d9516ade5c 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -254,6 +254,22 @@ emit_user_consts(struct fd_context *ctx, const struct ir3_shader_variant *v, cb->user_buffer, cb->buffer); } } + + struct ir3_ubo_analysis_state *state; + state = &v->shader->ubo_state; + + for (uint32_t i = 1; i < ARRAY_SIZE(state->range); i++) { + struct pipe_constant_buffer *cb = &constbuf->cb[i]; + + if (state->range[i].start < state->range[i].end && + constbuf->enabled_mask & (1 << i)) { + + ctx->emit_const(ring, v->type, state->range[i].offset / 4, + cb->buffer_offset + state->range[i].start, + (state->range[i].end - state->range[i].start) / 4, + cb->user_buffer, cb->buffer); + } + } } static void -- cgit v1.2.3