浏览代码

Added loop hint to PCF tent sampling functions to make compilation times a bit more sane.

/main
uygar 7 年前
当前提交
058fa25d
共有 1 个文件被更改,包括 11 次插入9 次删除
  1. 20
      Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowSampling.hlsl

20
Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowSampling.hlsl


// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
for (int i = 0; i < 4; i++)
[loop] for (int i = 0; i < 4; i++)
{
shadow += fetchesWeights[i] * SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( fetchesUV[i].xy, coord.z ), slice ).x;
}

// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
float fetchesWeights[4];
float2 fetchesUV[4];

// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
for (int i = 0; i < 9; i++)
[loop] for (int i = 0; i < 9; i++)
{
shadow += fetchesWeights[i] * SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( fetchesUV[i].xy, coord.z ), slice ).x;
}

// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
float fetchesWeights[9];
float2 fetchesUV[9];

// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
for (int i = 0; i < 16; i++)
[loop] for (int i = 0; i < 16; i++)
return shadow;
}

// add the depth bias
coord.z += depthBias;
half shadow = 0;
float shadow = 0.0;
float fetchesWeights[16];
float2 fetchesUV[16];

shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x;
}
return shadow;
}

正在加载...
取消
保存