Skip to content

Commit 6c24db7

Browse files
committed
Misc code cleanup
1 parent 05f9833 commit 6c24db7

File tree

1 file changed

+3
-4
lines changed
  • Outline.URP/Packages/UnityFx.Outline.URP/Runtime/Scripts

1 file changed

+3
-4
lines changed

Outline.URP/Packages/UnityFx.Outline.URP/Runtime/Scripts/OutlinePass.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
5050
var outlineResources = _feature.OutlineResources;
5151
var outlineSettings = _feature.OutlineSettings;
5252
var camData = renderingData.cameraData;
53+
var depthTexture = new RenderTargetIdentifier("_CameraDepthTexture");
5354

5455
if (_feature.OutlineLayerMask != 0)
5556
{
@@ -58,7 +59,6 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
5859
var renderStateBlock = new RenderStateBlock(RenderStateMask.Nothing);
5960
var sortingCriteria = camData.defaultOpaqueSortFlags;
6061
var drawingSettings = CreateDrawingSettings(_shaderTagIdList, ref renderingData, sortingCriteria);
61-
var depthTexture = new RenderTargetIdentifier("_CameraDepthTexture");
6262

6363
drawingSettings.enableDynamicBatching = true;
6464
drawingSettings.overrideMaterial = outlineResources.RenderMaterial;
@@ -75,7 +75,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
7575

7676
using (new ProfilingScope(cmd, _profilingSampler))
7777
{
78-
using (var renderer = new OutlineRenderer(cmd, outlineResources, _renderer.cameraColorTarget, depthTexture/*_renderer.cameraDepth*/, camData.cameraTargetDescriptor))
78+
using (var renderer = new OutlineRenderer(cmd, outlineResources, _renderer.cameraColorTarget, depthTexture, camData.cameraTargetDescriptor))
7979
{
8080
renderer.RenderObjectClear(outlineSettings.OutlineRenderMode);
8181
context.ExecuteCommandBuffer(cmd);
@@ -94,9 +94,8 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
9494
if (_feature.OutlineLayers)
9595
{
9696
var cmd = CommandBufferPool.Get(OutlineResources.EffectName);
97-
var depthTexture = new RenderTargetIdentifier("_CameraDepthTexture");
9897

99-
using (var renderer = new OutlineRenderer(cmd, outlineResources, _renderer.cameraColorTarget, depthTexture /*_renderer.cameraDepth*/, camData.cameraTargetDescriptor))
98+
using (var renderer = new OutlineRenderer(cmd, outlineResources, _renderer.cameraColorTarget, depthTexture, camData.cameraTargetDescriptor))
10099
{
101100
_renderObjects.Clear();
102101
_feature.OutlineLayers.GetRenderObjects(_renderObjects);

0 commit comments

Comments
 (0)