Parameterize dimensions and segments
This commit is contained in:
parent
e56f94dc56
commit
db1b0185e2
1 changed files with 4 additions and 2 deletions
|
@ -17,6 +17,9 @@ let alignedUniformsSize = (MemoryLayout<Uniforms>.size & ~0xFF) + 0x100
|
||||||
|
|
||||||
let maxBuffersInFlight = 3
|
let maxBuffersInFlight = 3
|
||||||
|
|
||||||
|
let terrainDimensions = float2(10, 10)
|
||||||
|
let terrainSegments = uint2(5, 5)
|
||||||
|
|
||||||
enum RendererError: Error {
|
enum RendererError: Error {
|
||||||
case badVertexDescriptor
|
case badVertexDescriptor
|
||||||
case badComputeFunction
|
case badComputeFunction
|
||||||
|
@ -75,7 +78,7 @@ class Renderer: NSObject, MTKViewDelegate {
|
||||||
}
|
}
|
||||||
self.library = library
|
self.library = library
|
||||||
|
|
||||||
terrain = Terrain(dimensions: float2(10, 10), segments: uint2(100, 100), device: device, library: library)!
|
terrain = Terrain(dimensions: terrainDimensions, segments: terrainSegments, device: device, library: library)!
|
||||||
|
|
||||||
do {
|
do {
|
||||||
pipelineState = try Renderer.buildRenderPipelineWithDevice(device: device,
|
pipelineState = try Renderer.buildRenderPipelineWithDevice(device: device,
|
||||||
|
@ -108,7 +111,6 @@ class Renderer: NSObject, MTKViewDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class func buildRenderPipelineWithDevice(device: MTLDevice,
|
class func buildRenderPipelineWithDevice(device: MTLDevice,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue