[Mesa-dev] [PATCH 3/4] gallium: Use enum pipe_shader_type in set_shader_buffers()

Kai Wasserbäch kai at dev.carbon-project.org
Sat Aug 27 10:08:25 UTC 2016


Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 +-
 src/gallium/drivers/radeonsi/si_descriptors.c | 8 +++++---
 src/gallium/drivers/softpipe/sp_state_image.c | 2 +-
 src/gallium/drivers/trace/tr_context.c        | 2 +-
 src/gallium/include/pipe/p_context.h          | 3 ++-
 src/mesa/state_tracker/st_atom_atomicbuf.c    | 2 +-
 src/mesa/state_tracker/st_atom_storagebuf.c   | 2 +-
 7 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index c9b0e3f..ee1e184 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1409,7 +1409,7 @@ nvc0_bind_buffers_range(struct nvc0_context *nvc0, const unsigned t,
 
 static void
 nvc0_set_shader_buffers(struct pipe_context *pipe,
-                        unsigned shader,
+                        enum pipe_shader_type shader,
                         unsigned start, unsigned nr,
                         const struct pipe_shader_buffer *buffers)
 {
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 573c8a8..dfd0607 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1060,19 +1060,21 @@ static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
 /* SHADER BUFFERS */
 
 static unsigned
-si_shader_buffer_descriptors_idx(unsigned shader)
+si_shader_buffer_descriptors_idx(enum pipe_shader_type shader)
 {
 	return SI_DESCS_FIRST_SHADER + shader * SI_NUM_SHADER_DESCS +
 	       SI_SHADER_DESCS_SHADER_BUFFERS;
 }
 
 static struct si_descriptors *
-si_shader_buffer_descriptors(struct si_context *sctx, unsigned shader)
+si_shader_buffer_descriptors(struct si_context *sctx,
+				  enum pipe_shader_type shader)
 {
 	return &sctx->descriptors[si_shader_buffer_descriptors_idx(shader)];
 }
 
-static void si_set_shader_buffers(struct pipe_context *ctx, unsigned shader,
+static void si_set_shader_buffers(struct pipe_context *ctx,
+				  enum pipe_shader_type shader,
 				  unsigned start_slot, unsigned count,
 				  const struct pipe_shader_buffer *sbuffers)
 {
diff --git a/src/gallium/drivers/softpipe/sp_state_image.c b/src/gallium/drivers/softpipe/sp_state_image.c
index 553a76a..c5ef466 100644
--- a/src/gallium/drivers/softpipe/sp_state_image.c
+++ b/src/gallium/drivers/softpipe/sp_state_image.c
@@ -53,7 +53,7 @@ static void softpipe_set_shader_images(struct pipe_context *pipe,
 }
 
 static void softpipe_set_shader_buffers(struct pipe_context *pipe,
-                                        unsigned shader,
+                                        enum pipe_shader_type shader,
                                         unsigned start,
                                         unsigned num,
                                         const struct pipe_shader_buffer *buffers)
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index a648297..61b69c2 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1711,7 +1711,7 @@ trace_context_set_tess_state(struct pipe_context *_context,
 
 
 static void trace_context_set_shader_buffers(struct pipe_context *_context,
-                                             unsigned shader,
+                                             enum pipe_shader_type shader,
                                              unsigned start, unsigned nr,
                                              const struct pipe_shader_buffer *buffers)
 {
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index b74679d..bea1924 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -314,7 +314,8 @@ struct pipe_context {
     *                   unless it's NULL, in which case no buffers will
     *                   be bound.
     */
-   void (*set_shader_buffers)(struct pipe_context *, unsigned shader,
+   void (*set_shader_buffers)(struct pipe_context *,
+                              enum pipe_shader_type shader,
                               unsigned start_slot, unsigned count,
                               const struct pipe_shader_buffer *buffers);
 
diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c b/src/mesa/state_tracker/st_atom_atomicbuf.c
index 7dde76a..f48ae61 100644
--- a/src/mesa/state_tracker/st_atom_atomicbuf.c
+++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
@@ -43,7 +43,7 @@
 static void
 st_bind_atomics(struct st_context *st,
                 struct gl_shader_program *prog,
-                unsigned shader_type)
+                enum pipe_shader_type shader_type)
 {
    unsigned i;
 
diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src/mesa/state_tracker/st_atom_storagebuf.c
index a5a760e..1b6ed99 100644
--- a/src/mesa/state_tracker/st_atom_storagebuf.c
+++ b/src/mesa/state_tracker/st_atom_storagebuf.c
@@ -42,7 +42,7 @@
 
 static void
 st_bind_ssbos(struct st_context *st, struct gl_linked_shader *shader,
-              unsigned shader_type)
+              enum pipe_shader_type shader_type)
 {
    unsigned i;
    struct pipe_shader_buffer buffers[MAX_SHADER_STORAGE_BUFFERS];
-- 
2.9.3



More information about the mesa-dev mailing list