浏览代码

Fix warning in stacklit.hlsl

/main
sebastienlagarde 6 年前
当前提交
092d7fe0
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 12
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl

12
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl


float _s_r0m, s_r12, m_rr; // we will need these outside the loop for further calculations
// HACK: If we don't use a local table and write the result directly in preLightData.vLayerEnergyCoeff
// we get a warning 'array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll'
// Caution: be sure NB_VLAYERS == 3 and complete the code after
float3 localvLayerEnergyCoeff[NB_VLAYERS];
// Iterate over the layers
for(int i = 0; i < NB_VLAYERS; ++i)
{

_s_ri0 = (e_ri0 > 0.0) ? _s_ri0/e_ri0 : 0.0;
// Store the coefficient and variance
preLightData.vLayerEnergyCoeff[i] = (m_r0i > 0.0) ? m_R0i : float3(0.0, 0.0, 0.0);
localvLayerEnergyCoeff[i] = (m_r0i > 0.0) ? m_R0i : float3(0.0, 0.0, 0.0);
//preLightData.vLayerPerceptualRoughness[i] = (m_r0i > 0.0) ? LinearVarianceToPerceptualRoughness(_s_r0m) : 0.0;
// Update energy

ji0 *= j21;
}
}
// HACK: See note above why we need to do this
preLightData.vLayerEnergyCoeff[0] = localvLayerEnergyCoeff[0];
preLightData.vLayerEnergyCoeff[1] = localvLayerEnergyCoeff[1];
preLightData.vLayerEnergyCoeff[2] = localvLayerEnergyCoeff[2];
//-------------------------------------------------------------
// Post compute:

正在加载...
取消
保存