nvk_cmd_pool_free_bo_list(pool, &cmd->bos);
nvk_cmd_pool_free_bo_list(pool, &cmd->gart_bos);
util_dynarray_fini(&cmd->pushes);
- util_dynarray_fini(&cmd->bo_refs);
vk_command_buffer_finish(&cmd->vk);
vk_free(&pool->vk.alloc, cmd);
}
list_inithead(&cmd->bos);
list_inithead(&cmd->gart_bos);
util_dynarray_init(&cmd->pushes, NULL);
- util_dynarray_init(&cmd->bo_refs, NULL);
*cmd_buffer_out = &cmd->vk;
cmd->push = (struct nv_push) {0};
util_dynarray_clear(&cmd->pushes);
- util_dynarray_clear(&cmd->bo_refs);
memset(&cmd->state, 0, sizeof(cmd->state));
}
if (unlikely(result != VK_SUCCESS))
return result;
- nvk_cmd_buffer_ref_bo(cmd, bo->bo);
-
*addr = bo->bo->offset;
*ptr = bo->map;
if (unlikely(result != VK_SUCCESS))
return result;
- nvk_cmd_buffer_ref_bo(cmd, bo->bo);
-
*addr = bo->bo->offset;
/* Pick whichever of the current upload BO and the new BO will have more
for (uint32_t i = 0; i < commandBufferCount; i++) {
VK_FROM_HANDLE(nvk_cmd_buffer, other, pCommandBuffers[i]);
- /* We only need to copy the pushes and BO refs. We do not copy the
+ /* We only need to copy the pushes. We do not copy the
* nvk_cmd_buffer::bos because that tracks ownership. Instead, we
* depend on the app to not discard secondaries while they are used by a
* primary. The Vulkan 1.3.227 spec for vkFreeCommandBuffers() says:
* do with it is reset it. vkResetCommandPool() has similar language.
*/
util_dynarray_append_dynarray(&cmd->pushes, &other->pushes);
- util_dynarray_append_dynarray(&cmd->bo_refs, &other->bo_refs);
}
}
vk_to_nvk_descriptor_set_layout(pipeline_layout->set_layouts[set_idx]);
if (desc->sets[set_idx] != set) {
- if (set->bo)
- nvk_cmd_buffer_ref_bo(cmd, set->bo);
desc->root.sets[set_idx] = nvk_descriptor_set_addr(set);
desc->sets[set_idx] = set;
desc->sets_dirty |= BITFIELD_BIT(set_idx);
bool no_prefetch;
};
-struct nvk_cmd_bo_ref {
- struct nouveau_ws_bo *bo;
-};
-
struct nvk_cmd_buffer {
struct vk_command_buffer vk;
*/
struct util_dynarray pushes;
- /** Array of struct nvk_cmd_bo_ref
- *
- * This is for any internal allocations which we want to reference which
- * aren't push buffers.
- */
- struct util_dynarray bo_refs;
-
uint64_t tls_space_needed;
};
uint64_t offset,
uint64_t dw_count);
-static inline void
-nvk_cmd_buffer_ref_bo(struct nvk_cmd_buffer *cmd,
- struct nouveau_ws_bo *bo)
-{
- struct nvk_cmd_bo_ref ref = { .bo = bo };
- util_dynarray_append(&cmd->bo_refs, struct nvk_cmd_bo_ref, ref);
-}
-
void nvk_cmd_buffer_begin_graphics(struct nvk_cmd_buffer *cmd,
const VkCommandBufferBeginInfo *pBeginInfo);
void nvk_cmd_buffer_begin_compute(struct nvk_cmd_buffer *cmd,
VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
VK_FROM_HANDLE(nvk_query_pool, pool, queryPool);
- nvk_cmd_buffer_ref_bo(cmd, pool->bo);
-
for (uint32_t i = 0; i < queryCount; i++) {
uint64_t addr = nvk_query_available_addr(pool, firstQuery + i);
VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
VK_FROM_HANDLE(nvk_query_pool, pool, queryPool);
- nvk_cmd_buffer_ref_bo(cmd, pool->bo);
-
struct nv_push *p = nvk_cmd_buffer_push(cmd, 10);
uint64_t report_addr = nvk_query_report_addr(pool, query);
VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
VK_FROM_HANDLE(nvk_query_pool, pool, queryPool);
- nvk_cmd_buffer_ref_bo(cmd, pool->bo);
-
nvk_cmd_begin_end_query(cmd, pool, query, index, false);
}
VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
VK_FROM_HANDLE(nvk_query_pool, pool, queryPool);
- nvk_cmd_buffer_ref_bo(cmd, pool->bo);
-
nvk_cmd_begin_end_query(cmd, pool, query, index, true);
/* From the Vulkan spec:
VK_FROM_HANDLE(nvk_query_pool, pool, queryPool);
VK_FROM_HANDLE(nvk_buffer, dst_buffer, dstBuffer);
- nvk_cmd_buffer_ref_bo(cmd, pool->bo);
-
if (flags & VK_QUERY_RESULT_WAIT_BIT) {
for (uint32_t i = 0; i < queryCount; i++) {
uint64_t avail_addr = nvk_query_available_addr(pool, firstQuery + i);