Fix Metal: Persist new window handle (Metal layer) when swapping view (#3452)

* When using the Metal rendering backend and updating the window handle
via setPlatformData(), the passed in Metal layer was not stored.
* Instead, the old window handle was still used.
* The fix addresses a scenario where two BGFX-backed Metal views on iOS
are created and rendering needs to happen either on one view or the other.
This commit is contained in:
Martin Friedli
2025-08-08 16:46:21 +02:00
committed by GitHub
parent 23baae9e00
commit fab28297e0

View File

@@ -3513,9 +3513,9 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames
else
#endif // BX_PLATFORM_VISIONOS
{
if (m_metalLayer)
if (NULL != m_metalLayer)
{
release(m_metalLayer);
MTL_RELEASE(m_metalLayer);
}
#if !BX_PLATFORM_VISIONOS