aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-06-01 11:32:04 -0700
committerEric Anholt <[email protected]>2020-06-05 13:36:29 -0700
commit07ec745014a9fd07a1948aa0f653b1a57b9b5e12 (patch)
treeb524015103aca5388de71a54d5bcf0d4ec11869a /src/freedreno/ir3
parentab29f2da42f0c5da21edc4dad82e841f243ec680 (diff)
freedreno/ir3: Stop pushing immediates once we've filled the constbuf.
If we filled the constbuf up with UBOs, we may need to avoid generating more immediate push constants. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5273>
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r--src/freedreno/ir3/ir3_cp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c
index ca80b7a8bc2..052c8a539ac 100644
--- a/src/freedreno/ir3/ir3_cp.c
+++ b/src/freedreno/ir3/ir3_cp.c
@@ -383,7 +383,14 @@ lower_immed(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr, unsigned n,
}
if (i == const_state->immediate_idx) {
- /* need to generate a new immediate: */
+ struct ir3_compiler *compiler = instr->block->shader->compiler;
+ /* Add on a new immediate to be pushed, if we have space left in the
+ * constbuf.
+ */
+ if (const_state->offsets.immediate + const_state->immediate_idx / 4 >=
+ compiler->max_const)
+ return false;
+
swiz = i % 4;
idx = i / 4;