Class GPUBufferDX12
GPU buffer for DirectX 12 backend.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.h
Syntax
public class GPUBufferDX12 : public GPUResourceDX12, public ResourceOwnerDX12
Constructors
GPUBufferDX12(GPUDeviceDX12* device, const StringView& name)
Initializes a new instance of the GPUBufferDX12 class.
Declaration
public GPUBufferDX12(GPUDeviceDX12* device, const StringView& name)
Parameters
|
GPUDeviceDX12
device
The device. |
|
StringView
name
The name. |
Methods
AsGPUResource()
Gets resource owner object as a GPUResource type or returns null if cannot perform cast.
Declaration
public virtual GPUResource* AsGPUResource() const override
Returns
|
GPUResource
|
Overrides
GetCounter()
Gets the counter resource.
Declaration
public GPUBufferDX12* GetCounter() const
Returns
|
GPUBufferDX12
|
GetIBView(D3D12_INDEX_BUFFER_VIEW& view)
Gets index buffer view descriptor. Valid only for the index buffers.
Declaration
public void GetIBView(D3D12_INDEX_BUFFER_VIEW& view) const
Parameters
|
D3D12_INDEX_BUFFER_VIEW
view
|
Returns
|
void
|
GetLocation()
Gets buffer location in a GPU memory.
Declaration
public D3D12_GPU_VIRTUAL_ADDRESS GetLocation() const
Returns
|
D3D12_GPU_VIRTUAL_ADDRESS
|
GetSizeInBytes()
Gets buffer size in a GPU memory in bytes.
Declaration
public uint64 GetSizeInBytes() const
Returns
|
uint64
|
GetVBView(D3D12_VERTEX_BUFFER_VIEW& view)
Gets vertex buffer view descriptor. Valid only for the vertex buffers.
Declaration
public void GetVBView(D3D12_VERTEX_BUFFER_VIEW& view) const
Parameters
|
D3D12_VERTEX_BUFFER_VIEW
view
|
Returns
|
void
|
Map(GPUResourceMapMode mode)
Gets a CPU pointer to the resource by mapping its contents. Denies the GPU access to that resource.
Always call Unmap if the returned pointer is valid to release resources.
Declaration
public virtual void* Map(GPUResourceMapMode mode) override
Parameters
|
GPUResourceMapMode
mode
The map operation mode. |
Returns
|
void
The pointer of the mapped CPU buffer with resource data or null if failed. |
Overrides
OnInit()
OnReleaseGPU()
Releases GPU resource data (implementation).
Declaration
protected virtual void OnReleaseGPU() override
Overrides
Unmap()
Invalidates the mapped pointer to a resource and restores the GPU's access to that resource.
Declaration
public virtual void Unmap() override
Overrides
View()
Gets the view for the whole buffer.
Declaration
public virtual GPUBufferView* View() const override
Returns
|
GPUBufferView
|