浏览代码

Remove redundant samplers in LightLoopDef.hlsl

/namespace
Evgenii Golubev 7 年前
当前提交
5e6cfadc
共有 2 个文件被更改,包括 3 次插入7 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl
  2. 1
      ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl


// Used by directional and spot lights
TEXTURE2D_ARRAY(_CookieTextures);
SAMPLER(sampler_CookieTextures);
SAMPLER(sampler_CookieCubeTextures);
SAMPLER(sampler_EnvTextures);
TEXTURE2D(_DeferredShadowTexture);

// Used by directional and spot lights.
float3 SampleCookie2D(LightLoopContext lightLoopContext, float2 coord, int index)
{
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, sampler_CookieTextures, coord, index, 0).rgb;
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, s_linear_clamp_sampler, coord, index, 0).rgb;
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, sampler_CookieCubeTextures, coord, index, 0).rgb;
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, s_linear_clamp_sampler, coord, index, 0).rgb;
}
//-----------------------------------------------------------------------------

// This code will be inlined as lightLoopContext is hardcoded in the light loop
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES)
{
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, sampler_EnvTextures, texCoord, index, lod);
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, s_trilinear_clamp_sampler, texCoord, index, lod);
}
else // SINGLE_PASS_SAMPLE_SKY
{

1
ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl


// These are the samplers available in the HDRenderPipeline.
// Avoid declaring extra samplers as they are 4x SGPR each on GCN.
SAMPLER(s_linear_clamp_sampler);
SAMPLER(s_linear_repeat_sampler);
SAMPLER(s_trilinear_clamp_sampler);
// ----------------------------------------------------------------------------

正在加载...
取消
保存