Revert "Campaign V slice V4a" - it lost world multisampling
This reverts ceec3bc4. Two independent reasons, either sufficient.
The rendering regression. The slice deleted TextRenderGlStateScope, which
saved GL_MULTISAMPLE and GL_SAMPLE_ALPHA_TO_COVERAGE on entry, disabled them
for the text pass, and restored them on exit (TextRenderGlStateScope.cs:111-112
and 153-154 at the parent commit). Its replacement bakes that state into the
text pipeline but nothing restores it, and GlGpuPassEncoder.Dispose does not
either. Every world renderer is still raw GL at this point in the campaign, so
from the first UI frame onward the world drew with multisampling disabled.
The offline pixel gate caught it: 1,791 of 563,200 compared pixels differed,
0.318% against a 0.001 threshold. The commit message attributed this to
wall-clock-driven ambient animation shifting phase, and committed through the
failure. That explanation does not survive its own control: capturing twice at
the reverted-to commit differs by 19 pixels and twice at the slice's own commit
by 8, while base-versus-head differs by 1,791 - a 224x gap that no shared-noise
source explains. An amplified difference image settles it visually: the changed
pixels are the silhouette edges of every tree, building and rock, with terrain
interiors, water and the entire UI untouched. That is the signature of losing
edge antialiasing, not of animated sprites.
This is the exact failure mode two existing memory notes already warn about -
a mid-frame renderer must set every GL state it uses rather than inherit it,
and issue #52's lesson that a rendering migration must audit per-pass GL state
before declaring itself done.
The scope. The brief was three small leaf renderers plus additive frame-
lifecycle wiring, roughly ten files. The commit changed 334 files with 3,665
insertions and 3,845 deletions, including 323 public-to-internal visibility
conversions across the App assembly, 55 test files, two retired conformance
tests, and a self-described temporary escape hatch for bridging raw-GL viewport
textures. Even without the regression, that is not separable into the part
worth keeping and the part worth dropping.
Reverting rather than patching because the good work here - the RHI frame
lifecycle wiring and a genuine render-state-cache staleness fix - is small
enough to redo cleanly against a tightened spec, while untangling it from 300+
files of unrelated churn is not.
Post-revert: Release build clean, App suite back to 3,843 passed / 3 skipped,
offline pixel gate passing at 19 differing pixels.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ceec3bc440
commit
9aaf97e785
334 changed files with 3841 additions and 3661 deletions
|
|
@ -263,6 +263,8 @@ internal sealed class FrameRootCompositionPhase
|
|||
live.DrawDispatcher,
|
||||
live.EnvCellRenderer,
|
||||
live.PortalDepthMask,
|
||||
foundation.TextRenderer,
|
||||
interaction.RetainedUi?.Host.TextRenderer,
|
||||
live.ClipFrame,
|
||||
foundation.Terrain,
|
||||
foundation.SceneLighting),
|
||||
|
|
@ -361,7 +363,6 @@ internal sealed class FrameRootCompositionPhase
|
|||
d.CellVisibility),
|
||||
d.WorldSceneDebugState,
|
||||
foundation.DebugLines,
|
||||
host.GpuFrameLifetime,
|
||||
d.PhysicsEngine,
|
||||
d.PlayerMode,
|
||||
d.PlayerController,
|
||||
|
|
@ -508,7 +509,7 @@ internal sealed class FrameRootCompositionPhase
|
|||
: (IRenderFramePostDiagnosticsPhase?)lifecycleAutomation
|
||||
?? NullRenderFramePostDiagnosticsPhase.Instance;
|
||||
var renderFrame = new RenderFrameOrchestrator(
|
||||
host.GpuFrameLifetime,
|
||||
host.GpuFrameFlights,
|
||||
new FrameProfilerGpuMeasurement(d.FrameProfiler, d.Gl),
|
||||
framePreparation,
|
||||
worldSceneRenderer,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ internal interface IGameWindowHostInputCameraPublication
|
|||
{
|
||||
void PublishGpuFrameFlights(GpuFrameFlightController value);
|
||||
void PublishGpuDevice(IGpuDevice value);
|
||||
void PublishGpuFrameLifetime(GpuDeviceFrameLifetime value);
|
||||
void PublishKeyboardSource(SilkKeyboardSource value);
|
||||
void PublishMouseSource(SilkMouseSource value);
|
||||
void PublishMouseLookCursor(IMouseLookCursor value);
|
||||
|
|
@ -24,7 +23,6 @@ internal interface IGameWindowHostInputCameraPublication
|
|||
internal sealed record HostInputCameraResult(
|
||||
GpuFrameFlightController GpuFrameFlights,
|
||||
IGpuDevice GpuDevice,
|
||||
GpuDeviceFrameLifetime GpuFrameLifetime,
|
||||
WorldRenderDiagnostics WorldRenderDiagnostics,
|
||||
SilkKeyboardSource? KeyboardSource,
|
||||
SilkMouseSource? MouseSource,
|
||||
|
|
@ -237,10 +235,9 @@ internal sealed class HostInputCameraCompositionPhase :
|
|||
// exist — it owns its own BindlessSupport detection (see
|
||||
// GlGpuDevice's class comment), so unlike the legacy WB render path it
|
||||
// has no dependency on WorldRenderCompositionPhase running first.
|
||||
// Campaign V slice V4a is the first real consumer (TextRenderer,
|
||||
// BitmapFont, DebugLineRenderer, TextureCache's UI upload path); it is
|
||||
// Nothing consumes this device yet (Campaign V slice V1); it is
|
||||
// proven against the real driver here and torn down with the render
|
||||
// stack.
|
||||
// stack so later slices (starting at V4a) have somewhere to plug in.
|
||||
IGpuDevice gpuDevice = scope.Acquire(
|
||||
"GPU device (RHI)",
|
||||
() => _factory.CreateGpuDevice(gl, gpuFrames),
|
||||
|
|
@ -248,14 +245,6 @@ internal sealed class HostInputCameraCompositionPhase :
|
|||
_publication.PublishGpuDevice);
|
||||
Fault(HostInputCameraCompositionPoint.GpuDevicePublished);
|
||||
|
||||
// V4a's structural addition: the shared IGpuFrame lifecycle that
|
||||
// ported renderers allocate rings and open passes against. Owns no
|
||||
// disposable resource of its own — it wraps gpuDevice, whose scope
|
||||
// above already tears it down — so it is published as a plain value,
|
||||
// not a second acquisition.
|
||||
var gpuFrameLifetime = new GpuDeviceFrameLifetime(gpuDevice);
|
||||
_publication.PublishGpuFrameLifetime(gpuFrameLifetime);
|
||||
|
||||
WorldRenderDiagnostics diagnostics =
|
||||
_factory.CreateWorldRenderDiagnostics(
|
||||
gl,
|
||||
|
|
@ -356,7 +345,6 @@ internal sealed class HostInputCameraCompositionPhase :
|
|||
return new HostInputCameraResult(
|
||||
gpuFrames,
|
||||
gpuDevice,
|
||||
gpuFrameLifetime,
|
||||
diagnostics,
|
||||
keyboard,
|
||||
mouse,
|
||||
|
|
|
|||
|
|
@ -33,10 +33,9 @@ namespace AcDream.App.Composition;
|
|||
internal sealed record InteractionRetainedUiDependencies(
|
||||
RuntimeOptions Options,
|
||||
GL Gl,
|
||||
IGpuDevice GpuDevice,
|
||||
Func<IGpuFrame> CurrentGpuFrame,
|
||||
IView Window,
|
||||
IInputContext Input,
|
||||
string ShadersDirectory,
|
||||
IDatReaderWriter Dats,
|
||||
object DatLock,
|
||||
TextureCache TextureCache,
|
||||
|
|
@ -390,8 +389,8 @@ internal sealed class RetailInteractionRetainedUiCompositionFactory
|
|||
d.Character.LocalPlayer);
|
||||
UiHost host = lease.AcquireHost(
|
||||
() => new UiHost(
|
||||
d.GpuDevice,
|
||||
d.CurrentGpuFrame,
|
||||
d.Gl,
|
||||
d.ShadersDirectory,
|
||||
d.DebugFont,
|
||||
d.HostQuiescence));
|
||||
checkpoint(InteractionRetainedUiCompositionPoint.UiHostAcquired);
|
||||
|
|
@ -478,9 +477,9 @@ internal sealed class RetailInteractionRetainedUiCompositionFactory
|
|||
host.WireKeyboard(keyboard);
|
||||
checkpoint(InteractionRetainedUiCompositionPoint.KeyboardInputWired);
|
||||
|
||||
(GpuTextureSlot, int, int) ResolveChrome(uint id)
|
||||
(uint, int, int) ResolveChrome(uint id)
|
||||
{
|
||||
GpuTextureSlot texture = d.TextureCache.GetOrUploadRenderSurface(
|
||||
uint texture = d.TextureCache.GetOrUploadRenderSurface(
|
||||
id,
|
||||
out int width,
|
||||
out int height);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ namespace AcDream.App.Composition;
|
|||
internal sealed record LivePresentationDependencies(
|
||||
RuntimeOptions Options,
|
||||
GL Gl,
|
||||
IGpuDevice GpuDevice,
|
||||
IWindow Window,
|
||||
object DatLock,
|
||||
RuntimeSettingsController Settings,
|
||||
|
|
@ -796,8 +795,7 @@ internal sealed class LivePresentationCompositionPhase
|
|||
paperdollLease.Resource,
|
||||
new RetailPaperdollFrameView(
|
||||
viewport,
|
||||
new PaperdollInventoryVisibility(inventoryFrame),
|
||||
d.GpuDevice),
|
||||
new PaperdollInventoryVisibility(inventoryFrame)),
|
||||
new RetailPaperdollDollFactory(
|
||||
new LivePaperdollEntityLookup(liveEntities),
|
||||
d.PlayerIdentity,
|
||||
|
|
@ -844,8 +842,7 @@ internal sealed class LivePresentationCompositionPhase
|
|||
new RetailCreatureAppraisalFrameView(
|
||||
creatureViewport,
|
||||
examinationFrame,
|
||||
appraisalController,
|
||||
d.GpuDevice),
|
||||
appraisalController),
|
||||
new RetailCreatureAppraisalCloneFactory(
|
||||
new LiveCreatureAppraisalEntityLookup(liveEntities)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ internal sealed record WorldRenderDependencies(
|
|||
WorldEnvironmentController Environment,
|
||||
IGameRenderResourceLifetime RenderResources,
|
||||
IGpuResourceRetirementQueue ResourceRetirement,
|
||||
IGpuDevice GpuDevice,
|
||||
ResidencyBudgetOptions ResidencyBudgets,
|
||||
uint InitialCenterLandblockId,
|
||||
string DiagnosticsDirectory,
|
||||
|
|
@ -90,10 +89,10 @@ internal interface IWorldRenderCompositionFactory
|
|||
void SetTerrainAnisotropic(TerrainAtlas atlas, int level);
|
||||
Shader CreateTerrainShader(GL gl, string shadersDirectory);
|
||||
SceneLightingUboBinding CreateSceneLighting(GL gl);
|
||||
DebugLineRenderer CreateDebugLines(IGpuDevice device);
|
||||
DebugLineRenderer CreateDebugLines(GL gl, string shadersDirectory);
|
||||
byte[]? TryLoadDebugFont();
|
||||
BitmapFont CreateDebugFont(IGpuDevice device, byte[] bytes);
|
||||
TextRenderer CreateTextRenderer(IGpuDevice device);
|
||||
BitmapFont CreateDebugFont(GL gl, byte[] bytes);
|
||||
TextRenderer CreateTextRenderer(GL gl, string shadersDirectory);
|
||||
TerrainModernRenderer CreateTerrain(
|
||||
GL gl,
|
||||
BindlessSupport bindless,
|
||||
|
|
@ -113,7 +112,6 @@ internal interface IWorldRenderCompositionFactory
|
|||
ResidencyBudgetOptions budgets);
|
||||
TextureCache CreateTextureCache(
|
||||
GL gl,
|
||||
IGpuDevice device,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless,
|
||||
IGpuResourceRetirementQueue retirement,
|
||||
|
|
@ -216,15 +214,21 @@ internal sealed class RetailWorldRenderCompositionFactory
|
|||
|
||||
public SceneLightingUboBinding CreateSceneLighting(GL gl) => new(gl);
|
||||
|
||||
public DebugLineRenderer CreateDebugLines(IGpuDevice device) => new(device);
|
||||
public DebugLineRenderer CreateDebugLines(
|
||||
GL gl,
|
||||
string shadersDirectory) =>
|
||||
new(gl, shadersDirectory);
|
||||
|
||||
public byte[]? TryLoadDebugFont() =>
|
||||
BitmapFont.TryLoadSystemMonospaceFont();
|
||||
|
||||
public BitmapFont CreateDebugFont(IGpuDevice device, byte[] bytes) =>
|
||||
new(device, bytes, pixelHeight: 15f, atlasSize: 512);
|
||||
public BitmapFont CreateDebugFont(GL gl, byte[] bytes) =>
|
||||
new(gl, bytes, pixelHeight: 15f, atlasSize: 512);
|
||||
|
||||
public TextRenderer CreateTextRenderer(IGpuDevice device) => new(device);
|
||||
public TextRenderer CreateTextRenderer(
|
||||
GL gl,
|
||||
string shadersDirectory) =>
|
||||
new(gl, shadersDirectory);
|
||||
|
||||
public TerrainModernRenderer CreateTerrain(
|
||||
GL gl,
|
||||
|
|
@ -290,7 +294,6 @@ internal sealed class RetailWorldRenderCompositionFactory
|
|||
|
||||
public TextureCache CreateTextureCache(
|
||||
GL gl,
|
||||
IGpuDevice device,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless,
|
||||
IGpuResourceRetirementQueue retirement,
|
||||
|
|
@ -298,7 +301,6 @@ internal sealed class RetailWorldRenderCompositionFactory
|
|||
ResidencyBudgetOptions budgets) =>
|
||||
new(
|
||||
gl,
|
||||
device,
|
||||
dats,
|
||||
bindless,
|
||||
retirement,
|
||||
|
|
@ -480,12 +482,12 @@ internal sealed class WorldRenderCompositionPhase
|
|||
DebugLineRenderer debugLines = AcquireAndPublish(
|
||||
scope,
|
||||
"debug lines",
|
||||
() => _factory.CreateDebugLines(_dependencies.GpuDevice),
|
||||
() => _factory.CreateDebugLines(gl, shadersDirectory),
|
||||
_publication.PublishDebugLines,
|
||||
WorldRenderCompositionPoint.DebugLinesPublished);
|
||||
|
||||
(BitmapFont? debugFont, TextRenderer? textRenderer) =
|
||||
ComposeOptionalHudResources(scope);
|
||||
ComposeOptionalHudResources(scope, gl, shadersDirectory);
|
||||
|
||||
TerrainModernRenderer terrain = AcquireAndPublish(
|
||||
scope,
|
||||
|
|
@ -533,7 +535,6 @@ internal sealed class WorldRenderCompositionPhase
|
|||
"texture cache",
|
||||
() => _factory.CreateTextureCache(
|
||||
gl,
|
||||
_dependencies.GpuDevice,
|
||||
content.Dats,
|
||||
bindless,
|
||||
_dependencies.ResourceRetirement,
|
||||
|
|
@ -585,7 +586,9 @@ internal sealed class WorldRenderCompositionPhase
|
|||
}
|
||||
|
||||
private (BitmapFont? Font, TextRenderer? Text) ComposeOptionalHudResources(
|
||||
CompositionAcquisitionScope scope)
|
||||
CompositionAcquisitionScope scope,
|
||||
GL gl,
|
||||
string shadersDirectory)
|
||||
{
|
||||
byte[]? fontBytes = _factory.TryLoadDebugFont();
|
||||
if (fontBytes is null)
|
||||
|
|
@ -597,13 +600,13 @@ internal sealed class WorldRenderCompositionPhase
|
|||
|
||||
var fontLease = scope.Acquire(
|
||||
"world HUD font",
|
||||
() => _factory.CreateDebugFont(_dependencies.GpuDevice, fontBytes),
|
||||
() => _factory.CreateDebugFont(gl, fontBytes),
|
||||
_factory.Release);
|
||||
BitmapFont font = fontLease.Resource;
|
||||
Fault(WorldRenderCompositionPoint.DebugFontCreated);
|
||||
var textLease = scope.Acquire(
|
||||
"world HUD text renderer",
|
||||
() => _factory.CreateTextRenderer(_dependencies.GpuDevice),
|
||||
() => _factory.CreateTextRenderer(gl, shadersDirectory),
|
||||
_factory.Release);
|
||||
TextRenderer text = textLease.Resource;
|
||||
Fault(WorldRenderCompositionPoint.TextRendererCreated);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue