From 946a1b294e1e511d4bb32817d0c82828b5305113 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 6 Jul 2023 10:21:50 -0400 Subject: 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. --- source/slang/hlsl.meta.slang | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source') 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 value) { return value; } + // Normalize a vector __generic __target_intrinsic(hlsl) -- cgit v1.2.3