diff options
| author | Yong He <yonghe@outlook.com> | 2025-01-07 22:26:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-07 22:26:31 -0800 |
| commit | c43f6fa55aca23365c86c6ec1737d42be74d9d3e (patch) | |
| tree | 2c49bc1dbd12ae5f46d682a3f240465931471060 /source/slang/slang-emit.cpp | |
| parent | 1a56f58fdd0c704e6dc0fad0f0ec33a25a35e60b (diff) | |
Lower varying parameters as pointers instead of SSA values. (#5919)
* Add executable test on matrix-typed vertex input.
* Fix emit logic of matrix layout qualifier.
* Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly.
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 7ea2fef88..b9217de41 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -42,6 +42,7 @@ #include "slang-ir-entry-point-uniforms.h" #include "slang-ir-explicit-global-context.h" #include "slang-ir-explicit-global-init.h" +#include "slang-ir-fix-entrypoint-callsite.h" #include "slang-ir-fuse-satcoop.h" #include "slang-ir-glsl-legalize.h" #include "slang-ir-glsl-liveness.h" @@ -76,6 +77,7 @@ #include "slang-ir-pytorch-cpp-binding.h" #include "slang-ir-redundancy-removal.h" #include "slang-ir-resolve-texture-format.h" +#include "slang-ir-resolve-varying-input-ref.h" #include "slang-ir-restructure-scoping.h" #include "slang-ir-restructure.h" #include "slang-ir-sccp.h" @@ -314,6 +316,7 @@ struct RequiredLoweringPassSet bool glslSSBO; bool byteAddressBuffer; bool dynamicResource; + bool resolveVaryingInputRef; }; // Scan the IR module and determine which lowering/legalization passes are needed based @@ -423,6 +426,9 @@ void calcRequiredLoweringPassSet( case kIROp_DynamicResourceType: result.dynamicResource = true; break; + case kIROp_ResolveVaryingInputRef: + result.resolveVaryingInputRef = true; + break; } if (!result.generics || !result.existentialTypeLayout) { @@ -591,6 +597,11 @@ Result linkAndOptimizeIR( if (requiredLoweringPassSet.glslGlobalVar) translateGLSLGlobalVar(codeGenContext, irModule); + if (requiredLoweringPassSet.resolveVaryingInputRef) + resolveVaryingInputRef(irModule); + + fixEntryPointCallsites(irModule); + // Replace any global constants with their values. // replaceGlobalConstants(irModule); |
