[virglrenderer-devel] [PATCH 5/9] renderer: refactor binding into one loop over shaders

Dave Airlie airlied at gmail.com
Thu Jun 14 02:01:48 UTC 2018


From: Dave Airlie <airlied at redhat.com>

This uses a single loop over the shaders instead of one loop
per object type.
---
 src/vrend_renderer.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 2dbb345..82b1ce9 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -1087,12 +1087,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) {
@@ -1108,13 +1104,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);
-- 
2.14.3



More information about the virglrenderer-devel mailing list