Commit 66bb416
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 1522442 commit 66bb416
File tree
5 files changed
+296
-137
lines changed- include/API
- lib/API
- DX
- MTL
- VK
5 files changed
+296
-137
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 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
| |||
0 commit comments