mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
zink: break out descriptor binding into separate function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
This commit is contained in:
parent
362b8792e7
commit
f81a4e904c
2 changed files with 21 additions and 13 deletions
|
|
@ -407,11 +407,26 @@ zink_reset_batch(struct zink_context *ctx, struct zink_batch *batch)
|
|||
batch->has_work = false;
|
||||
}
|
||||
|
||||
void
|
||||
zink_batch_bind_db(struct zink_context *ctx)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
struct zink_batch *batch = &ctx->batch;
|
||||
unsigned count = screen->compact_descriptors ? 3 : 5;
|
||||
VkDescriptorBufferBindingInfoEXT infos[ZINK_DESCRIPTOR_NON_BINDLESS_TYPES] = {0};
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
infos[i].sType = VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT;
|
||||
infos[i].address = batch->state->dd.db[i]->obj->bda;
|
||||
infos[i].usage = batch->state->dd.db[i]->obj->vkusage;
|
||||
assert(infos[i].usage);
|
||||
}
|
||||
VKSCR(CmdBindDescriptorBuffersEXT)(batch->state->cmdbuf, count, infos);
|
||||
}
|
||||
|
||||
/* called on context creation and after flushing an old batch */
|
||||
void
|
||||
zink_start_batch(struct zink_context *ctx, struct zink_batch *batch)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
zink_reset_batch(ctx, batch);
|
||||
|
||||
batch->state->usage.unflushed = true;
|
||||
|
|
@ -435,6 +450,7 @@ zink_start_batch(struct zink_context *ctx, struct zink_batch *batch)
|
|||
}
|
||||
|
||||
#ifdef HAVE_RENDERDOC_APP_H
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
if (VKCTX(CmdInsertDebugUtilsLabelEXT) && screen->renderdoc_api) {
|
||||
VkDebugUtilsLabelEXT capture_label;
|
||||
/* Magic fallback which lets us bridge the Wine barrier over to Linux RenderDoc. */
|
||||
|
|
@ -458,17 +474,8 @@ zink_start_batch(struct zink_context *ctx, struct zink_batch *batch)
|
|||
zink_resume_queries(ctx, batch);
|
||||
|
||||
/* descriptor buffers must always be bound at the start of a batch */
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB && !(ctx->flags & ZINK_CONTEXT_COPY_ONLY)) {
|
||||
unsigned count = screen->compact_descriptors ? 3 : 5;
|
||||
VkDescriptorBufferBindingInfoEXT infos[ZINK_DESCRIPTOR_NON_BINDLESS_TYPES] = {0};
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
infos[i].sType = VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT;
|
||||
infos[i].address = batch->state->dd.db[i]->obj->bda;
|
||||
infos[i].usage = batch->state->dd.db[i]->obj->vkusage;
|
||||
assert(infos[i].usage);
|
||||
}
|
||||
VKSCR(CmdBindDescriptorBuffersEXT)(batch->state->cmdbuf, count, infos);
|
||||
}
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB && !(ctx->flags & ZINK_CONTEXT_COPY_ONLY))
|
||||
zink_batch_bind_db(ctx);
|
||||
}
|
||||
|
||||
/* common operations to run post submit; split out for clarity */
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ void
|
|||
zink_batch_reference_program(struct zink_batch *batch,
|
||||
struct zink_program *pg);
|
||||
|
||||
|
||||
void
|
||||
zink_batch_bind_db(struct zink_context *ctx);
|
||||
void
|
||||
debug_describe_zink_batch_state(char *buf, const struct zink_batch_state *ptr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue