radv: Constify some pipeline helpers.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 15 Jan 2018 11:34:33 +0000 (12:34 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 30 Jan 2018 21:00:40 +0000 (22:00 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index 8627b1122bcea7168a3fceb381c89959e1e3be6c..51452a2fd57de688ddcfa22eaa34e3d3de515066 100644 (file)
@@ -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];
 
index cf8cf5fd4e7c48ccd826305d8689ef19c27603fa..736c900929ea4331e16b95c68bd8eee6a9c11ef2 100644 (file)
@@ -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;
 }