zink: fix ubo array sizing in ntv

there are only 2 ubos that can be emitted, except the emitted ubos
can start at an offset based on the first-used ubo, which means this
has to support the full range of ubo indices

fixes oob access in game Beyond All Reason

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23729>
(cherry picked from commit 9803174942)
This commit is contained in:
Mike Blumenkrantz 2023-06-19 10:30:58 -04:00 committed by Eric Engestrom
parent f2fa64def1
commit b94aca6dbf
2 changed files with 3 additions and 3 deletions

View file

@ -76,7 +76,7 @@
"description": "zink: fix ubo array sizing in ntv",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -54,8 +54,8 @@ struct ntv_context {
gl_shader_stage stage;
const struct zink_shader_info *sinfo;
SpvId ubos[2][5]; //8, 16, 32, unused, 64
nir_variable *ubo_vars[2];
SpvId ubos[PIPE_MAX_CONSTANT_BUFFERS][5]; //8, 16, 32, unused, 64
nir_variable *ubo_vars[PIPE_MAX_CONSTANT_BUFFERS];
SpvId ssbos[5]; //8, 16, 32, unused, 64
nir_variable *ssbo_vars;