XLE  v0.02.0
Public Member Functions | List of all members
BufferUploads::Manager Class Reference
Inheritance diagram for BufferUploads::Manager:
Inheritance graph
[legend]

Public Member Functions

void UpdateData (TransactionID id, DataPacket *rawData, const PartialResource &)
 Use UpdateData to change the data within an existing object More...
 
TransactionID Transaction_Begin (const BufferDesc &desc, DataPacket *initialisationData=NULL, TransactionOptions::BitField flags=0)
 Begin a new transaction More...
 
TransactionID Transaction_Begin (intrusive_ptr< ResourceLocator > &locator, TransactionOptions::BitField flags=0)
 Begin a new transaction More...
 
void Transaction_End (TransactionID id)
 Ends a transaction More...
 
void Transaction_Validate (TransactionID id)
 Validates a transaction More...
 
intrusive_ptr< ResourceLocatorTransaction_Immediate (const BufferDesc &desc, DataPacket *initialisationData, const PartialResource &)
 Create a new buffer synchronously More...
 
intrusive_ptr< ResourceLocatorGetResource (TransactionID id)
 Gets the resource from a completed transaction More...
 
void Resource_Validate (const ResourceLocator &locator)
 Read back data from a resource More...
 
intrusive_ptr< DataPacketResource_ReadBack (const ResourceLocator &locator)
 Read back data from a resource More...
 
void AddRef (TransactionID id)
 Add extra ref count to transaction More...
 
bool IsCompleted (TransactionID id)
 Checks for completion More...
 
CommandListMetrics PopMetrics ()
 Gets performance metrics More...
 
PoolSystemMetrics CalculatePoolMetrics () const
 Returns metrics about pool memory More...
 
size_t ByteCount (const BufferDesc &desc) const
 Returns the size of a buffer More...
 
void Update (RenderCore::IThreadContext &)
 Called every frame to update uploads More...
 
void Flush ()
 Stalls until all work queues are empty More...
 
void FramePriority_Barrier ()
 Sets a barrier for frame priority operations More...
 
EventListID EventList_GetLatestID ()
 
void EventList_Get (EventListID id, Event_ResourceReposition *&begin, Event_ResourceReposition *&end)
 
void EventList_Release (EventListID id)
 
void OnLostDevice ()
 
void OnResetDevice ()
 
 Manager (RenderCore::IDevice *renderDevice)
 
- Public Member Functions inherited from BufferUploads::IManager

Additional Inherited Members

- Public Types inherited from BufferUploads::IManager
typedef uint32 EventListID
 

Member Function Documentation

void BufferUploads::Manager::AddRef ( TransactionID  id)
virtual

Add extra ref count to transaction

Adds another reference count to a transaction. Useful when a resource is getting cloned. Should be balanced with a call to Transaction_End

See also
Transaction_End

Implements BufferUploads::IManager.

size_t BufferUploads::Manager::ByteCount ( const BufferDesc desc) const
virtual

Returns the size of a buffer

Calculates the size of a buffer from a description. This can be used to estimate the amount of GPU memory that will be used.

Implements BufferUploads::IManager.

PoolSystemMetrics BufferUploads::Manager::CalculatePoolMetrics ( ) const
virtual

Returns metrics about pool memory

Returns some profiling metrics related to the resource pooling buffers maintained by the system. Used by the BufferUploadDisplay for presenting profiling information.

Implements BufferUploads::IManager.

void BufferUploads::Manager::Flush ( )
virtual

Stalls until all work queues are empty

Normally should only be used during shutdown and loading.

Implements BufferUploads::IManager.

void BufferUploads::Manager::FramePriority_Barrier ( )
virtual

Sets a barrier for frame priority operations

Sets a barrier, which determines the "end of frame" point for frame priority operations. This will normally be called from the same thread that begins most upload operations.

Implements BufferUploads::IManager.

intrusive_ptr< ResourceLocator > BufferUploads::Manager::GetResource ( TransactionID  id)
virtual

Gets the resource from a completed transaction

After a transaction has been completed, get the resource with this method. Note that the reference count for the returned resource is incremented by one in this method. The caller must balance that with a call to Resource_Release().

Implements BufferUploads::IManager.

bool BufferUploads::Manager::IsCompleted ( TransactionID  id)
virtual

Checks for completion

Returns true iff the given transaction has been completed.

Implements BufferUploads::IManager.

CommandListMetrics BufferUploads::Manager::PopMetrics ( )
virtual

Gets performance metrics

Gets the latest performance metrics. Internally the system maintains a queue of performance metrics. Every frame, a new set of metrics is pushed onto the queue (until the stack reaches it's maximum size). PopMetrics() will remove the next item from the queue. If there no more items, "_commitTime" will be 0.

Implements BufferUploads::IManager.

intrusive_ptr< DataPacket > BufferUploads::Manager::Resource_ReadBack ( const ResourceLocator locator)
virtual

Read back data from a resource

Read data back from a resource. Sometimes this may require copying data from the GPU onto the CPU. Note that this can have a significant effect on performance! If the resource is currently in use by the GPU, it can result in a store. Whenever possible, it's recommended to avoid using this method. It's provided for compatibility and debugging.

Implements BufferUploads::IManager.

void BufferUploads::Manager::Resource_Validate ( const ResourceLocator locator)
virtual

Read back data from a resource

Read data back from a resource. Sometimes this may require copying data from the GPU onto the CPU. Note that this can have a significant effect on performance! If the resource is currently in use by the GPU, it can result in a store. Whenever possible, it's recommended to avoid using this method. It's provided for compatibility and debugging.

Implements BufferUploads::IManager.

TransactionID BufferUploads::Manager::Transaction_Begin ( const BufferDesc desc,
DataPacket initialisationData = NULL,
TransactionOptions::BitField  flags = 0 
)
virtual

Begin a new transaction

Begin a new transaction, either by creating a new resource, or by attaching to an existing resource.

Implements BufferUploads::IManager.

TransactionID BufferUploads::Manager::Transaction_Begin ( intrusive_ptr< ResourceLocator > &  locator,
TransactionOptions::BitField  flags = 0 
)
virtual

Begin a new transaction

Begin a new transaction, either by creating a new resource, or by attaching to an existing resource.

Implements BufferUploads::IManager.

void BufferUploads::Manager::Transaction_End ( TransactionID  id)
virtual

Ends a transaction

Ends a transaction started with Transaction_Begin. Internally, this updates a reference count. So every call to Transaction_Begin must be balanced with a call to Transaction_End. Be sure to end all transactions before destroying the buffer uploads manager.

Implements BufferUploads::IManager.

intrusive_ptr< ResourceLocator > BufferUploads::Manager::Transaction_Immediate ( const BufferDesc desc,
DataPacket initialisationData,
const PartialResource  
)
virtual

Create a new buffer synchronously

Creates a new resource synchronously. All creating objects will execute in the current thread, and a new resource will be returned from the call. Use these methods when uploads can't be delayed.

Implements BufferUploads::IManager.

void BufferUploads::Manager::Transaction_Validate ( TransactionID  id)
virtual

Validates a transaction

This is a tool for debugging. Checks a transaction for common problems. Only implemented in _DEBUG builds. Errors will invoke an assert.

Implements BufferUploads::IManager.

void BufferUploads::Manager::Update ( RenderCore::IThreadContext immediateContext)
virtual

Called every frame to update uploads

Performs once-per-frame tasks. Normally called by the render device once per frame.

Implements BufferUploads::IManager.

void BufferUploads::Manager::UpdateData ( TransactionID  id,
DataPacket rawData,
const PartialResource  
)
virtual

Use UpdateData to change the data within an existing object

Upload data for buffer uploads can be provided either to the Transaction_Begin call, or to UploadData. Use UploadData when you want to update an existing resource, or change the data that's already present.

Implements BufferUploads::IManager.


The documentation for this class was generated from the following files: