Description

Reported by a licensee. FDepthPassMeshProcessor::CollectPSOInitializersInternal sets RenderTargetsInfo.NumSamples to 1 (DepthRendering.cpp, CollectPSOInitializersInternal) regardless of the project's MSAA setting.

At runtime the depth prepass renders into SceneTextures.Depth.Target, which is created with FSceneTexturesConfig::NumSamples (SceneTextures.cpp). NumSamples is part of the precache PSO hash and match (FDynamicRHI::RHIComputePrecachePSOHash and RHIMatchPrecachePSOInitializers in DynamicRHI.cpp, and the D3D12 and Metal overrides), so with r.MSAACount above 1 every depth prepass PSO collected with 1 sample misses and compiles on first use.

The FSceneTexturesConfig passed to the collectors already holds the correct value: FSceneTexturesConfig::Init sets NumSamples from GetDefaultMSAACount (SceneTexturesConfig.cpp). Deferred decals and single layer water already use it when collecting PSOs.

Proposed fix: set RenderTargetsInfo.NumSamples = SceneTexturesConfig.NumSamples in FDepthPassMeshProcessor::CollectPSOInitializersInternal. Other mesh pass collectors (base pass, velocity, mobile base pass) hardcode 1 the same way and can be followed up separately.

Steps to Reproduce
  1. In a project using forward shading on a desktop RHI (D3D12 or Vulkan), set r.MSAACount=4 and r.PSOPrecache.Validation=2 under [SystemSettings] in DefaultEngine.ini.
  2. Run a development build of a level with static meshes and a depth prepass enabled, using a fresh PSO cache.
  3. Observe PSO precache misses logged for the DepthPass mesh pass, with NumSamples reported as the mismatching field (precached 1, runtime 4).

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-413325 in the post.

0
Login to Vote

Fixed
ComponentUE - Rendering - RHI
Affects Versions5.6, 5.7, 5.8
Target Fix5.9
Fix Commit60499603
CreatedNov 11, 2026
ResolvedNov 19, 2026
UpdatedDec 4, 2026
View Jira Issue