nvk/upload_queue: fix the _fill method
When calculating the height for multi line uploads we should ensure that
we do not exceed max_dim rather than using at least max_dim.
The assert is also changed to ensure that we do not upload more than the
source size.
Fixes: 22e44d54fd
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29784>
This commit is contained in:

committed by
Marge Bot

parent
a0c09eef93
commit
7c3bd27d3b
@@ -376,12 +376,12 @@ nvk_upload_queue_fill_locked(struct nvk_device *dev,
|
|||||||
uint32_t width_B, height;
|
uint32_t width_B, height;
|
||||||
if (size > max_dim) {
|
if (size > max_dim) {
|
||||||
width_B = max_dim;
|
width_B = max_dim;
|
||||||
height = MAX2(max_dim, size / width_B);
|
height = MIN2(max_dim, size / width_B);
|
||||||
} else {
|
} else {
|
||||||
width_B = size;
|
width_B = size;
|
||||||
height = 1;
|
height = 1;
|
||||||
}
|
}
|
||||||
assert(size <= width_B * height);
|
assert(width_B * height <= size);
|
||||||
|
|
||||||
struct nv_push p;
|
struct nv_push p;
|
||||||
nv_push_init(&p, queue->bo->map + queue->bo_push_end, cmd_size_dw);
|
nv_push_init(&p, queue->bo->map + queue->bo_push_end, cmd_size_dw);
|
||||||
|
Reference in New Issue
Block a user