diff options
| author | Yong He <yonghe@outlook.com> | 2022-08-22 09:43:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-22 09:43:05 -0700 |
| commit | 393185196ed65a9eeaf9502edbf3dcce87337d81 (patch) | |
| tree | 91c9fa14ddb21d15e6cedf83f7aa6b649e99db86 /source/slang/slang-type-layout.cpp | |
| parent | 15055d20c143cb398bd3e269541eebf24777390a (diff) | |
Support compile-time constant int val in the form of polynomials. (#2372)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
| -rw-r--r-- | source/slang/slang-type-layout.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp index 22af19271..73ccd4726 100644 --- a/source/slang/slang-type-layout.cpp +++ b/source/slang/slang-type-layout.cpp @@ -1479,6 +1479,18 @@ static LayoutSize GetElementCount(IntVal* val) // return 0; } + else if (auto polyIntVal = as<PolynomialIntVal>(val)) + { + // TODO: We want to treat the case where the number of + // elements in an array depends on a generic parameter + // much like the case where the number of elements is + // unbounded, *but* we can't just blindly do that because + // an API might disallow unbounded arrays in various + // cases where a generic bound might work (because + // any concrete specialization will have a finite bound...) + // + return 0; + } SLANG_UNEXPECTED("unhandled integer literal kind"); UNREACHABLE_RETURN(LayoutSize(0)); } |
