Expand description
GPU Resource Manager
Responsible for creating, updating, and managing GPU-side resources.
Uses a modular design with different responsibilities split into separate files:
- buffer.rs: Buffer operations
- texture.rs: Texture and Image operations
- geometry.rs: Geometry operations
- material.rs: Material operations
- binding.rs:
BindGroupoperations - allocator.rs:
ModelBufferAllocator resource_ids.rs: Resource ID tracking and change detection
§Resource Management Architecture
Uses an “Ensure -> Check -> Rebuild” pattern:
- Ensure phase: Ensure GPU resources exist with up-to-date data, returning physical resource IDs
- Check phase: Compare resource IDs for changes, deciding whether to rebuild
BindGroup - Rebuild phase: If rebuild is needed, collect
LayoutEntriesand check if a new Layout is required
Structs§
- Bind
Group Context - Bind
Group Fingerprint - Complete fingerprint of a
BindGroup - Ensure
Result - Result of an ensure operation
- GpuBuffer
Handle - Opaque handle into the GPU buffer arena.
- GpuGlobal
State - GPU global state (Group 0)
- Mipmap
Generator - Model
Buffer Allocator - Model Buffer allocator.
- Resource
IdSet - Resource ID set
- Resource
Manager - Sampler
Registry - System
Textures - Global system fallback texture pool and Group 3 bind-group infrastructure.
- Tracked
- Resource wrapper with a unique ID
Used to assign identity to
FrameResourcesor temporary resources
Enums§
Functions§
- generate_
gpu_ resource_ id - hash_
layout_ entries - Compute the hash of a
BindGroupLayoutEntrylist
Type Aliases§
- Resource
Id - Unique identifier for a GPU resource