Metal RGB to YUV conversion compute shader

混江龙づ霸主 提交于 2019-12-02 03:19:33

According to the Metal Shading Language Specification, the first parameter of all overloads of write on texture2d<> are 4-element vectors. This is the case even if the texture you're writing to has fewer than 4 components. So you can fix this by replacing the erroneous line with:

textureCbCr.write(half4(yuv.xyzz), uint2(gid.x / 2, gid.y / 2));

And the superfluous components will be masked out when performing the write.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!