Files
UnrealEngineUWP/Engine/Source/Developer/Windows
Yuriy ODonnell aa9e6a0c41 Added a basic implementation of assert in shaders for D3D12. Requires SM6 support which can be enabled through r.D3D12.AllowShaderModel6=1.
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]
2021-04-30 08:37:35 -04:00
..
2021-04-27 06:40:20 -04:00