The scaling needs to be ubo * MAX_INLINABLE_UNIFORMS, not
ubo * PIPE_MAX_CONSTANT_BUFFERS, otherwise accesses beyond buffer size
will result for ubo >= 4 (and we'd also access the wrong values later
for other non-zero ubo indices).
Fixes:
a7696a4d98bc ("lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21506>
/* Already recorded by other one */
for (int i = 0; i < num_offsets[ubo]; i++) {
- if (uni_offsets[ubo * MAX_NUM_BO + i] == offset)
+ if (uni_offsets[ubo * MAX_INLINABLE_UNIFORMS + i] == offset)
return true;
}
return false;
/* Record the uniform offset. */
- uni_offsets[ubo * MAX_NUM_BO + num_offsets[ubo]++] = offset;
+ uni_offsets[ubo * MAX_INLINABLE_UNIFORMS + num_offsets[ubo]++] = offset;
return true;
}
return false;