mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
nvk: Don't crash if we fail to allocate a push BO
Currently, we continue just fine until nvk_EndCommandBuffer calls nvk_cmd_buffer_flush_push() and it crashes tring to look at cmd->push_bo. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
parent
23409aea73
commit
156d7dd012
1 changed files with 8 additions and 6 deletions
|
|
@ -114,12 +114,14 @@ nvk_cmd_buffer_new_push(struct nvk_cmd_buffer *cmd)
|
|||
static void
|
||||
nvk_cmd_buffer_flush_push(struct nvk_cmd_buffer *cmd)
|
||||
{
|
||||
struct nvk_cmd_push push = {
|
||||
.bo = cmd->push_bo,
|
||||
.start_dw = cmd->push.start - (uint32_t *)cmd->push_bo->map,
|
||||
.dw_count = nv_push_dw_count(&cmd->push),
|
||||
};
|
||||
util_dynarray_append(&cmd->pushes, struct nvk_cmd_push, push);
|
||||
if (likely(cmd->push_bo != NULL)) {
|
||||
struct nvk_cmd_push push = {
|
||||
.bo = cmd->push_bo,
|
||||
.start_dw = cmd->push.start - (uint32_t *)cmd->push_bo->map,
|
||||
.dw_count = nv_push_dw_count(&cmd->push),
|
||||
};
|
||||
util_dynarray_append(&cmd->pushes, struct nvk_cmd_push, push);
|
||||
}
|
||||
|
||||
cmd->push.start = cmd->push.end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue