vrend: cleanup bind_ubo_locs()

refactor vrend_shader_info use to constant

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Ryan Neph 3 years ago
parent 26a4492b83
commit 9a8ebf2248
  1. 10
      src/vrend_renderer.c

@ -1494,14 +1494,16 @@ static int bind_ubo_locs(struct vrend_linked_shader_program *sprog,
{ {
if (!has_feature(feat_ubo)) if (!has_feature(feat_ubo))
return next_ubo_id; 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); 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) { while (mask) {
uint32_t ubo_idx = u_bit_scan(&mask); uint32_t ubo_idx = u_bit_scan(&mask);
char name[32]; char name[32];
if (sprog->ss[id]->sel->sinfo.ubo_indirect) if (sinfo->ubo_indirect)
snprintf(name, 32, "%subo[%d]", prefix, ubo_idx - 1); snprintf(name, 32, "%subo[%d]", prefix, ubo_idx - 1);
else else
snprintf(name, 32, "%subo%d", prefix, ubo_idx); 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; return next_ubo_id;
} }

Loading…
Cancel
Save