#include "Worklist.h"
#include "./../glslang/Include/ShHandle.h"
+#include "./../glslang/Include/revision.h"
#include "./../glslang/Public/ShaderLang.h"
#include "../SPIRV/GlslangToSpv.h"
#include "../SPIRV/GLSL450Lib.h"
return ESuccess;
}
- if (Options & EOptionDumpVersions) {
+ 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()); // TODO: move to consume source-generated data
+ printf("SPIR-V Version %s\n", spirvVersion.c_str());
if (Worklist.empty())
return ESuccess;
}
-// The file revision.h should be updated to the latest version, somehow, on
-// check-in, if glslang has changed.
-//
-// revision.template is the source for revision.h when using SubWCRev as the
-// method of updating revision.h. You don't have to do it this way, the
-// requirement is only that revision.h gets updated.
-//
-// revision.h is under source control so that not all consumers of glslang
-// source have to figure out how to create revision.h just to get a build
-// going. However, if it is not updated, it can be a version behind.
+// This header is generated by the make-revision script.
+// For the version, it uses the latest git tag followed by the number of commits.
+// For the date, it uses the current date (when then script is run).
-#define GLSLANG_REVISION "25512"
-#define GLSLANG_DATE "2014/02/24 14:36:08"
+#define GLSLANG_REVISION "2.1.686"
+#define GLSLANG_DATE "02-Aug-2015"
--- /dev/null
+#!/bin/sh
+
+echo "// This header is generated by the make-revision script."
+echo "// For the version, it uses the latest git tag followed by the number of commits."
+echo "// For the date, it uses the current date (when then script is run)."
+
+echo
+echo \#define GLSLANG_REVISION \"`git describe --tags --abbrev=0`.`git log --oneline | wc -l`\"
+echo \#define GLSLANG_DATE \"`date +%d-%b-%Y`\"