summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-hlsl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-hlsl.cpp')
-rw-r--r--source/slang/slang-emit-hlsl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp
index a5d634ebf..60769b0bd 100644
--- a/source/slang/slang-emit-hlsl.cpp
+++ b/source/slang/slang-emit-hlsl.cpp
@@ -442,6 +442,11 @@ void HLSLSourceEmitter::emitEntryPointAttributesImpl(
{
if (profile.getVersion() >= ProfileVersion::DX_6_1)
{
+ if (m_codeGenContext->getTargetProgram()->getOptionSet().getBoolOption(
+ CompilerOptionName::PlainFunctionEntryPoints))
+ {
+ return;
+ }
char const* stageName = getStageName(stage);
if (stageName)
{
@@ -787,6 +792,13 @@ bool HLSLSourceEmitter::tryEmitInstStmtImpl(IRInst* inst)
static bool isTargetHLSL2018(HLSLSourceEmitter* emitter, CapabilitySet targetCaps, Stage stage)
{
+ if (stage == Stage::Unknown &&
+ emitter->getTargetProgram()->getOptionSet().getBoolOption(
+ CompilerOptionName::PlainFunctionEntryPoints))
+ {
+ return false;
+ }
+
auto stageAtom = getAtomFromStage(stage);
// Cache the result of this function for easier lookup.