OGRE-Next: Ogre::AsyncTicket Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ogre::AsyncTicket Class Referenceabstract

In Ogre 2.0 data structures, reading data from GPU back to CPU is asynchronous. More...

`#include <OgreAsyncTicket.h>`

Inheritance diagram for Ogre::AsyncTicket:
[legend]

## Public Member Functions
| AsyncTicket (BufferPacked *creator, StagingBuffer *stagingBuffer, size_t elementStart, size_t elementCount)
virtual | ~AsyncTicket ()
const void * | map ()
| Maps the buffer for CPU access.
virtual bool | queryIsTransferDone ()
void | unmap ()
| Unmaps the pointer mapped with map().

## Detailed Description

In Ogre 2.0 data structures, reading data from GPU back to CPU is asynchronous.

See BufferPacked::readRequest to generate a ticket. While the async transfer is being performed, you should be doing something else.

Remarks
  If you call map() before the transfer is done, it will produce a stall as the CPU must wait for the GPU to finish all its pending operations.

  Use queryIsTransferDone() to query if the transfer has finished. Beware not all APIs support querying async transfer status. In those cases there is no reliable way to determine when the transfer is done. An almost safe bet is to wait two frames before mapping.

  Call BufferPacked::disposeTicket when you're done with this ticket.

## Constructor & Destructor Documentation

## ◆ AsyncTicket()

Ogre::AsyncTicket::AsyncTicket | ( | BufferPacked * | creator,
|  | StagingBuffer * | stagingBuffer,
|  | size_t | elementStart,
|  | size_t | elementCount )

## ◆ ~AsyncTicket()

virtual Ogre::AsyncTicket::~AsyncTicket | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ map()

const void * Ogre::AsyncTicket::map | ( |  | ) |

Maps the buffer for CPU access.

Will stall if transfer from GPU memory to staging area hasn't finished yet.

See also
  queryIsTransferDone.

Remarks
  Attempting to const cast the returned pointer and write to it is undefined behavior. Only call this function once. Once mapped, cannot be remapped again.

Returns
  The pointer with the data read from the GPU. Read only.

## ◆ queryIsTransferDone()

virtual bool Ogre::AsyncTicket::queryIsTransferDone | ( |  | ) |
| inlinevirtual

Reimplemented in Ogre::D3D11AsyncTicket, Ogre::GL3PlusAsyncTicket, Ogre::GLES2AsyncTicket, Ogre::MetalAsyncTicket, Ogre::NULLAsyncTicket, and Ogre::VulkanAsyncTicket.

## ◆ unmap()

void Ogre::AsyncTicket::unmap | ( |  | ) |

Unmaps the pointer mapped with map().

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

- OgreAsyncTicket.h