浏览代码

HLSLcc: change out of bounds fix to use iNrCoarseLights-1 instead

/fptl_cleanup
Antti Tapaninen 7 年前
当前提交
5d1327b6
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 5
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute
  2. 5
      Assets/ScriptableRenderPipeline/fptl/lightlistbuild-clustered.compute

5
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-clustered.compute


//////////// cell specific code
{
int pad = iNrCoarseLights & 1;
for(int l=(int) t; l<((iNrCoarseLights+pad)>>1); l += NR_THREADS)
for(int l=(int) t; l<((iNrCoarseLights+1)>>1); l += NR_THREADS)
const int l0 = coarseList[2*l+0], l1 = coarseList[min(2*l+1,iNrCoarseLights-pad)];
const int l0 = coarseList[2*l+0], l1 = coarseList[min(2*l+1,iNrCoarseLights-1)];
const unsigned int clustIdxMi0 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l0].z), suggestedBase));
const unsigned int clustIdxMa0 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l0+g_iNrVisibLights].z), suggestedBase));
const unsigned int clustIdxMi1 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l1].z), suggestedBase));

5
Assets/ScriptableRenderPipeline/fptl/lightlistbuild-clustered.compute


//////////// cell specific code
{
int pad = iNrCoarseLights & 1;
for(int l=(int) t; l<((iNrCoarseLights+pad)>>1); l += NR_THREADS)
for(int l=(int) t; l<((iNrCoarseLights+1)>>1); l += NR_THREADS)
const int l0 = coarseList[2*l+0], l1 = coarseList[min(2*l+1,iNrCoarseLights-pad)];
const int l0 = coarseList[2*l+0], l1 = coarseList[min(2*l+1,iNrCoarseLights-1)];
const unsigned int clustIdxMi0 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l0].z), suggestedBase));
const unsigned int clustIdxMa0 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l0+g_iNrVisibLights].z), suggestedBase));
const unsigned int clustIdxMi1 = (const unsigned int) min(255,SnapToClusterIdx(GetLinearDepth(g_vBoundsBuffer[l1].z), suggestedBase));

正在加载...
取消
保存