浏览代码

finally got around to replacing this with a suitable intrinsic

finally got around to replacing this with a suitable intrinsic
/main
mmikk 8 年前
当前提交
1c4a150e
共有 3 个文件被更改,包括 18 次插入6 次删除
  1. 8
      Assets/ScriptableRenderLoop/fptl/lightlistbuild-bigtile.compute
  2. 8
      Assets/ScriptableRenderLoop/fptl/lightlistbuild-clustered.compute
  3. 8
      Assets/ScriptableRenderLoop/fptl/lightlistbuild.compute

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


// NOTE! returns 1 when value_in==0
#if 0
return value;
return value_in==0 ? 0 : value;
#else
uint valpw2 = value_in==0 ? 0 : (1<<firstbithigh(value_in)); // firstbithigh(0) returns -1
return max(valpw2, valpw2<<(valpw2!=value_in ? 1 : 0)); // max() just in case of overflow
#endif
}

8
Assets/ScriptableRenderLoop/fptl/lightlistbuild-clustered.compute


}
// NOTE! returns 1 when value_in==0
#if 0
return value;
return value_in==0 ? 0 : value;
#else
uint valpw2 = value_in==0 ? 0 : (1<<firstbithigh(value_in)); // firstbithigh(0) returns -1
return max(valpw2, valpw2<<(valpw2!=value_in ? 1 : 0)); // max() just in case of overflow
#endif
}

8
Assets/ScriptableRenderLoop/fptl/lightlistbuild.compute


#else
// NOTE! returns 1 when value_in==0
#if 0
return value;
return value_in==0 ? 0 : value;
#else
uint valpw2 = value_in==0 ? 0 : (1<<firstbithigh(value_in)); // firstbithigh(0) returns -1
return max(valpw2, valpw2<<(valpw2!=value_in ? 1 : 0)); // max() just in case of overflow
#endif
}

正在加载...
取消
保存