Convert `uchar*` to `uchar4*` in Metal

31 Views Asked by At

Currently, I'm dealing with 2 types of data in my kernel function: RGBA color as uchar4* and indexed color as uchar*. It would be great if I could quickly convert the uchar* into uchar4*, so that I only need to pass in only 1 buffer for both cases and if it's RGBA data, I can just convert the uchar* to uchar4* to use the convenient accessors.

Is there any performant way of doing that?

0

There are 0 best solutions below