freedreno: fix off-by-one in assertions checking for const sizes

Caused assertions to trip even though everything was fine. The number of
constants can be equal to length, so we need less-than-or-equal.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5077>
This commit is contained in:
Ilia Mirkin
2020-05-17 01:42:06 -04:00
parent 1c05e16666
commit 475fb28377
4 changed files with 5 additions and 5 deletions
@@ -145,7 +145,7 @@ emit_const_bo(struct fd_ringbuffer *ring,
uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
{
/* TODO inline this */
assert(dst_offset + num < v->constlen * 4);
assert(dst_offset + num <= v->constlen * 4);
fd3_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
}
@@ -140,7 +140,7 @@ emit_const_bo(struct fd_ringbuffer *ring,
uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
{
/* TODO inline this */
assert(dst_offset + num < v->constlen * 4);
assert(dst_offset + num <= v->constlen * 4);
fd4_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
}
@@ -148,7 +148,7 @@ emit_const_bo(struct fd_ringbuffer *ring,
uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
{
/* TODO inline this */
assert(dst_offset + num < v->constlen * 4);
assert(dst_offset + num <= v->constlen * 4);
fd5_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
}
@@ -155,7 +155,7 @@ ir3_emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
}
}
assert(offset * 4 + params < v->constlen * 4);
assert(offset * 4 + params <= v->constlen * 4);
emit_const_bo(ring, v, offset * 4, params, prscs, offsets);
}
@@ -309,7 +309,7 @@ emit_tfbos(struct fd_context *ctx, const struct ir3_shader_variant *v,
}
}
assert(offset * 4 + params < v->constlen * 4);
assert(offset * 4 + params <= v->constlen * 4);
emit_const_bo(ring, v, offset * 4, params, prscs, offsets);
}