mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
zink: store base descriptor size on the screen
useful to have this around for reuse Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
This commit is contained in:
parent
651f322091
commit
453701256d
3 changed files with 3 additions and 2 deletions
|
|
@ -1502,9 +1502,8 @@ zink_batch_descriptor_init(struct zink_screen *screen, struct zink_batch_state *
|
|||
}
|
||||
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB && !(bs->ctx->flags & ZINK_CONTEXT_COPY_ONLY)) {
|
||||
size_t max_size = MAX4(screen->db_size[0], screen->db_size[1], screen->db_size[2], screen->db_size[3]);
|
||||
unsigned bind = ZINK_BIND_RESOURCE_DESCRIPTOR | ZINK_BIND_SAMPLER_DESCRIPTOR;
|
||||
struct pipe_resource *pres = pipe_buffer_create(&screen->base, bind, 0, max_size);
|
||||
struct pipe_resource *pres = pipe_buffer_create(&screen->base, bind, 0, screen->base_descriptor_size);
|
||||
if (!pres)
|
||||
return false;
|
||||
bs->dd.db = zink_resource(pres);
|
||||
|
|
|
|||
|
|
@ -2921,6 +2921,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
}
|
||||
screen->db_size[ZINK_DESCRIPTOR_TYPE_UNIFORMS] = screen->info.db_props.robustUniformBufferDescriptorSize;
|
||||
screen->info.have_KHR_push_descriptor = false;
|
||||
screen->base_descriptor_size = MAX4(screen->db_size[0], screen->db_size[1], screen->db_size[2], screen->db_size[3]);
|
||||
}
|
||||
|
||||
simple_mtx_init(&screen->dt_lock, mtx_plain);
|
||||
|
|
|
|||
|
|
@ -1303,6 +1303,7 @@ struct zink_screen {
|
|||
struct util_live_shader_cache shaders;
|
||||
|
||||
uint64_t db_size[ZINK_DESCRIPTOR_ALL_TYPES];
|
||||
unsigned base_descriptor_size;
|
||||
VkDescriptorSetLayout bindless_layout;
|
||||
|
||||
struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue