- In a complex material, compiler may not be able to see through the code to discover all unused inputs.
E.g. first pass compilation says that input A is unused, but B and C are used. After we rewrite the code to remove A, the code is simpler and compiler is now able to see that B is also unused.
Since we pass the "used attributes" to the next stage, this creates a mismatch where vertex shader outputs only C, but pixel shader (rewritten based on the first pass results) expects B and C.
- The fixed code will check if the unused inputs changed, and if so, will go back and rewrite the code based on a more complete info.
- This fixes a bug that JonL ran into for which I haven't yet created a JIRA (will do before checkin).
#rb Ben.Ingram, Rolando.Caloca, Jason.Nadro
#review @Lukas.Hermanns, @Rolando.Caloca, @Ben.Ingram, @Jason.Nadro, @Kevin.Ortegren
#jira UE-115083
[CL 16312596 by Arciel Rekman in ue5-main branch]
Example usage in a shader:
PLATFORM_ASSERT4(GroupThread > 4321, 0xDF7DC903, GroupThread, GroupIndex, GroupBase, asuint(123.456f));
Example GPU crash report output:
LogD3D12RHI: Error: [GPUBreadCrumb] Last tracked GPU operations:
LogD3D12RHI: Error: [GPUBreadCrumb] 3D Queue 0 - Begin: Frame 348 - Scene - ReflectionIndirect - RayTracingReflections - RayTracingDeferredReflectionsShade 957x466
LogD3D12RHI: Error: [GPUBreadCrumb] Shader assertion failed! ID: 0xDF7DC903
LogD3D12RHI: Error: [GPUBreadCrumb] Payload [int32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb] Payload [uint32]: 416 42 172032 1123477881
LogD3D12RHI: Error: [GPUBreadCrumb] Payload [hex]: 0x000001A0 0x0000002A 0x0002A000 0x42F6E979
LogD3D12RHI: Error: [GPUBreadCrumb] Payload [float]: 0.000000 0.000000 0.000000 123.456001
This works through automatic diagnostic buffer binding in D3D12 RHI, which becomes available in *any* shader as a UAV.
Opens the door for arbitrary human-readable message output from any shader in the future.
PLATFORM_ASSERT macro is always enabled and available on supported platforms. It is intended to be a low-level mechanism for a higher-level check() that would be controlled via CVars.
#rb Christopher.Waters
[CL 16167404 by Yuriy ODonnell in ue5-main branch]
Disabled by default (guarded by USE_SHADER_MODEL_6_6).
Includes work done by Yuriy.
#rb yuriy.odonnell
#fyi brian.karis, christopher.waters, lukas.hermanns
[CL 15914077 by graham wihlidal in ue5-main branch]
- Removed OutputMask since nothing was using it anymore.
- Made UAVMask an optional output from FXC compiles, only d3d11 reads it.
- UAVMask now created from entire set of UAVs and not just UAVs in Uniform Buffers.
#jira none
#rb mihnea.balta
#ROBOMERGE-SOURCE: CL 15643920 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v779-15635321)
[CL 15643927 by christopher waters in ue5-main branch]
- This makes shader compilation predictable and resolves the issue with Incredibuild failing to run SCWs on systems without the library.
#rb Chris.Waters, Rolando.Caloca, Lukas.Hermanns
#review-15600065 @Chris.Waters, @Rolando.Caloca, @Lukas.Hermanns
#robomerge Release-5.0-EarlyAccess
#jira UE-108348
[CL 15600059 by Arciel Rekman in ue5-main branch]
This adds support for a new compilation flag that enables warnings as errors. Support was added for most of the main platforms. This feature has to opted into since many shaders currenntly contain small warnings, however this gives the ability for developpers to locally opt-in to this behavior to slowly sanitize code.
A global CVar: r.Shaders.WarningsAsErrors was also added, which will force every shader to be (re)built with this enabled for even more thorough checking.
#rb Jason.Nadro, Lukas.Hermanns, Rolando.Caloca
[CL 15383543 by chris kulla in ue5-main branch]
#jira none
#rb stu.mckenna
#lockdown Marcus.Wassmer
#ROBOMERGE-SOURCE: CL 12928868 in //UE4/Release-4.25/... via CL 12928880 via CL 12928942
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v682-12900288)
[CL 12928955 by rob krajcarski in Main branch]
- this was added to aid DXC bring up and is no longer needed
- there are no active references
#rb David.Harvey
#jira none
#rnx
#ushell-cherrypick of 12599316 by eric.mcdaniel
#ROBOMERGE-SOURCE: CL 12754507 in //UE4/Release-4.25Plus/... via CL 12783839
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863)
[CL 12786352 by eric mcdaniel in Main branch]
- add support for disabling shader validation
- UE flag already existed but didn't result in additional args being given to the shader compiler
- D3D shader compiler now respects the flag
- added new cvar r.Shaders.Validation to drive this globally
- enabled by default
#rb David.Harvey
#jira none
#ushell-cherrypick of 12081058 by eric.mcdaniel
#ROBOMERGE-SOURCE: CL 12726824 in //UE4/Release-4.25Plus/... via CL 12781742
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863)
[CL 12782558 by eric mcdaniel in Main branch]
#rb Rolando.Caloca
#jira none
#ushell-cherrypick of 12581778 by Yuriy.ODonnell
#ROBOMERGE-SOURCE: CL 12624927 in //UE4/Release-4.25/... via CL 12624931 via CL 12624933
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v675-12543919)
[CL 12624936 by juan canada in Main branch]