|
The Vish Visualization Shell 0.3
Vish
|
Implements functionality related to an OpenGL buffer object. More...
#include <ocean/GLvish/GLBuffer.hpp>
Public Member Functions | |
| void * | map_wo (size_t offset=0, size_t length=0) const override |
| Recommended creation and usage pattern for a short-lived CPU staging buffer. | |
| void | setSubData (size_t offset, const void *data, size_t length) const override |
| Set a subset of the data, which is more efficient than setData();. | |
| Public Member Functions inherited from Wizt::MapMemory | |
| void | setData (size_t length, const StorageFlags &SF) const |
| Reserve data only. | |
Implements functionality related to an OpenGL buffer object.
|
overridevirtual |
Recommended creation and usage pattern for a short-lived CPU staging buffer.
This document describes the optimal OpenGL flags and workflow for a staging buffer used exclusively as an intermediate upload source. The staging buffer is mapped once, written once, unmapped immediately, and subsequently used as the source of a GPU-side copy operation into a device-local buffer.
A staging buffer serves as a CPU-visible temporary storage region. Data is written into the staging buffer by the CPU and then transferred into a non-mappable, device-local buffer using glCopyNamedBufferSubData(). The staging buffer itself is not used for rendering and is not accessed by the GPU outside of the copy operation.
For a staging buffer that is mapped only once and unmapped before any GPU access, the recommended storage flags are:
These flags permit CPU write access and impose no additional residency or synchronization requirements. Persistent or coherent mapping flags are not required because the buffer is not kept mapped across frames and does not require GPU-visible coherence while mapped.
The corresponding mapping flags should match the storage flags:
No additional mapping flags are necessary. In particular:
Implements Wizt::MapMemory.
References map_wo().
Referenced by map_wo().