diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-10 11:45:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 11:45:36 -0700 |
| commit | b5cdd8322bd51603c217dfb7662306628b144c78 (patch) | |
| tree | 0c57a636e10bd39408ea74e0caa68d9c30d6e43b /source | |
| parent | 6857dd57549f01daa025f45221a693259e474958 (diff) | |
Support all integer typed indices in StructuredBuffer Load/Store/[]. (#4311)
* Support all integer typed indices in StructuredBuffer Load/Store/[].
* Fix tests.
---------
Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index f9831bef2..e215fd93b 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -3655,13 +3655,14 @@ struct StructuredBuffer __intrinsic_op($(kIROp_StructuredBufferLoad)) [__readNone] [require(cpp_cuda_glsl_hlsl_spirv, structuredbuffer)] - T Load(int location); + T Load<TIndex : __BuiltinIntegerType>(TIndex location); __intrinsic_op($(kIROp_StructuredBufferLoadStatus)) [require(cpp_cuda_glsl_hlsl_spirv, structuredbuffer)] - T Load(int location, out uint status); + T Load<TIndex : __BuiltinIntegerType>(TIndex location, out uint status); - __subscript(uint index) -> T + __generic<TIndex : __BuiltinIntegerType> + __subscript(TIndex index) -> T { [__readNone] __intrinsic_op($(kIROp_StructuredBufferLoad)) @@ -4940,13 +4941,14 @@ struct $(item.name) [__NoSideEffect] __intrinsic_op($(kIROp_RWStructuredBufferLoad)) - T Load(int location); + T Load<TIndex : __BuiltinIntegerType>(TIndex location); [__NoSideEffect] __intrinsic_op($(kIROp_RWStructuredBufferLoadStatus)) - T Load(int location, out uint status); + T Load<TIndex : __BuiltinIntegerType>(TIndex location, out uint status); - __subscript(uint index) -> T + __generic<TIndex : __BuiltinIntegerType> + __subscript(TIndex index) -> T { [__NoSideEffect] __intrinsic_op($(kIROp_RWStructuredBufferGetElementPtr)) |
