A system for dynamically allocating GPU memory for rendering. 更多...
#include <DynamicBufferAllocator.h>
类 FGlobalDynamicReadBuffer 继承关系图:类 | |
| struct | FAllocation |
| Information regarding an allocation from this buffer. 更多... | |
Public 成员函数 | |
| void | Commit () |
| Commits allocated memory to the GPU. 更多... | |
| bool | IsRenderAlarmLoggingEnabled () const |
| Returns true if log statements should be made because we exceeded GMaxVertexBytesAllocatedPerFrame | |
Public 成员函数 继承自 FRenderResource | |
| FRenderResource () | |
| Default constructor. | |
| FRenderResource (ERHIFeatureLevel::Type InFeatureLevel) | |
| Constructor when we know what feature level this resource should support | |
| virtual FString | GetFriendlyName () const |
| virtual void | InitDynamicRHI () |
| Initializes the dynamic RHI resource and/or RHI render target used by this resource. 更多... | |
| virtual void | InitResource () |
| Initializes the resource. 更多... | |
| virtual void | InitRHI () |
| Initializes the RHI resources used by this resource. 更多... | |
| virtual void | ReleaseDynamicRHI () |
| Releases the dynamic RHI resource and/or RHI render target resources used by this resource. 更多... | |
| virtual void | ReleaseResource () |
| Prepares the resource for deletion. 更多... | |
| virtual void | ReleaseRHI () |
| Releases the RHI resources used by this resource. 更多... | |
| void | UpdateRHI () |
| If the resource's RHI resources have been initialized, then release and reinitialize it. 更多... | |
| virtual | ~FRenderResource () |
| Destructor used to catch unreleased resources. | |
Protected 成员函数 | |
| virtual void | InitRHI () override |
| Initializes the RHI resources used by this resource. 更多... | |
| virtual void | ReleaseRHI () override |
| Releases the RHI resources used by this resource. 更多... | |
Protected 属性 | |
| FDynamicReadBufferPool * | HalfBufferPool |
| The pools of read buffers from which allocations are made. | |
| size_t | TotalAllocatedSinceLastCommit |
| A total of all allocations made since the last commit. 更多... | |
额外继承的成员函数 | |
静态 Public 成员函数 继承自 FRenderResource | |
| static void | InitPreRHIResources () |
| Initialize all resources initialized before the RHI was initialized | |
A system for dynamically allocating GPU memory for rendering.
Note that this must derive from FRenderResource so that we can safely free the shader resource views for OpenGL and other platforms. If we wait until the module is shutdown, the renderer RHI will have already been destroyed and we can execute code on invalid data. By making ourself a render resource, we clean up immediately before the renderer dies.
| void FGlobalDynamicReadBuffer::Commit | ( | ) |
Commits allocated memory to the GPU.
WARNING: Once this buffer has been committed to the GPU, allocations remain valid only until the next call to Allocate!
|
overrideprotectedvirtual |
Initializes the RHI resources used by this resource.
Called when entering the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.
重载 FRenderResource .
|
overrideprotectedvirtual |
Releases the RHI resources used by this resource.
Called when leaving the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.
重载 FRenderResource .
|
protected |
A total of all allocations made since the last commit.
Used to alert about spikes in memory usage.