@@ -246,27 +246,22 @@ void RenderScreenSpaceShadows(HDCamera hdCamera, CommandBuffer cmd)
246246 return ;
247247 }
248248
249- if ( hdCamera . frameSettings . IsEnabled ( FrameSettingsField . RayTracing ) )
249+ using ( new ProfilingScope ( cmd , ProfilingSampler . Get ( HDProfileId . ScreenSpaceShadows ) ) )
250250 {
251- using ( new ProfilingScope ( cmd , ProfilingSampler . Get ( HDProfileId . ScreenSpaceShadows ) ) )
252- {
253- // First of all we handle the directional light
254- RenderDirectionalLightScreenSpaceShadow ( cmd , hdCamera ) ;
251+ // First of all we handle the directional light
252+ RenderDirectionalLightScreenSpaceShadow ( cmd , hdCamera ) ;
255253
254+ if ( hdCamera . frameSettings . IsEnabled ( FrameSettingsField . RayTracing ) )
255+ {
256256 // We handle the other light sources
257257 RenderLightScreenSpaceShadows ( hdCamera , cmd ) ;
258+ }
258259
259- // We do render the debug view
260- EvaluateShadowDebugView ( cmd , hdCamera ) ;
260+ // We do render the debug view
261+ EvaluateShadowDebugView ( cmd , hdCamera ) ;
261262
262- // Big the right texture
263- cmd . SetGlobalTexture ( HDShaderIDs . _ScreenSpaceShadowsTexture , m_ScreenSpaceShadowTextureArray ) ;
264- }
265- }
266- else
267- {
268- // We bind the black texture in this case
269- BindBlackShadowTexture ( cmd ) ;
263+ // Bind the right texture
264+ cmd . SetGlobalTexture ( HDShaderIDs . _ScreenSpaceShadowsTexture , m_ScreenSpaceShadowTextureArray ) ;
270265 }
271266 }
272267
@@ -911,12 +906,20 @@ void RenderPunctualScreenSpaceShadow(CommandBuffer cmd, HDCamera hdCamera
911906
912907 void EvaluateShadowDebugView ( CommandBuffer cmd , HDCamera hdCamera )
913908 {
914- ComputeShader shadowFilter = m_Asset . renderPipelineRayTracingResources . shadowFilterCS ;
915-
916909 // If this is the right debug mode and the index we are asking for is in the range
917910 HDRenderPipeline hdrp = ( RenderPipelineManager . currentPipeline as HDRenderPipeline ) ;
918911 if ( FullScreenDebugMode . ScreenSpaceShadows == hdrp . m_CurrentDebugDisplaySettings . data . fullScreenDebugMode )
919912 {
913+ if ( ! hdrp . rayTracingSupported )
914+ {
915+ // In this case we have not rendered any screenspace shadows, so push a black texture on the debug display
916+ hdrp . PushFullScreenDebugTexture ( hdCamera , cmd , TextureXR . GetBlackTextureArray ( ) , FullScreenDebugMode . ScreenSpaceShadows ) ;
917+ return ;
918+ }
919+
920+ // TODO: move the debug kernel outside of the ray tracing resources
921+ ComputeShader shadowFilter = m_Asset . renderPipelineRayTracingResources . shadowFilterCS ;
922+
920923 // Texture dimensions
921924 int texWidth = hdCamera . actualWidth ;
922925 int texHeight = hdCamera . actualHeight ;
0 commit comments