class
render::GpuResourcePool
Contains a pool of textures and buffers meant to accommodate reuse of such resources for the main purpose of using them as write targets on the GPU.
Public
Constructors
GpuResourcePool
Methods
Get
Attempts to find the unused render texture with the specified parameters in the pool, or creates a new texture otherwise.
- desc
- Descriptor structure that describes what kind of texture to retrieve.
Get
Attempts to find the unused render texture with the specified parameters in the pool, or creates a new texture otherwise.
Use this variant of the method if you are already holding a reference to a pooled texture which you want to reuse - this is more efficient than releasing the old texture and calling the other Get() variant.
- texture
- Existing reference to a pooled texture that you would prefer to reuse. If it matches the provided descriptor the system will return the unchanged texture, otherwise it will try to find another unused texture, or allocate a new one. New value will be output through this parameter.
- desc
- Descriptor structure that describes what kind of texture to retrieve.
Get
Attempts to find the unused storage buffer with the specified parameters in the pool, or creates a new buffer otherwise.
- desc
- Descriptor structure that describes what kind of buffer to retrieve.
Get
Attempts to find the unused storage buffer with the specified parameters in the pool, or creates a new buffer otherwise.
Use this variant of the method if you are already holding a reference to a pooled buffer which you want to reuse - this is more efficient than releasing the old buffer and calling the other Get() variant.
- buffer
- Existing reference to a pooled buffer that you would prefer to reuse. If it matches the provided descriptor the system will return the unchanged buffer, otherwise it will try to find another unused buffer, or allocate a new one. New value will be output through this parameter.
- desc
- Descriptor structure that describes what kind of buffer to retrieve.
Update
Lets the pool know that another frame has passed.
Prune
Destroys all unreferenced resources with that were last used frames ago.
Specify 0 to destroy all unreferenced resources.
staticInstance
Returns a reference to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticInstancePtr
Returns a pointer to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticShutDown
Shuts down this module and frees any resources it is using.
staticIsStarted
Query if the module has been started.
Protected
Methods
~Module<T>
OnStartUp
Override if you want your module to be notified once it has been constructed and started.
OnShutDown
Override if you want your module to be notified just before it is deleted.
staticInstanceInternal
Returns a singleton instance of this module.
Private
Methods
staticMatches
Checks does the provided texture match the parameters.
- texture
- Texture to check.
- desc
- Descriptor structure that describes what kind of texture to match.
Returns: True if the texture matches the descriptor, false otherwise.
staticMatches
Checks does the provided buffer match the parameters.
- buffer
- Buffer to check.
- desc
- Descriptor structure that describes what kind of buffer to match.
Returns: True if the buffer matches the descriptor, false otherwise.