浏览代码

Add WaveReadFirstLane()

/Yibing-Project-2
Evgenii Golubev 7 年前
当前提交
8c2d94e7
共有 3 个文件被更改,包括 11 次插入1 次删除
  1. 2
      ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl
  2. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute

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


// This file assume SHADER_API_D3D11 is defined
#define INTRINSIC_BITFIELD_EXTRACT
#define INTRINSIC_WAVEREADFIRSTLANE
#define WaveReadFirstLane ReadFirstLane
#define Mad24 mad24
#define INTRINSIC_MED3
#define INTRINSIC_MINMAX3

8
ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl


return BitFieldExtract(data, 1u, bitPos) != 0;
}
#ifndef INTRINSIC_WAVEREADFIRSTLANE
// Warning: for correctness, the value you pass to the function must be constant across the wave!
uint WaveReadFirstLane(uint scalarValue)
{
return scalarValue;
}
#endif
#ifndef INTRINSIC_CLAMP
// TODO: should we force all clamp to be intrinsic by default ?
// Some platform have one instruction clamp

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute


uint groupThreadId : SV_GroupThreadID)
{
// Note: any factor of 64 is a suitable wave size for our algorithm.
uint waveIndex = groupThreadId / 64;
uint waveIndex = WaveReadFirstLane(groupThreadId / 64);
uint laneIndex = groupThreadId % 64;
uint quadIndex = laneIndex / 4;

正在加载...
取消
保存