radv: print warnings for famous RADV_PERFTEST options that no longer exist
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jun 2020 10:12:18 +0000 (12:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 4 Aug 2020 17:09:57 +0000 (19:09 +0200)
RADV_PERFTEST=aco no longer exists, ACO is the default compiler.
RADV_PERFTEST=llvm is deprecated, use RADV_DEBUG=llvm instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5662>

src/amd/vulkan/radv_device.c

index a237a1a19bb64897f8b7f0bf2f061fd7fb6cbeb1..c52fbad8f68c3d744d9500c704f41f014b6a0910 100644 (file)
@@ -667,8 +667,26 @@ VkResult radv_CreateInstance(
        instance->debug_flags = parse_debug_string(getenv("RADV_DEBUG"),
                                                   radv_debug_options);
 
-       instance->perftest_flags = parse_debug_string(getenv("RADV_PERFTEST"),
-                                                  radv_perftest_options);
+       const char *radv_perftest_str = getenv("RADV_PERFTEST");
+       instance->perftest_flags = parse_debug_string(radv_perftest_str,
+                                                     radv_perftest_options);
+
+       if (radv_perftest_str) {
+               /* Output warnings for famous RADV_PERFTEST options that no
+                * longer exist or are deprecated.
+                */
+               if (strstr(radv_perftest_str, "aco")) {
+                       fprintf(stderr, "*******************************************************************************\n");
+                       fprintf(stderr, "* WARNING: Unknown option RADV_PERFTEST='aco'. ACO is enabled by default now. *\n");
+                       fprintf(stderr, "*******************************************************************************\n");
+               }
+               if (strstr(radv_perftest_str, "llvm")) {
+                       fprintf(stderr, "*********************************************************************************\n");
+                       fprintf(stderr, "* WARNING: Unknown option 'RADV_PERFTEST=llvm'. Did you mean 'RADV_DEBUG=llvm'? *\n");
+                       fprintf(stderr, "*********************************************************************************\n");
+                       abort();
+               }
+       }
 
        if (instance->debug_flags & RADV_DEBUG_STARTUP)
                radv_logi("Created an instance");