[lunarglass] r1099 committed - Add option to dump versions for glslang, SPIR-V, ESSL, GLSL, and GLSL....

1 view
Skip to first unread message

lunar...@googlecode.com

unread,
Aug 3, 2015, 9:08:39 PM8/3/15
to lunargla...@googlegroups.com
Revision: 1099
Author: jo...@lunarg.com
Date: Tue Aug 4 01:08:11 2015 UTC
Log: Add option to dump versions for glslang, SPIR-V, ESSL, GLSL, and
GLSL.std.450.

https://code.google.com/p/lunarglass/source/detail?r=1099

Modified:
/trunk/Standalone/main.cpp

=======================================
--- /trunk/Standalone/main.cpp Fri Jul 17 23:48:54 2015 UTC
+++ /trunk/Standalone/main.cpp Tue Aug 4 01:08:11 2015 UTC
@@ -36,6 +36,7 @@

// glslang includes
#include "glslang/Include/ShHandle.h"
+#include "glslang/Include/revision.h"
#include "glslang/Public/ShaderLang.h"
#include "SPIRV/doc.h"
#include "SPIRV/disassemble.h"
@@ -105,10 +106,10 @@
// Command-line options
//
enum CommandOptions {
- EOptionNone = 0x0000,
- EOptionIntermediate = 0x0001,
- EOptionSilent = 0x0002,
- EOptionMemoryLeakMode = 0x0004,
+ EOptionNone = 0x0000,
+ EOptionIntermediate = 0x0001,
+ EOptionSilent = 0x0002,
+ EOptionMemoryLeakMode = 0x0004,
EOptionRelaxedErrors = 0x0008,
EOptionGiveWarnings = 0x0010,
EOptionsLinkProgram = 0x0020,
@@ -256,6 +257,7 @@
" -r relaxed semantic error-checking mode\n"
" -s silent mode\n"
" -t multi-threaded: each argument is treated separately,
not linked together\n"
+ " -v print version strings\n"
" -V go through the SPIR-V intermediate language: glslang
AST -> SPIR-V -> Top IR\n"
" -w suppress warnings (except as required by
#extension : warn)\n"
" -z see developer options\n");
@@ -361,6 +363,9 @@
case 'u':
Options |= EOptionDumpIndexShader;
break;
+ case 'v':
+ Options |= EOptionDumpVersions;
+ break;
case 'w':
Options |= EOptionSuppressWarnings;
break;
@@ -874,6 +879,16 @@
if (failCode)
return failCode;

+ if (Options & EOptionDumpVersions) {
+ printf("Glslang Version: %s %s\n", GLSLANG_REVISION, GLSLANG_DATE);
+ printf("ESSL Version: %s\n", glslang::GetEsslVersionString());
+ printf("GLSL Version: %s\n", glslang::GetGlslVersionString());
+ std::string spirvVersion;
+ glslang::GetSpirvVersion(spirvVersion);
+ printf("SPIR-V Version %s\n", spirvVersion.c_str());
+ printf("GLSL.std.450 Version 99, Revision 1\n");
+ }
+
#ifdef USE_DEPRECATED_GLSLANG
int numCompilers = 0;
ShHandle compilers[EShLangCount];
Reply all
Reply to author
Forward
0 new messages