diff options
| author | Yong He <yonghe@outlook.com> | 2024-07-26 19:42:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-26 19:42:15 -0700 |
| commit | 7e2bc8e06f61d554bae9bbebc1db0302eb3f1d8a (patch) | |
| tree | 0f10e4a45cb81af2908da61743a4518de27748e2 /source/slang/slang-emit.cpp | |
| parent | c0bff66541302309ff4833e8d4ae2eba1561498a (diff) | |
Allow passing sized array to unsized array parameter. (#4744)
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 03d1b932c..8f7b5f66f 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -947,13 +947,13 @@ Result linkAndOptimizeIR( specializeResourceUsage(codeGenContext, irModule); specializeFuncsForBufferLoadArgs(codeGenContext, irModule); - // For GLSL targets, we also want to specialize calls to functions that - // takes array parameters if possible, to avoid performance issues on - // those platforms. - if (isKhronosTarget(targetRequest)) - { - specializeArrayParameters(codeGenContext, irModule); - } + // We also want to specialize calls to functions that + // takes unsized array parameters if possible. + // Moreover, for Khronos targets, we also want to specialize calls to functions + // that takes arrays/structs containing arrays as parameters with the actual + // global array object to avoid loading big arrays into SSA registers, which seems + // to cause performance issues. + specializeArrayParameters(codeGenContext, irModule); #if 0 dumpIRIfEnabled(codeGenContext, irModule, "AFTER RESOURCE SPECIALIZATION"); |
