zink: fix buffer view clamp overflow

dEQP-GLES3.functional.texture.specification.teximage2d_pbo.rgba32ui_cube
asserting on hkz

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31306>
This commit is contained in:
Alyssa Rosenzweig 2024-09-20 16:53:13 -04:00 committed by Marge Bot
parent f7d45cb362
commit 07470d19dd

View file

@ -986,7 +986,7 @@ create_bvci(struct zink_context *ctx, struct zink_resource *res, enum pipe_forma
if (bvci.offset + bvci.range >= res->base.b.width0)
bvci.range = VK_WHOLE_SIZE;
}
uint64_t clamp = blocksize * screen->info.props.limits.maxTexelBufferElements;
uint64_t clamp = (uint64_t)blocksize * (uint64_t)screen->info.props.limits.maxTexelBufferElements;
if (bvci.range == VK_WHOLE_SIZE && res->base.b.width0 > clamp)
bvci.range = clamp;
bvci.flags = 0;