diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index f427179b..1313c879 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -781,8 +781,12 @@ void CompileAndLinkShaderUnits(std::vector compUnits) shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count); if (entryPointName) // HLSL todo: this needs to be tracked per compUnits shader->setEntryPoint(entryPointName); - if (sourceEntryPointName) + if (sourceEntryPointName) { + if (entryPointName == nullptr) + printf("Warning: Changing source entry point name without setting an entry-point name.\n" + "Use '-e '.\n"); shader->setSourceEntryPoint(sourceEntryPointName); + } if (UserPreamble.isSet()) shader->setPreamble(UserPreamble.get()); shader->addProcesses(Processes); diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index fb6d0bc2..2a054c1c 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -152,7 +152,7 @@ public: { // Replace the entry point name given in the shader with the real entry point name, // if there is a substitution. - if (name != nullptr && *name == sourceEntryPointName) + if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0) name = NewPoolTString(intermediate.getEntryPointName().c_str()); }