diff options
| author | Tobin Ehlis <tobin@lunarg.com> | 2015-09-18 14:32:12 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobin@lunarg.com> | 2015-09-18 14:32:12 -0600 |
| commit | 2fdf61c95222102c3bd12471a0b6d77648535dda (patch) | |
| tree | 226f8dbaa8079229b3194ca1caaf19ccbb24d981 | |
| parent | f9066c13e473078c3e3331717e99b3401815e5be (diff) | |
| download | usermoji-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.txt | 4 | ||||
| -rwxr-xr-x | vk-layer-generate.py | 16 |
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(' {') |
