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
|
|
@ -34,9 +34,11 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
private readonly EntityEffectController _effects;
|
||||
private readonly LiveEntityLightController _lights;
|
||||
private readonly PhysicsScriptRunner _scripts;
|
||||
private readonly WbMeshAdapter _meshes;
|
||||
// Campaign V slice V6h: absent on a backend that composes no world
|
||||
// renderers. Their counters report zero, which is the truth there.
|
||||
private readonly WbMeshAdapter? _meshes;
|
||||
private readonly TextureCache _textures;
|
||||
private readonly WbDrawDispatcher _dispatcher;
|
||||
private readonly WbDrawDispatcher? _dispatcher;
|
||||
private readonly FrameProfiler _frameProfiler;
|
||||
private readonly IDatReaderWriter _dats;
|
||||
private readonly ResidencyManager _residency;
|
||||
|
|
@ -59,9 +61,9 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
EntityEffectController effects,
|
||||
LiveEntityLightController lights,
|
||||
PhysicsScriptRunner scripts,
|
||||
WbMeshAdapter meshes,
|
||||
WbMeshAdapter? meshes,
|
||||
TextureCache textures,
|
||||
WbDrawDispatcher dispatcher,
|
||||
WbDrawDispatcher? dispatcher,
|
||||
FrameProfiler frameProfiler,
|
||||
IDatReaderWriter dats,
|
||||
ResidencyManager residency,
|
||||
|
|
@ -86,10 +88,9 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
_effects = effects ?? throw new ArgumentNullException(nameof(effects));
|
||||
_lights = lights ?? throw new ArgumentNullException(nameof(lights));
|
||||
_scripts = scripts ?? throw new ArgumentNullException(nameof(scripts));
|
||||
_meshes = meshes ?? throw new ArgumentNullException(nameof(meshes));
|
||||
_meshes = meshes;
|
||||
_textures = textures ?? throw new ArgumentNullException(nameof(textures));
|
||||
_dispatcher = dispatcher
|
||||
?? throw new ArgumentNullException(nameof(dispatcher));
|
||||
_dispatcher = dispatcher;
|
||||
_frameProfiler = frameProfiler
|
||||
?? throw new ArgumentNullException(nameof(frameProfiler));
|
||||
_dats = dats ?? throw new ArgumentNullException(nameof(dats));
|
||||
|
|
@ -103,10 +104,15 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
|
||||
public WorldLifecycleResourceSnapshot Capture(RenderFrameOutcome outcome)
|
||||
{
|
||||
ObjectMeshManager meshManager = _meshes.MeshManager
|
||||
?? throw new InvalidOperationException(
|
||||
"Lifecycle snapshots require the composed modern mesh manager.");
|
||||
var mesh = meshManager.Diagnostics;
|
||||
// Present on GL, absent on a backend with no world renderers. The mesh
|
||||
// manager is still required whenever an adapter exists — a composed
|
||||
// adapter without one is a composition bug, not a backend difference.
|
||||
ObjectMeshManager? meshManager = _meshes is null
|
||||
? null
|
||||
: _meshes.MeshManager
|
||||
?? throw new InvalidOperationException(
|
||||
"Lifecycle snapshots require the composed modern mesh manager.");
|
||||
var mesh = meshManager?.Diagnostics ?? default;
|
||||
RenderFrameDiagnosticsSnapshot render = _renderDiagnostics.Snapshot;
|
||||
GCMemoryInfo memory = GC.GetGCMemoryInfo();
|
||||
ReadOnlySpan<GCGenerationInfo> generations = memory.GenerationInfo;
|
||||
|
|
@ -125,8 +131,9 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
CacheStats datObjectCacheStats = _dats is RuntimeDatCollection runtimeDats
|
||||
? runtimeDats.ObjectCacheStats
|
||||
: default;
|
||||
CacheStats cpuMeshCacheStats = meshManager.CpuMeshCacheStats;
|
||||
CacheStats decodedTextureCacheStats = meshManager.DecodedTextureCacheStats;
|
||||
CacheStats cpuMeshCacheStats = meshManager?.CpuMeshCacheStats ?? default;
|
||||
CacheStats decodedTextureCacheStats =
|
||||
meshManager?.DecodedTextureCacheStats ?? default;
|
||||
ResidencySnapshot residency = _residency.CaptureSnapshot();
|
||||
long trackedGpuBytes = GpuMemoryTracker.AllocatedBytes;
|
||||
long residencyGpuBytes = residency.TotalCharges.PhysicalGpuBytes;
|
||||
|
|
@ -160,8 +167,8 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
MeshRenderData: mesh.RenderData,
|
||||
MeshAtlasArrays: mesh.AtlasArrays,
|
||||
MeshEstimatedBytes: mesh.EstimatedBytes,
|
||||
StagedMeshUploads: _meshes.StagedUploadBacklog,
|
||||
StagedMeshBytes: _meshes.StagedUploadBytes,
|
||||
StagedMeshUploads: _meshes?.StagedUploadBacklog ?? 0,
|
||||
StagedMeshBytes: _meshes?.StagedUploadBytes ?? 0,
|
||||
TrackedGpuBytes: trackedGpuBytes,
|
||||
ResidencyGpuBytes: residencyGpuBytes,
|
||||
GpuTrackerMinusResidencyBytes: checked(
|
||||
|
|
@ -173,7 +180,7 @@ internal sealed class WorldLifecycleResourceSnapshotSource
|
|||
ActiveParticleTextures: _textures.ActiveParticleTextureCount,
|
||||
ParticleTextureOwners: _textures.ParticleTextureOwnerCount,
|
||||
CompositeWarmupPending:
|
||||
_dispatcher.LastCompositeWarmupPendingCount,
|
||||
_dispatcher?.LastCompositeWarmupPendingCount ?? 0,
|
||||
ManagedBytes: GC.GetTotalMemory(forceFullCollection: false),
|
||||
ManagedCommittedBytes: memory.TotalCommittedBytes,
|
||||
LohSizeBytes: lohSizeBytes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue