vrend: cleanup bind_image_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 9a8ebf2248
commit 9243cf5ffb
  1. 11
      src/vrend_renderer.c

@ -1532,9 +1532,10 @@ static void bind_image_locs(struct vrend_linked_shader_program *sprog,
int i; int i;
char name[32]; char name[32];
const char *prefix = pipe_shader_to_prefix(id); const char *prefix = pipe_shader_to_prefix(id);
const struct vrend_shader_info *sinfo = &sprog->ss[id]->sel->sinfo;
uint32_t mask = sprog->ss[id]->sel->sinfo.images_used_mask; uint32_t mask = sinfo->images_used_mask;
if (!mask && ! sprog->ss[id]->sel->sinfo.num_image_arrays) if (!mask && !sinfo->num_image_arrays)
return; return;
if (!has_feature(feat_images)) if (!has_feature(feat_images))
@ -1548,9 +1549,9 @@ static void bind_image_locs(struct vrend_linked_shader_program *sprog,
} else } else
sprog->img_locs[id] = NULL; sprog->img_locs[id] = NULL;
if (sprog->ss[id]->sel->sinfo.num_image_arrays) { if (sinfo->num_image_arrays) {
for (i = 0; i < sprog->ss[id]->sel->sinfo.num_image_arrays; i++) { for (i = 0; i < sinfo->num_image_arrays; i++) {
struct vrend_array *img_array = &sprog->ss[id]->sel->sinfo.image_arrays[i]; struct vrend_array *img_array = &sinfo->image_arrays[i];
for (int j = 0; j < img_array->array_size; j++) { for (int j = 0; j < img_array->array_size; j++) {
snprintf(name, 32, "%simg%d[%d]", prefix, img_array->first, j); snprintf(name, 32, "%simg%d[%d]", prefix, img_array->first, j);
sprog->img_locs[id][img_array->first + j] = glGetUniformLocation(sprog->id, name); sprog->img_locs[id][img_array->first + j] = glGetUniformLocation(sprog->id, name);

Loading…
Cancel
Save