Skip to content

Instantly share code, notes, and snippets.

@MasDennis
Created September 26, 2021 18:17
Show Gist options
  • Save MasDennis/c1e1513c63bdeed1090809d9c9fa64ae to your computer and use it in GitHub Desktop.
Save MasDennis/c1e1513c63bdeed1090809d9c9fa64ae to your computer and use it in GitHub Desktop.
guard let computePipelineState = self.computePipelineState,
let encoder = context.commandBuffer.makeComputeCommandEncoder()
else {
return
}
encoder.setComputePipelineState(computePipelineState)
encoder.setTexture(context.sourceColorTexture, index: 0)
encoder.setTexture(context.targetColorTexture, index: 1)
encoder.dispatchThreadgroups(self.threadgroupsPerGrid, threadsPerThreadgroup: self.threadsPerThreadgroup)
encoder.endEncoding()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment