コード例 #1
0
        public void CreateImmutableShort()
        {
            short[]         ud  = new short[] { 0, 1, 2, 3, 4, 5, 6 };
            DX11IndexBuffer ibo = DX11IndexBuffer.CreateImmutable(Device, ud);

            Assert.IsNotNull(ibo.Buffer, "Buffer Is Null");
            ibo.Dispose();
        }
コード例 #2
0
        public void StructuredCopyTest()
        {
            uint[]          ud  = new uint[] { 0, 1, 2, 3, 4, 5, 6 };
            DX11IndexBuffer ibo = DX11IndexBuffer.CreateImmutable(Device, ud);

            DX11StructuredBuffer sb      = ibo.CopyToStructuredBuffer(this.RenderContext);
            DX11StructuredBuffer staging = sb.AsStaging();

            this.RenderContext.Context.CopyResource(sb.Buffer, staging.Buffer);

            uint[] data = staging.ReadData <uint>(this.RenderContext);

            ibo.Dispose();
            sb.Dispose();
            staging.Dispose();

            Assert.AreEqual(ud.Length, data.Length, "Resources are or different Size");
            for (int i = 0; i < ud.Length; i++)
            {
                Assert.AreEqual(ud[i], data[i], "Data Mismatch");
            }
        }