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
xref:Subsystems/06_conclusion.adoc[Previous: Subsystems Conclusion] | xref:../index.adoc[Back to Building a Simple Engine]
15
+
xref:Building_a_Simple_Engine/Subsystems/06_conclusion.adoc[Previous: Subsystems Conclusion] | xref:Building_a_Simple_Engine/introduction.adoc[Back to Building a Simple Engine]
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/02_OpenXR_Vulkan_Handshake/01_introduction.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,4 +23,4 @@ If you don't perform this handshake correctly, you might find that you can't ini
23
23
24
24
By the end of this chapter, you will have modified your engine's initialization code to be fully spatial-aware, laying the groundwork for the predictive frame loop and runtime-owned swapchains that follow.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/02_OpenXR_Vulkan_Handshake/02_system_integration.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,4 +78,4 @@ By following the `XR_KHR_vulkan_enable2` protocol, we guarantee that our frames
78
78
79
79
In the next section, we will look at **Hardware Alignment**, where we ensure that the `VkPhysicalDevice` we select is the exact same one the headset is physically connected to.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/02_OpenXR_Vulkan_Handshake/03_hardware_alignment_luid.adoc
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,12 +40,14 @@ To find the LUID of a Vulkan physical device, we query the `VkPhysicalDeviceIDPr
40
40
----
41
41
// Iterating through physical devices to find a match
42
42
for (const auto& physicalDevice : instance.enumeratePhysicalDevices()) {
43
-
auto props2 = physicalDevice.getProperties2<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceIDProperties>();
44
-
auto idProps = props2.get<vk::PhysicalDeviceIDProperties>();
43
+
vk::PhysicalDeviceIDProperties idProps;
44
+
vk::PhysicalDeviceProperties2 props2;
45
+
props2.pNext = &idProps;
46
+
physicalDevice.getProperties2(&props2);
45
47
46
48
if (idProps.deviceLUIDValid) {
47
49
// Compare the 8-byte LUID against the target from OpenXR
48
-
if (memcmp(idProps.deviceLUID.data(), targetLUID, 8) == 0) {
50
+
if (std::memcmp(idProps.deviceLUID, targetLUID, VK_LUID_SIZE) == 0) {
49
51
return physicalDevice;
50
52
}
51
53
}
@@ -60,4 +62,4 @@ Vulkan 1.4 makes this easier by standardizing external memory handles, but these
60
62
61
63
In the final part of our handshake, we will ensure that our selected device is configured with the mandatory **Vulkan 1.4 features** required for a modern spatial pipeline.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/02_OpenXR_Vulkan_Handshake/04_vulkan_1_4_feature_requirements.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,4 +69,4 @@ We have now successfully:
69
69
70
70
With the handshake complete, we are ready to tackle the most significant architectural change in an XR engine: moving from engine-owned swapchains to **Runtime-Owned Swapchains**.
In `Renderer::createLogicalDevice`, we must explicitly enable the 1.4 features required for spatial computing:
154
+
In `Renderer::createLogicalDevice`, we must explicitly enable the Vulkan 1.3 features required for spatial computing, particularly **Dynamic Rendering** and **Synchronization 2**:
// ... create vk::raii::Device with multiviewFeatures in pNext ...
172
172
}
173
173
----
174
174
175
175
== Why These Changes?
176
176
177
177
By referencing the specific locations in `renderer_core.cpp`, we can see that OpenXR isn't just an "add-on"—it's a **collaborator** in the Vulkan lifecycle. Without the LUID matching in `pickPhysicalDevice`, our engine might initialize on a discrete GPU while the VR headset is tethered to an integrated one, leading to a complete failure to display. Similarly, the extension negotiation ensures that the XR compositor and our engine speak the same "dialect" of Vulkan.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/03_Runtime_Owned_Swapchains/01_introduction.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,4 +23,4 @@ This rhythm ensures that we never render into an image that is currently being d
23
23
24
24
By the end of this chapter, your engine will be able to render its spatial views directly into the headset's compositor buffers, using our existing RAII wrappers while respecting the runtime's ownership.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/03_Runtime_Owned_Swapchains/02_external_image_negotiation.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,4 +71,4 @@ By negotiating the images this way, we ensure a **Zero-Copy** hand-off. When we
71
71
72
72
This efficiency is the difference between a high-performance 90Hz experience and a laggy, uncomfortable one. In the next section, we'll see how to wrap these raw Vulkan handles into the engine's `vk::raii` abstractions.
Copy file name to clipboardExpand all lines: en/OpenXR_Vulkan_Spatial_Computing/03_Runtime_Owned_Swapchains/03_raii_resource_integration.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,4 +72,4 @@ This hybrid approach—using raw handles for external resources and RAII for int
72
72
73
73
In the next section, we will look at the **Memory Ownership Lifecycle**, where we master the delicate dance of waiting, acquiring, and releasing these images during our frame loop.
0 commit comments