浏览代码

prevent crash on iOS from illegal access

prevent crash on iOS from illegal access. In HLSL, unlike c++, for the
statement if(A && B) B is executed whether A succeeds or fails. In this
case the result is a crash on iOS (since we convert from hlsl to d3dasm
to metal).
/main
mmikk 8 年前
当前提交
53139a71
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-bigtile.compute
  2. 6
      Assets/ScriptableRenderLoop/fptl/lightlistbuild-bigtile.compute

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/Resources/lightlistbuild-bigtile.compute


for(int l=0; l<iNrCoarseLights; l++)
{
const uint idxCoarse = lightsListLDS[l];
[branch]if (idxCoarse<(uint)g_iNrVisibLights && _LightVolumeData[idxCoarse].lightVolume != LIGHTVOLUMETYPE_SPHERE) // don't bother doing edge tests for sphere lights since these have camera aligned bboxes.
bool canEnter = idxCoarse<(uint)g_iNrVisibLights;
if(canEnter) canEnter = canEnter && _LightVolumeData[idxCoarse].lightVolume != LIGHTVOLUMETYPE_SPHERE; // don't bother doing edge tests for sphere lights since these have camera aligned bboxes.
[branch]if(canEnter)
{
SFiniteLightBound lgtDat = g_data[idxCoarse];

6
Assets/ScriptableRenderLoop/fptl/lightlistbuild-bigtile.compute


const int totNrEdgePairs = 12*nrFrustEdges;
for(int l=0; l<iNrCoarseLights; l++)
{
const int idxCoarse = lightsListLDS[l];
[branch]if(idxCoarse<(uint) g_iNrVisibLights && g_vLightData[idxCoarse].lightType!=SPHERE_LIGHT) // don't bother doing edge tests for sphere lights since these have camera aligned bboxes.
const uint idxCoarse = lightsListLDS[l];
bool canEnter = idxCoarse<(uint) g_iNrVisibLights;
if(canEnter) canEnter = canEnter && g_vLightData[idxCoarse].lightType!=SPHERE_LIGHT; // don't bother doing edge tests for sphere lights since these have camera aligned bboxes.
[branch]if(canEnter)
{
SFiniteLightBound lgtDat = g_data[idxCoarse];

正在加载...
取消
保存