- 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]
Initial fixes and tested on D3D11, D3D12 and Vulkan
Changed 'n' to FShaderCodeName::Key
Also added checks if trying to add optional shader data out of order
#rb Jonas.Meyer, Kenzo.Terelst, Mihnea.Balta
[CL 14816162 by Rolando Caloca in ue5-main branch]