|
CeresEngine 0.2.0
A game development framework
|
A manager class that creates, manages and handles GPU images for images and textures used by the renderer. More...
#include <CeresEngine/Renderer/Resources/RendererTexture.hpp>
Classes | |
| struct | TextureInfo |
Public Member Functions | |
| RendererTextureManager (Renderer &renderer, GPUDevice &device) | |
Creates a new instance of the RendererTextureManager. | |
| ~RendererTextureManager () | |
Destroys the RendererTextureManager and releases all GPU resources managed and allocated by it. | |
| void | prepare () |
| GPUImagePtr | getImage (const TexturePtr &image) |
Tries to locate a GPU Image for the given image. | |
| RendererTexturePtr | get (const TexturePtr &image) |
| Gets a renderer texture object. | |
| GPUResourceSet & | getResourceSet () const |
| Gets the resource set for the global texture table. | |
| Renderer & | getRenderer () const |
| The renderer that owns this manager instance. | |
Private Member Functions | |
| RendererTexturePtr | getOrCreate (const TexturePtr &image) |
Gets an existing or creates a new renderer texture instance for the given engine image. | |
| RendererTexturePtr | create (const TexturePtr &image) |
Creates a new renderer texture instance for the given engine image. | |
| void | notifyDestroy (RendererTexture *texture) noexcept |
| Notifies the manager that the renderer texture is being destroyed. | |
Private Attributes | |
| Renderer & | mRenderer |
| The renderer that owns this manager instance. | |
| GPUDevice & | mDevice |
| The device to which the textures will be uploaded to. | |
| HashMap< Texture *, TextureInfo > | mTexturesByResource |
| A map that holds texture information for each engine texture used by the renderer. | |
| Vector< RendererTexture * > | mTextures |
| A vector that holds all renderer texture instances. | |
| bool | mDirty = false |
| Determines if the bindless resource set set is empty. | |
| GPUResourceSetDescriptor | mResourceSetDescriptor |
| GPUResourceSetPtr | mResourceSet |
| A pointer to the global texture resource set. | |
Friends | |
| class | RendererTexture |
A manager class that creates, manages and handles GPU images for images and textures used by the renderer.
|
explicit |
Creates a new instance of the RendererTextureManager.
| CeresEngine::RendererTextureManager::~RendererTextureManager | ( | ) |
Destroys the RendererTextureManager and releases all GPU resources managed and allocated by it.
|
private |
Creates a new renderer texture instance for the given engine image.
|
inline |
Gets a renderer texture object.
The renderer texture is a renderer usable representation of an image resource. This exture begins in the pending state but will eventually be uploaded to GPU and be usable by renderables and other objects in the renderer scene.
If a renderer texture object for the given image resource already exists, the existing instance is returned to the user. If no existing instance is found, a new one is created and returned to the user.
| image | The image resource to get or create a new renderer texture for. |
| GPUImagePtr CeresEngine::RendererTextureManager::getImage | ( | const TexturePtr & | image | ) |
Tries to locate a GPU Image for the given image.
If no such image exists, the manager might schedule an asynchronous upload of data to the GPU and return once the GPU image becomes available.
| image | The image to return a GPU image resource for. |
Image for the image“. If no such GPU image exists, the manager might returnnullptr` until the GPU data upload is complete.
|
private |
Gets an existing or creates a new renderer texture instance for the given engine image.
|
inline |
The renderer that owns this manager instance.
|
inline |
Gets the resource set for the global texture table.
This is a resource that binds all loaded textures and allows dynamically indexing the resources from the GPU.
|
privatenoexcept |
Notifies the manager that the renderer texture is being destroyed.
| void CeresEngine::RendererTextureManager::prepare | ( | ) |
|
friend |
|
private |
The device to which the textures will be uploaded to.
Determines if the bindless resource set set is empty.
|
private |
The renderer that owns this manager instance.
|
private |
A pointer to the global texture resource set.
|
private |
|
private |
A vector that holds all renderer texture instances.
The order they appear in the vector corresponds to their IDs and positions in the bindless resource set.
|
private |
A map that holds texture information for each engine texture used by the renderer.