Skip to content

Commit f6725ea

Browse files
committed
Change spirv intrinsic name, add it to cpp compat
1 parent c7bdd2a commit f6725ea

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

include/nbl/builtin/hlsl/cpp_compat/intrinsics.hlsl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ inline FloatingPoint rsqrt(FloatingPoint x)
206206
#endif
207207
}
208208

209+
template<typename Integer>
210+
inline Integer bitReverse(Integer base)
211+
{
212+
#ifdef __HLSL_VERSION
213+
return spirv::bitReverse(x);
214+
#else
215+
return glm::bitfieldReverse(x);
216+
#endif
217+
}
218+
219+
209220
}
210221
}
211222

include/nbl/builtin/hlsl/spirv_intrinsics/core.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ enable_if_t<is_integral_v<Integral>, Integral> bitFieldInsert( Integral base, In
232232

233233
template<typename Integral>
234234
[[vk::ext_instruction( spv::OpBitReverse )]]
235-
enable_if_t<is_integral_v<Integral>, Integral> bitFieldReverse( Integral base );
235+
enable_if_t<is_integral_v<Integral>, Integral> bitReverse( Integral base );
236236

237237
template<typename FloatingPoint>
238238
[[vk::ext_instruction( spv::OpIsNan )]]

0 commit comments

Comments
 (0)