zink: change program pointer on struct zink_descriptor_set to pool pointer
the program using the set isn't very relevant now that there's the intermediate pool struct which stores the sets Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
This commit is contained in:
parent
817de3c776
commit
871022dc84
|
@ -158,7 +158,7 @@ allocate_desc_set(struct zink_screen *screen, struct zink_program *pg, enum zink
|
|||
for (unsigned i = 0; i < bucket_size; i ++) {
|
||||
struct zink_descriptor_set *zds = &alloc[i];
|
||||
pipe_reference_init(&zds->reference, 1);
|
||||
zds->pg = pg;
|
||||
zds->pool = pool;
|
||||
zds->hash = 0;
|
||||
zds->invalid = true;
|
||||
zds->recycled = false;
|
||||
|
@ -308,8 +308,7 @@ quick_out:
|
|||
void
|
||||
zink_descriptor_set_recycle(struct zink_descriptor_set *zds)
|
||||
{
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_descriptor_pool *pool = pg->pool[zds->type];
|
||||
struct zink_descriptor_pool *pool = zds->pool;
|
||||
/* if desc set is still in use by a batch, don't recache */
|
||||
uint32_t refcount = p_atomic_read(&zds->reference.count);
|
||||
if (refcount != 1)
|
||||
|
@ -325,8 +324,6 @@ zink_descriptor_set_recycle(struct zink_descriptor_set *zds)
|
|||
|
||||
_mesa_hash_table_remove(pool->desc_sets, he);
|
||||
if (zds->invalid) {
|
||||
if (pg->last_set[zds->type] == zds)
|
||||
pg->last_set[zds->type] = NULL;
|
||||
zink_descriptor_set_invalidate(zds);
|
||||
util_dynarray_append(&pool->alloc_desc_sets, struct zink_descriptor_set *, zds);
|
||||
} else {
|
||||
|
@ -441,7 +438,7 @@ zink_descriptor_program_init(struct zink_screen *screen,
|
|||
null_binding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT |
|
||||
VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT |
|
||||
VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT | VK_SHADER_STAGE_COMPUTE_BIT;
|
||||
VkDescriptorPoolSize null_size = {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, ZINK_DESCRIPTOR_TYPES};
|
||||
VkDescriptorPoolSize null_size = {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, ZINK_DEFAULT_MAX_DESCS};
|
||||
pg->pool[i] = descriptor_pool_create(screen, &null_binding, 1, &null_size, 1);
|
||||
if (!pg->pool[i])
|
||||
return false;
|
||||
|
|
|
@ -67,7 +67,7 @@ struct zink_descriptor_pool {
|
|||
};
|
||||
|
||||
struct zink_descriptor_set {
|
||||
struct zink_program *pg;
|
||||
struct zink_descriptor_pool *pool;
|
||||
enum zink_descriptor_type type;
|
||||
struct pipe_reference reference; //incremented for batch usage
|
||||
VkDescriptorSet desc_set;
|
||||
|
|
|
@ -357,7 +357,7 @@ bind_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds, unsi
|
|||
uint32_t *dynamic_offsets, unsigned dynamic_offset_idx, bool is_compute, bool cache_hit)
|
||||
{
|
||||
bool need_flush = false;
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program;
|
||||
struct zink_batch *batch = is_compute ? &ctx->compute_batch : zink_curr_batch(ctx);
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
assert(zds->desc_set);
|
||||
|
@ -396,7 +396,7 @@ static bool
|
|||
update_ubo_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds, struct zink_transition *transitions, int *num_transitions,
|
||||
struct set *transition_hash, bool is_compute, bool cache_hit)
|
||||
{
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program;
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
unsigned num_descriptors = pg->pool[zds->type]->num_descriptors;
|
||||
unsigned num_bindings = zink_program_num_bindings_typed(pg, zds->type, is_compute);
|
||||
|
@ -478,7 +478,7 @@ static bool
|
|||
update_ssbo_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds, struct zink_transition *transitions, int *num_transitions,
|
||||
struct set *transition_hash, bool is_compute, bool cache_hit)
|
||||
{
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program;
|
||||
ASSERTED struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
unsigned num_descriptors = pg->pool[zds->type]->num_descriptors;
|
||||
unsigned num_bindings = zink_program_num_bindings_typed(pg, zds->type, is_compute);
|
||||
|
@ -582,7 +582,7 @@ static bool
|
|||
update_sampler_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds, struct zink_transition *transitions, int *num_transitions,
|
||||
struct set *transition_hash, bool is_compute, bool cache_hit)
|
||||
{
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program;
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
unsigned num_descriptors = pg->pool[zds->type]->num_descriptors;
|
||||
unsigned num_bindings = zink_program_num_bindings(pg, is_compute);
|
||||
|
@ -655,7 +655,7 @@ static bool
|
|||
update_image_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds, struct zink_transition *transitions, int *num_transitions,
|
||||
struct set *transition_hash, bool is_compute, bool cache_hit)
|
||||
{
|
||||
struct zink_program *pg = zds->pg;
|
||||
struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program;
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
unsigned num_descriptors = pg->pool[zds->type]->num_descriptors;
|
||||
unsigned num_bindings = zink_program_num_bindings(pg, is_compute);
|
||||
|
|
Loading…
Reference in New Issue