diff --git a/BIL/CMakeLists.txt b/BIL/CMakeLists.txt index 676a83ccb76d60540e31c420b7a156aa31277202..8f01ddf2591a633a2dfa7612d266104575768167 100644 --- a/BIL/CMakeLists.txt +++ b/BIL/CMakeLists.txt @@ -9,6 +9,7 @@ set(SOURCES BilDoc.cpp) set(HEADERS + Bil.h GlslangToBil.h BilBuilder.h Bir.h diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index c2d1247cabea44a8431fb9044c1ea5285099e0fa..3ee056fdeeac4f357c978ac1a09819f78af29fcb 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -42,6 +42,7 @@ #include "./../glslang/Public/ShaderLang.h" #include "../BIL/GlslangToBil.h" #include "../BIL/BilDisassemble.h" +#include "../BIL/BilDoc.h" #include <string.h> #include <stdlib.h> #include <math.h> @@ -498,6 +499,11 @@ bool ProcessArguments(int argc, char* argv[]) case 'm': Options |= EOptionMemoryLeakMode; break; + case 'p': + glbil::Parameterize(); + glbil::PrintDoc(); + exit(0); + break; case 'q': Options |= EOptionDumpReflection; break; @@ -638,6 +644,7 @@ void CompileAndLinkShaders() if (CompileFailed || LinkFailed) printf("Bil is not generated for failed compile or link\n"); else { + glbil::Parameterize(); for (int stage = 0; stage < EShLangCount; ++stage) { if (program.getIntermediate((EShLanguage)stage)) { std::vector<unsigned int> bil; @@ -854,11 +861,13 @@ void usage() "\n" "To get other information, use one of the following options:\n" "(Each option must be specified separately, but can go anywhere in the command line.)\n" + " -b create BIL in file <stage>.bil and print out disassembly\n" " -c configuration dump; use to create default configuration file (redirect to a .conf file)\n" " -d default to desktop (#version 110) when there is no version in the shader (default is ES version 100)\n" " -i intermediate tree (glslang AST) is printed out\n" " -l link validation of all input files\n" " -m memory leak mode\n" + " -p print BIL documentation\n" " -q dump reflection query database\n" " -r relaxed semantic error-checking mode\n" " -s silent mode\n" diff --git a/Test/makeDoc b/Test/makeDoc new file mode 100644 index 0000000000000000000000000000000000000000..c9d598ec4188a4131fb1632abbd6ed31dfe3bc65 --- /dev/null +++ b/Test/makeDoc @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +./glslangValidator -p > instDesc +asciidoc --backend=html5 instDesc