mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-14 15:30:37 +01:00
treewide: Use os_get_option_secure instead secure_getenv
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Acked-by: Antonio Ospite <antonio.ospite@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38128>
This commit is contained in:
parent
34db720660
commit
95faaa4553
5 changed files with 9 additions and 9 deletions
|
|
@ -400,7 +400,7 @@ _vtn_fail(struct vtn_builder *b, const char *file, unsigned line,
|
|||
file, line, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
const char *dump_path = secure_getenv("MESA_SPIRV_FAIL_DUMP_PATH");
|
||||
const char *dump_path = os_get_option_secure("MESA_SPIRV_FAIL_DUMP_PATH");
|
||||
if (dump_path)
|
||||
vtn_dump_shader(b, dump_path, "fail");
|
||||
|
||||
|
|
@ -7293,14 +7293,14 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
|||
b->shader->has_debug_info = options->debug_info;
|
||||
_mesa_blake3_compute(words, word_count * sizeof(uint32_t), b->shader->info.source_blake3);
|
||||
|
||||
const char *dump_path = secure_getenv("MESA_SPIRV_DUMP_PATH");
|
||||
const char *dump_path = os_get_option_secure("MESA_SPIRV_DUMP_PATH");
|
||||
if (dump_path) {
|
||||
char blake3_str[BLAKE3_HEX_LEN];
|
||||
_mesa_blake3_format(blake3_str, b->shader->info.source_blake3);
|
||||
vtn_dump_shader(b, dump_path, blake3_str);
|
||||
}
|
||||
|
||||
const char *read_path = secure_getenv("MESA_SPIRV_READ_PATH");
|
||||
const char *read_path = os_get_option_secure("MESA_SPIRV_READ_PATH");
|
||||
if (read_path) {
|
||||
char blake3_str[BLAKE3_HEX_LEN];
|
||||
_mesa_blake3_format(blake3_str, b->shader->info.source_blake3);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ _mesa_get_shader_capture_path(void)
|
|||
static const char *path = NULL;
|
||||
|
||||
if (!read_env_var) {
|
||||
path = secure_getenv("MESA_SHADER_CAPTURE_PATH");
|
||||
path = os_get_option_secure("MESA_SHADER_CAPTURE_PATH");
|
||||
read_env_var = true;
|
||||
|
||||
#if ANDROID_SHADER_CAPTURE
|
||||
|
|
@ -1989,14 +1989,14 @@ _mesa_dump_shader_source(const mesa_shader_stage stage, const char *source,
|
|||
{
|
||||
#ifndef CUSTOM_SHADER_REPLACEMENT
|
||||
static bool path_exists = true;
|
||||
char *dump_path;
|
||||
const char *dump_path;
|
||||
FILE *f;
|
||||
char blake3_str[BLAKE3_OUT_LEN * 2 + 1];
|
||||
|
||||
if (!path_exists)
|
||||
return;
|
||||
|
||||
dump_path = secure_getenv("MESA_SHADER_DUMP_PATH");
|
||||
dump_path = os_get_option_secure("MESA_SHADER_DUMP_PATH");
|
||||
if (!dump_path) {
|
||||
path_exists = false;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -927,7 +927,7 @@ disk_cache_generate_cache_dir(void *mem_ctx, const char *gpu_name,
|
|||
}
|
||||
|
||||
if (path == NULL) {
|
||||
char *xdg_cache_home = secure_getenv("XDG_CACHE_HOME");
|
||||
const char *xdg_cache_home = os_get_option_secure("XDG_CACHE_HOME");
|
||||
|
||||
if (xdg_cache_home) {
|
||||
path = concatenate_and_mkdir(mem_ctx, xdg_cache_home, cache_dir_name,
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ vk_instance_init(struct vk_instance *instance,
|
|||
instance->trace_per_submit = debug_get_bool_option("MESA_VK_TRACE_PER_SUBMIT", false);
|
||||
if (!instance->trace_per_submit) {
|
||||
instance->trace_frame = (uint32_t)debug_get_num_option("MESA_VK_TRACE_FRAME", 0xFFFFFFFF);
|
||||
instance->trace_trigger_file = secure_getenv("MESA_VK_TRACE_TRIGGER");
|
||||
instance->trace_trigger_file = os_get_option_secure("MESA_VK_TRACE_TRIGGER");
|
||||
}
|
||||
|
||||
simple_mtx_init(&instance->renderdoc_mtx, mtx_plain);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ struct vk_instance {
|
|||
uint64_t trace_mode;
|
||||
|
||||
uint32_t trace_frame;
|
||||
char *trace_trigger_file;
|
||||
const char *trace_trigger_file;
|
||||
|
||||
/** Whether the capture mode is per-submit. */
|
||||
bool trace_per_submit;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue