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
|
|
@ -58,8 +58,8 @@ public sealed class ResourceCleanupGroupTests
|
|||
throw new InvalidOperationException("release failed");
|
||||
});
|
||||
|
||||
GlResourceConstructionException failure =
|
||||
Assert.Throws<GlResourceConstructionException>(() =>
|
||||
ResourceConstructionException failure =
|
||||
Assert.Throws<ResourceConstructionException>(() =>
|
||||
resources.RollbackConstructionAndThrow(
|
||||
"construction failed",
|
||||
new InvalidOperationException("original failure")));
|
||||
|
|
@ -74,62 +74,6 @@ public sealed class ResourceCleanupGroupTests
|
|||
Assert.Equal(2, releases);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WorldRenderFoundationConstructorsPublishEveryOwnedPrefix()
|
||||
{
|
||||
string root = FindRepoRoot();
|
||||
string graphicsDevice = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"OpenGLGraphicsDevice.cs"));
|
||||
string shader = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"GLSLShader.cs"));
|
||||
string uniformBuffer = File.ReadAllText(Path.Combine(
|
||||
root,
|
||||
"src",
|
||||
"AcDream.App",
|
||||
"Rendering",
|
||||
"Wb",
|
||||
"ManagedGLUniformBuffer.cs"));
|
||||
|
||||
AssertAppearsInOrder(
|
||||
graphicsDevice,
|
||||
"var resources = new ResourceCleanupGroup();",
|
||||
"InstanceVBO = CreateConstructionBuffer(resources",
|
||||
"WrapSampler = CreateConstructionSampler(",
|
||||
"ClampSampler = CreateConstructionSampler(",
|
||||
"_sceneDataBuffer = new ManagedGLUniformBuffer(",
|
||||
"resources.Add(",
|
||||
"\"WB scene-data uniform buffer\"",
|
||||
"InitializeSharedDebugResources(resources);",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
AssertAppearsInOrder(
|
||||
shader,
|
||||
"ShaderProgramConstruction.Build(",
|
||||
"resources.Add(\"WB shader program\"",
|
||||
"configure shader {Name} SceneData binding",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
AssertAppearsInOrder(
|
||||
uniformBuffer,
|
||||
"TrackedGlResource.CreateBuffer(",
|
||||
"resources.Add(",
|
||||
"TrackedGlResource.AllocateBufferStorage(",
|
||||
"resources.TransferAll();",
|
||||
"resources.RollbackConstructionAndThrow(");
|
||||
Assert.Contains("internal void DisposeImmediately()", uniformBuffer,
|
||||
StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Campaign V slice V4a moved TextRenderer's constructor off raw
|
||||
/// VAO/VBO/texture GL names and onto two device-owned resources — a
|
||||
|
|
@ -176,49 +120,6 @@ public sealed class ResourceCleanupGroupTests
|
|||
return count;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnedNameIsRetainedWhenPostconditionAndFirstRollbackFail()
|
||||
{
|
||||
bool deleteFails = true;
|
||||
int deleteCalls = 0;
|
||||
|
||||
GlResourceConstructionException failure =
|
||||
Assert.Throws<GlResourceConstructionException>(() =>
|
||||
GlResourceCommand.CreateNameCore(
|
||||
"synthetic buffer",
|
||||
static () => { },
|
||||
() => 42,
|
||||
() => throw new InvalidOperationException("postcondition failed"),
|
||||
name =>
|
||||
{
|
||||
Assert.Equal(42u, name);
|
||||
deleteCalls++;
|
||||
if (deleteFails)
|
||||
throw new InvalidOperationException("delete failed");
|
||||
}));
|
||||
|
||||
Assert.False(failure.IsCleanupComplete);
|
||||
Assert.Equal(1, deleteCalls);
|
||||
|
||||
deleteFails = false;
|
||||
failure.RetryCleanup();
|
||||
failure.RetryCleanup();
|
||||
|
||||
Assert.True(failure.IsCleanupComplete);
|
||||
Assert.Equal(2, deleteCalls);
|
||||
}
|
||||
|
||||
private static void AssertAppearsInOrder(string source, params string[] values)
|
||||
{
|
||||
int cursor = -1;
|
||||
foreach (string value in values)
|
||||
{
|
||||
int next = source.IndexOf(value, cursor + 1, StringComparison.Ordinal);
|
||||
Assert.True(next > cursor, $"Missing or out-of-order source fragment: {value}");
|
||||
cursor = next;
|
||||
}
|
||||
}
|
||||
|
||||
private static string FindRepoRoot()
|
||||
{
|
||||
DirectoryInfo? directory = new(AppContext.BaseDirectory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue