Metal中常用的数据结构有向量、矩阵、原子数据类型、缓存、纹理、采样器、数组、用户自定义结构体等,C++的数据结构double, long, unsigned long, long long,unsigned...vertexID [[ vertex_id ]], // vertex_id是顶点shader每次处理的index,用于定位当前的顶点
constant LYVertex *vertexArray...最后求h和v的向量和,再写回纹理中。...右 |
中 | * * * | | 左 中 右 |
下 | * * * | | 左 中 右 |
*/
half4 topLeft...length(half2(grayH, grayV));
destTexture.write(half4(color, color, color, 1.0), grid); // 写回对应纹理