zink: avoid overflow when clamping bufferviews
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
(cherry picked from commit 084f3b6664
)
This commit is contained in:

committed by
Dylan Baker

parent
01edc6f174
commit
883c0f7b2f
@@ -571,7 +571,7 @@
|
|||||||
"description": "zink: avoid overflow when clamping bufferviews",
|
"description": "zink: avoid overflow when clamping bufferviews",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null
|
"because_sha": null
|
||||||
},
|
},
|
||||||
|
@@ -800,7 +800,7 @@ create_bvci(struct zink_context *ctx, struct zink_resource *res, enum pipe_forma
|
|||||||
if (bvci.offset + bvci.range >= res->base.b.width0)
|
if (bvci.offset + bvci.range >= res->base.b.width0)
|
||||||
bvci.range = VK_WHOLE_SIZE;
|
bvci.range = VK_WHOLE_SIZE;
|
||||||
}
|
}
|
||||||
uint32_t clamp = blocksize * screen->info.props.limits.maxTexelBufferElements;
|
uint64_t clamp = blocksize * screen->info.props.limits.maxTexelBufferElements;
|
||||||
if (bvci.range == VK_WHOLE_SIZE && res->base.b.width0 > clamp)
|
if (bvci.range == VK_WHOLE_SIZE && res->base.b.width0 > clamp)
|
||||||
bvci.range = clamp;
|
bvci.range = clamp;
|
||||||
bvci.flags = 0;
|
bvci.flags = 0;
|
||||||
|
Reference in New Issue
Block a user