zink: simplify check for knowing whether descriptor updating is needed
if a program has at least one pool object set then it will have descriptors Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9348>
This commit is contained in:
parent
fe31566fbb
commit
80d9f3aa34
|
@ -962,7 +962,7 @@ zink_draw_vbo(struct pipe_context *pctx,
|
|||
}
|
||||
}
|
||||
|
||||
if (zink_program_num_descriptors(&gfx_program->base))
|
||||
if (zink_program_has_descriptors(&gfx_program->base))
|
||||
update_descriptors(ctx, screen, false);
|
||||
|
||||
struct zink_batch *batch = zink_batch_rp(ctx);
|
||||
|
@ -1171,7 +1171,7 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
|
|||
VkPipeline pipeline = zink_get_compute_pipeline(screen, comp_program,
|
||||
&ctx->compute_pipeline_state);
|
||||
|
||||
if (zink_program_num_descriptors(&comp_program->base))
|
||||
if (zink_program_has_descriptors(&comp_program->base))
|
||||
update_descriptors(ctx, screen, true);
|
||||
|
||||
|
||||
|
|
|
@ -118,6 +118,16 @@ zink_desc_type_from_vktype(VkDescriptorType type)
|
|||
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zink_program_has_descriptors(const struct zink_program *pg)
|
||||
{
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(pg->pool); i++) {
|
||||
if (pg->pool[i])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned
|
||||
zink_program_num_descriptors(const struct zink_program *pg);
|
||||
|
||||
|
|
Loading…
Reference in New Issue