예제 #1
0
        public unsafe Span <T> AsSpan <T>(ID3D11Texture2D resource, int mipSlice, int arraySlice) where T : unmanaged
        {
            resource.CalculateSubResourceIndex(mipSlice, arraySlice, out int mipSize);
            Span <byte> source = new Span <byte>(DataPointer.ToPointer(), mipSize * RowPitch);

            return(MemoryMarshal.Cast <byte, T>(source));
        }
예제 #2
0
 public unsafe Span <T> AsSpan <T>(ID3D11Texture2D resource, int mipSlice, int arraySlice)
 {
     resource.CalculateSubResourceIndex(mipSlice, arraySlice, out int mipSize);
     return(new Span <T>(DataPointer.ToPointer(), mipSize * RowPitch));
 }