public void CreateInterleaved1() { var pos = MemoryAccessInfo.CreateDefaultElement("POSITION"); var nrm = MemoryAccessInfo.CreateDefaultElement("NORMAL"); var attributes = new[] { pos, nrm }; const int baseOffset = 8; var byteStride = MemoryAccessInfo.SetInterleavedInfo(attributes, baseOffset, 5); pos = attributes[0]; nrm = attributes[1]; Assert.AreEqual(24, byteStride); Assert.AreEqual(baseOffset + 0, pos.ByteOffset); Assert.AreEqual(24, pos.ByteStride); Assert.AreEqual(5, pos.ItemsCount); Assert.AreEqual(baseOffset + 12, nrm.ByteOffset); Assert.AreEqual(24, nrm.ByteStride); Assert.AreEqual(5, nrm.ItemsCount); Assert.IsTrue(pos.IsValidVertexAttribute); Assert.IsTrue(nrm.IsValidVertexAttribute); }
public static MemoryAccessInfo[] Slice(MemoryAccessInfo[] attributes, int start, int count) { var dst = new MemoryAccessInfo[attributes.Length]; for (int i = 0; i < dst.Length; ++i) { dst[i] = attributes[i].Slice(start, count); } return(dst); }
public void Update(BYTES data, MemoryAccessInfo encoding) { this._Slicer = encoding; this._Data = data; }
public MemoryAccessor(MemoryAccessInfo info) { this._Slicer = info; this._Data = default; }
public MemoryAccessor(BYTES data, MemoryAccessInfo info) { this._Slicer = info; this._Data = data; }
public void Update(ArraySegment <Byte> data, MemoryAccessInfo info) { this._Attribute = info; this._Data = data; }
public MemoryAccessor(MemoryAccessInfo info) { this._Attribute = info; this._Data = default; }