v2.0.0
First Public Release!
Write complicated Metal codes and pipelines in very short lines of code!
class MyCompute: EMMetalComputeFunction {
@EMArgument("tex") var tex: EMMetalTexture = .init(texture: nil, usage: .read_write)
@EMArgument("intensity") var intensity: Float = 100
@ShaderStringBuilder
override var impl: String {
"float2 floatGid = float2(gid.x, gid.y);"
"float2 center = float2(tex.get_width() / 2, tex.get_height() / 2);"
"float dist = distance(center, floatGid);"
"float color = intensity / dist;"
"tex.write(float4(color, color, color, 1), gid);"
}
}