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解析吗?