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.
This commit is contained in:
parent
8ce6e2ba49
commit
f1e0c87127
9 changed files with 199 additions and 10 deletions
|
|
@ -308,8 +308,13 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node)
|
|||
// identifier
|
||||
HlslToken idToken;
|
||||
while (acceptIdentifier(idToken)) {
|
||||
TString* fnName = idToken.string;
|
||||
|
||||
// Potentially rename shader entry point function. No-op most of the time.
|
||||
parseContext.renameShaderFunction(fnName);
|
||||
|
||||
// function_parameters
|
||||
TFunction& function = *new TFunction(idToken.string, declaredType);
|
||||
TFunction& function = *new TFunction(fnName, declaredType);
|
||||
if (acceptFunctionParameters(function)) {
|
||||
// post_decls
|
||||
acceptPostDecls(function.getWritableType().getQualifier());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue