feat(render): Campaign V slice V6h — the Vulkan composition host
ACDREAM_RENDER_BACKEND=vulkan now runs the real GameWindow composition rather
than a second main(). All nine phases execute: DAT load, streaming, camera,
entity table, session, and the real retained UiHost drawing through the RHI.
No world renderers — they are raw GL until V4t and the world arm behind it.
The offline log is the client's own (acdream.pak opened, 6266 spells, Region
0x13000000, "loading world view centered on 0xA9B4FFFF", fourteen retail
LayoutDesc lines, streaming radii), and the captured frame is the retail
retained UI: vitals, combat/spell bar with DAT scarab icons, the nine-slot
toolbar, chat with tabs and Send, radar/compass with dat-font glyphs. Sampled
against the GL capture the widgets agree — chat interior RGBA (25,24,27,158)
vs (22,21,23,158), vitals bar (117,1,0) and toolbar slot (0,11,17) identical.
Three seams, as §5.5.9 specified:
1. Platform acquisition — already generic — publishes GameWindowGraphics
instead of a bare GL. Phases that still speak raw GL read Graphics.Gl and
take their Vulkan arm when it is null; each branch names the slice that
removes it.
2. VulkanHostInputCameraCompositionFactory is a new file and the whole of the
Phase-1 fork: four graphics members differ, input/camera/pointer delegate.
The default factory is chosen inside the phase from the platform result.
HostInputCameraResult gained backend-neutral Retirement and FrameSlots.
3. The frame root forks on one condition. The GL world-scene assembly is
unchanged, wrapped in `if (gl is not null)`; the Vulkan arm's graph is one
backbuffer clear pass computing the same RenderFrameFoundation from the same
clock and weather owners, then private presentation over it.
§5.5.9's three TextureCache couplings are unpicked: the constructor takes GL?
and rejects bindless without one, world entry points route through a Gl
property that throws naming V4t, and the (GlGpuTexture) VRAM-accounting cast
became a backend test. That cast's stated reason — DrawSprite's texture-unit
binding — was already stale, deleted at V6d.
VulkanBringUpHost is reduced to the capability-probe harness it is named for:
the instance/surface/device/swapchain sequence moved into VulkanGraphicsContext,
which the composition host and the harness now share. It is reached only with
ACDREAM_VULKAN_PROBE=1.
One latent Vulkan defect surfaced and is fixed here. The first composition-host
frame died with ErrorDeviceLost; validation named VUID-vkCmdDraw-None-08600 —
descriptor set 2 never bound. VulkanGpuPassEncoder bound sets 0/1/2 only as a
side effect of BindStorageBuffer/BindUniformBuffer, so a pass sampling the
texture table while binding no buffer — every retained-UI and debug-line pass —
drew with the table unbound. It survived V6c-V6g because the bring-up host
always drew VulkanRhiScene first and the UI pass inherited its binds; the
composition host has no 3-D scene. The fix is one line in the encoder's
constructor beside the viewport and scissor defaults, which exist for exactly
the same reason: a pass opens with complete binding state rather than depending
on what preceded it.
Gates: strict GL offline pixel gate against 46d893f7 measures 1.24e-05 (7 of
563,200 pixels), inside the documented 15-23 px / 4.1e-05 band, so GL behaviour
did not move. App tests 4,075/3 skips; complete Release suite 9,138/5 skips.
One full Vulkan run with VK_LAYER_KHRONOS_validation: zero errors, zero
warnings. Both Vulkan runs converged the ownership ledger — no [shutdown]
diagnostic on either stream. The reduced probe harness presented 34,811
validation-clean frames.
No divergence-register row: GL is the shipping backend and the pixel gate proves
it unmoved; the Vulkan arm is not a retail deviation but a backend under
construction.
Next is V4t, the texture stack, which the world arm cannot be written without.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
46d893f7c3
commit
b16f820643
29 changed files with 2292 additions and 997 deletions
|
|
@ -23,7 +23,7 @@ namespace AcDream.App.Composition;
|
|||
internal sealed record FrameRootDependencies(
|
||||
RuntimeOptions Options,
|
||||
GameRuntime Runtime,
|
||||
GL Gl,
|
||||
GameWindowGraphics Graphics,
|
||||
IWindow Window,
|
||||
IInputContext Input,
|
||||
WorldTimeService WorldTime,
|
||||
|
|
@ -137,7 +137,7 @@ internal sealed class FrameRootRuntimeBindings : IDisposable
|
|||
|
||||
internal sealed class FrameRootCompositionPhase
|
||||
: IFrameRootCompositionPhase<
|
||||
GameWindowPlatformResult<GL, IInputContext>,
|
||||
GameWindowPlatformResult<GameWindowGraphics, IInputContext>,
|
||||
HostInputCameraResult,
|
||||
ContentEffectsAudioResult,
|
||||
SettingsDevToolsResult,
|
||||
|
|
@ -164,7 +164,7 @@ internal sealed class FrameRootCompositionPhase
|
|||
}
|
||||
|
||||
public FrameRootResult Compose(
|
||||
GameWindowPlatformResult<GL, IInputContext> platform,
|
||||
GameWindowPlatformResult<GameWindowGraphics, IInputContext> platform,
|
||||
HostInputCameraResult host,
|
||||
ContentEffectsAudioResult content,
|
||||
SettingsDevToolsResult settings,
|
||||
|
|
@ -181,7 +181,7 @@ internal sealed class FrameRootCompositionPhase
|
|||
ArgumentNullException.ThrowIfNull(interaction);
|
||||
ArgumentNullException.ThrowIfNull(live);
|
||||
ArgumentNullException.ThrowIfNull(session);
|
||||
if (!ReferenceEquals(_dependencies.Gl, platform.Graphics)
|
||||
if (!ReferenceEquals(_dependencies.Graphics, platform.Graphics)
|
||||
|| !ReferenceEquals(_dependencies.Input, platform.Input))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
|
|
@ -236,13 +236,20 @@ internal sealed class FrameRootCompositionPhase
|
|||
{
|
||||
FrameRootDependencies d = _dependencies;
|
||||
WorldRenderFoundation foundation = world.Foundation;
|
||||
// Campaign V slice V6h: the frame root is the one seam that genuinely
|
||||
// forks. On GL every world renderer exists and the render graph is
|
||||
// unchanged. On Vulkan none of them does, so the graph is the clear pass,
|
||||
// the private-presentation phase, and the retained UI inside it — the
|
||||
// client's own frame, drawn entirely through the RHI.
|
||||
GL? gl = d.Graphics.Gl;
|
||||
var teleportRenderState =
|
||||
new LocalPlayerTeleportRenderStateSource(session.LocalTeleport);
|
||||
var renderLoginState = new RenderLoginStateSource(
|
||||
d.Options.LiveMode,
|
||||
d.PlayerMode);
|
||||
var renderFrameGlState = new RenderFrameGlStateController(
|
||||
new SilkRenderFrameGlStateApi(d.Gl));
|
||||
RenderFrameGlStateController? renderFrameGlState = gl is null
|
||||
? null
|
||||
: new RenderFrameGlStateController(new SilkRenderFrameGlStateApi(gl));
|
||||
var renderFrameLivePreparation =
|
||||
new RuntimeRenderFrameLivePreparation(
|
||||
foundation.TextureCache,
|
||||
|
|
@ -256,8 +263,26 @@ internal sealed class FrameRootCompositionPhase
|
|||
live.ParticleRenderer,
|
||||
d.FrameProfiler,
|
||||
d.FrameDiagnosticsEnabled);
|
||||
IRenderFrameClearPhase clearPhase = gl is not null
|
||||
? new RuntimeRenderFrameClearPhase(
|
||||
gl,
|
||||
d.WorldTime,
|
||||
d.Weather,
|
||||
teleportRenderState,
|
||||
d.ParticleVisibility,
|
||||
host.WorldRenderDiagnostics
|
||||
?? throw new InvalidOperationException(
|
||||
"The GL frame root requires the GL state tripwire."),
|
||||
renderFrameGlState!)
|
||||
: new AcDream.App.Rendering.Gpu.Vk.VulkanRenderFrameClearPhase(
|
||||
host.GpuFrameLifetime,
|
||||
d.WorldTime,
|
||||
d.Weather,
|
||||
teleportRenderState,
|
||||
d.ParticleVisibility,
|
||||
() => d.Graphics.Vulkan?.SampleCount ?? 1);
|
||||
var renderFrameResources = new RenderFrameResourceController(
|
||||
host.GpuFrameFlights,
|
||||
host.FrameSlots,
|
||||
new RuntimeRenderFrameBeginResources(
|
||||
foundation.TextureCache,
|
||||
live.DrawDispatcher,
|
||||
|
|
@ -266,14 +291,7 @@ internal sealed class FrameRootCompositionPhase
|
|||
live.ClipFrame,
|
||||
foundation.Terrain,
|
||||
foundation.SceneLighting),
|
||||
new RuntimeRenderFrameClearPhase(
|
||||
d.Gl,
|
||||
d.WorldTime,
|
||||
d.Weather,
|
||||
teleportRenderState,
|
||||
d.ParticleVisibility,
|
||||
host.WorldRenderDiagnostics,
|
||||
renderFrameGlState),
|
||||
clearPhase,
|
||||
renderFrameLivePreparation);
|
||||
Fault(FrameRootCompositionPoint.RenderResourcesCreated);
|
||||
|
||||
|
|
@ -285,98 +303,8 @@ internal sealed class FrameRootCompositionPhase
|
|||
content.ParticleSink,
|
||||
d.EffectPoses,
|
||||
live.EntityEffects);
|
||||
var worldFrameEnvironment =
|
||||
new RuntimeWorldFrameEnvironmentPreparation(
|
||||
d.Options,
|
||||
d.WorldTime,
|
||||
d.Lighting,
|
||||
live.DrawDispatcher,
|
||||
live.EnvCellRenderer,
|
||||
foundation.SceneLighting,
|
||||
d.RenderRange,
|
||||
skyPesFrame);
|
||||
var worldRenderFrameBuilder = new WorldRenderFrameBuilder(
|
||||
new RuntimeWorldFrameCameraSource(
|
||||
host.CameraController,
|
||||
session.LocalTeleport),
|
||||
new RuntimeWorldFrameVisibilityPreparation(
|
||||
live.SelectionScene,
|
||||
d.ParticleVisibility,
|
||||
foundation.Terrain,
|
||||
session.WorldReveal,
|
||||
live.EnvCellFrustum),
|
||||
new RuntimeWorldFrameSettingsPreview(
|
||||
d.Settings,
|
||||
content.Audio?.Engine,
|
||||
host.CameraController,
|
||||
d.DisplayFramePacing),
|
||||
new RuntimeWorldFrameRootSource(
|
||||
d.PhysicsEngine,
|
||||
d.CellVisibility,
|
||||
d.PlayerMode,
|
||||
d.ChaseCameraInput,
|
||||
d.PlayerController,
|
||||
d.WorldOrigin),
|
||||
worldFrameEnvironment,
|
||||
new RuntimeWorldFrameAnimatedEntitySource(
|
||||
d.Animations,
|
||||
live.StaticAnimationScheduler,
|
||||
live.EquippedChildren),
|
||||
new RuntimeWorldFrameBuildingSource(
|
||||
live.LandblockPipeline,
|
||||
d.CellVisibility));
|
||||
var terrainDrawDiagnostics = new TerrainDrawDiagnosticsController(
|
||||
d.FrameDiagnosticsEnabled,
|
||||
host.WorldRenderDiagnostics,
|
||||
new RuntimeFramePipelineDiagnosticFactsSource(
|
||||
foundation.Terrain,
|
||||
live.LandblockPipeline,
|
||||
renderFrameLivePreparation,
|
||||
live.DrawDispatcher,
|
||||
session.Streaming,
|
||||
live.LiveEntities,
|
||||
live.WorldState),
|
||||
d.RenderDiagnosticLog);
|
||||
var retailPViewCells = new RetailPViewCellSource(d.CellVisibility);
|
||||
var retailPViewPassExecutor = new RetailPViewPassExecutor(
|
||||
d.Gl,
|
||||
renderFrameGlState,
|
||||
new SilkRetailPViewFramebufferSource(d.Window),
|
||||
live.ClipFrame,
|
||||
foundation.Terrain,
|
||||
live.EnvCellRenderer,
|
||||
live.DrawDispatcher,
|
||||
live.SkyRenderer,
|
||||
content.ParticleSystem,
|
||||
live.ParticleRenderer,
|
||||
live.PortalDepthMask,
|
||||
d.RetailAlphaQueue,
|
||||
host.WorldRenderDiagnostics,
|
||||
terrainDrawDiagnostics);
|
||||
var worldSceneDiagnostics = new WorldSceneDiagnosticsController(
|
||||
host.WorldRenderDiagnostics,
|
||||
new RuntimeWorldScenePViewDiagnosticSource(
|
||||
d.PlayerController,
|
||||
d.PhysicsEngine,
|
||||
d.CellVisibility),
|
||||
d.WorldSceneDebugState,
|
||||
foundation.DebugLines,
|
||||
d.PhysicsEngine,
|
||||
d.PlayerMode,
|
||||
d.PlayerController,
|
||||
d.DebugVmRenderFacts,
|
||||
settings.DevTools is not null);
|
||||
var worldScenePasses = new WorldScenePassExecutor(
|
||||
d.Gl,
|
||||
renderFrameGlState,
|
||||
live.ClipFrame,
|
||||
live.DrawDispatcher,
|
||||
live.EnvCellRenderer,
|
||||
foundation.Terrain,
|
||||
terrainDrawDiagnostics,
|
||||
live.SkyRenderer,
|
||||
content.ParticleSystem,
|
||||
live.ParticleRenderer);
|
||||
IWorldSceneFramePhase worldSceneRenderer =
|
||||
AcDream.App.Rendering.Gpu.Vk.VulkanWorldScenePhase.Instance;
|
||||
CurrentRenderSceneOracle? currentRenderSceneOracle =
|
||||
interaction.RetainedUi?.Screenshots is not null
|
||||
&& d.Options.AutomationArtifactDirectory is not null
|
||||
|
|
@ -391,41 +319,144 @@ internal sealed class FrameRootCompositionPhase
|
|||
message => d.Log("[UI-PROBE] " + message),
|
||||
acknowledgeDirty: false)
|
||||
: null;
|
||||
RenderScenePViewFrameProductController? renderFrameProduct =
|
||||
live.RenderSceneShadow is not null
|
||||
? new RenderScenePViewFrameProductController(
|
||||
live.RenderSceneShadow,
|
||||
currentRenderSceneOracle,
|
||||
message => d.Log("[UI-PROBE] " + message),
|
||||
live.DrawDispatcher)
|
||||
: null;
|
||||
// After G4 the retained product is the production object source.
|
||||
// The old dispatcher/selection observer is intentionally detached;
|
||||
// automation still compares the independently built PView route list.
|
||||
live.DrawDispatcher.SetCurrentRenderSceneObserver(null);
|
||||
live.SelectionScene.SetCurrentRenderSceneObserver(null);
|
||||
var worldSceneRenderer = new WorldSceneRenderer(
|
||||
renderFrameResources,
|
||||
renderLoginState,
|
||||
d.WorldEnvironment,
|
||||
worldRenderFrameBuilder,
|
||||
new RuntimeWorldSceneEntitySource(live.WorldState),
|
||||
live.SelectionScene,
|
||||
d.RetailAlphaQueue,
|
||||
d.ParticleVisibility,
|
||||
new WorldScenePViewRenderer(
|
||||
new RetailPViewRenderer(
|
||||
currentRenderSceneOracle,
|
||||
renderFrameProduct),
|
||||
retailPViewPassExecutor,
|
||||
retailPViewPassExecutor),
|
||||
retailPViewCells,
|
||||
worldScenePasses,
|
||||
d.RenderRange,
|
||||
worldSceneDiagnostics,
|
||||
live.WorldAvailability);
|
||||
RenderScenePViewFrameProductController? renderFrameProduct = null;
|
||||
if (gl is not null)
|
||||
{
|
||||
// The GL world scene, unchanged. Campaign V slice V6h wrapped it in
|
||||
// this one condition and changed nothing inside it: every renderer
|
||||
// it composes exists on GL and none of them exists on Vulkan, so the
|
||||
// Vulkan arm keeps the VulkanWorldScenePhase assigned above.
|
||||
WorldRenderDiagnostics worldRenderDiagnostics =
|
||||
host.WorldRenderDiagnostics
|
||||
?? throw new InvalidOperationException(
|
||||
"The GL world scene requires the GL state tripwire.");
|
||||
var worldFrameEnvironment =
|
||||
new RuntimeWorldFrameEnvironmentPreparation(
|
||||
d.Options,
|
||||
d.WorldTime,
|
||||
d.Lighting,
|
||||
live.DrawDispatcher!,
|
||||
live.EnvCellRenderer!,
|
||||
foundation.SceneLighting!,
|
||||
d.RenderRange,
|
||||
skyPesFrame);
|
||||
var worldRenderFrameBuilder = new WorldRenderFrameBuilder(
|
||||
new RuntimeWorldFrameCameraSource(
|
||||
host.CameraController,
|
||||
session.LocalTeleport),
|
||||
new RuntimeWorldFrameVisibilityPreparation(
|
||||
live.SelectionScene,
|
||||
d.ParticleVisibility,
|
||||
foundation.Terrain!,
|
||||
session.WorldReveal,
|
||||
live.EnvCellFrustum),
|
||||
new RuntimeWorldFrameSettingsPreview(
|
||||
d.Settings,
|
||||
content.Audio?.Engine,
|
||||
host.CameraController,
|
||||
d.DisplayFramePacing),
|
||||
new RuntimeWorldFrameRootSource(
|
||||
d.PhysicsEngine,
|
||||
d.CellVisibility,
|
||||
d.PlayerMode,
|
||||
d.ChaseCameraInput,
|
||||
d.PlayerController,
|
||||
d.WorldOrigin),
|
||||
worldFrameEnvironment,
|
||||
new RuntimeWorldFrameAnimatedEntitySource(
|
||||
d.Animations,
|
||||
live.StaticAnimationScheduler,
|
||||
live.EquippedChildren),
|
||||
new RuntimeWorldFrameBuildingSource(
|
||||
live.LandblockPipeline,
|
||||
d.CellVisibility));
|
||||
var terrainDrawDiagnostics = new TerrainDrawDiagnosticsController(
|
||||
d.FrameDiagnosticsEnabled,
|
||||
worldRenderDiagnostics,
|
||||
new RuntimeFramePipelineDiagnosticFactsSource(
|
||||
foundation.Terrain!,
|
||||
live.LandblockPipeline,
|
||||
renderFrameLivePreparation,
|
||||
live.DrawDispatcher!,
|
||||
session.Streaming,
|
||||
live.LiveEntities,
|
||||
live.WorldState),
|
||||
d.RenderDiagnosticLog);
|
||||
var retailPViewCells = new RetailPViewCellSource(d.CellVisibility);
|
||||
var retailPViewPassExecutor = new RetailPViewPassExecutor(
|
||||
gl,
|
||||
renderFrameGlState!,
|
||||
new SilkRetailPViewFramebufferSource(d.Window),
|
||||
live.ClipFrame,
|
||||
foundation.Terrain!,
|
||||
live.EnvCellRenderer!,
|
||||
live.DrawDispatcher!,
|
||||
live.SkyRenderer!,
|
||||
content.ParticleSystem,
|
||||
live.ParticleRenderer!,
|
||||
live.PortalDepthMask!,
|
||||
d.RetailAlphaQueue,
|
||||
worldRenderDiagnostics,
|
||||
terrainDrawDiagnostics);
|
||||
var worldSceneDiagnostics = new WorldSceneDiagnosticsController(
|
||||
worldRenderDiagnostics,
|
||||
new RuntimeWorldScenePViewDiagnosticSource(
|
||||
d.PlayerController,
|
||||
d.PhysicsEngine,
|
||||
d.CellVisibility),
|
||||
d.WorldSceneDebugState,
|
||||
foundation.DebugLines,
|
||||
d.PhysicsEngine,
|
||||
d.PlayerMode,
|
||||
d.PlayerController,
|
||||
d.DebugVmRenderFacts,
|
||||
settings.DevTools is not null);
|
||||
var worldScenePasses = new WorldScenePassExecutor(
|
||||
gl,
|
||||
renderFrameGlState!,
|
||||
live.ClipFrame,
|
||||
live.DrawDispatcher!,
|
||||
live.EnvCellRenderer!,
|
||||
foundation.Terrain!,
|
||||
terrainDrawDiagnostics,
|
||||
live.SkyRenderer!,
|
||||
content.ParticleSystem,
|
||||
live.ParticleRenderer!);
|
||||
renderFrameProduct =
|
||||
live.RenderSceneShadow is not null
|
||||
? new RenderScenePViewFrameProductController(
|
||||
live.RenderSceneShadow,
|
||||
currentRenderSceneOracle,
|
||||
message => d.Log("[UI-PROBE] " + message),
|
||||
live.DrawDispatcher!)
|
||||
: null;
|
||||
// After G4 the retained product is the production object source.
|
||||
// The old dispatcher/selection observer is intentionally detached;
|
||||
// automation still compares the independently built PView route list.
|
||||
live.DrawDispatcher!.SetCurrentRenderSceneObserver(null);
|
||||
live.SelectionScene.SetCurrentRenderSceneObserver(null);
|
||||
worldSceneRenderer = new WorldSceneRenderer(
|
||||
renderFrameResources,
|
||||
renderLoginState,
|
||||
d.WorldEnvironment,
|
||||
worldRenderFrameBuilder,
|
||||
new RuntimeWorldSceneEntitySource(live.WorldState),
|
||||
live.SelectionScene,
|
||||
d.RetailAlphaQueue,
|
||||
d.ParticleVisibility,
|
||||
new WorldScenePViewRenderer(
|
||||
new RetailPViewRenderer(
|
||||
currentRenderSceneOracle,
|
||||
renderFrameProduct),
|
||||
retailPViewPassExecutor,
|
||||
retailPViewPassExecutor),
|
||||
retailPViewCells,
|
||||
worldScenePasses,
|
||||
d.RenderRange,
|
||||
worldSceneDiagnostics,
|
||||
live.WorldAvailability);
|
||||
}
|
||||
Fault(FrameRootCompositionPoint.WorldRendererCreated);
|
||||
|
||||
bindings = new FrameRootRuntimeBindings();
|
||||
WorldLifecycleAutomationController? lifecycleAutomation = null;
|
||||
if (interaction.RetainedUi?.Screenshots is { } screenshots
|
||||
|
|
@ -508,7 +539,9 @@ internal sealed class FrameRootCompositionPhase
|
|||
?? NullRenderFramePostDiagnosticsPhase.Instance;
|
||||
var renderFrame = new RenderFrameOrchestrator(
|
||||
host.GpuFrameLifetime,
|
||||
new FrameProfilerGpuMeasurement(d.FrameProfiler, d.Gl),
|
||||
gl is not null
|
||||
? new FrameProfilerGpuMeasurement(d.FrameProfiler, gl)
|
||||
: AcDream.App.Rendering.Gpu.Vk.NullRenderFrameGpuMeasurement.Instance,
|
||||
framePreparation,
|
||||
worldSceneRenderer,
|
||||
privatePresentation,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue