Add a versioning system and tie it to the -v command-line option. System is described in glslang/Include/revision.template.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24314 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-12-04 04:43:40 +00:00
parent 44222f90af
commit 319de233dc
5 changed files with 65 additions and 18 deletions

View File

@@ -63,6 +63,7 @@ enum TOptions {
EOptionDumpConfig = 0x080,
EOptionDumpReflection = 0x100,
EOptionSuppressWarnings = 0x200,
EOptionDumpVersions = 0x400,
};
//
@@ -486,6 +487,9 @@ bool ProcessArguments(int argc, char* argv[])
Options |= EOptionMultiThreaded;
#endif
break;
case 'v':
Options |= EOptionDumpVersions;
break;
case 'w':
Options |= EOptionSuppressWarnings;
break;
@@ -552,9 +556,6 @@ void CompileAndLinkShaders()
// keep track of what to free
std::list<glslang::TShader*> shaders;
//printf("%s\n", glslang::GetEsslVersionString());
//printf("%s\n", glslang::GetGlslVersionString());
EShMessages messages = EShMsgDefault;
SetMessageOptions(messages);
@@ -632,6 +633,13 @@ int C_DECL main(int argc, char* argv[])
return ESuccess;
}
if (Options & EOptionDumpVersions) {
printf("ESSL Version: %s\n", glslang::GetEsslVersionString());
printf("GLSL Version: %s\n", glslang::GetGlslVersionString());
if (Worklist.empty())
return ESuccess;
}
if (Worklist.empty()) {
usage();
return EFailUsage;
@@ -783,27 +791,32 @@ void CompileFile(const char *fileName, ShHandle compiler)
//
void usage()
{
printf("Usage: glslangValidator [ options ] filename\n"
"Where: filename is a name ending in\n"
" .conf provides an optional config file that replaces the default configuration\n"
printf("Usage: glslangValidator [option]... [file]...\n"
"\n"
"Where: each 'file' ends in\n"
" .conf to provide an optional config file that replaces the default configuration\n"
" (see -c option below for generating a template)\n"
" .vert for a vertex shader\n"
" .tesc for a tessellation control shader\n"
" .tese for a tessellation evaluation shader\n"
" .geom for a geometry shader\n"
" .frag for a fragment shader\n"
" .comp for a compute shader\n\n"
" .comp for a compute shader\n"
"\n"
"Compilation warnings and errors will be printed to stdout.\n"
"\n"
"To get other information, use one of the following options:\n"
"-c: configuration dump; use to create default configuration file (redirect to a .conf file)\n"
"-i: intermediate tree (glslang AST) is printed out\n"
"-l: link validation of all input files\n"
"-m: memory leak mode\n"
"-q: dump reflection query database\n"
"-r: relaxed semantic error-checking mode\n"
"-s: silent mode\n"
"-t: multi-threaded mode\n"
"-w: suppress warnings (except as required by #extension : warn)\n"
"(Each option must be specified separately, but can go anywhere in the command line.)\n"
" -c configuration dump; use to create default configuration file (redirect to a .conf file)\n"
" -i intermediate tree (glslang AST) is printed out\n"
" -l link validation of all input files\n"
" -m memory leak mode\n"
" -q dump reflection query database\n"
" -r relaxed semantic error-checking mode\n"
" -s silent mode\n"
" -t multi-threaded mode\n"
" -v print version strings\n"
" -w suppress warnings (except as required by #extension : warn)\n"
);
}