|
Foundation
|
#include <Resource.hpp>
Public Member Functions | |
| VulkanBuffer (VulkanDevice const &device, RHIBufferDesc const &desc) | |
| VulkanBuffer (VulkanDevice const &device, RHIBufferDesc const &desc, vk::raii::Buffer &&buffer, bool shared=true) | |
| ~VulkanBuffer () override | |
| auto & | GetVkBuffer () |
| void * | Map () override |
| Maps the entire buffer to the host memory. Alignment is implementation-defined. Implementations MUST guarantee consecutive calls to Map() return the same pointer, therefore it's not possible to map the same resource multiple times. For caching behaviours, RHIBufferDesc. | |
| void | Flush (size_t offset, size_t size) override |
| Flushes the mapped region to the device. Depending on the implementation, this may be a no-op. | |
| void | Unmap () override |
| Releases or unmaps a previously mapped resource. Implementations MUST guarantee that Unmap() is called at destruction time if the resource is still mapped. | |
| vk::DeviceAddress | GetBufferAddress () const |
| RHIBufferScopedHandle< RHIBuffer > | CreateAliasedBuffer (RHIBufferDesc const &desc, size_t offset) override |
| RHIBuffer * | GetAliasedBuffer (Handle handle) const override |
| void | DestroyAliasedBuffer (Handle handle) override |
| size_t | GetAllocationSize () const override |
| void | DebugSetObjectName (const char *name) override |
Public Member Functions inherited from Foundation::RHI::RHIBuffer | |
| RHIBuffer (RHIDevice const &device, RHIBufferDesc const &desc) | |
| template<typename T > | |
| Span< T > | MapSpan (size_t count=kFullSize) |
| Creates a span that maps a contiguous region of the buffer to the host memory. Behaviour of the memory access is defined by the resource itself. e.g. RO/RW. It is undefined behaviour to access the memory without regard to the resource's host access type. For detailed mapping behaviour, Map | |
| template<typename T > | |
| T * | Map () |
| Maps as pointer of T. | |
Public Member Functions inherited from Foundation::RHI::RHIObject | |
| RHIObject ()=default | |
| RHIObject (RHIObject const &)=delete | |
| RHIObject & | operator= (const RHIObject &)=delete |
| RHIObject (RHIObject &&)=delete | |
| RHIObject & | operator= (RHIObject &&)=delete |
| virtual | ~RHIObject ()=default |
Public Attributes | |
| const bool | mShared {false} |
Public Attributes inherited from Foundation::RHI::RHIBuffer | |
| const RHIBufferDesc | mDesc |
Protected Attributes | |
| VulkanDevice const & | mDevice |
| VmaAllocation | mAllocation {nullptr} |
| vk::raii::Buffer | mBuffer {nullptr} |
| void * | mMapped {nullptr} |
| RHIObjectPool< VulkanBuffer > | mAliases |
Protected Attributes inherited from Foundation::RHI::RHIBuffer | |
| const RHIDevice & | mDevice |
| VulkanBuffer::VulkanBuffer | ( | VulkanDevice const & | device, |
| RHIBufferDesc const & | desc | ||
| ) |
| VulkanBuffer::VulkanBuffer | ( | VulkanDevice const & | device, |
| RHIBufferDesc const & | desc, | ||
| vk::raii::Buffer && | buffer, | ||
| bool | shared = true |
||
| ) |
|
override |
|
overridevirtual |
Implements Foundation::RHI::RHIBuffer.
|
overridevirtual |
Implements Foundation::RHI::RHIBuffer.
|
overridevirtual |
Implements Foundation::RHI::RHIBuffer.
|
overridevirtual |
Flushes the mapped region to the device. Depending on the implementation, this may be a no-op.
Implements Foundation::RHI::RHIBuffer.
Implements Foundation::RHI::RHIBuffer.
|
overridevirtual |
Implements Foundation::RHI::RHIBuffer.
| vk::DeviceAddress VulkanBuffer::GetBufferAddress | ( | ) | const |
|
inline |
|
overridevirtual |
Maps the entire buffer to the host memory. Alignment is implementation-defined. Implementations MUST guarantee consecutive calls to Map() return the same pointer, therefore it's not possible to map the same resource multiple times. For caching behaviours, RHIBufferDesc.
Implements Foundation::RHI::RHIBuffer.
|
overridevirtual |
Releases or unmaps a previously mapped resource. Implementations MUST guarantee that Unmap() is called at destruction time if the resource is still mapped.
Implements Foundation::RHI::RHIBuffer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| const bool Foundation::RHI::VulkanBuffer::mShared {false} |