zink: add screen-based indexing to descriptor sets

this allows indirection for internal descriptor type -> vk descriptor set
and enables more easily altering the descriptor set index at runtime

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16645>
This commit is contained in:
Mike Blumenkrantz 2022-05-16 16:54:47 -04:00 committed by Marge Bot
parent 252cdac5cc
commit f7eb871efa
2 changed files with 8 additions and 0 deletions

View File

@ -2180,6 +2180,13 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
zink_verify_device_extensions(screen);
screen->desc_set_id[ZINK_DESCRIPTOR_TYPES] = 0;
screen->desc_set_id[ZINK_DESCRIPTOR_TYPE_UBO] = 1;
screen->desc_set_id[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW] = 2;
screen->desc_set_id[ZINK_DESCRIPTOR_TYPE_SSBO] = 3;
screen->desc_set_id[ZINK_DESCRIPTOR_TYPE_IMAGE] = 4;
screen->desc_set_id[ZINK_DESCRIPTOR_BINDLESS] = 5;
if (screen->info.have_EXT_calibrated_timestamps && !check_have_device_time(screen))
goto fail;

View File

@ -164,6 +164,7 @@ struct zink_screen {
struct vk_dispatch_table vk;
uint8_t desc_set_id[ZINK_MAX_DESCRIPTOR_SETS];
bool (*descriptor_program_init)(struct zink_context *ctx, struct zink_program *pg);
void (*descriptor_program_deinit)(struct zink_context *ctx, struct zink_program *pg);
void (*descriptors_update)(struct zink_context *ctx, bool is_compute);