Skip to content

Instantly share code, notes, and snippets.

@rmirabelli
Last active March 9, 2018 20:36
Show Gist options
  • Save rmirabelli/3ba3d6690d10aea33ca0bc052a50ef87 to your computer and use it in GitHub Desktop.
Save rmirabelli/3ba3d6690d10aea33ca0bc052a50ef87 to your computer and use it in GitHub Desktop.
Use those shaders
// vertex & fragment shader
descriptor.vertexFunction = runtimeLibrary?.makeFunction(name: "copy_vertex")
descriptor.fragmentFunction = runtimeLibrary?.makeFunction(name: "constant_color")
// framebuffer format
descriptor.colorAttachments[0].pixelFormat = .bgra8Unorm
// compile to MTLPRenderPipelineState
let renderPipeline = try device?.makeRenderPipelineState(descriptor: descriptor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment