Performance
Architecture
SweejTech Propagation makes use of GPU Raytracing to accelerate raytracing operations. In order to do that, it makes use of engine code and features that run on different threads, as well as the GPU hardware itself.
Game Thread
The Game Thread is used to execute blueprint functions and to register and unregister non-Unreal Audio sounds with the system.
Audio Pipe (for Unreal Audio sounds)
This pipe is consumed by a Foreground Worker thread and will shop up there in Unreal Insights.
For Unreal Audio sounds, the Audio Thread is used to register and unregister Unreal Audio sounds and to update their DSP parameters.
Line tracing on the CPU to ensure there are no first-frame artefacts is also performed on this thread for all Unreal Audio sounds.
Normal Priority Background Worker Threads
A normal priorty background thread is used via the Async Task system to update CPU-side buffers that will be passed to the GPU, and to process the results of GPU readbacks.
Render Thread
The Render thread is used to dispatch the raytracing compute shader to the GPU, and to handle readbacks from the GPU.
GPU Compute Queue
The Obstruction compute shader is dispatched to the async compute queue so it can use the raytracing hardware on the GPU as it becomes available, in parallel with the graphics queue. This will distort the actual time it appears to take on Unreal Insights traces, since a variable amount of waiting can occur every frame. To test more accurately, disable async compute via the console command r.RDG.AsyncCompute 0.
Measurements
Measured using a PC with:
- Intel i9-12900K CPU
- NVIDIA GeForce RTX 3090
On a build with:
- Unreal 5.7.0 Standalone
- Development configuration build
- Scene with 33 Propagation-enabled sources
| Operation | Median Time (μsec) | Thread |
|---|---|---|
| UpdatePrimitiveIDs | 70 | Background Worker |
| UpdateActiveSoundPositions | 1 | Audio Pipe |
| AddActiveSound | 50 | Audio Pipe |
| DispatchRays | 30 | Render Thread |
| RemoveActiveSound | 10 | Audio Pipe |
| UpdatePositions | 10 | Background Worker |
| ProcessResults | 10 | Background Worker |
| PerformSyncLineTrace | 10 | Game Thread |
| AddPropagationComponent | 10 | Game Thread |
| RemovePropagationComponent | 1 | Game Thread |
| RayTraceComputeShader | 30 | GPU Compute |
