mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-23 23:41:13 +00:00
zink: move VkQueue to batch object
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
This commit is contained in:
parent
ef538e50c8
commit
38c5e154df
@ -303,7 +303,7 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
|
||||
si.pNext = &mem_signal;
|
||||
}
|
||||
|
||||
if (vkQueueSubmit(ctx->queue, 1, &si, batch->state->fence.fence) != VK_SUCCESS) {
|
||||
if (vkQueueSubmit(batch->queue, 1, &si, batch->state->fence.fence) != VK_SUCCESS) {
|
||||
debug_printf("ZINK: vkQueueSubmit() failed\n");
|
||||
ctx->is_device_lost = true;
|
||||
|
||||
|
@ -78,6 +78,7 @@ struct zink_batch {
|
||||
struct zink_batch_state *state;
|
||||
|
||||
uint32_t last_batch_id;
|
||||
VkQueue queue; //gfx+compute
|
||||
|
||||
bool has_work;
|
||||
bool in_rp; //renderpass is currently active
|
||||
|
@ -289,7 +289,7 @@ zink_context_destroy(struct pipe_context *pctx)
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
struct zink_screen *screen = zink_screen(pctx->screen);
|
||||
|
||||
if (ctx->queue && vkQueueWaitIdle(ctx->queue) != VK_SUCCESS)
|
||||
if (ctx->batch.queue && vkQueueWaitIdle(ctx->batch.queue) != VK_SUCCESS)
|
||||
debug_printf("vkQueueWaitIdle failed\n");
|
||||
|
||||
util_blitter_destroy(ctx->blitter);
|
||||
@ -2587,12 +2587,13 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||
if (!ctx->blitter)
|
||||
goto fail;
|
||||
|
||||
vkGetDeviceQueue(screen->dev, screen->gfx_queue, 0, &ctx->batch.queue);
|
||||
|
||||
incr_curr_batch(ctx);
|
||||
zink_start_batch(ctx, &ctx->batch);
|
||||
if (!ctx->batch.state)
|
||||
goto fail;
|
||||
|
||||
vkGetDeviceQueue(screen->dev, screen->gfx_queue, 0, &ctx->queue);
|
||||
simple_mtx_init(&ctx->batch_mtx, mtx_plain);
|
||||
|
||||
ctx->program_cache = _mesa_hash_table_create(NULL,
|
||||
|
@ -136,7 +136,6 @@ struct zink_context {
|
||||
struct zink_batch batch;
|
||||
simple_mtx_t batch_mtx;
|
||||
struct zink_fence *last_fence; //the last command buffer submitted
|
||||
VkQueue queue; //gfx+compute
|
||||
struct hash_table batch_states; //submitted batch states
|
||||
struct util_dynarray free_batch_states; //unused batch states
|
||||
VkDeviceSize resource_size; //the accumulated size of resources in submitted buffers
|
||||
|
Loading…
Reference in New Issue
Block a user