![]() |
Lysa
0.0
Lysa 3D Engine
|
Central container responsible for GPU-ready shared resources.
The Resources class owns and manages device memory arrays (vertices, indices, materials, mesh surfaces), the global sampler set, the descriptor layout/set used by draw pipelines, and texture images including fallback (blank) assets.
Thread-safety:
Public Member Functions | |
| Resources (const vireo::Vireo &vireo, ResourcesConfiguration &config, const vireo::SubmitQueue &graphicQueue) | |
| DeviceMemoryArray & | getVertexArray () |
| DeviceMemoryArray & | getIndexArray () |
| DeviceMemoryArray & | getMaterialArray () |
| DeviceMemoryArray & | getMeshSurfaceArray () |
| Samplers & | getSamplers () |
| uint32 | addTexture (const Image &image) |
| const auto & | getDescriptorSet () const |
| void | flush () |
| void | update () |
| void | cleanup () |
| void | setUpdated () |
| bool | isUpdated () const |
| auto & | getMutex () |
| auto | getBlankImage () |
| auto | getBlankCubeMap () |
| Resources (Resources &) = delete | |
| Resources & | operator= (Resources &) = delete |
Static Public Attributes | |
| static constexpr auto | MAX_TEXTURES {500} |
| static constexpr uint32 | SET_RESOURCES {0} |
| static constexpr vireo::DescriptorIndex | BINDING_MATERIAL {0} |
| static constexpr vireo::DescriptorIndex | BINDING_SURFACES {1} |
| static constexpr vireo::DescriptorIndex | BINDING_TEXTURE {2} |
| static std::shared_ptr< vireo::DescriptorLayout > | descriptorLayout {nullptr} |
| Resources | ( | const vireo::Vireo & | vireo, |
| ResourcesConfiguration & | config, | ||
| const vireo::SubmitQueue & | graphicQueue | ||
| ) |
Constructs the resources container and allocates GPU-side structures.
| vireo | Graphics backend entry point. |
| config | High-level resources configuration (sizes, formats, etc.). |
| graphicQueue | Queue used to submit upload and initialization work. |
|
delete |
Adds a texture to the internal textures list and uploads it to the GPU. If the capacity MAX_TEXTURES is reached, an engine-defined policy applies (typically reuse or replace); callers should not rely on indices beyond the limit.
| image | CPU-side image data to upload. |
| void cleanup | ( | ) |
Releases all GPU and CPU-side resources owned by this container.
| void flush | ( | ) |
Flushes pending uploads to the device. Typically enqueues copy/transfer commands to make new/updated resources visible to the GPU.
|
inline |
Returns the default cubemap blank image used as a safe fallback.
|
inline |
Returns the default 2D blank image used as a safe fallback.
|
inline |
Returns the descriptor set that exposes resources to shaders.
|
inline |
Returns the device memory array storing index data.
|
inline |
Returns the device memory array storing material parameters.
|
inline |
Returns the device memory array storing mesh surface ranges/metadata.
|
inline |
Provides access to the internal mutex used to guard mutations.
|
inline |
Returns the global sampler collection used by the renderer.
|
inline |
Returns the device memory array storing vertex data.
|
inline |
Returns true when an update has been flagged since the last processing.
|
delete |
|
inline |
Marks the container as updated so dependent systems can react.
| void update | ( | ) |
Applies incremental updates to buffers, images, and descriptors if needed.
|
staticconstexpr |
Descriptor binding index for the material buffer.
|
staticconstexpr |
Descriptor binding index for the mesh surfaces buffer.
|
staticconstexpr |
Descriptor binding index for the textures array/sampled images.
|
inlinestatic |
Shared descriptor layout describing the above bindings.
|
staticconstexpr |
Maximum number of textures managed and bound by this container.
|
staticconstexpr |
Descriptor set index used by pipelines to bind shared resources.