2
我想uint4
向量轉換爲uchar4
向量,但我不知道什麼是這樣做的正確方法:openCL:如何將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; //