Commit c88f0f5f authored by Lubosz Sarnecki's avatar Lubosz Sarnecki

gears: Run as overlay.

parent bd4e673b
...@@ -100,6 +100,15 @@ _check_vk_extension() ...@@ -100,6 +100,15 @@ _check_vk_extension()
XR_KHR_VULKAN_ENABLE_EXTENSION_NAME)) XR_KHR_VULKAN_ENABLE_EXTENSION_NAME))
return false; return false;
result =
is_extension_supported(XR_EXTX_OVERLAY_EXTENSION_NAME,
instanceExtensionProperties, instanceExtensionCount);
if (!xr_result(result,
"Runtime does not support required instance extension %s\n",
XR_EXTX_OVERLAY_EXTENSION_NAME))
return false;
return true; return true;
} }
...@@ -135,13 +144,14 @@ static bool ...@@ -135,13 +144,14 @@ static bool
_create_instance(xr_example* self) _create_instance(xr_example* self)
{ {
const char* const enabledExtensions[] = { const char* const enabledExtensions[] = {
XR_KHR_VULKAN_ENABLE_EXTENSION_NAME XR_KHR_VULKAN_ENABLE_EXTENSION_NAME,
XR_EXTX_OVERLAY_EXTENSION_NAME,
}; };
XrInstanceCreateInfo instanceCreateInfo = { XrInstanceCreateInfo instanceCreateInfo = {
.type = XR_TYPE_INSTANCE_CREATE_INFO, .type = XR_TYPE_INSTANCE_CREATE_INFO,
.createFlags = 0, .createFlags = 0,
.enabledExtensionCount = 1, .enabledExtensionCount = ARRAY_SIZE(enabledExtensions),
.enabledExtensionNames = enabledExtensions, .enabledExtensionNames = enabledExtensions,
.enabledApiLayerCount = 0, .enabledApiLayerCount = 0,
.applicationInfo = { .applicationInfo = {
...@@ -787,8 +797,15 @@ xr_init_post_vk(xr_example* self, ...@@ -787,8 +797,15 @@ xr_init_post_vk(xr_example* self,
uint32_t queue_family_index, uint32_t queue_family_index,
uint32_t queue_index) uint32_t queue_index)
{ {
XrSessionCreateInfoOverlayEXTX overlay_info = {
.type = XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX,
.sessionLayersPlacement = 1,
};
self->graphics_binding = (XrGraphicsBindingVulkanKHR){ self->graphics_binding = (XrGraphicsBindingVulkanKHR){
.type = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR, .type = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR,
.next = &overlay_info,
.instance = instance, .instance = instance,
.physicalDevice = physical_device, .physicalDevice = physical_device,
.device = device, .device = device,
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include <openxr/openxr.h> #include <openxr/openxr.h>
#include <openxr/openxr_platform.h> #include <openxr/openxr_platform.h>
#define ENABLE_SKY_LAYER 1 #define ENABLE_SKY_LAYER 0
#define ENABLE_GEARS_LAYER 1 #define ENABLE_GEARS_LAYER 1
#define ENABLE_QUAD_LAYERS 1 #define ENABLE_QUAD_LAYERS 0
#if ENABLE_QUAD_LAYERS #if ENABLE_QUAD_LAYERS
#include "xr_quad.h" #include "xr_quad.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment