diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit.cpp | 14 | ||||
| -rw-r--r-- | source/slang/slang-ir-specialize-resources.cpp | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 5ecebddad..352a27746 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -459,6 +459,20 @@ Result linkAndOptimizeIR( // pass down the target request along with the IR. // specializeResourceOutputs(compileRequest, targetRequest, irModule); + // + // After specialization of function outputs, we may find that there + // are cases where opaque-typed local variables can now be eliminated + // and turned into SSA temporaries. Such optimization may enable + // the following passes to "see" and specialize more cases. + // + // TODO: We should consider whether there are cases that will require + // iterating the passes as given here in order to achieve a fully + // specialized result. If that is the case, we might consider implementing + // a single combined pass that makes all of the relevant changes and + // iterates to convergence. + // + constructSSA(irModule); + // specializeFuncsForBufferLoadArgs(compileRequest, targetRequest, irModule); specializeResourceParameters(compileRequest, targetRequest, irModule); diff --git a/source/slang/slang-ir-specialize-resources.cpp b/source/slang/slang-ir-specialize-resources.cpp index 00357ca50..09db3391f 100644 --- a/source/slang/slang-ir-specialize-resources.cpp +++ b/source/slang/slang-ir-specialize-resources.cpp @@ -342,6 +342,9 @@ struct ResourceOutputSpecializationPass if(as<IRByteAddressBufferTypeBase>(type)) return true; + if(as<IRSamplerStateTypeBase>(type)) + return true; + // TODO: more cases here? return false; |
