mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/graphicsdriver/metal: Release objects appropriately
This commit is contained in:
parent
17d8cb5311
commit
ab26312108
@ -744,7 +744,9 @@ func (g *Graphics) draw(rps mtl.RenderPipelineState, dst *Image, dstRegion drive
|
|||||||
StencilCompareFunction: mtl.CompareFunctionAlways,
|
StencilCompareFunction: mtl.CompareFunctionAlways,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
g.rce.SetDepthStencilState(g.view.getMTLDevice().MakeDepthStencilState(desc))
|
ss := g.view.getMTLDevice().MakeDepthStencilState(desc)
|
||||||
|
g.rce.SetDepthStencilState(ss)
|
||||||
|
ss.Release()
|
||||||
case drawWithStencil:
|
case drawWithStencil:
|
||||||
desc := mtl.DepthStencilDescriptor{
|
desc := mtl.DepthStencilDescriptor{
|
||||||
BackFaceStencil: mtl.StencilDescriptor{
|
BackFaceStencil: mtl.StencilDescriptor{
|
||||||
@ -760,7 +762,9 @@ func (g *Graphics) draw(rps mtl.RenderPipelineState, dst *Image, dstRegion drive
|
|||||||
StencilCompareFunction: mtl.CompareFunctionNotEqual,
|
StencilCompareFunction: mtl.CompareFunctionNotEqual,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
g.rce.SetDepthStencilState(g.view.getMTLDevice().MakeDepthStencilState(desc))
|
ss := g.view.getMTLDevice().MakeDepthStencilState(desc)
|
||||||
|
g.rce.SetDepthStencilState(ss)
|
||||||
|
ss.Release()
|
||||||
case noStencil:
|
case noStencil:
|
||||||
desc := mtl.DepthStencilDescriptor{
|
desc := mtl.DepthStencilDescriptor{
|
||||||
BackFaceStencil: mtl.StencilDescriptor{
|
BackFaceStencil: mtl.StencilDescriptor{
|
||||||
@ -776,7 +780,9 @@ func (g *Graphics) draw(rps mtl.RenderPipelineState, dst *Image, dstRegion drive
|
|||||||
StencilCompareFunction: mtl.CompareFunctionAlways,
|
StencilCompareFunction: mtl.CompareFunctionAlways,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
g.rce.SetDepthStencilState(g.view.getMTLDevice().MakeDepthStencilState(desc))
|
ss := g.view.getMTLDevice().MakeDepthStencilState(desc)
|
||||||
|
g.rce.SetDepthStencilState(ss)
|
||||||
|
ss.Release()
|
||||||
}
|
}
|
||||||
|
|
||||||
g.rce.DrawIndexedPrimitives(mtl.PrimitiveTypeTriangle, indexLen, mtl.IndexTypeUInt16, g.ib, indexOffset*2)
|
g.rce.DrawIndexedPrimitives(mtl.PrimitiveTypeTriangle, indexLen, mtl.IndexTypeUInt16, g.ib, indexOffset*2)
|
||||||
|
Loading…
Reference in New Issue
Block a user