Navigation
API > API/Runtime > API/Runtime/RHI > API/Runtime/RHI/FRHICommandListBase
Description
LockBufferMGPU / UnlockBufferMGPU may ONLY be called for buffers with the EBufferUsageFlags::MultiGPUAllocate flag set! And buffers with that flag set may not call the regular (single GPU) LockBuffer / UnlockBuffer. The single GPU version of LockBuffer uses driver mirroring to propagate the updated buffer to other GPUs, while the MGPU / MultiGPUAllocate version requires the caller to manually lock and initialize the buffer separately on each GPU. This can be done by iterating over FRHIGPUMask::All() and calling LockBufferMGPU / UnlockBufferMGPU for each version.
EBufferUsageFlags::MultiGPUAllocate is only needed for cases where CPU initialized data needs to be different per GPU, which is a rare edge case. Currently, this is only used for the ray tracing acceleration structure address buffer, which contains virtual address references to other GPU resources, which may be in a different location on each GPU.
| Name | LockBufferMGPU |
| Type | function |
| Header File | /Engine/Source/Runtime/RHI/Public/RHICommandList.h |
| Include Path | #include "RHICommandList.h" |
void * LockBufferMGPU
(
FRHIBuffer * Buffer,
uint32 GPUIndex,
uint32 Offset,
uint32 SizeRHI,
EResourceLockMode LockMode
)