lavapipe: drop device pointer from queue

Just use the copy in the base

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
This commit is contained in:
Dave Airlie 2025-11-02 05:42:31 +10:00
parent fe5a99175f
commit 5875d6cf93
2 changed files with 15 additions and 10 deletions

View file

@ -1709,9 +1709,10 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
static void
destroy_pipelines(struct lvp_queue *queue)
{
struct lvp_device *device = lvp_queue_device(queue);
simple_mtx_lock(&queue->lock);
while (util_dynarray_contains(&queue->pipeline_destroys, struct lvp_pipeline*)) {
lvp_pipeline_destroy(queue->device, util_dynarray_pop(&queue->pipeline_destroys, struct lvp_pipeline*), true);
lvp_pipeline_destroy(device, util_dynarray_pop(&queue->pipeline_destroys, struct lvp_pipeline*), true);
}
simple_mtx_unlock(&queue->lock);
}
@ -1721,8 +1722,9 @@ lvp_queue_submit(struct vk_queue *vk_queue,
struct vk_queue_submit *submit)
{
struct lvp_queue *queue = container_of(vk_queue, struct lvp_queue, vk);
struct lvp_device *device = lvp_queue_device(queue);
VkResult result = vk_sync_wait_many(&queue->device->vk,
VkResult result = vk_sync_wait_many(&device->vk,
submit->wait_count, submit->waits,
VK_SYNC_WAIT_COMPLETE, UINT64_MAX);
if (result != VK_SUCCESS)
@ -1733,26 +1735,26 @@ lvp_queue_submit(struct vk_queue *vk_queue,
for (uint32_t i = 0; i < submit->buffer_bind_count; i++) {
VkSparseBufferMemoryBindInfo *bind = &submit->buffer_binds[i];
lvp_buffer_bind_sparse(queue->device, queue, bind);
lvp_buffer_bind_sparse(device, queue, bind);
}
for (uint32_t i = 0; i < submit->image_opaque_bind_count; i++) {
VkSparseImageOpaqueMemoryBindInfo *bind = &submit->image_opaque_binds[i];
lvp_image_bind_opaque_sparse(queue->device, queue, bind);
lvp_image_bind_opaque_sparse(device, queue, bind);
}
for (uint32_t i = 0; i < submit->image_bind_count; i++) {
VkSparseImageMemoryBindInfo *bind = &submit->image_binds[i];
lvp_image_bind_sparse(queue->device, queue, bind);
lvp_image_bind_sparse(device, queue, bind);
}
for (uint32_t i = 0; i < submit->command_buffer_count; i++) {
struct lvp_cmd_buffer *cmd_buffer =
container_of(submit->command_buffers[i], struct lvp_cmd_buffer, vk);
lvp_execute_cmds(queue->device, queue, cmd_buffer);
lvp_execute_cmds(device, queue, cmd_buffer);
}
simple_mtx_unlock(&queue->lock);
@ -1763,7 +1765,7 @@ lvp_queue_submit(struct vk_queue *vk_queue,
for (uint32_t i = 0; i < submit->signal_count; i++) {
struct lvp_pipe_sync *sync =
vk_sync_as_lvp_pipe_sync(submit->signals[i].sync);
lvp_pipe_sync_signal_with_fence(queue->device, sync, queue->last_fence);
lvp_pipe_sync_signal_with_fence(device, sync, queue->last_fence);
}
destroy_pipelines(queue);
@ -1786,8 +1788,6 @@ lvp_queue_init(struct lvp_device *device, struct lvp_queue *queue,
return result;
}
queue->device = device;
queue->ctx = device->pscreen->context_create(device->pscreen, NULL, PIPE_CONTEXT_ROBUST_BUFFER_ACCESS);
queue->cso = cso_create_context(queue->ctx, CSO_NO_VBUF);
queue->uploader = u_upload_create(queue->ctx, 1024 * 1024, PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STREAM, 0);

View file

@ -180,7 +180,6 @@ bool lvp_physical_device_extension_supported(struct lvp_physical_device *dev,
struct lvp_queue {
struct vk_queue vk;
struct lvp_device *device;
struct pipe_context *ctx;
struct cso_context *cso;
struct u_upload_mgr *uploader;
@ -190,6 +189,12 @@ struct lvp_queue {
simple_mtx_t lock;
};
static inline struct lvp_device *
lvp_queue_device(const struct lvp_queue *queue)
{
return (struct lvp_device *)queue->vk.base.device;
}
struct lvp_pipeline_cache {
struct vk_object_base base;
struct lvp_device *device;