Commit 2aa7f3a6 by John Kessenich

SPV compression: Remove file/path manipulation stuff, setting up for that to be…

SPV compression: Remove file/path manipulation stuff, setting up for that to be a separate tool. Added copyright messages as well. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31201 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent ccc7acc9
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "../SPIRV/GLSL450Lib.h" #include "../SPIRV/GLSL450Lib.h"
#include "../SPIRV/doc.h" #include "../SPIRV/doc.h"
#include "../SPIRV/disassemble.h" #include "../SPIRV/disassemble.h"
#include "../SPIRV/SPVRemapper.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
...@@ -72,8 +71,6 @@ enum TOptions { ...@@ -72,8 +71,6 @@ enum TOptions {
EOptionSpv = 0x0800, EOptionSpv = 0x0800,
EOptionHumanReadableSpv = 0x1000, EOptionHumanReadableSpv = 0x1000,
EOptionDefaultDesktop = 0x2000, EOptionDefaultDesktop = 0x2000,
EOptionCanonicalizeSpv = 0x4000,
EOptionStripSpv = 0x8000,
}; };
// //
...@@ -484,17 +481,11 @@ bool ProcessArguments(int argc, char* argv[]) ...@@ -484,17 +481,11 @@ bool ProcessArguments(int argc, char* argv[])
for (; argc >= 1; argc--, argv++) { for (; argc >= 1; argc--, argv++) {
Work[argc] = 0; Work[argc] = 0;
if (argv[0][0] == '-') { if (argv[0][0] == '-') {
const char optLetter = argv[0][1]; switch (argv[0][1]) {
case 'H':
switch (optLetter) { Options |= EOptionHumanReadableSpv;
case 'S': // fall through to -V // fall through to -V
case 'C': // fall through to -V
case 'H': // fall through to -V
case 'V': case 'V':
if (optLetter == 'H') Options |= EOptionHumanReadableSpv;
if (optLetter == 'S') Options |= EOptionStripSpv;
if (optLetter == 'C') Options |= EOptionCanonicalizeSpv;
Options |= EOptionSpv; Options |= EOptionSpv;
Options |= EOptionLinkProgram; Options |= EOptionLinkProgram;
break; break;
...@@ -669,17 +660,7 @@ void CompileAndLinkShaders() ...@@ -669,17 +660,7 @@ void CompileAndLinkShaders()
case EShLangCompute: name = "comp"; break; case EShLangCompute: name = "comp"; break;
default: name = "unknown"; break; default: name = "unknown"; break;
} }
if (Options & (EOptionCanonicalizeSpv | EOptionStripSpv)) {
const unsigned int remapOpts =
((Options & EOptionCanonicalizeSpv) ? (spv::spirvbin_t::ALL_BUT_STRIP) : 0) |
((Options & EOptionStripSpv) ? (spv::spirvbin_t::STRIP) : 0);
spv::Parameterize();
spv::spirvbin_t().remap(spirv, remapOpts);
}
glslang::OutputSpv(spirv, name); glslang::OutputSpv(spirv, name);
if (Options & EOptionHumanReadableSpv) { if (Options & EOptionHumanReadableSpv) {
spv::Parameterize(); spv::Parameterize();
GLSL_STD_450::GetDebugNames(GlslStd450DebugNames); GLSL_STD_450::GetDebugNames(GlslStd450DebugNames);
...@@ -886,8 +867,6 @@ void usage() ...@@ -886,8 +867,6 @@ void usage()
"To get other information, use one of the following options:\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" "(Each option must be specified separately, but can go anywhere in the command line.)\n"
" -V create SPIR-V in file <stage>.spv\n" " -V create SPIR-V in file <stage>.spv\n"
" -C canonicalize generated SPIR-V: turns on -V\n"
" -S debug-strip SPIR-V: turns on -V\n"
" -H print human readable form of SPIR-V; turns on -V\n" " -H print human readable form of SPIR-V; turns on -V\n"
" -c configuration dump; use to create default configuration file (redirect to a .conf file)\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" " -d default to desktop (#version 110) when there is no version in the shader (default is ES version 100)\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment