anv: Push UBO ranges relative to the start of the binding
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 13 Mar 2020 20:30:41 +0000 (15:30 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 16 Mar 2020 15:14:14 +0000 (15:14 +0000)
commit4061ac859d0b612a801ae9047afbd352fb74e006
treea60e8784ea9f5a81e4f87bb89fd2dc2a1a40a9f2
parentae15b4fd733597880fee5357fb2d1f2f100b30c1
anv: Push UBO ranges relative to the start of the binding

There was a disconnect between anv_nir_compute_push_layout and the code
which sets up the push_ubo_sizes array.  The NIR code we emit checks
relative to the start of the bound UBO range so that, if we end up with
a vector which straddles the start of the push range, we can perform the
bounds check without risking overflow issues.  The code which sets up
the push_ubo_sizes, on the other hand, assumed it was relative to the
start of the push range.  Somehow, this didn't get get caught by any of
the available tests.

Fixes: e03f9652801 "anv: Bounds-check pushed UBOs when ..."
Closes: #2623
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4195>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4195>
src/intel/vulkan/anv_nir_compute_push_layout.c
src/intel/vulkan/genX_cmd_buffer.c