From c02405cbb7ce028d63c034587afa2f4cdd5dec52 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 10 May 2026 17:13:44 +0200 Subject: [PATCH] refactor(render): extract WbDrawDispatcher.GroupKey to internal type at namespace scope Mechanical refactor: GroupKey was a private nested record struct on WbDrawDispatcher. The upcoming EntityClassificationCache (ISSUE #53) needs to store GroupKey inside CachedBatch records, so it must be visible to both the dispatcher and the cache. Promoting to internal at file scope is the smallest change that achieves this. No behavior change. 1688 tests pass; 8 pre-existing failures unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.App/Rendering/Wb/GroupKey.cs | 20 +++++++++++++++++++ .../Rendering/Wb/WbDrawDispatcher.cs | 9 --------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 src/AcDream.App/Rendering/Wb/GroupKey.cs diff --git a/src/AcDream.App/Rendering/Wb/GroupKey.cs b/src/AcDream.App/Rendering/Wb/GroupKey.cs new file mode 100644 index 0000000..696363c --- /dev/null +++ b/src/AcDream.App/Rendering/Wb/GroupKey.cs @@ -0,0 +1,20 @@ +using AcDream.Core.Meshing; + +namespace AcDream.App.Rendering.Wb; + +/// +/// Bucket identity for 's per-frame group dictionary. +/// Two (entity, batch) pairs that share the same render +/// in a single glMultiDrawElementsIndirect draw command. Promoted to +/// internal at file scope (was a private nested type) so +/// can store it inside +/// without depending on dispatcher internals. +/// +internal readonly record struct GroupKey( + uint Ibo, + uint FirstIndex, + int BaseVertex, + int IndexCount, + ulong BindlessTextureHandle, + uint TextureLayer, + TranslucencyKind Translucency); diff --git a/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs b/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs index cb27f87..15d0e6e 100644 --- a/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs +++ b/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs @@ -920,15 +920,6 @@ public sealed unsafe class WbDrawDispatcher : IDisposable // ──────────────────────────────────────────────────────────────────────── - private readonly record struct GroupKey( - uint Ibo, - uint FirstIndex, - int BaseVertex, - int IndexCount, - ulong BindlessTextureHandle, - uint TextureLayer, - TranslucencyKind Translucency); - private sealed class InstanceGroup { public uint Ibo;