summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-type-layout.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-09-15 14:22:59 -0700
committerGitHub <noreply@github.com>2022-09-15 14:22:59 -0700
commita6032446c6bf7f64d1e201bf438a4c7605a3dbb4 (patch)
treea95267c52155e13699ff9aab38ab68353d76939e /source/slang/slang-type-layout.cpp
parent05f9aaf6a4ef246dcf89b00000a8e59e90c47662 (diff)
Language feature: pointer sized int types. (#2401)
* Language feature: pointer sized int types. * Fix. * small change to test. * Fix stdlib. * Fix. * Fix. * Add typedef for `size_t` in stdlib. * Fix test. * Add `intptr_t::size` constant. 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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index 5a32f6566..c77aadd68 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -82,11 +82,13 @@ struct DefaultLayoutRulesImpl : SimpleLayoutRulesImpl
case BaseType::Int16: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 2,2);
case BaseType::Int: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 4,4);
case BaseType::Int64: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 8,8);
+ case BaseType::IntPtr: return SimpleLayoutInfo(LayoutResourceKind::Uniform, sizeof(intptr_t), sizeof(intptr_t));
case BaseType::UInt8: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 1,1);
case BaseType::UInt16: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 2,2);
case BaseType::UInt: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 4,4);
case BaseType::UInt64: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 8,8);
+ case BaseType::UIntPtr: return SimpleLayoutInfo(LayoutResourceKind::Uniform, sizeof(intptr_t), sizeof(intptr_t));
case BaseType::Half: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 2,2);
case BaseType::Float: return SimpleLayoutInfo( LayoutResourceKind::Uniform, 4,4);