Skip to content

lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass

A few lines earlier uni_offsets is accessed with ubo scaled by PIPE_MAX_CONSTANT_BUFFERS:

   if (uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + i] == offset)

Found by inspection.

Looking at the before and after NIR code for dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays, using the correct indexing appears to enable the pass to inline an additional uniform. My guess is that when a uniform is used more than once, the first loop wouldn't find the offset recorded in the table because it was recorded at the wrong location.

Fixes: d23a9380 ("lavapipe: implement extreme uniform inlining")

Merge request reports

Loading