File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
include/nbl/builtin/hlsl/spirv_intrinsics Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ #ifndef _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_GLSL_STD_450_INCLUDED_
2
+ #define _NBL_BUILTIN_HLSL_SPIRV_INTRINSICS_GLSL_STD_450_INCLUDED_
3
+
4
+ #ifdef __HLSL_VERSION
5
+ #include <nbl/builtin/hlsl/cpp_compat.hlsl>
6
+ #include "spirv/unified1/GLSL.std.450.h"
7
+
8
+ namespace nbl
9
+ {
10
+ namespace hlsl
11
+ {
12
+ namespace spirv
13
+ {
14
+
15
+ // Find MSB and LSB restricted to 32-bit width component types https://registry.khronos.org/SPIR-V/specs/unified1/GLSL.std.450.html
16
+
17
+ template<typename Integral NBL_FUNC_REQUIRES (is_integral_v<Integral> && (sizeof (scalar_type_t<Integral>) == 4 ))
18
+ [[vk::ext_instruction (GLSLstd450::GLSLstd450FindILsb, "GLSL.std.450" )]]
19
+ Integral findILsb (Integral value);
20
+
21
+ template<typename Integral NBL_FUNC_REQUIRES (is_integral_v<Integral> && (sizeof (scalar_type_t<Integral>) == 4 ))
22
+ [[vk::ext_instruction (GLSLstd450::GLSLstd450FindSMsb, "GLSL.std.450" )]]
23
+ Integral findSMsb (Integral value);
24
+
25
+ template<typename Integral NBL_FUNC_REQUIRES (is_integral_v<Integral> && (sizeof (scalar_type_t<Integral>) == 4 ))
26
+ [[vk::ext_instruction (GLSLstd450::GLSLstd450FindUMsb, "GLSL.std.450" )]]
27
+ Integral findUMsb (Integral value);
28
+
29
+ }
30
+ }
31
+ }
32
+
33
+ #endif
34
+ #endif
You can’t perform that action at this time.
0 commit comments