diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-07-06 10:21:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-06 10:21:50 -0400 |
| commit | 946a1b294e1e511d4bb32817d0c82828b5305113 (patch) | |
| tree | 207cc9ce818b40fe4e3c39cff5cdcc4e854238a7 /source | |
| parent | b9ac4ace1133b12161faa70e61139cbdfc55db83 (diff) | |
Work around for NonUniformResourceIndex with non integral types. (#2963)
* Work around for NonUniformResourceIndex with non integral types.
* Make the non integral NonUniformResourceIndex, inline early.
* Add a depreciated warning.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 89a34588c..05fcee323 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -3202,6 +3202,13 @@ int NonUniformResourceIndex(int index) return index; } +/// HLSL allows NonUniformResourceIndex around non int/uint types. +/// It's effect is presumably to ignore it, which the following implementation does. +/// We should also look to add a warning for this scenario. +[__unsafeForceInlineEarly] +[deprecated("NonUniformResourceIndex on a type other than uint/int is depreciated and has no effect")] +T NonUniformResourceIndex<T>(T value) { return value; } + // Normalize a vector __generic<T : __BuiltinFloatingPointType, let N : int> __target_intrinsic(hlsl) |
