diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2023-02-06 09:41:36 -0800 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2023-02-08 20:34:46 +0000 |
commit | c52859394049e286293ef09df00cfccef5f569ee (patch) | |
tree | 08674d3566347710ad9444167c646070512b2b2e /src | |
parent | f615ca7458c292dc6c67beba84fc080fcdee063c (diff) | |
download | mesa-c52859394049e286293ef09df00cfccef5f569ee.tar.gz mesa-c52859394049e286293ef09df00cfccef5f569ee.tar.bz2 mesa-c52859394049e286293ef09df00cfccef5f569ee.zip |
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 recored in the table
because it was recorded at the wrong location.
Fixes: d23a9380dd6 ("lavapipe: implement extreme uniform inlining")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
(cherry picked from commit a7696a4d98bcf4cdfae1c56a21c4deb3a9ce004f)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/frontends/lavapipe/lvp_inline_uniforms.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/frontends/lavapipe/lvp_inline_uniforms.c b/src/gallium/frontends/lavapipe/lvp_inline_uniforms.c index 76c0b517530..1afb29be8a9 100644 --- a/src/gallium/frontends/lavapipe/lvp_inline_uniforms.c +++ b/src/gallium/frontends/lavapipe/lvp_inline_uniforms.c @@ -101,7 +101,7 @@ src_only_uses_uniforms(const nir_src *src, int component, /* Record the uniform offset. */ if (uni_offsets) - uni_offsets[ubo * MAX_INLINABLE_UNIFORMS + num_offsets[ubo]++] = offset; + uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + num_offsets[ubo]++] = offset; return true; } return false; |