mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/metal: Bug fix: TestImageEvenOdd failed
RenderCommandEncoder must be reset whenever the stencil mode is 'prepareStencil' in order to clear the stencil buffer.
This commit is contained in:
parent
3670b7dd62
commit
be1a0e90e7
@ -707,7 +707,7 @@ func (g *Graphics) draw(rps mtl.RenderPipelineState, dst *Image, dstRegion drive
|
||||
// When prepareing a stencil buffer, flush the current render command encoder
|
||||
// to make sure the stencil buffer is cleared when loading.
|
||||
// TODO: What about clearing the stencil buffer by vertices?
|
||||
if g.lastDstTexture != dst.mtlTexture() || (g.lastStencilMode == noStencil) != (stencilMode == noStencil) {
|
||||
if g.lastDstTexture != dst.mtlTexture() || (g.lastStencilMode == noStencil) != (stencilMode == noStencil) || stencilMode == prepareStencil {
|
||||
g.flushRenderCommandEncoderIfNeeded()
|
||||
}
|
||||
g.lastStencilMode = stencilMode
|
||||
|
Loading…
Reference in New Issue
Block a user