Skip to content

Commit 4cbd415

Browse files
committed
Adds bitfieldInsert
1 parent 50bab4c commit 4cbd415

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

3rdparty/dxc/dxc

Submodule dxc updated 257 files

include/nbl/builtin/hlsl/glsl_compat/core.hlsl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,27 @@ T bitfieldExtract( T val, uint32_t offsetBits, uint32_t numBits )
192192
return impl::bitfieldExtract<T, is_signed<T>::value, is_integral<T>::value>::template __call(val,offsetBits,numBits);
193193
}
194194

195+
196+
namespace impl
197+
{
198+
199+
template<typename T>
200+
struct bitfieldInsert
201+
{
202+
enable_if_t<is_integral_v<T>, T> __call( T base, T insert, uint32_t offset, uint32_t count )
203+
{
204+
return spirv::bitFieldInsert<T>( base, insert, offset, count );
205+
}
206+
};
207+
208+
} //namespace impl
209+
210+
template<typename T>
211+
T bitfieldInsert( T base, T insert, uint32_t offset, uint32_t count )
212+
{
213+
return impl::bitfieldInsert<T>::template __call(base, insert, offset, count);
214+
}
215+
195216
#endif
196217

197218
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ template<typename Signed>
218218
[[vk::ext_instruction( spv::OpBitFieldSExtract )]]
219219
enable_if_t<is_signed_v<Signed>, Signed> bitFieldSExtract( Signed val, uint32_t offsetBits, uint32_t numBits );
220220

221+
template<typename Integral>
222+
[[vk::ext_instruction( spv::OpBitFieldInsert )]]
223+
Integral bitFieldInsert( Integral base, Integral insert, uint32_t offset, uint32_t count );
224+
221225
}
222226

223227
#endif

0 commit comments

Comments
 (0)