public unsafe Span <T> AsSpan <T>(ID3D11Texture3D resource, int mipSlice, int arraySlice) where T : unmanaged
        {
            resource.CalculateSubResourceIndex(mipSlice, arraySlice, out int mipSize);
            Span <byte> source = new(DataPointer.ToPointer(), mipSize *DepthPitch);

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