Added --vn option to generate a C header file containing a variable assigned to the hex representation of the shader. This is a standard feature on Microsoft's HLSL compiler and it allows developers to include pre-compiled shaders directly into the code. This option enables "Hex output", so it is NOT required to specify -x as well. The output file name is preserved, so no ".h" extension is added. If you want the output file to have ".h" extension then you have to specify it on the output file name. The generated header file uses the "#pragma once" pragma to avoid multiple inclusions.
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index d133b59..fb37f8f 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -163,6 +163,7 @@
 const char* entryPointName = nullptr;
 const char* sourceEntryPointName = nullptr;
 const char* shaderStageName = nullptr;
+const char* variableName = nullptr;
 
 std::array<unsigned int, EShLangCount> baseSamplerBinding;
 std::array<unsigned int, EShLangCount> baseTextureBinding;
@@ -302,7 +303,20 @@
                     } else if (lowerword == "no-storage-format" || // synonyms
                                lowerword == "nsf") {
                         Options |= EOptionNoStorageFormat;
-                    } else if (lowerword == "source-entrypoint" || // synonyms
+					}
+					else if (lowerword == "variable-name" || // synonyms
+						lowerword == "vn") {
+						Options |= EOptionOutputHexadecimal;
+						variableName = argv[1];
+						if (argc > 0) {
+							argc--;
+							argv++;
+						}
+						else
+							Error("no <C-variable-name> provided for --variable-name");
+						break;
+					}
+					else if (lowerword == "source-entrypoint" || // synonyms
                                lowerword == "sep") {
                         sourceEntryPointName = argv[1];
                         if (argc > 0) {
@@ -650,7 +664,7 @@
                     if (! (Options & EOptionMemoryLeakMode)) {
                         printf("%s", logger.getAllMessages().c_str());
                         if (Options & EOptionOutputHexadecimal) {
-                            glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage));
+							glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
                         } else {
                             glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
                         }
@@ -987,6 +1001,8 @@
            "\n"
            "  --keep-uncalled                         don't eliminate uncalled functions when linking\n"
            "  --ku                                    synonym for --keep-uncalled\n"
+		   "  --variable-name <name>                  Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.\n"
+		   "  --vn <name>                             synonym for --variable-name <name>.\n"
            );
 
     exit(EFailUsage);