LiteFX  0.1.1.2021
Computer Graphics Engine
LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer > Class Template Referenceabstract

Allows the object to transfer data between its local memory from or to an arbitrary LiteFX::Rendering::IBuffer object. More...

#include <rendering.hpp>

Inherited by LiteFX::Rendering::ITexture< VulkanDescriptorLayout, IVulkanBuffer, VulkanCommandBuffer >, LiteFX::Rendering::ITexture< DirectX12DescriptorLayout, IDirectX12Buffer, DirectX12CommandBuffer >, LiteFX::Rendering::ITransferableBuffer< IVulkanBuffer, VulkanCommandBuffer > [virtual], LiteFX::Rendering::ITransferableBuffer< TDerived, TCommandBuffer > [virtual], LiteFX::Rendering::ITransferableBuffer< IDirectX12Buffer, DirectX12CommandBuffer > [virtual], LiteFX::Rendering::ITexture< TDescriptorLayout, TBufferInterface, TCommandBuffer >, and LiteFX::Rendering::ITransferableBuffer< TBufferInterface, TCommandBuffer > [virtual].

Public Types

using command_buffer_type = TCommandBuffer
 
using buffer_type = TBufferInterface
 

Public Member Functions

virtual ~ITransferable () noexcept=default
 
virtual void transferFrom (const TCommandBuffer &commandBuffer, const TBufferInterface &source, const UInt32 &sourceElement=0, const UInt32 &targetElement=0, const UInt32 &elements=1) const =0
 Transfers data from the source buffer into the objects local memory. More...
 
virtual void transferTo (const TCommandBuffer &commandBuffer, const TBufferInterface &target, const UInt32 &sourceElement=0, const UInt32 &targetElement=0, const UInt32 &elements=1) const =0
 Transfers data from the objects local memory into the target buffer. More...
 

Detailed Description

template<typename TBufferInterface, typename TCommandBuffer>
class LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >

Allows the object to transfer data between its local memory from or to an arbitrary LiteFX::Rendering::IBuffer object.

Template Parameters
TBufferInterfaceThe type of the buffer interface. Must inherit from IBuffer.
TCommandBufferThe type of the command buffer. Must implement from ICommandBuffer.

Member Typedef Documentation

◆ buffer_type

template<typename TBufferInterface , typename TCommandBuffer >
using LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >::buffer_type = TBufferInterface

◆ command_buffer_type

template<typename TBufferInterface , typename TCommandBuffer >
using LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >::command_buffer_type = TCommandBuffer

Constructor & Destructor Documentation

◆ ~ITransferable()

template<typename TBufferInterface , typename TCommandBuffer >
virtual LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >::~ITransferable ( )
virtualdefaultnoexcept

Member Function Documentation

◆ transferFrom()

template<typename TBufferInterface , typename TCommandBuffer >
virtual void LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >::transferFrom ( const TCommandBuffer &  commandBuffer,
const TBufferInterface &  source,
const UInt32 sourceElement = 0,
const UInt32 targetElement = 0,
const UInt32 elements = 1 
) const
pure virtual

Transfers data from the source buffer into the objects local memory.

Parameters
commandBufferThe command buffer to issue the transfer command to.
sourceThe source buffer to transfer data from.
sourceElementThe index of the first element in the source buffer to copy.
targetElementThe index of the first element in the current buffer to copy to.
elementsThe number of elements to copy from the source buffer into the current buffer.
Exceptions
ArgumentOutOfRangeExceptionThrown, if the number of either the source buffer or the current buffer has not enough elements for the specified elements parameter.

◆ transferTo()

template<typename TBufferInterface , typename TCommandBuffer >
virtual void LiteFX::Rendering::ITransferable< TBufferInterface, TCommandBuffer >::transferTo ( const TCommandBuffer &  commandBuffer,
const TBufferInterface &  target,
const UInt32 sourceElement = 0,
const UInt32 targetElement = 0,
const UInt32 elements = 1 
) const
pure virtual

Transfers data from the objects local memory into the target buffer.

Parameters
commandBufferThe command buffer to issue the transfer command to.
targetThe target buffer to transfer data to.
sourceElementThe index of the first element in the current buffer to copy.
targetElementThe index of the first element in the target buffer to copy to.
elementsThe number of elements to copy from the current buffer into the target buffer.
Exceptions
ArgumentOutOfRangeExceptionThrown, if the number of either the target buffer or the current buffer has not enough elements for the specified elements parameter.