gallium: make constant_buffer const
authorRob Clark <robclark@freedesktop.org>
Tue, 7 Jun 2016 18:29:01 +0000 (14:29 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 20 Jun 2016 16:36:20 +0000 (12:36 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
21 files changed:
src/gallium/drivers/ddebug/dd_context.c
src/gallium/drivers/freedreno/freedreno_state.c
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/ilo/ilo_state.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/noop/noop_state.c
src/gallium/drivers/nouveau/nv30/nv30_state.c
src/gallium/drivers/nouveau/nv50/nv50_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_state.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/softpipe/sp_state_shader.c
src/gallium/drivers/svga/svga_pipe_constants.c
src/gallium/drivers/swr/swr_state.cpp
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/vc4/vc4_state.c
src/gallium/drivers/virgl/virgl_context.c
src/gallium/include/pipe/p_context.h

index b88df92900687641d13a3acc2dee851f7139c863..785dde784c922dcb9aaa20d97b29628aa303d1f2 100644 (file)
@@ -343,7 +343,7 @@ DD_IMM_STATE(polygon_stipple, const struct pipe_poly_stipple, *state, state)
 static void
 dd_context_set_constant_buffer(struct pipe_context *_pipe,
                                uint shader, uint index,
-                               struct pipe_constant_buffer *constant_buffer)
+                               const struct pipe_constant_buffer *constant_buffer)
 {
    struct dd_context *dctx = dd_context(_pipe);
    struct pipe_context *pipe = dctx->pipe;
index e4df909e602f5521d7e68c1a43b28ec41591d6e7..53ea39b3d2923e83317e3fbffac13ba36a3b6841 100644 (file)
@@ -89,7 +89,7 @@ fd_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask)
  */
 static void
 fd_set_constant_buffer(struct pipe_context *pctx, uint shader, uint index,
-               struct pipe_constant_buffer *cb)
+               const struct pipe_constant_buffer *cb)
 {
        struct fd_context *ctx = fd_context(pctx);
        struct fd_constbuf_stateobj *so = &ctx->constbuf[shader];
index 8fa2f42e7c69661c6ad54c305d7a56660fbba923..2efa14e3f1b40255ad5917e2578ef4231482ee60 100644 (file)
@@ -675,7 +675,7 @@ static void i915_delete_vs_state(struct pipe_context *pipe, void *shader)
 
 static void i915_set_constant_buffer(struct pipe_context *pipe,
                                      uint shader, uint index,
-                                     struct pipe_constant_buffer *cb)
+                                     const struct pipe_constant_buffer *cb)
 {
    struct i915_context *i915 = i915_context(pipe);
    struct pipe_resource *buf = cb ? cb->buffer : NULL;
index 37234ec08e8a56500f6efc13ab7e255ec4f9d8bf..53a5aca78cf47fe479839fe7dab4c26a845da678 100644 (file)
@@ -1536,7 +1536,7 @@ ilo_set_clip_state(struct pipe_context *pipe,
 static void
 ilo_set_constant_buffer(struct pipe_context *pipe,
                         uint shader, uint index,
-                        struct pipe_constant_buffer *buf)
+                        const struct pipe_constant_buffer *buf)
 {
    const struct ilo_dev *dev = ilo_context(pipe)->dev;
    struct ilo_state_vector *vec = &ilo_context(pipe)->state_vector;
index 3a678e39da58d66ebbb46d62926171ceccaaa510..b110202864352e5e8169a19944485844f8a7925f 100644 (file)
@@ -2836,7 +2836,7 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
 static void
 llvmpipe_set_constant_buffer(struct pipe_context *pipe,
                              uint shader, uint index,
-                             struct pipe_constant_buffer *cb)
+                             const struct pipe_constant_buffer *cb)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
    struct pipe_resource *constants = cb ? cb->buffer : NULL;
index fe5b5e4696efc99f91999f5a61c0b57b60deeb9b..0ddffa20abe4f12f4e011ebf16cd21d368119945 100644 (file)
@@ -176,7 +176,7 @@ static void noop_set_framebuffer_state(struct pipe_context *ctx,
 
 static void noop_set_constant_buffer(struct pipe_context *ctx,
                                        uint shader, uint index,
-                                       struct pipe_constant_buffer *cb)
+                                       const struct pipe_constant_buffer *cb)
 {
 }
 
index fd604c2266d9693b409ca649bbcc2db87589c692..3655e0cb7f6c6c2d954df812aa77126de7d40e02 100644 (file)
@@ -327,7 +327,7 @@ nv30_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask)
 
 static void
 nv30_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                         struct pipe_constant_buffer *cb)
+                         const struct pipe_constant_buffer *cb)
 {
    struct nv30_context *nv30 = nv30_context(pipe);
    struct pipe_resource *buf = cb ? cb->buffer : NULL;
index 9f5b5cb57f4f125ec022d93bdd101a604d065868..a84c9e27992451aefe711cbe86e6b04e2e2fd9ff 100644 (file)
@@ -842,7 +842,7 @@ nv50_cp_state_bind(struct pipe_context *pipe, void *hwcso)
 
 static void
 nv50_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                         struct pipe_constant_buffer *cb)
+                         const struct pipe_constant_buffer *cb)
 {
    struct nv50_context *nv50 = nv50_context(pipe);
    struct pipe_resource *res = cb ? cb->buffer : NULL;
index 2fbe8172bc1dbee73e66874c00fd23108c6e9d9b..4173d0687337ed6adb7ea044c1f60977cbe401b9 100644 (file)
@@ -831,7 +831,7 @@ nvc0_cp_state_bind(struct pipe_context *pipe, void *hwcso)
 
 static void
 nvc0_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
-                         struct pipe_constant_buffer *cb)
+                         const struct pipe_constant_buffer *cb)
 {
    struct nvc0_context *nvc0 = nvc0_context(pipe);
    struct pipe_resource *res = cb ? cb->buffer : NULL;
index 1063cce7f0361e1b3b8a5969312a26cdff959e46..01ccd46f702cafaeebf49cf1603582a1fb217ea5 100644 (file)
@@ -2003,7 +2003,7 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader)
 
 static void r300_set_constant_buffer(struct pipe_context *pipe,
                                      uint shader, uint index,
-                                     struct pipe_constant_buffer *cb)
+                                     const struct pipe_constant_buffer *cb)
 {
     struct r300_context* r300 = r300_context(pipe);
     struct r300_constant_buffer *cbuf;
index 3f8c7b29cf42743094b470e3331e288f608bf972..1ca583c883dc6697afb7636c39f64d985edea5a5 100644 (file)
@@ -1053,7 +1053,7 @@ void r600_constant_buffers_dirty(struct r600_context *rctx, struct r600_constbuf
 }
 
 static void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index,
-                                    struct pipe_constant_buffer *input)
+                                    const struct pipe_constant_buffer *input)
 {
        struct r600_context *rctx = (struct r600_context *)ctx;
        struct r600_constbuf_state *state = &rctx->constbuf_state[shader];
index 5ad251f2d3f264dee3b4029adb5bc26fad41e5a9..55686e8b61efbd3f83c22e5db2a98963a1022984 100644 (file)
@@ -940,7 +940,7 @@ void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuf
 static void si_set_constant_buffer(struct si_context *sctx,
                                   struct si_buffer_resources *buffers,
                                   unsigned descriptors_idx,
-                                  uint slot, struct pipe_constant_buffer *input)
+                                  uint slot, const struct pipe_constant_buffer *input)
 {
        struct si_descriptors *descs = &sctx->descriptors[descriptors_idx];
        assert(slot < descs->num_elements);
@@ -1003,7 +1003,7 @@ static void si_set_constant_buffer(struct si_context *sctx,
 }
 
 void si_set_rw_buffer(struct si_context *sctx,
-                     uint slot, struct pipe_constant_buffer *input)
+                     uint slot, const struct pipe_constant_buffer *input)
 {
        si_set_constant_buffer(sctx, &sctx->rw_buffers,
                                                SI_DESCS_RW_BUFFERS, slot, input);
@@ -1011,7 +1011,7 @@ void si_set_rw_buffer(struct si_context *sctx,
 
 static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
                                        uint shader, uint slot,
-                                       struct pipe_constant_buffer *input)
+                                       const struct pipe_constant_buffer *input)
 {
        struct si_context *sctx = (struct si_context *)ctx;
 
index ab34feca857ca8b0b2c69ec609c49ed3807a2182..8d538e1c185bf0b986e9b2f64e75d0efca6f4d78 100644 (file)
@@ -302,8 +302,7 @@ void si_emit_graphics_shader_userdata(struct si_context *sctx,
                                       struct r600_atom *atom);
 void si_emit_compute_shader_userdata(struct si_context *sctx);
 void si_set_rw_buffer(struct si_context *sctx,
-                     uint slot, struct pipe_constant_buffer *input);
-
+                     uint slot, const struct pipe_constant_buffer *input);
 /* si_state.c */
 struct si_shader_selector;
 
index 54564c1a4bebaf5c4afd216d40f7758b1e4be50e..77f09b001a85c9d2bb910370380d6a5c3d4d7ed3 100644 (file)
@@ -624,7 +624,7 @@ static void
 rbug_set_constant_buffer(struct pipe_context *_pipe,
                          uint shader,
                          uint index,
-                         struct pipe_constant_buffer *_cb)
+                         const struct pipe_constant_buffer *_cb)
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
index 38673d85cdf9edd1e0275139bc135633faf0400e..a7456628d80ae2575863ee5907b85efab7bb8d57 100644 (file)
@@ -338,7 +338,7 @@ softpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
 static void
 softpipe_set_constant_buffer(struct pipe_context *pipe,
                              uint shader, uint index,
-                             struct pipe_constant_buffer *cb)
+                             const struct pipe_constant_buffer *cb)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
    struct pipe_resource *constants = cb ? cb->buffer : NULL;
index 204b13c9b1320805b4105d7be42995bc4418ac23..b88cdb1e63232782187ec669164c0263af2f2c88 100644 (file)
@@ -46,7 +46,7 @@ struct svga_constbuf
 
 static void svga_set_constant_buffer(struct pipe_context *pipe,
                                      uint shader, uint index,
-                                     struct pipe_constant_buffer *cb)
+                                     const struct pipe_constant_buffer *cb)
 {
    struct svga_screen *svgascreen = svga_screen(pipe->screen);
    struct svga_context *svga = svga_context(pipe);
index 1f34365d30e12229d1d4bae99d776aa4173c41d7..31745fca6027574c84f97d8bab62e5b5009ea649 100644 (file)
@@ -409,7 +409,7 @@ static void
 swr_set_constant_buffer(struct pipe_context *pipe,
                         uint shader,
                         uint index,
-                        struct pipe_constant_buffer *cb)
+                        const struct pipe_constant_buffer *cb)
 {
    struct swr_context *ctx = swr_context(pipe);
    struct pipe_resource *constants = cb ? cb->buffer : NULL;
index 7ea5946542a6845b6e06465357d9ef7a874595b7..0412dd79f8997c39b92261ed4a4359f20688a8de 100644 (file)
@@ -772,7 +772,7 @@ trace_context_set_sample_mask(struct pipe_context *_pipe,
 static void
 trace_context_set_constant_buffer(struct pipe_context *_pipe,
                                   uint shader, uint index,
-                                  struct pipe_constant_buffer *constant_buffer)
+                                  const struct pipe_constant_buffer *constant_buffer)
 {
    struct trace_context *tr_ctx = trace_context(_pipe);
    struct pipe_context *pipe = tr_ctx->pipe;
index 7e0ada7d0fa36593c45bfbc54aa2dea9896998f3..7aa39319084925bacbe3b524879ce6ea07fba976 100644 (file)
@@ -375,7 +375,7 @@ vc4_vertex_state_bind(struct pipe_context *pctx, void *hwcso)
 
 static void
 vc4_set_constant_buffer(struct pipe_context *pctx, uint shader, uint index,
-                        struct pipe_constant_buffer *cb)
+                        const struct pipe_constant_buffer *cb)
 {
         struct vc4_context *vc4 = vc4_context(pctx);
         struct vc4_constbuf_stateobj *so = &vc4->constbuf[shader];
index d2d161722e1749a1660c422a9262f76094297394..27e85a828425c26a24960fecfd18f68c2701d58e 100644 (file)
@@ -426,7 +426,7 @@ static void virgl_hw_set_index_buffer(struct pipe_context *ctx,
 
 static void virgl_set_constant_buffer(struct pipe_context *ctx,
                                      uint shader, uint index,
-                                     struct pipe_constant_buffer *buf)
+                                     const struct pipe_constant_buffer *buf)
 {
    struct virgl_context *vctx = virgl_context(ctx);
 
index 7319835bcdb62e4ff3b1cfb927203d53262bbe66..67ee5cc6477a62effd547b680b606bdc63ffb8f4 100644 (file)
@@ -261,7 +261,7 @@ struct pipe_context {
 
    void (*set_constant_buffer)( struct pipe_context *,
                                 uint shader, uint index,
-                                struct pipe_constant_buffer *buf );
+                                const struct pipe_constant_buffer *buf );
 
    void (*set_framebuffer_state)( struct pipe_context *,
                                   const struct pipe_framebuffer_state * );