Skip to content

Instantly share code, notes, and snippets.

@kunofellasleep
Last active October 15, 2018 08:19
Show Gist options
  • Save kunofellasleep/7bdd649baa3346973386a5d0d823f29d to your computer and use it in GitHub Desktop.
Save kunofellasleep/7bdd649baa3346973386a5d0d823f29d to your computer and use it in GitHub Desktop.
kernel void blendAdd(
texture2d<float, access::write> outTex [[texture(0)]],
texture2d<float, access::read> inTex [[texture(1)]],
texture2d<float, access::read> inTex2 [[texture(2)]],
uint2 gid [[thread_position_in_grid]]) {
float4 c = inTex.read(gid).rgba;
float4 add = inTex2.read(gid).rgba;
c.rgb += add.rgb;
outTex.write(c.rgba, gid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment