renderer: refactor binding into one loop over shaders

This uses a single loop over the shaders instead of one loop
per object type.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Dave Airlie 7 years ago
parent d2171aa4e7
commit 9c902a90f5
  1. 13
      src/vrend_renderer.c

@ -1086,12 +1086,8 @@ static struct vrend_linked_shader_program *add_shader_program(struct vrend_conte
continue;
bind_sampler_locs(sprog, id);
}
for (id = PIPE_SHADER_VERTEX; id <= last_shader; id++) {
if (!sprog->ss[id])
continue;
bind_const_locs(sprog, id);
bind_ubo_locs(sprog, id);
}
if (!vrend_state.have_gles31_vertex_attrib_binding) {
@ -1107,13 +1103,6 @@ static struct vrend_linked_shader_program *add_shader_program(struct vrend_conte
sprog->attrib_locs = NULL;
}
for (id = PIPE_SHADER_VERTEX; id <= last_shader; id++) {
if (!sprog->ss[id])
continue;
bind_ubo_locs(sprog, id);
}
if (vs->sel->sinfo.num_ucp) {
for (i = 0; i < vs->sel->sinfo.num_ucp; i++) {
snprintf(name, 32, "clipp[%d]", i);

Loading…
Cancel
Save