aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobin@lunarg.com>2015-09-18 14:32:12 -0600
committerTobin Ehlis <tobin@lunarg.com>2015-09-18 14:32:12 -0600
commit2fdf61c95222102c3bd12471a0b6d77648535dda (patch)
tree226f8dbaa8079229b3194ca1caaf19ccbb24d981
parentf9066c13e473078c3e3331717e99b3401815e5be (diff)
downloadusermoji-2fdf61c95222102c3bd12471a0b6d77648535dda.tar.xz
layers: Fix APIDump to handle "stdout" special case
Also setting example vk_layer_settings.txt file to have APIDump write to stdout.
-rw-r--r--layers/vk_layer_settings.txt4
-rwxr-xr-xvk-layer-generate.py16
2 files changed, 13 insertions, 7 deletions
diff --git a/layers/vk_layer_settings.txt b/layers/vk_layer_settings.txt
index 863371bb..7251ff9e 100644
--- a/layers/vk_layer_settings.txt
+++ b/layers/vk_layer_settings.txt
@@ -79,8 +79,8 @@ ThreadingLogFilename = stdout
APIDumpDetailed = TRUE
# NoAddr TRUE causes "address" to be dumped in place of hex addresses
APIDumpNoAddr = FALSE
-# File = TRUE indicates that output should be written to file
-APIDumpFile = TRUE
+# File = TRUE indicates that output should be written to file instead of STDOUT
+APIDumpFile = FALSE
# LogFilename is file to dump to when "File = TRUE" default is "vk_apidump.txt"
APIDumpLogFilename = stdout
# Flush = TRUE causes IO to be flushed after each line that's written
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index 26873d45..0d020b92 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -732,13 +732,19 @@ class APIDumpSubcommand(Subcommand):
header_txt.append('{')
header_txt.append(' if(writeToFile)')
header_txt.append(' {')
- header_txt.append(' fileStream.open(fileName);')
- header_txt.append(' if ((fileStream.rdstate() & fileStream.failbit) != 0) {')
+ header_txt.append(' if (fileName == "stdout")')
+ header_txt.append(' {')
header_txt.append(' outputStream = &std::cout;')
- header_txt.append(' (*outputStream) << endl << "APIDump ERROR: Bad output filename specified: " << fileName << ". Writing to STDOUT instead" << endl << endl;')
+ header_txt.append(' (*outputStream) << endl << "APIDump output filename \'stdout\' specified. Writing to STDOUT instead of a file." << endl << endl;')
+ header_txt.append(' } else {')
+ header_txt.append(' fileStream.open(fileName);')
+ header_txt.append(' if ((fileStream.rdstate() & fileStream.failbit) != 0) {')
+ header_txt.append(' outputStream = &std::cout;')
+ header_txt.append(' (*outputStream) << endl << "APIDump ERROR: Bad output filename specified: " << fileName << ". Writing to STDOUT instead" << endl << endl;')
+ header_txt.append(' }')
+ header_txt.append(' else')
+ header_txt.append(' outputStream = &fileStream;')
header_txt.append(' }')
- header_txt.append(' else')
- header_txt.append(' outputStream = &fileStream;')
header_txt.append(' }')
header_txt.append(' else')
header_txt.append(' {')