[Mesa-dev] [PATCH 1/7] radv: only display options that are enabled

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Mar 14 11:27:03 UTC 2018


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_debug.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index c8794d06ea..f3b79004f6 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -598,23 +598,27 @@ radv_dump_enabled_options(struct radv_device *device, FILE *f)
 {
 	uint64_t mask;
 
-	fprintf(f, "Enabled debug options: ");
+	if (device->instance->debug_flags) {
+		fprintf(f, "Enabled debug options: ");
 
-	mask = device->instance->debug_flags;
-	while (mask) {
-		int i = u_bit_scan64(&mask);
-		fprintf(f, "%s, ", radv_get_debug_option_name(i));
+		mask = device->instance->debug_flags;
+		while (mask) {
+			int i = u_bit_scan64(&mask);
+			fprintf(f, "%s, ", radv_get_debug_option_name(i));
+		}
+		fprintf(f, "\n");
 	}
-	fprintf(f, "\n");
 
-	fprintf(f, "Enabled perftest options: ");
+	if (device->instance->perftest_flags) {
+		fprintf(f, "Enabled perftest options: ");
 
-	mask = device->instance->perftest_flags;
-	while (mask) {
-		int i = u_bit_scan64(&mask);
-		fprintf(f, "%s, ", radv_get_perftest_option_name(i));
+		mask = device->instance->perftest_flags;
+		while (mask) {
+			int i = u_bit_scan64(&mask);
+			fprintf(f, "%s, ", radv_get_perftest_option_name(i));
+		}
+		fprintf(f, "\n");
 	}
-	fprintf(f, "\n");
 }
 
 static void
-- 
2.16.2



More information about the mesa-dev mailing list