Commit 4a67b8e
Add CommandBuffer abstraction with backend-specific downcasting
Command buffer creation and management was previously spread across
each backend's executeProgram() with no shared interface, making it
impossible to manage command buffers from backend-agnostic code. This
introduces a CommandBuffer base class on Device so that higher-level
code can create and pass around command buffers without knowing the
backend. Per-object allocator/pool ownership also prepares for future
async execution where multiple command buffers may be in-flight with
independent lifetimes.
- DX: DXCommandBuffer owns Allocator, CmdList, Fence, Event
- VK: VKCommandBuffer owns CmdPool, CmdBuffer; each submission
creates a new CommandBuffer for independent lifetime management
- MTL: MTLCommandBuffer wraps MTL::CommandBuffer
Device::createCommandBuffer() returns Expected<unique_ptr<CommandBuffer>>
with a default "not supported" implementation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3bcc85c commit 4a67b8e
File tree
5 files changed
+304
-172
lines changed- include/API
- lib/API
- DX
- MTL
- VK
5 files changed
+304
-172
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
0 commit comments