Module: Mesa
Branch: master
Commit: 6f1a3f081e59599557c8436b7c8666d0fbba2677
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f1a3f081e59599557c8436b7c8666d0fbba2677

Author: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Date:   Mon Jan 15 12:34:33 2018 +0100

radv: Constify some pipeline helpers.

Reviewed-by: Dave Airlie <airl...@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>

---

 src/amd/vulkan/radv_pipeline.c | 8 ++++----
 src/amd/vulkan/radv_private.h  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 8627b1122b..51452a2fd5 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1576,7 +1576,7 @@ static const struct radv_prim_vertex_count 
prim_size_table[] = {
        [V_008958_DI_PT_2D_TRI_STRIP] = {0, 0},
 };
 
-static struct ac_vs_output_info *get_vs_output_info(struct radv_pipeline 
*pipeline)
+static const struct ac_vs_output_info *get_vs_output_info(const struct 
radv_pipeline *pipeline)
 {
        if (radv_pipeline_has_gs(pipeline))
                return &pipeline->gs_copy_shader->info.vs.outinfo;
@@ -1588,7 +1588,7 @@ static struct ac_vs_output_info 
*get_vs_output_info(struct radv_pipeline *pipeli
 
 static void calculate_vgt_gs_mode(struct radv_pipeline *pipeline)
 {
-       struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
+       const struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
 
        pipeline->graphics.vgt_primitiveid_en = false;
        pipeline->graphics.vgt_gs_mode = 0;
@@ -1608,7 +1608,7 @@ static void calculate_vgt_gs_mode(struct radv_pipeline 
*pipeline)
 
 static void calculate_vs_outinfo(struct radv_pipeline *pipeline)
 {
-       struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
+       const struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
 
        unsigned clip_dist_mask, cull_dist_mask, total_mask;
        clip_dist_mask = outinfo->clip_dist_mask;
@@ -1667,7 +1667,7 @@ static uint32_t offset_to_ps_input(uint32_t offset, bool 
flat_shade)
 static void calculate_ps_inputs(struct radv_pipeline *pipeline)
 {
        struct radv_shader_variant *ps;
-       struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
+       const struct ac_vs_output_info *outinfo = get_vs_output_info(pipeline);
 
        ps = pipeline->shaders[MESA_SHADER_FRAGMENT];
 
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index cf8cf5fd4e..736c900929 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1272,12 +1272,12 @@ struct radv_pipeline {
        unsigned scratch_bytes_per_wave;
 };
 
-static inline bool radv_pipeline_has_gs(struct radv_pipeline *pipeline)
+static inline bool radv_pipeline_has_gs(const struct radv_pipeline *pipeline)
 {
        return pipeline->shaders[MESA_SHADER_GEOMETRY] ? true : false;
 }
 
-static inline bool radv_pipeline_has_tess(struct radv_pipeline *pipeline)
+static inline bool radv_pipeline_has_tess(const struct radv_pipeline *pipeline)
 {
        return pipeline->shaders[MESA_SHADER_TESS_CTRL] ? true : false;
 }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to