These are chat archives for libmir/public
Some context: I'm mmap-ing an image from GPU VRAM into CPU RAM, so I can do a simple mutation,
without the need to execute a shader/kernel just for that (and I'm not concerned about perf
in this part of my app). The problem is that GPU resources like images have special
alignment/padding requirements and I need to be able to specify that,
so I can use ndslice to do the mutation in a more convenient way.
For example I need the following 2x2 image:
void* gpuMem = 0x030A0000 size_t gpuMemSize = 256 size_t gpuRowPitch = 128 uint* pixels = cast(uint*)gpuMem pixels: 0 (used) 1 (used) 3 (padding) ... 31 (padding) 32 (used) 33 (used) 34 (padding) ... 63 (padding) // So AFAIU, I need the following slice: Slice!(uint, 2) ._ptr = pixels ._lengths = [ 2, 2] ._strides = [32, 1]