The engine uses GRayTracingPlaformMask to compute ShouldCompilePermutation() for shaders. This is filled based on platform settings and capabilities when running the editor. When running a standalone game, the mask is filled purely based on whether ray tracing is enabled for the project (r.RayTracing) and the current runtime environment supports it (GRHISupportsRayTracing).
The new CVar is meant to be consistent between the cook time and run time. This is achieved by setting GRHISupportsRayTracing=false when running on SM5 if r.RayTracing.RequireSM6 is 1.
#rb christopher.waters
#preflight 631f8c8680642a7fa783ca18
#jira UE-163012
[CL 21971785 by Yuriy ODonnell in ue5-main branch]
#jira UE-159832
#rb Aaron.mcleran Phil.Popp Dan.Thompson Josh.Adams
#preflight 62d260033c3df323907eaa93
[CL 21153330 by jimmy smith in ue5-main branch]
* RT shaders are still excluded from SM5 if project is configured to not cook SM5 shaders for D3D12
#rb chris.kulla
#jira UE-158270
#preflight 62d1d478e468fcfd0b97d55a
[CL 21117293 by Yuriy ODonnell in ue5-main branch]
* This is necessary because some (pre UE 5.1) projects use this instead of D3D12TargetedShaderFormats, etc.
#rb jason.nadro
#jira UE-158270
#preflight 62c47a332f31b87c6c91fb52
#ROBOMERGE-AUTHOR: yuriy.odonnell
#ROBOMERGE-SOURCE: CL 20947047 via CL 20947122 via CL 20947433
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)
[CL 20950739 by yuriy odonnell in ue5-main branch]
* Add ITargetPlatform::GetRayTracingShaderFormats(), with default implementation that falls back to GetAllTargetedShaderFormats() if HWRT is enabled for a platform
* Override GetRayTracingShaderFormats() for TGenericWindowsTargetPlatform to return only enabled D3D12 and VK shader formats (excluding D3D11)
* Use GetRayTracingShaderFormat() and UsesRayTracing() to configure GRayTracingPlaformMask (the mask contains one bit per shader platform)
Previously all bits of GRayTracingPlaformMask were set if project uses ray tracing, then shader platform bits were disabled for all possible shader formats for platforms that don't support ray tracing.
If SM5 was disabled for D3D12, ray tracing shaders would still get compiled for it because the corresponding bit was still set in GRayTracingPlaformMask.
With this change, SM5 bit will no longer be set in GRayTracingPlaformMask in the editor if it is disabled for D3D12 RHI for the project, so ray tracing shaders won't be compiled.
When running a packaged build, GRayTracingPlaformMask is now set to 0 or 1 based on global project setting (r.RayTracing) and whether the current machine+RHI supports ray tracing.
#rb christopher.waters, jason.nadro
#preflight 62bd0dea3f0d6beee259b636
#ROBOMERGE-AUTHOR: yuriy.odonnell
#ROBOMERGE-SOURCE: CL 20897852 via CL 20898485 via CL 20899239
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)
[CL 20901755 by yuriy odonnell in ue5-main branch]
the bad value passed to BlockSize was not actually used so behavior was not actually broken
#preflight 628bb9cc016e5daa1cbc21e5
#rb jon.olick
[CL 20335399 by charles bloom in ue5-main branch]
On Windows, "TargetedRHIs" is now split into "D3D11TargetedShaderFormats", "D3D12TargetedShaderFormats" and "VulkanTargetedShaderFormats". "TargetedRHIs" is still parsed for backwards compatibility.
Using this, projects can now be more easily configured for D3D12-only or even Vulkan-only.
Updated FShaderFormatsPropertyDetails to use FName instead of FString for shader platforms. Also added a filtering method for mixed RHI platforms like Windows.
#jira none
#rb mihnea.balta, josh.adams
#preflight 6287cbf46c7692ac8cc8805f
[CL 20300786 by christopher waters in ue5-main branch]
This unifies a few Performance Mode settings together and now allows a project to restrict D3D12 to SM6 only.
#rb mihnea.balta, josh.adams
#preflight 622f83adc51b66df4c210b1e
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 19376538 via CL 19376631
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)
[CL 19378054 by christopher waters in ue5-main branch]
ES3.1 is used as a fast renderer mode, but still supports DX11 textures
log a message when BC6+7 is encoded as uncompressed
delete the unused GetVirtualTextureLayerFormat
#preflight 62168881476ef5d8a206b828
#rb jeremy.moore
#ROBOMERGE-AUTHOR: charles.bloom
#ROBOMERGE-SOURCE: CL 19100346 via CL 19105003 via CL 19105192 via CL 19110090
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19148337 by charles bloom in ue5-main branch]