我想将uint4
矢量转换为uchar4
矢量,但我不确定这样做的正确方法是什么:
const uint4 res;
res = read_imageui(input, sampler, pos_read);
output[p] = res // error: assigning to '__global uchar4' from incompatible type 'const uint4';
output[p] = (uchar4)res; // error: invalid conversion between ext-vector type 'uchar4' and 'uint4'
output[p].x = (uchar)res.x; //
output[p].y = (uchar)res.y; //
output[p].z = (uchar)res.z; // works, but is this the only/right way to go?
output[p].w = (uchar)res.w; //