diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index 546ff293e3d..09c1710c27e 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -45,7 +45,7 @@ struct radv_shader_context { const struct nir_shader *shader; struct ac_shader_abi abi; const struct radv_nir_compiler_options *options; - struct radv_shader_info *shader_info; + const struct radv_shader_info *shader_info; const struct radv_shader_args *args; gl_shader_stage stage; @@ -113,7 +113,7 @@ create_llvm_function(struct ac_llvm_context *ctx, LLVMModuleRef module, LLVMBuil static void load_descriptor_sets(struct radv_shader_context *ctx) { - struct radv_userdata_locations *user_sgprs_locs = &ctx->shader_info->user_sgprs_locs; + const struct radv_userdata_locations *user_sgprs_locs = &ctx->shader_info->user_sgprs_locs; uint32_t mask = ctx->shader_info->desc_set_used_mask; if (user_sgprs_locs->shader_data[AC_UD_INDIRECT_DESCRIPTOR_SETS].sgpr_idx != -1) { @@ -1168,7 +1168,7 @@ radv_emit_streamout(struct radv_shader_context *ctx, unsigned stream) /* Write streamout data. */ for (i = 0; i < ctx->shader_info->so.num_outputs; i++) { struct radv_shader_output_values shader_out = {0}; - struct radv_stream_output *output = &ctx->shader_info->so.outputs[i]; + const struct radv_stream_output *output = &ctx->shader_info->so.outputs[i]; if (stream != output->stream) continue; @@ -1185,7 +1185,7 @@ radv_emit_streamout(struct radv_shader_context *ctx, unsigned stream) static void radv_build_param_exports(struct radv_shader_context *ctx, struct radv_shader_output_values *outputs, - unsigned noutput, struct radv_vs_output_info *outinfo, + unsigned noutput, const struct radv_vs_output_info *outinfo, bool export_clip_dists) { for (unsigned i = 0; i < noutput; i++) { @@ -1211,7 +1211,8 @@ radv_build_param_exports(struct radv_shader_context *ctx, struct radv_shader_out */ static void radv_llvm_export_vs(struct radv_shader_context *ctx, struct radv_shader_output_values *outputs, - unsigned noutput, struct radv_vs_output_info *outinfo, bool export_clip_dists) + unsigned noutput, const struct radv_vs_output_info *outinfo, + bool export_clip_dists) { LLVMValueRef psize_value = NULL, layer_value = NULL, viewport_value = NULL; LLVMValueRef primitive_shading_rate = NULL; @@ -1353,7 +1354,7 @@ radv_llvm_export_vs(struct radv_shader_context *ctx, struct radv_shader_output_v static void handle_vs_outputs_post(struct radv_shader_context *ctx, bool export_prim_id, bool export_clip_dists, - struct radv_vs_output_info *outinfo) + const struct radv_vs_output_info *outinfo) { struct radv_shader_output_values *outputs; unsigned noutput = 0; @@ -1659,9 +1660,9 @@ handle_ngg_outputs_post_2(struct radv_shader_context *ctx) /* Export per-vertex data (positions and parameters). */ ac_build_ifcc(&ctx->ac, is_es_thread, 6002); { - struct radv_vs_output_info *outinfo = ctx->stage == MESA_SHADER_TESS_EVAL - ? &ctx->shader_info->tes.outinfo - : &ctx->shader_info->vs.outinfo; + const struct radv_vs_output_info *outinfo = ctx->stage == MESA_SHADER_TESS_EVAL + ? &ctx->shader_info->tes.outinfo + : &ctx->shader_info->vs.outinfo; /* Exporting the primitive ID is handled below. */ /* TODO: use the new VS export path */ @@ -1937,7 +1938,7 @@ gfx10_ngg_gs_emit_epilogue_2(struct radv_shader_context *ctx) tmp = LLVMBuildICmp(builder, LLVMIntULT, tid, vertlive_scan.result_reduce, ""); ac_build_ifcc(&ctx->ac, tmp, 5145); { - struct radv_vs_output_info *outinfo = &ctx->shader_info->vs.outinfo; + const struct radv_vs_output_info *outinfo = &ctx->shader_info->vs.outinfo; bool export_view_index = ctx->options->key.has_multiview_view_index; struct radv_shader_output_values *outputs; unsigned noutput = 0; @@ -2357,7 +2358,7 @@ declare_esgs_ring(struct radv_shader_context *ctx) static LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm, const struct radv_nir_compiler_options *options, - struct radv_shader_info *info, + const struct radv_shader_info *info, struct nir_shader *const *shaders, int shader_count, const struct radv_shader_args *args) { @@ -2644,7 +2645,7 @@ ac_compile_llvm_module(struct ac_llvm_compiler *ac_llvm, LLVMModuleRef llvm_modu static void radv_compile_nir_shader(struct ac_llvm_compiler *ac_llvm, const struct radv_nir_compiler_options *options, - struct radv_shader_info *info, + const struct radv_shader_info *info, struct radv_shader_binary **rbinary, const struct radv_shader_args *args, struct nir_shader *const *nir, int nir_count) @@ -2747,7 +2748,7 @@ ac_gs_copy_shader_emit(struct radv_shader_context *ctx) static void radv_compile_gs_copy_shader(struct ac_llvm_compiler *ac_llvm, const struct radv_nir_compiler_options *options, - struct radv_shader_info *info, + const struct radv_shader_info *info, struct nir_shader *geom_shader, struct radv_shader_binary **rbinary, const struct radv_shader_args *args) @@ -2789,7 +2790,7 @@ radv_compile_gs_copy_shader(struct ac_llvm_compiler *ac_llvm, void llvm_compile_shader(const struct radv_nir_compiler_options *options, - struct radv_shader_info *info, unsigned shader_count, + const struct radv_shader_info *info, unsigned shader_count, struct nir_shader *const *shaders, struct radv_shader_binary **binary, const struct radv_shader_args *args) { diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 1a0641ac2c6..84340806584 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -2646,7 +2646,7 @@ struct radv_nir_compiler_options; struct radv_shader_info; void llvm_compile_shader(const struct radv_nir_compiler_options *options, - struct radv_shader_info *info, unsigned shader_count, + const struct radv_shader_info *info, unsigned shader_count, struct nir_shader *const *shaders, struct radv_shader_binary **binary, const struct radv_shader_args *args); diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 9ae950783d9..9f6c786d65b 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -2049,7 +2049,7 @@ radv_find_shader(struct radv_device *device, uint64_t pc) } const char * -radv_get_shader_name(struct radv_shader_info *info, gl_shader_stage stage) +radv_get_shader_name(const struct radv_shader_info *info, gl_shader_stage stage) { switch (stage) { case MESA_SHADER_VERTEX: diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index fa1eba5be2d..52a5b06ab7c 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -535,7 +535,7 @@ struct radv_shader *radv_find_shader(struct radv_device *device, uint64_t pc); unsigned radv_get_max_waves(const struct radv_device *device, struct radv_shader *shader, gl_shader_stage stage); -const char *radv_get_shader_name(struct radv_shader_info *info, gl_shader_stage stage); +const char *radv_get_shader_name(const struct radv_shader_info *info, gl_shader_stage stage); unsigned radv_compute_spi_ps_input(const struct radv_device *device, const struct radv_shader_info *info);