feat(render): Vulkan campaign V11 step 2 — delete the OpenGL backend
Vulkan is the sole, user-signed-off backend (V10 landed) and step 1 already removed ImGui/Studio/DevTools. This step deletes the GL rendering backend itself: every Gpu/Gl/** implementation, the Wb ManagedGL*/GLHelpers/GLSLShader/GLStateScope/RenderStateCache/ BindlessSupport family, Shader/ShaderProgramConstruction/SamplerCache, RenderBootstrap, and RenderFrameGlStateController. GameWindow.cs's Run()/CreateGraphics()/CreateBackbufferReader()/ OnLoad() collapse to their Vulkan-only arm; GameWindowGraphics loses its OpenGlGameWindowGraphics subclass. RuntimeOptions.RenderBackend and RenderBackendKind (incl. the Gl member of GpuBackendKind) are gone — there is nothing left to select between. The five world-draw dual-arm renderers (WbDrawDispatcher, EnvCellRenderer, TerrainModernRenderer, ParticleRenderer, SkyRenderer) and the composition roots (WorldRenderComposition, HostInputCameraComposition, LivePresentationComposition, FrameRootComposition) collapse to their RHI-only arm. GL-only diagnostic properties with a live external reader (DynamicBufferCount and friends) simplify to a documented `=> 0`/no-op rather than disappearing, since the reader is out of this commit's scope. A few GL-flavored mechanisms turned out to be backend-neutral once isolated: GlConstructionCleanupLedger is renamed ResourceConstructionCleanupLedger (exception-chain walking has nothing to do with GL), and GlfwNativePlatformProbe moved out of the otherwise GL-only GraphicalCapabilityRecord.cs into GraphicalWindowBackendSelection.cs before the rest of that file was deleted. Test files with no surviving subject are deleted outright (GraphicalCapabilityRequirementsTests, ShaderProgramConstructionTests, PortalDepthShaderParityTests, TextureCacheBindlessTests, TextRendererFailureSafetyTests, ClipFrameUploadTests, every Gpu/Gl/*Tests, GlTextureOwnershipTests, RenderFrameGlStateControllerTests); others get their dead GL-only members trimmed while their live assertions stay (ClipFrameLayoutTests' MeshClipSsboBinding check now reads GpuBindingModel.StorageClipRegions, the same binding index under its new backend-neutral name; GpuResourceRetirementTransactionTests drops its OpenGLGraphicsDevice-subclassing test double and the two GL queue tests it existed for). EnvCellRendererTests' construction helper now builds a real ObjectMeshManager via VulkanMeshPipelineDevice instead of passing null through a null-forgiving operator, since the RHI constructor never tolerated a null mesh manager and the old GL constructor (which did) is gone. Deferred to the next two steps, deliberately not touched here: the Silk.NET.OpenGL/.Extensions.ARB package references, IMeshPipelineDevice.Gl (WbMeshAdapter's GL? threading stays in place), Chorizite.Core's stale csproj comment (the package itself is still load-bearing — TextureFormat and friends are used well beyond the deleted ManagedGLUniformBuffer), and the CI/gate scripts. Build: `dotnet build AcDream.slnx -c Release` — 0 warnings, 0 errors. Tests: full-solution `dotnet test` green across every project (App.Tests 3937/3940 + 3 skips, Core.Tests 3296/3298 + 2 skips, all others 100%); the 2 App.Tests names that flake under full-suite parallel execution (#250-family, documented pre-existing) pass in isolation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
b70b9832ff
commit
8a7a0837e1
121 changed files with 1243 additions and 19840 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using AcDream.App.Audio;
|
||||
using AcDream.App.Composition;
|
||||
|
|
@ -19,7 +19,6 @@ using AcDream.Runtime.Gameplay;
|
|||
using DatReaderWriter.DBObjs;
|
||||
using Silk.NET.Input;
|
||||
using Silk.NET.OpenAL;
|
||||
using Silk.NET.OpenGL;
|
||||
|
||||
namespace AcDream.App.Tests.Composition;
|
||||
|
||||
|
|
@ -253,7 +252,7 @@ public sealed class ContentEffectsAudioCompositionTests
|
|||
Poses = new EntityEffectPoseRegistry();
|
||||
Factory = new Factory();
|
||||
Publication = new Publication();
|
||||
Platform = new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.OpenGl, null!);
|
||||
Platform = new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.Instance, null!);
|
||||
Host = (HostInputCameraResult)RuntimeHelpers.GetUninitializedObject(
|
||||
typeof(HostInputCameraResult));
|
||||
Dependencies = new ContentEffectsAudioDependencies(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
using AcDream.App.Composition;
|
||||
using AcDream.App.Input;
|
||||
|
|
@ -8,7 +8,6 @@ using AcDream.App.Tests.Rendering.Gpu;
|
|||
using AcDream.UI.Abstractions.Input;
|
||||
using Silk.NET.Input;
|
||||
using Silk.NET.Maths;
|
||||
using Silk.NET.OpenGL;
|
||||
|
||||
namespace AcDream.App.Tests.Composition;
|
||||
|
||||
|
|
@ -95,7 +94,7 @@ public sealed class HostInputCameraCompositionTests
|
|||
IKeyboard keyboard = DispatchProxy.Create<IKeyboard, NullDeviceProxy>();
|
||||
IMouse mouse = DispatchProxy.Create<IMouse, NullDeviceProxy>();
|
||||
Input = new InputContext(keyboard, mouse);
|
||||
Platform = new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.OpenGl, Input);
|
||||
Platform = new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.Instance, Input);
|
||||
ViewportAspect = new ViewportAspectState();
|
||||
Framebuffer = new FramebufferResizeController(ViewportAspect);
|
||||
Capture = new CaptureSource();
|
||||
|
|
|
|||
|
|
@ -1,61 +1,30 @@
|
|||
using AcDream.App;
|
||||
using AcDream.App.Composition;
|
||||
using Silk.NET.Core.Contexts;
|
||||
using Silk.NET.OpenGL;
|
||||
using AcDream.App.Rendering;
|
||||
using AcDream.App.Rendering.Gpu.Vk;
|
||||
|
||||
namespace AcDream.App.Tests.Composition;
|
||||
|
||||
/// <summary>
|
||||
/// Campaign V slice V6h: the graphics handle composition tests hand to a phase.
|
||||
/// The graphics handle composition tests hand to a phase.
|
||||
///
|
||||
/// <para>The phases now select their backend arm from
|
||||
/// <see cref="GameWindowGraphics"/> rather than from a bare <c>GL</c> reference,
|
||||
/// so a test that means "compose the OpenGL arm" has to say so. The GL instance
|
||||
/// is never called: every composition test supplies a stub factory that ignores
|
||||
/// its context argument, and the loader below would fault if anything did — which
|
||||
/// is the point. It is a token identifying the arm, not a driver.</para>
|
||||
/// <para>Campaign V slice V11 deleted the raw-GL arm — <c>GameWindowGraphics</c>
|
||||
/// no longer has a <c>Backend</c> or <c>Gl</c> member to select between, so this
|
||||
/// is now a single Vulkan-shaped token: a real <see cref="VulkanWorldPassScope"/>
|
||||
/// (composition phases require one, and it needs no live surface — just a
|
||||
/// sample count), no live <see cref="VulkanGraphicsContext"/> because tests never
|
||||
/// dereference it.</para>
|
||||
/// </summary>
|
||||
internal sealed class TestGameWindowGraphics : GameWindowGraphics
|
||||
{
|
||||
private readonly GL? _gl;
|
||||
public static TestGameWindowGraphics Instance { get; } = new();
|
||||
|
||||
private TestGameWindowGraphics(RenderBackendKind backend, GL? gl)
|
||||
private TestGameWindowGraphics()
|
||||
{
|
||||
Backend = backend;
|
||||
_gl = gl;
|
||||
}
|
||||
|
||||
/// <summary>Selects the OpenGL arm, with a context token no test dereferences.</summary>
|
||||
public static TestGameWindowGraphics OpenGl { get; } =
|
||||
new(RenderBackendKind.Gl, new GL(new UnusableNativeContext()));
|
||||
|
||||
/// <summary>Selects the Vulkan arm: no GL context exists.</summary>
|
||||
public static TestGameWindowGraphics Vulkan { get; } =
|
||||
new(RenderBackendKind.Vulkan, null);
|
||||
|
||||
public override RenderBackendKind Backend { get; }
|
||||
|
||||
public override GL? Gl => _gl;
|
||||
public override IWorldPassScope? WorldPassScope { get; } = new VulkanWorldPassScope(sampleCount: 1);
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
private sealed class UnusableNativeContext : INativeContext
|
||||
{
|
||||
public nint GetProcAddress(string proc, int? slot = null) =>
|
||||
throw new InvalidOperationException(
|
||||
$"A composition test called GL entry point '{proc}'. " +
|
||||
"Test graphics are a backend token, not a driver.");
|
||||
|
||||
public bool TryGetProcAddress(string proc, out nint addr, int? slot = null)
|
||||
{
|
||||
addr = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Runtime.CompilerServices;
|
||||
using AcDream.App.Composition;
|
||||
using AcDream.App.Rendering;
|
||||
|
|
@ -14,7 +14,6 @@ using AcDream.UI.Abstractions.Settings;
|
|||
using DatReaderWriter.DBObjs;
|
||||
using Silk.NET.Input;
|
||||
using Silk.NET.OpenGL;
|
||||
using Shader = AcDream.App.Rendering.Shader;
|
||||
|
||||
namespace AcDream.App.Tests.Composition;
|
||||
|
||||
|
|
@ -90,15 +89,12 @@ public sealed class WorldRenderCompositionTests
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("terrain shader", "terrain shader")]
|
||||
[InlineData("scene lighting", "scene lighting")]
|
||||
[InlineData("debug lines", "debug lines")]
|
||||
[InlineData("HUD", "text renderer|debug font")]
|
||||
[InlineData("terrain", "terrain")]
|
||||
[InlineData("mesh shader", "mesh shader")]
|
||||
[InlineData("WB mesh adapter", "WB mesh adapter")]
|
||||
[InlineData("texture cache", "texture cache")]
|
||||
[InlineData("sampler cache", "sampler cache")]
|
||||
public void FailedPublicationRollsBackOnlyItsUnpublishedResourcePrefix(
|
||||
string publication,
|
||||
string expectedReleaseOrder)
|
||||
|
|
@ -193,7 +189,7 @@ public sealed class WorldRenderCompositionTests
|
|||
if (point == _failurePoint)
|
||||
throw new InvalidOperationException($"fault at {point}");
|
||||
}).Compose(
|
||||
new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.OpenGl, null!),
|
||||
new GameWindowPlatformResult<GameWindowGraphics, IInputContext>(TestGameWindowGraphics.Instance, null!),
|
||||
Content,
|
||||
new SettingsDevToolsResult(
|
||||
QualitySettings.From(QualityPreset.High)));
|
||||
|
|
@ -224,8 +220,6 @@ public sealed class WorldRenderCompositionTests
|
|||
public ResidencyBudgetOptions? TextureBudgets { get; private set; }
|
||||
public ResidencyManager? RegisteredResidency { get; private set; }
|
||||
|
||||
public void InitializeGlState(GL gl) { }
|
||||
|
||||
public WorldRegionData LoadRegion(IDatReaderWriter dats) =>
|
||||
new(Stub<Region>(), new float[256]);
|
||||
|
||||
|
|
@ -233,16 +227,6 @@ public sealed class WorldRenderCompositionTests
|
|||
WorldEnvironmentController environment,
|
||||
Region region) { }
|
||||
|
||||
public BindlessSupport RequireBindless(GL gl, Action<string> log) =>
|
||||
Stub<BindlessSupport>();
|
||||
|
||||
public TerrainAtlas AcquireTerrainAtlas(
|
||||
IGameRenderResourceLifetime lifetime,
|
||||
GL gl,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless) =>
|
||||
lifetime.AcquireTerrainAtlas(() => Atlas);
|
||||
|
||||
/// <summary>
|
||||
/// Campaign V slice V6i-2: the arm a backend with no GL context takes.
|
||||
/// Returns the same stub atlas through the same lifetime owner, so the
|
||||
|
|
@ -258,7 +242,7 @@ public sealed class WorldRenderCompositionTests
|
|||
/// Recorded rather than run: the exercise needs a real
|
||||
/// <see cref="IGpuDevice"/> to create images through. Its behaviour is
|
||||
/// covered by <c>RhiWorldTextureArrayTests</c> and by the Vulkan
|
||||
/// composition-host run — see plan §5.5.13.
|
||||
/// composition-host run  see plan §5.5.13.
|
||||
/// </summary>
|
||||
public void ExerciseBackendNeutralWorldTextures(
|
||||
IGpuDevice device,
|
||||
|
|
@ -270,12 +254,6 @@ public sealed class WorldRenderCompositionTests
|
|||
public void SetTerrainAnisotropic(TerrainAtlas atlas, int level) =>
|
||||
AnisotropicLevel = level;
|
||||
|
||||
public Shader CreateTerrainShader(GL gl, string shadersDirectory) =>
|
||||
Resource<Shader>("terrain shader");
|
||||
|
||||
public SceneLightingUboBinding CreateSceneLighting(GL gl) =>
|
||||
Resource<SceneLightingUboBinding>("scene lighting");
|
||||
|
||||
public SceneLightingUboBinding CreateBackendNeutralSceneLighting(
|
||||
ICurrentGpuFrameSource frameSource,
|
||||
IWorldPassScope scope) =>
|
||||
|
|
@ -294,15 +272,6 @@ public sealed class WorldRenderCompositionTests
|
|||
IGpuDevice device, ICurrentGpuFrameSource frameSource, string shadersDirectory) =>
|
||||
Resource<TextRenderer>("text renderer");
|
||||
|
||||
public TerrainModernRenderer CreateTerrain(
|
||||
GL gl,
|
||||
BindlessSupport bindless,
|
||||
Shader shader,
|
||||
TerrainAtlas atlas,
|
||||
IGpuDevice gpuDevice,
|
||||
IGpuResourceRetirementQueue retirement) =>
|
||||
Resource<TerrainModernRenderer>("terrain");
|
||||
|
||||
public TerrainModernRenderer CreateBackendNeutralTerrain(
|
||||
IGpuDevice gpuDevice,
|
||||
ICurrentGpuFrameSource frameSource,
|
||||
|
|
@ -323,9 +292,6 @@ public sealed class WorldRenderCompositionTests
|
|||
Stub<TerrainBlendingContext>(),
|
||||
new ConcurrentDictionary<uint, SurfaceInfo>());
|
||||
|
||||
public Shader CreateMeshShader(GL gl, string shadersDirectory) =>
|
||||
Resource<Shader>("mesh shader");
|
||||
|
||||
public WbMeshAdapter CreateMeshAdapter(
|
||||
GL? gl,
|
||||
IGpuDevice device,
|
||||
|
|
@ -339,10 +305,8 @@ public sealed class WorldRenderCompositionTests
|
|||
}
|
||||
|
||||
public TextureCache CreateTextureCache(
|
||||
GL gl,
|
||||
IGpuDevice device,
|
||||
IDatReaderWriter dats,
|
||||
BindlessSupport bindless,
|
||||
IGpuResourceRetirementQueue retirement,
|
||||
string diagnosticsDirectory,
|
||||
ResidencyBudgetOptions budgets)
|
||||
|
|
@ -362,9 +326,6 @@ public sealed class WorldRenderCompositionTests
|
|||
RegisteredResidency = manager;
|
||||
}
|
||||
|
||||
public SamplerCache CreateSamplerCache(GL gl) =>
|
||||
Resource<SamplerCache>("sampler cache");
|
||||
|
||||
public void Release(IDisposable resource)
|
||||
{
|
||||
Releases.Add(_names[resource]);
|
||||
|
|
@ -385,10 +346,6 @@ public sealed class WorldRenderCompositionTests
|
|||
public WbMeshAdapter? MeshAdapter { get; private set; }
|
||||
public TextureCache? TextureCache { get; private set; }
|
||||
|
||||
public void PublishBindlessSupport(BindlessSupport value) =>
|
||||
Fail("bindless");
|
||||
public void PublishTerrainShader(Shader value) =>
|
||||
Fail("terrain shader");
|
||||
public void PublishSceneLighting(SceneLightingUboBinding value) =>
|
||||
Fail("scene lighting");
|
||||
public void PublishDebugLines(DebugLineRenderer value) =>
|
||||
|
|
@ -407,7 +364,6 @@ public sealed class WorldRenderCompositionTests
|
|||
TerrainBlendingContext blending,
|
||||
ConcurrentDictionary<uint, SurfaceInfo> surfaceCache) =>
|
||||
Fail("terrain build state");
|
||||
public void PublishMeshShader(Shader value) => Fail("mesh shader");
|
||||
|
||||
public void PublishWbMeshAdapter(WbMeshAdapter value)
|
||||
{
|
||||
|
|
@ -421,9 +377,6 @@ public sealed class WorldRenderCompositionTests
|
|||
TextureCache = value;
|
||||
}
|
||||
|
||||
public void PublishSamplerCache(SamplerCache value) =>
|
||||
Fail("sampler cache");
|
||||
|
||||
private void Fail(string point)
|
||||
{
|
||||
if (string.Equals(failure, point, StringComparison.Ordinal))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue