@@ -57,10 +57,10 @@ public partial class HDRenderPipeline
57
57
// This buffer holds the unfiltered, accumulated, shadow values, it is accessed with the same index as the one used at runtime (aka screen space shadow slot)
58
58
static RTHandle ShadowHistoryBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
59
59
{
60
- HDRenderPipelineAsset hdPipelineAsset = GraphicsSettings . renderPipelineAsset as HDRenderPipelineAsset ;
60
+ HDRenderPipeline hdrp = RenderPipelineManager . currentPipeline as HDRenderPipeline ;
61
+ HDRenderPipelineAsset hdPipelineAsset = hdrp . m_Asset ;
61
62
GraphicsFormat graphicsFormat = ( GraphicsFormat ) hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . screenSpaceShadowBufferFormat ;
62
- HDRenderPipeline hdrp = ( RenderPipelineManager . currentPipeline as HDRenderPipeline ) ;
63
- int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdrp . m_Asset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
63
+ int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
64
64
return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
65
65
enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ScreenSpaceShadowHistoryBuffer{1}" , viewName , frameIndex ) ) ;
66
66
}
@@ -70,20 +70,20 @@ static RTHandle ShadowHistoryBufferAllocatorFunction(string viewName, int frameI
70
70
// It is accessed with the same index used at runtime (aka screen space shadow slot)
71
71
static RTHandle ShadowHistoryValidityBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
72
72
{
73
- HDRenderPipelineAsset hdPipelineAsset = GraphicsSettings . renderPipelineAsset as HDRenderPipelineAsset ;
74
- HDRenderPipeline hdrp = ( RenderPipelineManager . currentPipeline as HDRenderPipeline ) ;
73
+ HDRenderPipeline hdrp = RenderPipelineManager . currentPipeline as HDRenderPipeline ;
74
+ HDRenderPipelineAsset hdPipelineAsset = hdrp . m_Asset ;
75
75
GraphicsFormat graphicsFormat = ( GraphicsFormat ) hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . screenSpaceShadowBufferFormat ;
76
- int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdrp . m_Asset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
76
+ int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
77
77
return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
78
78
enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ShadowHistoryValidityBuffer{1}" , viewName , frameIndex ) ) ;
79
79
}
80
80
81
81
static RTHandle ShadowHistoryDistanceBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
82
82
{
83
- HDRenderPipelineAsset hdPipelineAsset = GraphicsSettings . renderPipelineAsset as HDRenderPipelineAsset ;
84
- HDRenderPipeline hdrp = ( RenderPipelineManager . currentPipeline as HDRenderPipeline ) ;
83
+ HDRenderPipeline hdrp = RenderPipelineManager . currentPipeline as HDRenderPipeline ;
84
+ HDRenderPipelineAsset hdPipelineAsset = hdrp . m_Asset ;
85
85
GraphicsFormat graphicsFormat = ( GraphicsFormat ) hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . screenSpaceShadowBufferFormat ;
86
- int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdrp . m_Asset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
86
+ int numShadowSlices = Math . Max ( ( int ) Math . Ceiling ( hdPipelineAsset . currentPlatformRenderPipelineSettings . hdShadowInitParams . maxScreenSpaceShadowSlots / 4.0f ) , 1 ) ;
87
87
return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
88
88
enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ShadowHistoryDistanceBuffer{1}" , viewName , frameIndex ) ) ;
89
89
}
0 commit comments