浏览代码

Add the BitFieldInsert() intrinsic

/feature-ReflectionProbeFit
Evgenii Golubev 7 年前
当前提交
fbfbcd6c
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 2
      ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl
  2. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl

2
ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl


#define BitFieldExtract __v_bfe_u32
#define INTRINSIC_BITFIELD_EXTRACT_SIGN_EXTEND
#define BitFieldExtractSignExtend __v_bfe_i32
#define INTRINSIC_BITFIELD_INSERT
#define BitFieldInsert __v_bfi_b32
#define INTRINSIC_WAVEREADFIRSTLANE
#define WaveReadFirstLane ReadFirstLane
#define INTRINSIC_MAD24

8
ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl


}
#endif // INTRINSIC_BITFIELD_EXTRACT_SIGN_EXTEND
#ifdef INTRINSIC_BITFIELD_INSERT
// Inserts the bits indicated by 'mask' from 'src' into 'dst'.
uint BitFieldInsert(uint mask, uint src, uint dst)
{
return (src & mask) | (dst & ~mask);
}
#endif // INTRINSIC_BITFIELD_INSERT
bool IsBitSet(uint data, uint offset)
{
return BitFieldExtract(data, offset, 1u) != 0;

正在加载...
取消
保存