浏览代码

GC fix for LightLoopSettings

/main
Thomas 7 年前
当前提交
7d48de83
共有 2 个文件被更改,包括 15 次插入19 次删除
  1. 28
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs
  2. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs

28
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs


using System;
using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]

}
// aggregateFrameSettings already contain the aggregation of RenderPipelineSettings and FrameSettings (regular and/or debug)
static public LightLoopSettings InitializeLightLoopSettings(Camera camera, FrameSettings aggregateFrameSettings,
RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings)
public static void InitializeLightLoopSettings(Camera camera, FrameSettings aggregateFrameSettings,
RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings,
ref LightLoopSettings dstLightLoopSettings)
LightLoopSettings aggregate = new LightLoopSettings();
if (dstLightLoopSettings == null)
dstLightLoopSettings = new LightLoopSettings();
aggregate.enableTileAndCluster = frameSettings.lightLoopSettings.enableTileAndCluster;
aggregate.enableComputeLightEvaluation = frameSettings.lightLoopSettings.enableComputeLightEvaluation;
aggregate.enableComputeLightVariants = frameSettings.lightLoopSettings.enableComputeLightVariants;
aggregate.enableComputeMaterialVariants = frameSettings.lightLoopSettings.enableComputeMaterialVariants;
aggregate.enableFptlForForwardOpaque = frameSettings.lightLoopSettings.enableFptlForForwardOpaque;
aggregate.enableBigTilePrepass = frameSettings.lightLoopSettings.enableBigTilePrepass;
dstLightLoopSettings.enableTileAndCluster = frameSettings.lightLoopSettings.enableTileAndCluster;
dstLightLoopSettings.enableComputeLightEvaluation = frameSettings.lightLoopSettings.enableComputeLightEvaluation;
dstLightLoopSettings.enableComputeLightVariants = frameSettings.lightLoopSettings.enableComputeLightVariants;
dstLightLoopSettings.enableComputeMaterialVariants = frameSettings.lightLoopSettings.enableComputeMaterialVariants;
dstLightLoopSettings.enableFptlForForwardOpaque = frameSettings.lightLoopSettings.enableFptlForForwardOpaque;
dstLightLoopSettings.enableBigTilePrepass = frameSettings.lightLoopSettings.enableBigTilePrepass;
aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && aggregateFrameSettings.enableMSAA;
dstLightLoopSettings.enableFptlForForwardOpaque = dstLightLoopSettings.enableFptlForForwardOpaque && aggregateFrameSettings.enableMSAA;
aggregate.isFptlEnabled = !aggregateFrameSettings.enableForwardRenderingOnly || aggregate.enableFptlForForwardOpaque;
return aggregate;
dstLightLoopSettings.isFptlEnabled = !aggregateFrameSettings.enableForwardRenderingOnly || dstLightLoopSettings.enableFptlForForwardOpaque;
}
static public void RegisterDebug(String menuName, LightLoopSettings lightLoopSettings)

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs


// Init a FrameSettings from renderpipeline settings, frame settings and debug settings (if any)
// This will aggregate the various option
public static FrameSettings InitializeFrameSettings(Camera camera, RenderPipelineSettings renderPipelineSettings, FrameSettings srcFrameSettings, ref FrameSettings dstFrameSettings)
public static void InitializeFrameSettings(Camera camera, RenderPipelineSettings renderPipelineSettings, FrameSettings srcFrameSettings, ref FrameSettings dstFrameSettings)
{
if (dstFrameSettings == null)
dstFrameSettings = new FrameSettings();

dstFrameSettings.enableShadowMask = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;
dstFrameSettings.lightLoopSettings = LightLoopSettings.InitializeLightLoopSettings(camera, dstFrameSettings, renderPipelineSettings, srcFrameSettings);
return dstFrameSettings;
LightLoopSettings.InitializeLightLoopSettings(camera, dstFrameSettings, renderPipelineSettings, srcFrameSettings, ref dstFrameSettings.lightLoopSettings);
}
static public void RegisterDebug(String menuName, FrameSettings frameSettings)

正在加载...
取消
保存