From b94aca6dbf8400224ffdc40fca68bd9e4164fbca Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 19 Jun 2023 10:30:58 -0400 Subject: [PATCH] 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: (cherry picked from commit 98031749421ae328d5b38a3931b5b507ee0838b6) --- .pick_status.json | 2 +- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 41cb08a2ad2..495b1d7d2c6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 }, diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index ff969b9b8fd..12feced58a0 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -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;