zink: remove intermediate func for descriptor set getting

we can simplify this a bit by just getting the objects in the function

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
This commit is contained in:
Mike Blumenkrantz 2020-10-06 12:33:39 -04:00 committed by Marge Bot
parent 141ff0e091
commit fe31566fbb
3 changed files with 4 additions and 14 deletions

View File

@ -262,8 +262,6 @@ populate_zds_key(struct zink_context *ctx, enum zink_descriptor_type type, bool
struct zink_descriptor_set *
zink_descriptor_set_get(struct zink_context *ctx,
struct zink_batch *batch,
struct zink_program *pg,
enum zink_descriptor_type type,
bool is_compute,
bool *cache_hit)
@ -271,6 +269,8 @@ zink_descriptor_set_get(struct zink_context *ctx,
*cache_hit = false;
struct zink_descriptor_set *zds;
struct zink_screen *screen = zink_screen(ctx->base.screen);
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_descriptor_pool *pool = pg->pool[type];
unsigned descs_used = 1;
assert(type < ZINK_DESCRIPTOR_TYPES);
@ -338,7 +338,7 @@ zink_descriptor_set_get(struct zink_context *ctx,
if (pool->num_sets_allocated + pool->key.num_descriptors > ZINK_DEFAULT_MAX_DESCS) {
batch = zink_flush_batch(ctx, batch);
zink_batch_reference_program(batch, pg);
return zink_descriptor_set_get(ctx, batch, pg, type, is_compute, cache_hit);
return zink_descriptor_set_get(ctx, type, is_compute, cache_hit);
}
} else {
if (pg->last_set[type] && !pg->last_set[type]->hash) {

View File

@ -118,8 +118,6 @@ zink_resource_desc_set_add(struct zink_resource *res, struct zink_descriptor_set
struct zink_descriptor_set *
zink_descriptor_set_get(struct zink_context *ctx,
struct zink_batch *batch,
struct zink_program *pg,
enum zink_descriptor_type type,
bool is_compute,
bool *cache_hit);

View File

@ -266,14 +266,6 @@ get_gfx_program(struct zink_context *ctx)
return ctx->curr_program;
}
static struct zink_descriptor_set *
get_descriptor_set(struct zink_context *ctx, bool is_compute, enum zink_descriptor_type type, bool *cache_hit)
{
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);
return zink_descriptor_set_get(ctx, batch, pg, type, is_compute, cache_hit);
}
struct zink_transition {
struct zink_resource *res;
VkImageLayout layout;
@ -743,7 +735,7 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is
struct zink_descriptor_set *zds[ZINK_DESCRIPTOR_TYPES];
for (int h = 0; h < ZINK_DESCRIPTOR_TYPES; h++) {
if (pg->pool[h])
zds[h] = get_descriptor_set(ctx, is_compute, h, &cache_hit[h]);
zds[h] = zink_descriptor_set_get(ctx, h, is_compute, &cache_hit[h]);
else
zds[h] = NULL;
}