Asynchronous texture uploader.
More...
#include <TextureUploader.hpp>
|
|
virtual void | RenderThreadUpdate (IDeviceContext *pContext)=0 |
| | Executes pending render-thread operations.
|
| |
| virtual void | AllocateUploadBuffer (IDeviceContext *pContext, const UploadBufferDesc &Desc, IUploadBuffer **ppBuffer)=0 |
| | Allocates upload buffer.
|
| |
| virtual void | ScheduleGPUCopy (IDeviceContext *pContext, ITexture *pDstTexture, Uint32 ArraySlice, Uint32 MipLevel, IUploadBuffer *pUploadBuffer, bool AutoRecycle=false)=0 |
| | Schedules a GPU copy or executes the copy immediately.
|
| |
| virtual void | RecycleBuffer (IUploadBuffer *pUploadBuffer)=0 |
| | Recycles upload buffer to make it available for future operations.
|
| |
|
virtual TextureUploaderStats | GetStats ()=0 |
| | Returns texture uploader statistics, see Diligent::TextureUploaderStats.
|
| |
| virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
| | Queries the specific interface.
|
| |
| template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type> |
| void | QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface) |
| |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
| | Increments the number of strong references by 1.
|
| |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
| |
| virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
| |
Asynchronous texture uploader.
◆ AllocateUploadBuffer()
Allocates upload buffer.
- Parameters
-
| [in] | pContext | - Pointer to the device context when the method is executed by render thread, or null when it is called from a worker thread, see remarks. |
| [in] | Desc | - Buffer description, see Diligent::UploadBufferDesc. |
| [out] | ppBuffer | - Memory address where pointer to the created upload buffer object will be written to. |
When the method is called from a worker thread (pContext is null), it may enqueue a render-thread operation and block until the operation is complete. If in this case the method is in fact called from the render thread, it may never return causing a deadlock. Always provide non-null device context when calling the method from the render thread. On the other hand, always pass null when calling the method from a worker thread to avoid synchronization issues, which may result in an undefined behavior.
The method can be safely called from multiple threads simultaneously. However, if pContext is not null, the application is responsible for synchronizing the access to the context.
◆ RecycleBuffer()
| virtual void Diligent::ITextureUploader::RecycleBuffer |
( |
IUploadBuffer * | pUploadBuffer | ) |
|
|
pure virtual |
Recycles upload buffer to make it available for future operations.
- Parameters
-
| [in] | pUploadBuffer | - Upload buffer to recycle. |
◆ ScheduleGPUCopy()
| virtual void Diligent::ITextureUploader::ScheduleGPUCopy |
( |
IDeviceContext * | pContext, |
|
|
ITexture * | pDstTexture, |
|
|
Uint32 | ArraySlice, |
|
|
Uint32 | MipLevel, |
|
|
IUploadBuffer * | pUploadBuffer, |
|
|
bool | AutoRecycle = false ) |
|
pure virtual |
Schedules a GPU copy or executes the copy immediately.
- Parameters
-
| [in] | pContext | - Pointer to the device context when the method is executed by render thread, or null when it is called from a worker thread, see remarks. |
| [in] | pDstTexture | - Destination texture for copy operation. |
| [in] | ArraySlice | - Destination array slice. When multiple slices are copied, the starting slice. |
| [in] | MipLevel | - Destination mip level. When multiple mip levels are copied, the starting mip level. |
| [in] | pUploadBuffer | - Upload buffer to copy data from. |
| [in] | AutoRecycle | - Whether to recycle the upload buffer after the copy operation is complete. |
When the method is called from a worker thread (pContext is null), it may enqueue a render-thread operation and block until the operation is complete. If in this case the method is in fact called from the render thread, it may never return causing a deadlock. Always provide non-null device context when calling the method from the render thread. On the other hand, always pass null when calling the method from a worker thread to avoid synchronization issues, which may result in an undefined behavior.