summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-01-17 11:57:06 -0500
committerGitHub <noreply@github.com>2025-01-17 08:57:06 -0800
commit91430870a8a6ec2825969823b892a9c8a0d588ab (patch)
treefc78378a51cc1456729d61c0f8e7c9dbd8d6690d /source
parente743c17f72ab332f7eb467f02dd9567f3f8d3de0 (diff)
hoist entry point params for wgsl (#6116)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-legalize-varying-params.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/source/slang/slang-ir-legalize-varying-params.cpp b/source/slang/slang-ir-legalize-varying-params.cpp
index 9720084ba..3b65ee59a 100644
--- a/source/slang/slang-ir-legalize-varying-params.cpp
+++ b/source/slang/slang-ir-legalize-varying-params.cpp
@@ -1574,8 +1574,8 @@ public:
}
protected:
- LegalizeShaderEntryPointContext(IRModule* module, DiagnosticSink* sink, bool hoistParameters)
- : m_module(module), m_sink(sink), hoistParameters(hoistParameters)
+ LegalizeShaderEntryPointContext(IRModule* module, DiagnosticSink* sink)
+ : m_module(module), m_sink(sink)
{
}
@@ -1758,7 +1758,6 @@ protected:
}
private:
- const bool hoistParameters;
HashSet<IRStructField*> semanticInfoToRemove;
void removeSemanticLayoutsFromLegalizedStructs()
@@ -2985,16 +2984,9 @@ private:
// If the entrypoint is receiving varying inputs as a pointer, turn it into a value.
depointerizeInputParams(entryPoint.entryPointFunc);
- // TODO FIXME: Enable these for WGSL and remove the `hoistParemeters` member field.
- // WGSL entry point legalization currently only applies attributes to struct parameters,
- // apply the same hoisting from Metal to WGSL to fix it.
- if (hoistParameters)
- {
- hoistEntryPointParameterFromStruct(entryPoint);
- packStageInParameters(entryPoint);
- }
-
// Input Parameter Legalize
+ hoistEntryPointParameterFromStruct(entryPoint);
+ packStageInParameters(entryPoint);
flattenInputParameters(entryPoint);
// System Value Legalize
@@ -3023,7 +3015,7 @@ class LegalizeMetalEntryPointContext : public LegalizeShaderEntryPointContext
{
public:
LegalizeMetalEntryPointContext(IRModule* module, DiagnosticSink* sink)
- : LegalizeShaderEntryPointContext(module, sink, true)
+ : LegalizeShaderEntryPointContext(module, sink)
{
generatePermittedTypes_sv_target();
}
@@ -3681,7 +3673,7 @@ class LegalizeWGSLEntryPointContext : public LegalizeShaderEntryPointContext
{
public:
LegalizeWGSLEntryPointContext(IRModule* module, DiagnosticSink* sink)
- : LegalizeShaderEntryPointContext(module, sink, false)
+ : LegalizeShaderEntryPointContext(module, sink)
{
}