mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
compile metal in cmake
This commit is contained in:
@ -109,12 +109,8 @@ class Renderer {
|
||||
|
||||
// Create shader library & grab functions
|
||||
do {
|
||||
//self.lib = try device.makeDefaultLibrary(bundle: Bundle.main)
|
||||
let options = MTLCompileOptions()
|
||||
options.fastMathEnabled = true
|
||||
self.lib = try device.makeLibrary(source: Self.shaderSource, options: options)
|
||||
}
|
||||
catch {
|
||||
self.lib = try device.makeDefaultLibrary(bundle: Bundle.main)
|
||||
} catch {
|
||||
throw RendererError.initFailure("Metal shader compilation failed:\n\(error.localizedDescription)")
|
||||
}
|
||||
let vertexProgram = lib.makeFunction(name: "vertexMain")
|
||||
@ -127,8 +123,7 @@ class Renderer {
|
||||
pipeDescription.colorAttachments[0].pixelFormat = layer.pixelFormat
|
||||
do {
|
||||
self.pso = try device.makeRenderPipelineState(descriptor: pipeDescription)
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
throw RendererError.initFailure("Failed to create pipeline state: \(error.localizedDescription)")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user