Skip to content

v2.0.0

Compare
Choose a tag to compare
@yukiny0811 yukiny0811 released this 09 Jan 15:40
· 53 commits to main since this release
f5fd2fe

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);"
    }
}

display