radv: introduce RADV_DEBUG=llvm option
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 12 Jun 2020 16:55:00 +0000 (17:55 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 25 Jun 2020 13:16:23 +0000 (15:16 +0200)
This option enables the LLVM compiler backend to be used
for shader compilation

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5445>

docs/envvars.rst
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c

index 5c9e851da8be596bc114fd2d810780bace063ca0..bebc1e1a48dbd82e56b474671d49a69bd9d95400 100644 (file)
@@ -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``
index 63605035815615b37fba316ebc446cb0c3b4d08a..2935f6a79a7194fe33a174880f81cce28fd9a6bf 100644 (file)
@@ -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 {
index 534fd5fd47a02c6e43933204d6a710788d79f171..88f21692235af29465aefc34978ed469a8024c43 100644 (file)
@@ -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");