Ver Fonte

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.
Martin Friedli há 5 meses atrás
pai
commit
fab28297e0
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/renderer_mtl.mm

+ 2 - 2
src/renderer_mtl.mm

@@ -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