Skip to content

Commit 935bf4a

Browse files
committed
Discard encoder state before Canvas Flush to prevent NativeEngine state leaking into nanovg rendering.
1 parent c73534c commit 935bf4a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Polyfills/Canvas/Source/Context.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,11 @@ namespace Babylon::Polyfills::Internal
623623
return;
624624
}
625625

626+
// Discard any residual encoder state from NativeEngine rendering.
627+
// In the old model Canvas had its own per-thread encoder with clean state;
628+
// now it shares the frame encoder with NativeEngine.
629+
encoder->discard(BGFX_DISCARD_ALL);
630+
626631
bool needClear = m_canvas->UpdateRenderTarget();
627632

628633
Graphics::FrameBuffer& frameBuffer = m_canvas->GetFrameBuffer();

0 commit comments

Comments
 (0)