When processing RGB data in RS through kernel
-Allocation
construct, I'm using uchar3/uchar4 data-type in RS to process RGB data. However both of these datatypes are single 32 bit field with 32 bit alignment. This way I lose out on r-component of 2nd pixel.
The RS developer docs suggests Element.Builder
for creating custom data-types. However its usage doesn't quite give me a single 24-bit-field-with-24-bit-alignment element with most of the primitive datatypes (U8, RGB_888, etc.) . Is there a prescribed way to use/create a 24 bit field 24 bit aligned element?
No, Typically non-power of 2 alignment will create all sorts of havok for hardware units. Some load units will bus fault, other runs at 1/4 speed. For this reason the Vec3 types are all stored as if they were vec4.