return VK_SUCCESS;
}
+static void
+nvk_cmd_buffer_flush_push(struct nvk_cmd_buffer *cmd)
+{
+ 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;
+}
+
void
nvk_cmd_buffer_new_push(struct nvk_cmd_buffer *cmd)
{
- VkResult result;
+ nvk_cmd_buffer_flush_push(cmd);
- result = nvk_cmd_buffer_alloc_bo(cmd, &cmd->push_bo);
+ VkResult result = nvk_cmd_buffer_alloc_bo(cmd, &cmd->push_bo);
if (unlikely(result != VK_SUCCESS)) {
STATIC_ASSERT(NVK_CMD_BUFFER_MAX_PUSH <= NVK_CMD_BO_SIZE / 4);
cmd->push_bo = NULL;
}
}
-static void
-nvk_cmd_buffer_flush_push(struct nvk_cmd_buffer *cmd)
-{
- 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;
-}
-
VkResult
nvk_cmd_buffer_upload_alloc(struct nvk_cmd_buffer *cmd,
uint32_t size, uint32_t alignment,