Render metal with passthrough not working with correct Info.plist

I can get the fully immersive rendering working with metal and composite services but in WWDC 24 rendering metal with passthrough was announced: https://developer.apple.com/wwdc24/10092. I watched the video and downloaded the test project. I noticed that the passthrough was showing up in the demo project but not in my metal project. After debugging I found out it was this key: Preferred Default Scene Session Role in my Info.plist that was set to Compositor Services Immersive Space Application Session Role (like the video said) but it needed to be set to Window Application Session Role for the passthrough to come in.

Is this a bug?

Does your application start with the CompositorServices ImmersiveSpace? If so, your scene manifest in the info plist would need to look similar to this:

<key>UIApplicationSceneManifest</key>
<dict>
	<key>UIApplicationPreferredDefaultSceneSessionRole</key>
	<string>CPSceneSessionRoleImmersiveSpaceApplication</string>
	<key>UISceneConfigurations</key>
	<dict>
		<key>CPSceneSessionRoleImmersiveSpaceApplication</key>
		<array>
			<dict>
				<key>UISceneInitialImmersionStyle</key>
				<string>UIImmersionStyleMixed</string>
			</dict>
		</array>
	</dict>
</dict>

Also in the ImmersiveSpace you will need to set the style to mixed. This is how you would set it to be always mixed:

.immersionStyle(selection: .constant(.mixed), in: .mixed)

Does your application start with the CompositorServices ImmersiveSpace?

Yep, I have an ImmersiveSpace whos content is created using Compositor Services.

Regarding the plist, I had exactly that and I am getting a black background with no passthrough.

Also in the ImmersiveSpace you will need to set the style to mixed. This is how you would set it to be always mixed:

Yep I have that set too.

Is this happening on the Vision Pro simulator or the Vision Pro device?

Simulator

Render metal with passthrough not working with correct Info.plist
 
 
Q