[Mesa-dev] [PATCH 28/53] st/mesa: pass gl_program to st_bind_ubos()

Timothy Arceri timothy.arceri at collabora.com
Tue Jan 3 02:43:32 UTC 2017


We no longer need anything from gl_linked_shader.

Reviewed-by: Eric Anholt <eric at anholt.net>
---
 src/mesa/state_tracker/st_atom_constbuf.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index 45bb885..ef1a6f2 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -238,21 +238,21 @@ const struct st_tracked_state st_update_cs_constants = {
    update_cs_constants					/* update */
 };
 
-static void st_bind_ubos(struct st_context *st,
-                           struct gl_linked_shader *shader,
-                           unsigned shader_type)
+static void st_bind_ubos(struct st_context *st, struct gl_program *prog,
+                         unsigned shader_type)
 {
    unsigned i;
    struct pipe_constant_buffer cb = { 0 };
 
-   if (!shader)
+   if (!prog)
       return;
 
-   for (i = 0; i < shader->Program->info.num_ubos; i++) {
+   for (i = 0; i < prog->info.num_ubos; i++) {
       struct gl_uniform_buffer_binding *binding;
       struct st_buffer_object *st_obj;
 
-      binding = &st->ctx->UniformBufferBindings[shader->Program->sh.UniformBlocks[i]->Binding];
+      binding =
+         &st->ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
       st_obj = st_buffer_object(binding->BufferObject);
 
       cb.buffer = st_obj->buffer;
@@ -284,7 +284,7 @@ static void bind_vs_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_VERTEX], PIPE_SHADER_VERTEX);
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_VERTEX]->Program, PIPE_SHADER_VERTEX);
 }
 
 const struct st_tracked_state st_bind_vs_ubos = {
@@ -299,7 +299,7 @@ static void bind_fs_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_FRAGMENT], PIPE_SHADER_FRAGMENT);
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program, PIPE_SHADER_FRAGMENT);
 }
 
 const struct st_tracked_state st_bind_fs_ubos = {
@@ -314,7 +314,7 @@ static void bind_gs_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_GEOMETRY], PIPE_SHADER_GEOMETRY);
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program, PIPE_SHADER_GEOMETRY);
 }
 
 const struct st_tracked_state st_bind_gs_ubos = {
@@ -329,7 +329,7 @@ static void bind_tcs_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_TESS_CTRL], PIPE_SHADER_TESS_CTRL);
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_TESS_CTRL]->Program, PIPE_SHADER_TESS_CTRL);
 }
 
 const struct st_tracked_state st_bind_tcs_ubos = {
@@ -344,7 +344,7 @@ static void bind_tes_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL], PIPE_SHADER_TESS_EVAL);
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL]->Program, PIPE_SHADER_TESS_EVAL);
 }
 
 const struct st_tracked_state st_bind_tes_ubos = {
@@ -359,7 +359,7 @@ static void bind_cs_ubos(struct st_context *st)
    if (!prog)
       return;
 
-   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
+   st_bind_ubos(st, prog->_LinkedShaders[MESA_SHADER_COMPUTE]->Program,
                 PIPE_SHADER_COMPUTE);
 }
 
-- 
2.9.3



More information about the mesa-dev mailing list