From 9a8ebf224852a2914a9b71dd0908a3664e43101c Mon Sep 17 00:00:00 2001 From: Ryan Neph Date: Wed, 18 Aug 2021 13:11:31 -0700 Subject: [PATCH] vrend: cleanup bind_ubo_locs() refactor vrend_shader_info use to constant Signed-off-by: Ryan Neph Reviewed-by: Gert Wollny --- src/vrend_renderer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 6d86306..e942a50 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -1494,14 +1494,16 @@ static int bind_ubo_locs(struct vrend_linked_shader_program *sprog, { if (!has_feature(feat_ubo)) return next_ubo_id; - if (sprog->ss[id]->sel->sinfo.ubo_used_mask) { + + const struct vrend_shader_info *sinfo = &sprog->ss[id]->sel->sinfo; + if (sinfo->ubo_used_mask) { const char *prefix = pipe_shader_to_prefix(id); - unsigned mask = sprog->ss[id]->sel->sinfo.ubo_used_mask; + unsigned mask = sinfo->ubo_used_mask; while (mask) { uint32_t ubo_idx = u_bit_scan(&mask); char name[32]; - if (sprog->ss[id]->sel->sinfo.ubo_indirect) + if (sinfo->ubo_indirect) snprintf(name, 32, "%subo[%d]", prefix, ubo_idx - 1); else snprintf(name, 32, "%subo%d", prefix, ubo_idx); @@ -1511,7 +1513,7 @@ static int bind_ubo_locs(struct vrend_linked_shader_program *sprog, } } - sprog->ubo_used_mask[id] = sprog->ss[id]->sel->sinfo.ubo_used_mask; + sprog->ubo_used_mask[id] = sinfo->ubo_used_mask; return next_ubo_id; }