re-org en App
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Core Module — Manager and Executor Layers
|
||||
|
||||
## Overview
|
||||
|
||||
The `core` module contains two architectural layers that drive rendering:
|
||||
|
||||
| File | Responsibility |
|
||||
|------|---------------|
|
||||
| **context** | **Manager layer** — owns GPU hardware resource lifecycle (Instance, Surface, Adapter, Device, Queue). Initializes GPU at startup; orchestrates frame-by-frame rendering via begin_frame() / end_frame(). Does not own rendering logic. |
|
||||
| **renderer** | **Executor layer** — owns Device/Queue references after initialization from Context. Orchestrates draw calls by binding Material pipelines and Mesh vertex data into a RenderPass. Does not own raw hardware resources externally or RenderPipelines/shaders. |
|
||||
| **frame** | Per-frame RAII wrapper around the surface texture and its TextureView. Exists only for the duration of a single rendering pass. |
|
||||
|
||||
## Interaction with Other Modules
|
||||
|
||||
- **utils**: Context returns WsgError from all fallible methods; Renderer does not use errors directly.
|
||||
- **pipeline**: Context requires Device reference during pipeline creation in new(); Renderer uses PipelineCache indirectly through Material.
|
||||
- **resources**: Renderer consumes Mesh and Material instances for draw calls.
|
||||
- **scene**: Renderer queries Scene for Material/Mesh pairs to render.
|
||||
Reference in New Issue
Block a user