Skip to content

Commit 9afe548

Browse files
committed
refactor(vulkan): start phase a pass recorder extraction
1 parent 0886711 commit 9afe548

6 files changed

Lines changed: 114 additions & 2 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Capability Migration Phase A Checklist (Pass Recorder Extraction)
2+
3+
Scope date: 2026-02-19
4+
Scope target: structural extraction only, zero behavior change
5+
6+
## 1. Orchestrator delegation
7+
8+
- [x] Extract shadow/main recording behind feature-owned recorder facade.
9+
- [x] Extract post composite recording behind feature-owned recorder facade.
10+
- [x] Keep existing recorder logic and pass order unchanged.
11+
12+
## 2. Behavior boundary
13+
14+
- [x] No graph/runtime behavior changes.
15+
- [x] No shader/descriptor wiring changes.
16+
17+
## 3. Validation
18+
19+
- [x] Run targeted Vulkan test slice after extraction.
20+
21+
## 4. Next
22+
23+
- [ ] Decompose post composite wrapper into module-level recorder boundaries.
24+
- [ ] Decompose reflection/AA recorder boundaries for graph-ready ownership.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Capability Migration Phase A: Pass Recorder Extraction
2+
3+
Date: 2026-02-19
4+
Status: Started (AA/post + shadow/main recorder facades extracted)
5+
6+
## Goal
7+
8+
Extract feature-owned pass recorders with zero rendering behavior change.
9+
10+
## Delivered in this slice
11+
12+
- Added `VulkanShadowMainPassRecorder` wrapper for shadow/main recording.
13+
- Added `VulkanPostCompositePassRecorder` wrapper for post composite recording.
14+
- Updated `VulkanFrameCommandOrchestrator` to delegate to these recorders.
15+
16+
## Behavior boundary
17+
18+
- Recording logic still executes through existing `VulkanRenderCommandRecorder`.
19+
- No pass ordering changes.
20+
- No shader/descriptor/runtime behavior changes.
21+
22+
## Next in Phase A
23+
24+
- Split wrappers into per-feature ownership boundaries aligned with capability catalog:
25+
- post modules (tonemap/bloom/ssao/smaa/taa/fog)
26+
- reflection module recorder boundary
27+
- AA resolve recorder boundary

docs/capability-contract-v1-plan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,9 @@ Scope: post-reflections sequencing kickoff
4949
- Post modularization activation/planning artifacts are tracked in:
5050
- `docs/capability-contract-phase3-post-modularization.md`
5151
- `docs/capability-contract-phase3-post-modularization-checklist.md`
52+
53+
## Phase A status
54+
55+
- Pass-recorder extraction kickoff artifacts are tracked in:
56+
- `docs/capability-contract-phaseA-pass-recorder-extraction.md`
57+
- `docs/capability-contract-phaseA-pass-recorder-checklist.md`

engine-impl-vulkan/src/main/java/org/dynamislight/impl/vulkan/command/VulkanFrameCommandOrchestrator.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import java.util.function.IntUnaryOperator;
1212

1313
public final class VulkanFrameCommandOrchestrator {
14+
private static final VulkanShadowMainPassRecorder SHADOW_MAIN_RECORDER = new VulkanShadowMainPassRecorder();
15+
private static final VulkanPostCompositePassRecorder POST_COMPOSITE_RECORDER = new VulkanPostCompositePassRecorder();
16+
1417
private VulkanFrameCommandOrchestrator() {
1518
}
1619

@@ -49,7 +52,7 @@ public static void record(
4952
));
5053
}
5154

52-
VulkanRenderCommandRecorder.recordShadowAndMainPasses(
55+
SHADOW_MAIN_RECORDER.record(
5356
stack,
5457
commandBuffer,
5558
new VulkanRenderCommandRecorder.RenderPassInputs(
@@ -90,7 +93,7 @@ public static void record(
9093
);
9194

9295
if (inputs.postOffscreenActive()) {
93-
VulkanRenderCommandRecorder.PostCompositeState postInitialized = VulkanRenderCommandRecorder.executePostCompositePass(
96+
VulkanRenderCommandRecorder.PostCompositeState postInitialized = POST_COMPOSITE_RECORDER.record(
9497
stack,
9598
commandBuffer,
9699
new VulkanRenderCommandRecorder.PostCompositeInputs(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.dynamislight.impl.vulkan.command;
2+
3+
import org.lwjgl.system.MemoryStack;
4+
import org.lwjgl.vulkan.VkCommandBuffer;
5+
6+
/**
7+
* Feature-owned recorder facade for post composite execution.
8+
*
9+
* This is a Phase A extraction wrapper with no behavior changes.
10+
*/
11+
final class VulkanPostCompositePassRecorder {
12+
VulkanRenderCommandRecorder.PostCompositeState record(
13+
MemoryStack stack,
14+
VkCommandBuffer commandBuffer,
15+
VulkanRenderCommandRecorder.PostCompositeInputs inputs
16+
) {
17+
return VulkanRenderCommandRecorder.executePostCompositePass(
18+
stack,
19+
commandBuffer,
20+
inputs
21+
);
22+
}
23+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.dynamislight.impl.vulkan.command;
2+
3+
import java.util.List;
4+
import java.util.function.IntUnaryOperator;
5+
import org.lwjgl.system.MemoryStack;
6+
import org.lwjgl.vulkan.VkCommandBuffer;
7+
8+
/**
9+
* Feature-owned recorder facade for shadow + main geometry pass execution.
10+
*
11+
* This is a Phase A extraction wrapper with no behavior changes.
12+
*/
13+
final class VulkanShadowMainPassRecorder {
14+
void record(
15+
MemoryStack stack,
16+
VkCommandBuffer commandBuffer,
17+
VulkanRenderCommandRecorder.RenderPassInputs inputs,
18+
List<VulkanRenderCommandRecorder.MeshDrawCmd> meshes,
19+
IntUnaryOperator dynamicUniformOffset
20+
) {
21+
VulkanRenderCommandRecorder.recordShadowAndMainPasses(
22+
stack,
23+
commandBuffer,
24+
inputs,
25+
meshes,
26+
dynamicUniformOffset
27+
);
28+
}
29+
}

0 commit comments

Comments
 (0)