Web: Change a bunch of HLSL methods from dynamic to compile-time known.

This saves about 7K.
By changing just a few methods to be compile-time known, a bunch of
scattered code becomes DCE.
This commit is contained in:
John Kessenich 2019-07-27 08:18:03 -06:00
parent d4ed5158d1
commit bfc21ff1a9
9 changed files with 55 additions and 26 deletions

View file

@ -235,7 +235,11 @@ class TIntermediate {
public:
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
implicitThisName("@this"), implicitCounterName("@count"),
language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0),
language(l),
#ifdef ENABLE_HLSL
source(EShSourceNone),
#endif
profile(p), version(v), treeRoot(0),
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet),
inputPrimitive(ElgNone), outputPrimitive(ElgNone),
@ -285,8 +289,13 @@ public:
void output(TInfoSink&, bool tree);
void removeTree();
#ifdef ENABLE_HLSL
void setSource(EShSource s) { source = s; }
EShSource getSource() const { return source; }
#else
void setSource(EShSource s) { assert(s == EShSourceGlsl); }
EShSource getSource() const { return EShSourceGlsl; }
#endif
void setEntryPointName(const char* ep)
{
entryPointName = ep;
@ -842,7 +851,9 @@ protected:
static const char* getResourceName(TResourceType);
const EShLanguage language; // stage, known at construction time
#ifdef ENABLE_HLSL
EShSource source; // source language, known a bit later
#endif
std::string entryPointName;
std::string entryPointMangledName;
typedef std::list<TCall> TGraph;