mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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
|
// When prepareing a stencil buffer, flush the current render command encoder
|
||||||
// to make sure the stencil buffer is cleared when loading.
|
// to make sure the stencil buffer is cleared when loading.
|
||||||
// TODO: What about clearing the stencil buffer by vertices?
|
// 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.flushRenderCommandEncoderIfNeeded()
|
||||||
}
|
}
|
||||||
g.lastStencilMode = stencilMode
|
g.lastStencilMode = stencilMode
|
||||||
|
Loading…
Reference in New Issue
Block a user