public void SerializeExtraData(BinaryWriter writer) { uint elementCount = Buffer?.ElementCount ?? 0; writer.Write(elementCount); if (elementCount > 0) { writer.Write((uint)(Buffer.IsStreamed() ? 1 : 0)); writer.Write(Flags); writer.Write((uint)Buffer.Format); writer.Write(Buffer.ElementStride); Buffer.ToData(writer); } }
public void SerializeExtraData(BinaryWriter writer) { var dataFormat = Buffer.Format switch { EDataBufferFormat.R_UINT_16 => EIndexFormat.Index16, EDataBufferFormat.R_UINT_32 => EIndexFormat.Index32, _ => throw new NotSupportedException("Unknown index buffer type"), }; uint elementCount = Buffer?.ElementCount ?? 0; writer.Write(elementCount); if (elementCount > 0) { writer.Write(Flags); writer.Write((uint)dataFormat); writer.Write((uint)(Buffer.IsStreamed() ? 1 : 0)); ResourceGUID.ToData(writer); Buffer.ToData(writer); } }