@@ -57,10 +57,10 @@ public partial class HDRenderPipeline
5757 // 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)
5858 static RTHandle ShadowHistoryBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
5959 {
60- HDRenderPipelineAsset hdPipelineAsset = GraphicsSettings . renderPipelineAsset as HDRenderPipelineAsset ;
60+ HDRenderPipeline hdrp = RenderPipelineManager . currentPipeline as HDRenderPipeline ;
61+ HDRenderPipelineAsset hdPipelineAsset = hdrp . m_Asset ;
6162 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 ) ;
6464 return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
6565 enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ScreenSpaceShadowHistoryBuffer{1}" , viewName , frameIndex ) ) ;
6666 }
@@ -70,20 +70,20 @@ static RTHandle ShadowHistoryBufferAllocatorFunction(string viewName, int frameI
7070 // It is accessed with the same index used at runtime (aka screen space shadow slot)
7171 static RTHandle ShadowHistoryValidityBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
7272 {
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 ;
7575 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 ) ;
7777 return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
7878 enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ShadowHistoryValidityBuffer{1}" , viewName , frameIndex ) ) ;
7979 }
8080
8181 static RTHandle ShadowHistoryDistanceBufferAllocatorFunction ( string viewName , int frameIndex , RTHandleSystem rtHandleSystem )
8282 {
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 ;
8585 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 ) ;
8787 return rtHandleSystem . Alloc ( Vector2 . one , slices : numShadowSlices * TextureXR . slices , dimension : TextureDimension . Tex2DArray , filterMode : FilterMode . Point , colorFormat : graphicsFormat ,
8888 enableRandomWrite : true , useDynamicScale : true , useMipMap : false , name : string . Format ( "{0}_ShadowHistoryDistanceBuffer{1}" , viewName , frameIndex ) ) ;
8989 }
0 commit comments