Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 添加纹理混合模式的核函数_Ios_Swift_Metal_Metalkit - Fatal编程技术网

Ios 添加纹理混合模式的核函数

Ios 添加纹理混合模式的核函数,ios,swift,metal,metalkit,Ios,Swift,Metal,Metalkit,我将两个纹理传递给内核函数,如下所示 kernel void compute(texture2d<float,access::write> output [[texture(0)]], texture2d<float, access::read> src [[texture(1)]], uint2 gid [[thread_position_in_grid]]) kernelvoid计算(t

我将两个纹理传递给内核函数,如下所示

kernel void compute(texture2d<float,access::write> output [[texture(0)]],
                    texture2d<float, access::read> src [[texture(1)]],
                    uint2 gid [[thread_position_in_grid]])
kernelvoid计算(texture2d输出[[texture(0)],
纹理2d src[[纹理(1)],
uint2 gid[[螺纹位置在网格中]]

我需要混合src纹理以输出具有不同Blendmodes的纹理。我们不能用两个纹理传递。我认为我们可以通过传递两种纹理进行阅读,一种纹理进行写作,但我认为这不是最好的选择。建议一种使用两个纹理传递的内核函数Add blendmode的方法

您是否尝试过使用
access::read_write
限定输出纹理?对于Metal 1.2,内核和图形函数可以读写相同的纹理。多示例支持读写吗?我不这么认为。在多样本纹理上运行计算内核的用例是什么?您正在进行自定义MSAA解析吗?