Skip to content

Commit

Permalink
bugfix - imporve refresh rate to solve blink and stroking missing. pr…
Browse files Browse the repository at this point in the history
…oblem
  • Loading branch information
Harley-xk committed Oct 10, 2020
1 parent e704afb commit 9e23bf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions MaLiang/Classes/MetalBase/MetalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ open class MetalView: MTKView {
super.draw(rect)

guard metalAvaliable,
let target = screenTarget, target.modified,
let target = screenTarget,
let texture = target.texture else {
return
}
Expand All @@ -159,9 +159,7 @@ open class MetalView: MTKView {
if let drawable = currentDrawable {
commandBuffer?.present(drawable)
}
commandBuffer?.commit()

target.modified = false
commandBuffer?.commit()
}
}

Expand Down
2 changes: 0 additions & 2 deletions MaLiang/Classes/MetalBase/RenderTarget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ open class RenderTarget {
internal var commandBuffer: MTLCommandBuffer?
internal var commandQueue: MTLCommandQueue?
internal var device: MTLDevice?
internal var modified = false

internal func updateBuffer(with size: CGSize) {
self.drawableSize = size
Expand Down Expand Up @@ -101,7 +100,6 @@ open class RenderTarget {
internal func commitCommands() {
commandBuffer?.commit()
commandBuffer = nil
modified = true
}

// make empty testure
Expand Down

0 comments on commit 9e23bf1

Please sign in to comment.