nvk: Stop creating a new upload BO every time

We intended this optimization for the case where we're uploading more
data than we had in the previous upload BO.  If there is no previous
upload BO, we always want to set it to the new one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:03 -06:00 committed by Marge Bot
parent 55278fe2b8
commit 7660e585f6

View file

@ -175,7 +175,7 @@ nvk_cmd_buffer_upload_alloc(struct nvk_cmd_buffer *cmd,
* upload BO on this one allocation and continuing on the current upload
* BO.
*/
if (size < cmd->upload_offset) {
if (cmd->upload_bo == NULL || size < cmd->upload_offset) {
cmd->upload_bo = bo;
cmd->upload_offset = size;
}