allow renaming of shader entry point when creating SPIR-V
Use "--source-entrypoint name" on the command line, or the
TShader::setSourceEntryPoint(char*) API.
When the name given to the above interfaces is detected in the
shader source, it will be renamed to the entry point name supplied
to the -e option or the TShader::setEntryPoint() method.
diff --git a/hlsl/hlslParseHelper.h b/hlsl/hlslParseHelper.h
index 246c7c4..f9cb0d3 100755
--- a/hlsl/hlslParseHelper.h
+++ b/hlsl/hlslParseHelper.h
@@ -47,6 +47,7 @@
public:
HlslParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins,
int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&,
+ const TString sourceEntryPointName,
bool forwardCompatible = false, EShMessages messages = EShMsgDefault);
virtual ~HlslParseContext();
void initializeExtensionBehavior();
@@ -165,6 +166,9 @@
bool handleOutputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry);
bool handleInputGeometry(const TSourceLoc&, const TLayoutGeometry& geometry);
+ // Potentially rename shader entry point function
+ void renameShaderFunction(TString*& name) const;
+
protected:
void inheritGlobalDefaults(TQualifier& dst) const;
TVariable* makeInternalVariable(const char* name, const TType&) const;
@@ -251,6 +255,8 @@
TMap<int, TVector<TVariable*>> flattenMap;
unsigned int nextInLocation;
unsigned int nextOutLocation;
+
+ TString sourceEntryPointName;
};
} // end namespace glslang