浏览代码

Update performance-related comments

/main
Evgenii Golubev 8 年前
当前提交
58a0f9c9
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl

3
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


float3 dir = lightData.right;
// TODO: precompute half-length. Same as for LTC area lights.
// In fact, why not store both endpoints? Saves us 7 cycles.
float3 p1 = lightData.positionWS - lightData.right * (0.5 * len);
float3 p2 = lightData.positionWS + lightData.right * (0.5 * len);

float halfWidth = lightData.size.x * 0.5;
float halfHeight = lightData.size.y * 0.5;
// TODO: store 4 points and save 24 cycles.
// TODO: store 4 points and save 12 cycles (24x MADs - 12x MOVs).
float3 p0 = lightData.positionWS + lightData.right * -halfWidth + lightData.up * halfHeight;
float3 p1 = lightData.positionWS + lightData.right * -halfWidth + lightData.up * -halfHeight;
float3 p2 = lightData.positionWS + lightData.right * halfWidth + lightData.up * -halfHeight;

正在加载...
取消
保存