![]() |
VR-Forces Developer's Guide
|
Intermediate base for GL operations that work with texture objects.
Subclasses implement the no-arg execute() to perform GL work (texture allocation, pixel upload, deletion, etc.).
The execute(DtGpuArenaUploadState&) overload defined on this class is called by DtGpuArena for every op queued in myOneTimeGpuOps. It invokes execute() and then automatically credits textureByteCount() to the arena's upload-statistics state. Subclasses do not need to handle this accounting themselves.
The default textureByteCount() returns 0; allocation and deletion ops do not upload pixel data and therefore do not override it.

Public Member Functions | |
| DtGlTextureOp (const std::string &name, DtDe &de) | |
| virtual | ~DtGlTextureOp () |
| virtual unsigned int | textureByteCount () const |
| virtual void | execute (DtGpuArenaUploadState &uploadState) override |
Public Member Functions inherited from makVrv::DtGpuOperation | |
| DtGpuOperation (const std::string &name, DtDe &de) | |
| virtual | ~DtGpuOperation () |
| virtual void | execute ()=0 |
Additional Inherited Members | |
Protected Attributes inherited from makVrv::DtGpuOperation | |
| DtDe & | myDe |
| const std::string | myName |
| makVrv::DtGlTextureOp::DtGlTextureOp | ( | const std::string & | name, |
| DtDe & | de | ||
| ) |
Construct with a name and engine context.
| name | Logical name for this operation. |
| de | Engine context (not owned). |
|
virtual |
Returns the number of texture bytes this op uploads to the GPU. Default returns 0 (allocation ops do not upload data).
Reimplemented in makVrv::DtTextureSubRegionUploadOp, makVrv::DtTextureUploadOp, and makVrv::DtTextureAllocOp.
|
overridevirtual |
Calls execute(), then credits textureByteCount() to the upload state.
This is the mechanism by which all DtGlTextureOp subclasses participate in statsUploadedTextureMemory accounting without any extra action by the subclass. DtGpuArena calls this overload for every op in myOneTimeGpuOps; the subclass only needs to implement the no-arg execute() and, if it uploads data, textureByteCount().
| uploadState | Per-frame upload state for the current arena pass. |
execute() for GL work and textureByteCount() for byte accounting. Do not override this overload. Reimplemented from makVrv::DtGpuOperation.