using System.Runtime.InteropServices; using DatReaderWriter.Enums; using Chorizite.Core.Render; namespace AcDream.App.Rendering.Wb { /// /// Per-batch (draw call) data for modern rendering. /// Consists of a texture-table slot (Campaign V slice V2; was a raw 64-bit /// bindless handle) and the layer index within the shared/pooled array. /// Indexed by gl_DrawIDARB in the vertex shader. Same 16-byte std430 shape /// as mesh_modern.vert's BatchData: TextureTableIndex/Reserved/TextureIndex/ /// Flags at offsets 0/4/8/12 — see ModernBatchDataLayoutTests. /// [StructLayout(LayoutKind.Sequential, Pack = 4)] internal struct ModernBatchData { public uint TextureTableIndex; // 4 bytes — slot into the binding=9 handle table public uint Reserved; // 4 bytes — pad, keeps TextureIndex/Flags at offsets 8/12 public uint TextureIndex; // 4 bytes — layer within the texture array public uint Flags; // 4 bytes — reserved, matches mesh_modern.vert's BatchData.flags } internal struct LandblockMdiCommand { public ulong SortKey; public ulong ObjectId; public DrawElementsIndirectCommand Command; public ModernBatchData BatchData; public uint TextureIndex; public ManagedGLTextureArray Atlas; public uint VAO; public uint IBO; public bool IsTransparent; public bool IsAdditive; public bool HasWrappingUVs; } }