summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-hlsl.cpp
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-10-11 13:34:03 -0700
committeryum <yum.food.vr@gmail.com>2025-10-17 18:37:45 -0700
commit482914e1b42dd44f4696b48c834136631672cebe (patch)
tree4d9ef2a7044d25d208daa07b2b1c909210492c53 /source/slang/slang-emit-hlsl.cpp
parentff064b9a0f1316007f46710432f854777a520fdf (diff)
Optionally disable entry point param cbuffer transform
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.