mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-17 00:30:19 +01:00
zink: clamp tbo creation to maxTexelBufferElements
for sparse buffers, the total buffer size will be huge, so this needs
to only be the limit that the driver can support to avoid crashing
or whatever
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14692>
(cherry picked from commit 27d405dc2f)
This commit is contained in:
parent
9b50b320d1
commit
e2085aeaff
2 changed files with 4 additions and 1 deletions
|
|
@ -3460,7 +3460,7 @@
|
|||
"description": "zink: clamp tbo creation to maxTexelBufferElements",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -643,6 +643,9 @@ create_bvci(struct zink_context *ctx, struct zink_resource *res, enum pipe_forma
|
|||
assert(bvci.format);
|
||||
bvci.offset = offset;
|
||||
bvci.range = !offset && range == res->base.b.width0 ? VK_WHOLE_SIZE : range;
|
||||
uint32_t clamp = util_format_get_blocksize(format) * screen->info.props.limits.maxTexelBufferElements;
|
||||
if (bvci.range == VK_WHOLE_SIZE && res->base.b.width0 > clamp)
|
||||
bvci.range = clamp;
|
||||
bvci.flags = 0;
|
||||
return bvci;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue