LiteFX 0.4.1.2025
Computer Graphics Engine
|
Describes a chunk of device memory. More...
#include <rendering_api.hpp>
Inherited by LiteFX::Rendering::IBuffer [virtual]
, and LiteFX::Rendering::IImage [virtual]
.
Public Member Functions | |
virtual | ~IDeviceMemory () noexcept=default |
virtual UInt32 | elements () const noexcept=0 |
Gets the number of sub-resources inside the memory chunk. | |
virtual size_t | size () const noexcept=0 |
Gets the size (in bytes) of the aligned memory chunk. | |
virtual size_t | elementSize () const noexcept=0 |
Returns the size of a single element within the buffer. If there is only one element, this is equal to size. | |
virtual size_t | elementAlignment () const noexcept=0 |
Returns the alignment of a single element. | |
virtual size_t | alignedElementSize () const noexcept=0 |
Returns the actual size of the element in device memory. | |
virtual ResourceUsage | usage () const noexcept=0 |
Returns the usage flags for the resource. | |
bool | writable () const noexcept |
Returns true , if the resource can be bound to a read/write descriptor. | |
virtual UInt64 | virtualAddress () const noexcept=0 |
Gets the address of the resource in GPU memory. | |
Protected Member Functions | |
IDeviceMemory () noexcept=default | |
IDeviceMemory (IDeviceMemory &&) noexcept=default | |
IDeviceMemory (const IDeviceMemory &)=default | |
IDeviceMemory & | operator= (IDeviceMemory &&) noexcept=default |
IDeviceMemory & | operator= (const IDeviceMemory &)=default |
Describes a chunk of device memory.
|
protecteddefaultnoexcept |
|
protecteddefaultnoexcept |
|
protecteddefault |
|
virtualdefaultnoexcept |
|
pure virtualnoexcept |
Returns the actual size of the element in device memory.
For images, this method will return a value that equals the result of size, aligned by elementAlignment.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Returns the alignment of a single element.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Gets the number of sub-resources inside the memory chunk.
For buffers, this equals the number of array elements. For images, this equals the product of layers, levels and planes. This number represents the number of states, that can be obtained by calling the state method.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Returns the size of a single element within the buffer. If there is only one element, this is equal to size.
For images, this method will return a value that equals the result of size.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
protecteddefault |
|
protecteddefaultnoexcept |
|
pure virtualnoexcept |
Gets the size (in bytes) of the aligned memory chunk.
The size of the device memory block depends on different factors. The actual used memory of one element can be obtained by calling by the elementSize. For different reasons, though, elements may be required to be aligned to a certain size. The size of one aligned element is returned by alignedElementSize. The size of the memory block, the elements get aligned to is returned by elementAlignment.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, LiteFX::Rendering::Backends::VulkanImage, and LiteFX::Rendering::IImage.
|
pure virtualnoexcept |
Returns the usage flags for the resource.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
pure virtualnoexcept |
Gets the address of the resource in GPU memory.
Note that this may not be supported for all resource types in all backends. For example, Vulkan does not support obtaining virtual addresses of image resources.
Implemented in LiteFX::Rendering::Backends::DirectX12Buffer, LiteFX::Rendering::Backends::DirectX12Image, LiteFX::Rendering::Backends::VulkanBuffer, and LiteFX::Rendering::Backends::VulkanImage.
|
inlinenoexcept |
Returns true
, if the resource can be bound to a read/write descriptor.
If the resource is not writable, attempting to bind it to a writable descriptor will result in an exception.
true
, if the resource can be bound to a read/write descriptor.