From b78f64507e9edf315208147811479146947270fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 12 Jun 2020 17:55:00 +0100 Subject: [PATCH] radv: introduce RADV_DEBUG=llvm option This option enables the LLVM compiler backend to be used for shader compilation Reviewed-by: Samuel Pitoiset Part-of: --- docs/envvars.rst | 2 ++ src/amd/vulkan/radv_debug.h | 1 + src/amd/vulkan/radv_device.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/docs/envvars.rst b/docs/envvars.rst index 5c9e851da8b..bebc1e1a48d 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -510,6 +510,8 @@ RADV driver environment variables ``RADV_DEBUG`` a comma-separated list of named flags, which do various things: + ``llvm`` + enable LLVM compiler backend ``allbos`` force all allocated buffers to be referenced in submissions ``allentrypoints`` diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h index 63605035815..2935f6a79a7 100644 --- a/src/amd/vulkan/radv_debug.h +++ b/src/amd/vulkan/radv_debug.h @@ -57,6 +57,7 @@ enum { RADV_DEBUG_DUMP_META_SHADERS = 0x4000000, RADV_DEBUG_NO_MEMORY_CACHE = 0x8000000, RADV_DEBUG_DISCARD_TO_DEMOTE = 0x10000000, + RADV_DEBUG_LLVM = 0x20000000, }; enum { diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 534fd5fd47a..88f21692235 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -507,6 +507,7 @@ static const struct debug_control radv_debug_options[] = { {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS}, {"metashaders", RADV_DEBUG_DUMP_META_SHADERS}, {"nomemorycache", RADV_DEBUG_NO_MEMORY_CACHE}, + {"llvm", RADV_DEBUG_LLVM}, {NULL, 0} }; @@ -677,6 +678,10 @@ VkResult radv_CreateInstance( instance->perftest_flags = parse_debug_string(getenv("RADV_PERFTEST"), radv_perftest_options); + if (instance->debug_flags & RADV_DEBUG_LLVM) { + instance->perftest_flags &= ~RADV_PERFTEST_ACO; + } + if (instance->perftest_flags & RADV_PERFTEST_ACO) fprintf(stderr, "WARNING: Experimental compiler backend enabled. Here be dragons! Incorrect rendering, GPU hangs and/or resets are likely\n"); -- 2.30.2