You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Device::UpdateWindow silently no-ops on some backends and re-binds on others when called while Bgfx.Initialized == true. No error, no log. Asymmetric with #1689 (which made UpdateDevice throw — clean because UpdateDevice is uniformly init-only on every backend).
Mechanics
Update* methods set Dirty on Bgfx.InitState. Each frame, DeviceImpl::Frame() → UpdateBgfxState() runs bgfx::setPlatformData + bgfx::frame(BGFX_FRAME_DISCARD) + bgfx::reset when dirty. The new nwh reaches g_platformData; whether bgfx re-binds the swap chain / surface is backend-specific:
Backend
Re-binds to new nwh?
OpenGL / Android
Yes (GlContext::resize recreates EGL surface from g_platformData.nwh)
OpenGL / Emscripten
Yes (canvas resize)
OpenGL / Linux Wayland
Resizes existing window only
OpenGL / Linux X11 (GLX)
No
D3D11 / Win32
No (swap chain bound to original HWND at init)
D3D11 / UWP SwapChainPanel
Yes, when m_scd.ndt == SwapChainPanel marker
D3D12
No
Metal
Only when BGFX_RESET_INTERNAL_FORCE is set (external callers don''t set this)
Where it matters
Apps/Playground/Android/.../BabylonNativeJNI.cppsurfaceChanged calls UpdateWindow + UpdateSize mid-render. Works only because Android-OpenGL re-binds. Same pattern on Win32 D3D11/D3D12, iOS Metal, or Linux X11 would silently keep rendering to the old window.
Options
Throw from UpdateWindow when initialized (symmetric with Throw from Device::UpdateDevice when rendering is enabled #1689). Callers do Disable → UpdateWindow → UpdateSize → Enable. Android JNI path needs updating; small efficiency regression vs EGL surface re-create.
Wait for uniform nwh re-bind in bgfx reset, then keep UpdateWindow reset-applicable everywhere. Depends on bgfx changes that don''t exist yet.
Device::UpdateWindowsilently no-ops on some backends and re-binds on others when called whileBgfx.Initialized == true. No error, no log. Asymmetric with #1689 (which madeUpdateDevicethrow — clean becauseUpdateDeviceis uniformly init-only on every backend).Mechanics
Update*methods setDirtyonBgfx.InitState. Each frame,DeviceImpl::Frame() → UpdateBgfxState()runsbgfx::setPlatformData + bgfx::frame(BGFX_FRAME_DISCARD) + bgfx::resetwhen dirty. The newnwhreachesg_platformData; whether bgfx re-binds the swap chain / surface is backend-specific:nwh?GlContext::resizerecreates EGL surface fromg_platformData.nwh)m_scd.ndt == SwapChainPanel markerBGFX_RESET_INTERNAL_FORCEis set (external callers don''t set this)Where it matters
Apps/Playground/Android/.../BabylonNativeJNI.cppsurfaceChangedcallsUpdateWindow + UpdateSizemid-render. Works only because Android-OpenGL re-binds. Same pattern on Win32 D3D11/D3D12, iOS Metal, or Linux X11 would silently keep rendering to the old window.Options
UpdateWindowwhen initialized (symmetric with Throw from Device::UpdateDevice when rendering is enabled #1689). Callers doDisable → UpdateWindow → UpdateSize → Enable. Android JNI path needs updating; small efficiency regression vs EGL surface re-create.nwhre-bind in bgfx reset, then keepUpdateWindowreset-applicable everywhere. Depends on bgfx changes that don''t exist yet.