@@ -246,27 +246,22 @@ void RenderScreenSpaceShadows(HDCamera hdCamera, CommandBuffer cmd)
246
246
return ;
247
247
}
248
248
249
- if ( hdCamera . frameSettings . IsEnabled ( FrameSettingsField . RayTracing ) )
249
+ using ( new ProfilingScope ( cmd , ProfilingSampler . Get ( HDProfileId . ScreenSpaceShadows ) ) )
250
250
{
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 ) ;
255
253
254
+ if ( hdCamera . frameSettings . IsEnabled ( FrameSettingsField . RayTracing ) )
255
+ {
256
256
// We handle the other light sources
257
257
RenderLightScreenSpaceShadows ( hdCamera , cmd ) ;
258
+ }
258
259
259
- // We do render the debug view
260
- EvaluateShadowDebugView ( cmd , hdCamera ) ;
260
+ // We do render the debug view
261
+ EvaluateShadowDebugView ( cmd , hdCamera ) ;
261
262
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 ) ;
270
265
}
271
266
}
272
267
@@ -911,12 +906,20 @@ void RenderPunctualScreenSpaceShadow(CommandBuffer cmd, HDCamera hdCamera
911
906
912
907
void EvaluateShadowDebugView ( CommandBuffer cmd , HDCamera hdCamera )
913
908
{
914
- ComputeShader shadowFilter = m_Asset . renderPipelineRayTracingResources . shadowFilterCS ;
915
-
916
909
// If this is the right debug mode and the index we are asking for is in the range
917
910
HDRenderPipeline hdrp = ( RenderPipelineManager . currentPipeline as HDRenderPipeline ) ;
918
911
if ( FullScreenDebugMode . ScreenSpaceShadows == hdrp . m_CurrentDebugDisplaySettings . data . fullScreenDebugMode )
919
912
{
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
+
920
923
// Texture dimensions
921
924
int texWidth = hdCamera . actualWidth ;
922
925
int texHeight = hdCamera . actualHeight ;
0 commit comments