فهرست منبع

compiling

Signed-off-by: byrcolin <[email protected]>
byrcolin 3 سال پیش
والد
کامیت
baca70d3a1

+ 4 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkDevice.h

@@ -8,6 +8,8 @@
 
 #pragma once
 
+
+
 #include <XR/XRDevice.h>
 #include <OpenXRVk_Platform.h>
 
@@ -17,6 +19,7 @@ namespace OpenXRVk
         : public XR::DeviceDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(DeviceDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(DeviceDescriptor, "{B0DB4670-A233-4F3F-A5C7-5D2B76F6D911}", XR::DeviceDescriptor);
 
         DeviceDescriptor() = default;
@@ -30,6 +33,7 @@ namespace OpenXRVk
         : public XR::Device
     {
     public:
+        AZ_CLASS_ALLOCATOR(Device, AZ::SystemAllocator, 0);
         AZ_RTTI(Device, "{81FD9B99-EDA5-4381-90EC-335073554379}", XR::Device);
 
         static AZStd::intrusive_ptr<Device> Create();

+ 2 - 2
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkFactory.h

@@ -9,6 +9,7 @@
 #pragma once
 
 #include <XR/XRFactory.h>
+
 #include <OpenXRVk_Platform.h>
 #include <OpenXRVk/OpenXRVkDevice.h>
 #include <OpenXRVk/OpenXRVkInstance.h>
@@ -27,8 +28,7 @@ namespace OpenXRVk
     {
     public:
         AZ_CLASS_ALLOCATOR(Factory, AZ::SystemAllocator, 0);
-
-        AZ_DISABLE_COPY_MOVE(Factory);
+        AZ_RTTI(Factory, "{11C46EF4-2AB5-47F7-B4F6-D30DDD53F1D8}", XR::Factory);
 
         Factory();
         ~Factory();

+ 2 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkGraphicsBinding.h

@@ -17,6 +17,7 @@ namespace OpenXRVk
         : public XR::GraphicsBindingDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(GraphicsBindingDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(GraphicsBindingDescriptor, "{1083C93E-FB2B-4441-B705-5C44427F2961}", XR::GraphicsBindingDescriptor);
 
         XrGraphicsBindingVulkan2KHR m_graphicsBinding{ XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR };
@@ -26,6 +27,7 @@ namespace OpenXRVk
         : public XR::GraphicsBinding
     {
     public:
+        AZ_CLASS_ALLOCATOR(GraphicsBinding, AZ::SystemAllocator, 0);
         AZ_RTTI(GraphicsBinding, "{1001E681-EA2E-4898-AC08-B93AA5B63508}", XR::GraphicsBinding);
 
     };

+ 7 - 4
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkInput.h

@@ -17,6 +17,7 @@ namespace OpenXRVk
         : public XR::InputDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(InputDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(InputDescriptor, "{5CE5E693-775B-42A5-9B32-7C1006C69975}", XR::InputDescriptor);
 
         InputDescriptor() = default;
@@ -30,6 +31,7 @@ namespace OpenXRVk
         : public XR::Input
     {
     public:
+        AZ_CLASS_ALLOCATOR(Input, AZ::SystemAllocator, 0);
         AZ_RTTI(Input, "{97ADD1FE-27DF-4F36-9F61-683F881F9477}", XR::Input);
 
         Input() = default;
@@ -41,6 +43,7 @@ namespace OpenXRVk
         void InitializeActions() override;
         void PollActions() override;
         void PollEvents() override;
+        AZ::RHI::ResultCode InitInternal() override;
 
     private:
         struct InputState
@@ -50,10 +53,10 @@ namespace OpenXRVk
             XrAction poseAction{ XR_NULL_HANDLE };
             XrAction vibrateAction{ XR_NULL_HANDLE };
             XrAction quitAction{ XR_NULL_HANDLE };
-            AZStd::array<XrPath, Side::COUNT> handSubactionPath;
-            AZStd::array<XrSpace, Side::COUNT> handSpace;
-            AZStd::array<float, Side::COUNT> handScale = { { 1.0f, 1.0f } };
-            AZStd::array<XrBool32, Side::COUNT> handActive;
+            AZStd::array<XrPath, 2> handSubactionPath;
+            AZStd::array<XrSpace, 2> handSpace;
+            AZStd::array<float, 2> handScale = { { 1.0f, 1.0f } };
+            AZStd::array<XrBool32, 2> handActive;
         };
         InputState m_input;
     };

+ 2 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkInstance.h

@@ -19,6 +19,7 @@ namespace OpenXRVk
         : public XR::InstanceDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(InstanceDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(InstanceDescriptor, "{F7D29A7A-5841-4B6F-ADFE-3734316BC63D}", XR::InstanceDescriptor);
 
         InstanceDescriptor() = default;
@@ -32,6 +33,7 @@ namespace OpenXRVk
         : public XR::Instance
     {
     public:
+        AZ_CLASS_ALLOCATOR(Instance, AZ::SystemAllocator, 0);
         AZ_RTTI(Instance, "{1A62DF32-2909-431C-A938-B1E841A50768}", XR::Instance);
 
         Instance() = default;

+ 3 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkPhysicalDevice.h

@@ -17,6 +17,7 @@ namespace OpenXRVk
         : public XR::PhysicalDeviceDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(PhysicalDeviceDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(PhysicalDeviceDescriptor, "{CB485C38-E723-4593-ADCF-DFE220A6A24B}", XR::PhysicalDeviceDescriptor);
 
         PhysicalDeviceDescriptor() = default;
@@ -31,11 +32,13 @@ namespace OpenXRVk
         : public XR::PhysicalDevice
     {
     public:
+        AZ_CLASS_ALLOCATOR(PhysicalDevice, AZ::SystemAllocator, 0);
         AZ_RTTI(PhysicalDevice, "{7CE8D7C1-7CC6-4841-9505-DED2761617AC}", XR::PhysicalDevice);
 
         PhysicalDevice() = default;
         virtual ~PhysicalDevice() = default;
 
+        static AZStd::vector<AZStd::intrusive_ptr<XR::PhysicalDevice>> EnumerateDeviceList();
     };
 } // namespace XR
 

+ 2 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkSession.h

@@ -18,6 +18,7 @@ namespace OpenXRVk
         : public XR::SessionDescriptor 
     {
     public:
+        AZ_CLASS_ALLOCATOR(SessionDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SessionDescriptor, "{775CCED3-9676-4F48-B419-BDADE0F7F447}", XR::SessionDescriptor);
 
         SessionDescriptor() = default;
@@ -31,6 +32,7 @@ namespace OpenXRVk
         : public XR::Session
     {
     public:
+        AZ_CLASS_ALLOCATOR(Session, AZ::SystemAllocator, 0);
         AZ_RTTI(Session, "{6C899F0C-9A3D-4D79-8E4F-92AFB67E5EB1}", XR::Session);
 
         static AZStd::intrusive_ptr<Session> Create();

+ 4 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkSpace.h

@@ -8,6 +8,7 @@
 
 #pragma once
 
+
 #include <XR/XRSpace.h>
 #include <OpenXRVk_Platform.h>
 
@@ -18,6 +19,9 @@ namespace OpenXRVk
         : public XR::Space
     {
     public:
+        AZ_CLASS_ALLOCATOR(Space, AZ::SystemAllocator, 0);
+        AZ_RTTI(Space, "{E99557D0-9061-4691-9524-CE0ACC3A14FA}", XR::Space);
+        
         static AZStd::intrusive_ptr<Space> Create();
 
         //XrSpaceLocation GetSpace(XrSpace space);

+ 8 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkSwapChain.h

@@ -17,6 +17,7 @@ namespace OpenXRVk
         : public XR::SwapChainDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChainDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SwapChainDescriptor, "{0C6214B3-9271-4972-B6B0-13C4A23D9155}", XR::SwapChainDescriptor);
 
         SwapChainDescriptor() = default;
@@ -29,6 +30,7 @@ namespace OpenXRVk
         : public XR::SwapChainImageDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChainImageDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SwapChainImageDescriptor, "{056D30CF-4B1E-4EC3-9990-A7D9C38C895B}", XR::SwapChainImageDescriptor);
 
         SwapChainImageDescriptor() = default;
@@ -42,6 +44,10 @@ namespace OpenXRVk
         : public XR::SwapChain
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChain, AZ::SystemAllocator, 0);
+        AZ_RTTI(SwapChain, "{3DD88236-8C9F-4864-86F5-018C198BC07E}", XR::SwapChain);
+
+        SwapChain() = default;
         virtual ~SwapChain() = default;
 
         static AZStd::intrusive_ptr<SwapChain> Create();
@@ -50,6 +56,7 @@ namespace OpenXRVk
             : public XR::SwapChain::Image
         {
         public:
+            AZ_CLASS_ALLOCATOR(Image, AZ::SystemAllocator, 0);
             AZ_RTTI(Image, "{717ABDD4-C050-4FDF-8E93-3784F81FE315}", XR::SwapChain::Image);
 
             static AZStd::intrusive_ptr<Image> Create();
@@ -63,6 +70,7 @@ namespace OpenXRVk
             : public XR::SwapChain::View
         {
         public:
+            AZ_CLASS_ALLOCATOR(View, AZ::SystemAllocator, 0);
             AZ_RTTI(View, "{F8312427-AC2D-4737-9A8F-A16ADA5319D0}", XR::SwapChain::View);
 
             static AZStd::intrusive_ptr<View> Create();

+ 9 - 5
Gems/OpenXRVk/Code/Include/OpenXRVk/OpenXRVkSystem.h

@@ -8,6 +8,8 @@
 
 #pragma once
 
+#include <AzCore/Component/TickBus.h>
+
 #include <XR/XRSystem.h>
 
 #include <OpenXRVk_Platform.h>
@@ -19,8 +21,6 @@
 #include <OpenXRVk/OpenXRVkSession.h>
 #include <OpenXRVk/OpenXRVkGraphicsBinding.h>
 
-#include <AzCore/Component/TickBus.h>
-
 namespace OpenXRVk
 {
     class System final
@@ -28,6 +28,7 @@ namespace OpenXRVk
         , public AZ::SystemTickBus::Handler
     {
     public:
+        AZ_CLASS_ALLOCATOR(System, AZ::SystemAllocator, 0);
         AZ_RTTI(System, "{FBAFDEE2-0A03-4EA8-98E9-A1C8DB32DBCF}", XR::System);
 
         ///////////////////////////////////////////////////////////////////////////////////
@@ -65,7 +66,7 @@ namespace OpenXRVk
         AZ::RPI::XRInstanceDescriptor* GetInstanceDescriptor() override;
 
         // Provide Swap chain specific data to RHI
-        AZ::RPI::XRSwapChainImageDescriptor* GetSwapChainImageDescriptor(int swapchainIndex) override;
+        AZ::RPI::XRSwapChainImageDescriptor* GetSwapChainImageDescriptor(AZ::u16 swapchainIndex) override;
 
         // Provide access to Graphics Binding specific data that RHI can populate
         AZ::RPI::XRGraphicsBindingDescriptor* GetGraphicsBindingDescriptor() override;
@@ -84,7 +85,6 @@ namespace OpenXRVk
         AZ::RHI::ResultCode InitDevice();
 
     private:
-        AZ::RHI::ResultCode InitInstance();
 
         ///////////////////////////////////////////////////////////////////////////////////
         // SystemTickBus
@@ -92,6 +92,9 @@ namespace OpenXRVk
         void OnSystemTick() override;
         //////////////////////////////////////////////////////////////////////////////////
 
+        AZStd::vector<AZStd::string> m_layerNames;
+        AZStd::vector<AZStd::string> m_extentionNames;
+
         AZStd::intrusive_ptr<OpenXRVk::Instance> m_instance;
         AZStd::intrusive_ptr<OpenXRVk::Device> m_device;
         AZStd::intrusive_ptr<OpenXRVk::Session> m_session;
@@ -101,7 +104,8 @@ namespace OpenXRVk
         bool m_exitRenderLoop = false;
         AZStd::intrusive_ptr<OpenXRVk::DeviceDescriptor> m_deviceDesc;
         AZStd::intrusive_ptr<OpenXRVk::InstanceDescriptor> m_instanceDesc;
-        AZStd::intrusive_ptr<OpenXRVk::SwapChainDescriptor> m_swapchainDesc;
+        AZStd::vector<AZStd::intrusive_ptr<OpenXRVk::SwapChainDescriptor>> m_swapchainDesc;
+        AZStd::vector<AZStd::intrusive_ptr<OpenXRVk::SwapChainImageDescriptor>> m_swapchainImageDesc;
         AZStd::intrusive_ptr<OpenXRVk::GraphicsBindingDescriptor> m_graphicsBindingDesc;
     };
 }

+ 7 - 0
Gems/OpenXRVk/Code/Include/OpenXRVk/Platform/Windows/OpenXRVk_Windows.h

@@ -12,7 +12,14 @@
 #include <AzCore/std/algorithm.h>
 #include <limits.h>
 
+#include <Unknwn.h>
+
 #include <glad/vulkan.h>
+
+ // Tell OpenXR what platform code we'll be using
+#define XR_USE_PLATFORM_WIN32
+#define XR_USE_GRAPHICS_API_VULKAN
+
 #include <openxr/openxr.h>
 #include <openxr/openxr_platform.h>
 #include <openxr/openxr_reflection.h>

+ 1 - 1
Gems/OpenXRVk/Code/Source/OpenXRVkDevice.cpp

@@ -12,7 +12,7 @@ namespace OpenXRVk
 {
     AZStd::intrusive_ptr<Device> Device::Create()
     {
-        return nullptr;
+        return aznew Device;
     }
 
     AZ::RHI::ResultCode Device::InitDeviceInternal()

+ 8 - 8
Gems/OpenXRVk/Code/Source/OpenXRVkFactory.cpp

@@ -24,49 +24,49 @@ namespace OpenXRVk
     // Create XR::Instance object
     AZStd::intrusive_ptr<XR::Instance> CreateInstance()
     {
-        return aznew OpenXRVk::Instance;
+        return aznew Instance;
     }
 
     // Create XR::Device object
     AZStd::intrusive_ptr<XR::Device> CreateDevice()
     {
-        return aznew OpenXRVk::Device;
+        return aznew Device;
     }
 
     // Return a list of XR::PhysicalDevice
     AZStd::vector<AZStd::intrusive_ptr<XR::PhysicalDevice>> EnumerateDeviceList()
     {
-        return OpenXRVk::PhysicalDevice::EnumerateList();
+        return PhysicalDevice::EnumerateDeviceList();
     }
 
     // Create XR::Session object
     AZStd::intrusive_ptr<XR::Session> CreateSession()
     {
-        return aznew OpenXRVk::Session;
+        return aznew Session;
     }
 
     // Create XR::Input object
     AZStd::intrusive_ptr<XR::Input> CreateInput()
     {
-        return aznew OpenXRVk::Input;
+        return aznew Input;
     }
 
     // Create XR::SwapChain object
     AZStd::intrusive_ptr<XR::SwapChain> CreateSwapchain()
     {
-        return aznew OpenXRVk::SwapChain;
+        return aznew SwapChain;
     }
 
     // Create XR::ViewSwapChain object
     AZStd::intrusive_ptr<XR::SwapChain::View> CreateViewSwapchain()
     {
-        return aznew OpenXRVk::SwapChain::View;
+        return aznew SwapChain::View;
     }
 
     // Create RPI::XR::GraphicsBindingDescriptor that will contain
     // renderer information needed to start a session
     AZStd::intrusive_ptr<XR::GraphicsBindingDescriptor> CreateGraphicsBindingDescriptor()
     {
-        return aznew OpenXRVk::SwapChain::View;
+        return aznew GraphicsBindingDescriptor;
     }
 }

+ 11 - 1
Gems/OpenXRVk/Code/Source/OpenXRVkInput.cpp

@@ -17,7 +17,17 @@ namespace OpenXRVk
 
     AZ::RHI::ResultCode Input::Init()
     {
-        InitializeActions();
+        if(XR::Input::Init() == AZ::RHI::ResultCode::Success)
+        {
+            InitializeActions();
+        }
+
+        return AZ::RHI::ResultCode::Success;
+    }
+
+    AZ::RHI::ResultCode Input::InitInternal()
+    {
+        return AZ::RHI::ResultCode::Success;
     }
 
     void Input::InitializeActions()

+ 2 - 2
Gems/OpenXRVk/Code/Source/OpenXRVkInstance.cpp

@@ -10,12 +10,12 @@
 
 namespace OpenXRVk
 {
-    AZStd::intrusive_ptr<Instance> Instance::Create();
+    AZStd::intrusive_ptr<Instance> Instance::Create()
     {
         return nullptr;
     }
 
-    AZ::RHI::ResultCode Instance::InitInstanceInternal();
+    AZ::RHI::ResultCode Instance::InitInstanceInternal()
     {
         AZ::RHI::ResultCode res = XR::Instance::InitInstanceInternal();
         // xrCreateInstance(m_xrInstance)

+ 4 - 4
Gems/OpenXRVk/Code/Source/OpenXRVkModule.cpp

@@ -21,10 +21,10 @@ namespace AZ
             : public AZ::Module
         {
         public:
-            AZ_RTTI(PlatformModule, "{C34AA64E-0983-4D30-A33C-0D7C7676A20E}", AZ::Module);
-            AZ_CLASS_ALLOCATOR(PlatformModule, AZ::SystemAllocator, 0);
+            AZ_RTTI(Module, "{C34AA64E-0983-4D30-A33C-0D7C7676A20E}", AZ::Module);
+            AZ_CLASS_ALLOCATOR(Module, AZ::SystemAllocator, 0);
 
-            PlatformModule()
+            Module()
                 : AZ::Module()
             {
             }
@@ -35,4 +35,4 @@ namespace AZ
 // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
 // The first parameter should be GemName_GemIdLower
 // The second should be the fully qualified name of the class above
-AZ_DECLARE_MODULE_CLASS(Gem_OpenXRVk, AZ::OpenXRVk::PlatformModule)
+AZ_DECLARE_MODULE_CLASS(Gem_OpenXRVk, AZ::OpenXRVk::Module)

+ 5 - 0
Gems/OpenXRVk/Code/Source/OpenXRVkPhysicalDevice.cpp

@@ -10,4 +10,9 @@
 
 namespace OpenXRVk
 {
+    AZStd::vector<AZStd::intrusive_ptr<XR::PhysicalDevice>> PhysicalDevice::EnumerateDeviceList()
+    {
+        AZStd::vector<AZStd::intrusive_ptr<XR::PhysicalDevice>> res;
+        return res;
+    }
 }

+ 4 - 9
Gems/OpenXRVk/Code/Source/OpenXRVkSession.cpp

@@ -10,7 +10,7 @@
 
 namespace OpenXRVk
 {
-    AZStd::intrusive_ptr<Session> Session::Create();
+    AZStd::intrusive_ptr<Session> Session::Create()
     {
         return nullptr;
     }
@@ -28,9 +28,9 @@ namespace OpenXRVk
     }
 
     void Session::HandleSessionStateChangedEvent(
-        const XrEventDataSessionStateChanged& stateChangedEvent,
-        bool* exitRenderLoop,
-        bool* requestRestart)
+        const XrEventDataSessionStateChanged& /*stateChangedEvent*/,
+        bool* /*exitRenderLoop*/,
+        bool* /*requestRestart*/)
     {
         // Handle Session state changes
     }
@@ -50,9 +50,4 @@ namespace OpenXRVk
         return m_sessionState == XR_SESSION_STATE_FOCUSED;
     }
 
-    AZ::RHI::ResultCode Session::InitInternal()
-    {
-        // Init specific code
-        return AZ::RHI::ResultCode::Success;
-    }
 }

+ 2 - 1
Gems/OpenXRVk/Code/Source/OpenXRVkSpace.cpp

@@ -10,8 +10,9 @@
 
 namespace OpenXRVk
 {
-    AZStd::intrusive_ptr<AZ::RPI::XR::Space> Space::Create()
+    AZStd::intrusive_ptr<Space> Space::Create()
     {
+        return nullptr;
     }
 
     //XrSpaceLocation GetSpace(XrSpace space)

+ 4 - 4
Gems/OpenXRVk/Code/Source/OpenXRVkSwapChain.cpp

@@ -13,20 +13,20 @@ namespace OpenXRVk
 {
     AZStd::intrusive_ptr<SwapChain> SwapChain::Create()
     {
-        return nullptr;
+        return aznew SwapChain;
     }
 
     AZStd::intrusive_ptr<SwapChain::Image> SwapChain::Image::Create()
     {
-        return nullptr;
+        return aznew SwapChain::Image;
     }
 
     AZStd::intrusive_ptr<SwapChain::View> SwapChain::View::Create()
     {
-        return nullptr;
+        return aznew SwapChain::View;
     }
 
-    AZ::RHI::ResultCode SwapChain::View::Init(XrSwapchain handle, AZ::u32 width, AZ::u32 height)
+    AZ::RHI::ResultCode SwapChain::View::Init(XrSwapchain /*handle*/, AZ::u32 /*width*/, AZ::u32 /*height*/)
     {
         return AZ::RHI::ResultCode::Success;
     }

+ 90 - 91
Gems/OpenXRVk/Code/Source/OpenXRVkSystem.cpp

@@ -7,168 +7,167 @@
  */
 
 #include <OpenXRVk/OpenXRVkSystem.h>
+#include <OpenXRVk/OpenXRVkFactory.h>
 
 namespace OpenXRVk
 {
     // Accessor functions for RHI objects that are populated by backend XR gems
     // This will allow XR gem to provide device related data to RHI
-    AZ::RPI::XRDeviceDescriptor* OpenXRVk::System::GetDeviceDescriptor()
+    AZ::RPI::XRDeviceDescriptor* System::GetDeviceDescriptor()
     {
         return m_deviceDesc.get();
     }
 
     // Provide access to instance specific data to RHI
-    AZ::RPI::XRInstanceDescriptor* OpenXRVk::System::GetInstanceDescriptor()
+    AZ::RPI::XRInstanceDescriptor* System::GetInstanceDescriptor()
     {
         return m_instanceDesc.get();
     }
 
     // Provide Swapchain specific data to RHI
-    AZ::RPI::XRSwapChainImageDescriptor* OpenXRVk::System::GetSwapChainImageDescriptor(int swapchainIndex)
+    AZ::RPI::XRSwapChainImageDescriptor* System::GetSwapChainImageDescriptor(AZ::u16 swapchainIndex)
     {
-        return m_swapchainDesc->m_descriptor.get();
+        return m_swapchainImageDesc[swapchainIndex].get();
     }
 
     // Provide access to Graphics Binding specific data that RHI can populate
-    AZ::RPI::XRGraphicsBindingDescriptor* OpenXRVk::System::GetGraphicsBindingDescriptor()
+    AZ::RPI::XRGraphicsBindingDescriptor* System::GetGraphicsBindingDescriptor()
     {
         return m_graphicsBindingDesc.get();
     }
 
     // Access supported Layers and extension names
-    const AZStd::vector<AZStd::string>& OpenXRVk::System::GetLayerNames()
+    const AZStd::vector<AZStd::string>& System::GetLayerNames()
     {
+        return m_layerNames;
     }
 
-    const AZStd::vector<AZStd::string>& OpenXRVk::System::GetExtensionNames()
+    const AZStd::vector<AZStd::string>& System::GetExtensionNames()
     {
+        return m_extentionNames;
     }
 
     // Create XR instance object and initialize it
-    AZ::RHI::ResultCode OpenXRVk::System::InitInstance()
-    {
-        m_instance = XR::Factory::Get()->CreateInstance();
-
-        if (m_instance)
-        {
-            return m_instance->InitInstanceInternal();
-        }
-        return AZ::RPI::XR::ResultCode::Fail;
+    AZ::RHI::ResultCode System::InitInstance()
+    {
+//         m_instance = Factory::Get().CreateInstance();
+// 
+//         if (m_instance)
+//         {
+//             return m_instance->InitInstanceInternal();
+//         }
+        return AZ::RHI::ResultCode::Fail;
     }
 
     // Create XR device object and initialize it
-    AZ::RHI::ResultCode OpenXRVk::System::InitDevice()
-    {
-        m_device = XR::Factory::Get()->CreateDevice();
-
-        // Get a list of XR compatible devices
-        AZStd::vector<AZStd::intrusive_ptr<PhysicalDevice>> physicalDeviceList = Factory::Get()->EnumerateDeviceList();
-
-        // Code to pick the correct device.
-        // For now we can just pick the first device in the list
-
-        if (m_device)
-        {
-            return m_device->InitDeviceInternal();
-        }
+    AZ::RHI::ResultCode System::InitDevice()
+    {
+//         m_device = Factory::Get().CreateDevice();
+// 
+//         // Get a list of XR compatible devices
+//         AZStd::vector<AZStd::intrusive_ptr<PhysicalDevice>> physicalDeviceList = Factory::Get().EnumerateDeviceList();
+// 
+//         // Code to pick the correct device.
+//         // For now we can just pick the first device in the list
+// 
+//         if (m_device)
+//         {
+//             return m_device->InitDeviceInternal();
+//         }
         return AZ::RHI::ResultCode::Fail;
     }
 
     // Initialize XR instance and device
-    AZ::RHI::ResultCode OpenXRVk::System::InitializeSystem()
-    {
-        AZ::RHI::ResultCode instResult = InitInstance();
-        if (instResult != AZ::RHI::ResultCode::Success)
-        {
-            AZ_Assert(false, "XR Instance creation failed");
-            return instResult;
-        }
-
-        AZ::RHI::ResultCode deviceResult = InitDevice();
-        if (deviceResult != AZ::RHI::ResultCode::Success)
-        {
-            AZ_Assert(false, "XR device creation failed");
-            return deviceResult;
-        }
+    AZ::RHI::ResultCode System::InitializeSystem()
+    {
+//         AZ::RHI::ResultCode instResult = InitInstance();
+//         if (instResult != AZ::RHI::ResultCode::Success)
+//         {
+//             AZ_Assert(false, "XR Instance creation failed");
+//             return instResult;
+//         }
+// 
+//         AZ::RHI::ResultCode deviceResult = InitDevice();
+//         if (deviceResult != AZ::RHI::ResultCode::Success)
+//         {
+//             AZ_Assert(false, "XR device creation failed");
+//             return deviceResult;
+//         }
         return AZ::RHI::ResultCode::Success;
     }
 
     // Initialize a XR session
-    AZ::RHI::ResultCode OpenXRVk::System::InitializeSession(AZStd::intrusive_ptr<GraphicsBinding> graphicsBinding)
-    {
-        m_session = XR::Factory::Get()->CreateSession();
-
-        if (m_session)
-        {
-            XR::SessionDescriptor sessionDesc;
-            m_gbDesc = XR::Factory::Get()->CreateGraphicsBindingDescriptor();
-            sessionDesc.m_graphicsBinding = RPISystem::Get()->PopulateGrapicsBinding(m_graphicsBindingDesc);
-            AZ::RHI::ResultCode sessionResult = m_session->Init(sessionDesc);
-            AZ_Assert(sessionResult == AZ::RHI::ResultCode::Success, "Session init failed");
-
-            m_xrInput = XR::Factory::Get()->CreateInput();
-            return m_xrInput->InitializeActions();
-        }
+    AZ::RHI::ResultCode System::InitializeSession()
+    {
+//         m_session = Factory::Get().CreateSession();
+// 
+//         if (m_session)
+//         {
+//             XR::SessionDescriptor sessionDesc;
+//             m_graphicsBindingDesc = Factory::Get().CreateGraphicsBindingDescriptor();
+//             sessionDesc.m_graphicsBinding = RPISystem::Get()->PopulateGrapicsBinding(m_graphicsBindingDesc);
+//             AZ::RHI::ResultCode sessionResult = m_session->Init(sessionDesc);
+//             AZ_Assert(sessionResult == AZ::RHI::ResultCode::Success, "Session init failed");
+// 
+//             m_xrInput = Factory::Get().CreateInput();
+//             return m_xrInput->InitializeActions();
+//         }
         return AZ::RHI::ResultCode::Fail;
     }
 
     // Manage session lifecycle to track if RenderFrame should be called.
-    bool OpenXRVk::System::IsSessionRunning() const
+    bool System::IsSessionRunning() const
     {
         return m_session->IsSessionRunning();
     }
 
     // Create a Swapchain which will responsible for managing
     // multiple XR swapchains and multiple swapchain images within it
-    AZ::RHI::ResultCode OpenXRVk::System::CreateSwapchain()
-    {
-        m_swapChain = XR::Factory::Get()->CreateSwapchain();
-
-        if (m_swapChain)
-        {
-            ResultCode swapchainCreationResult = m_swapChain->Init(sessionDesc);
-            AZ_Assert(sessionResult == ResultCode::Success, "Swapchain init failed");
-            return swapchainCreationResult;
-        }
+    AZ::RHI::ResultCode System::CreateSwapchain()
+    {
+//         m_swapChain = Factory::Get().CreateSwapchain();
+// 
+//         if (m_swapChain)
+//         {
+//             AZ::RHI::ResultCode swapchainCreationResult = m_swapChain->Init(sessionDesc);
+//             AZ_Assert(sessionResult == AZ::RHI::ResultCode::Success, "Swapchain init failed");
+//             return swapchainCreationResult;
+//         }
         return AZ::RHI::ResultCode::Fail;
     }
 
     // Indicate start of a frame
-    void OpenXRVk::System::BeginFrame()
+    void System::BeginFrame()
     {
     }
 
     // Indicate end of a frame
-    void OpenXRVk::System::EndFrame()
+    void System::EndFrame()
     {
     }
 
     // Indicate start of a XR view to help with synchronizing XR swapchain
-    void OpenXRVk::System::BeginView()
+    void System::BeginView()
     {
     }
 
     // Indicate end of a XR view to help with synchronizing XR swapchain
-    void OpenXRVk::System::EndView()
-    {
-    }
-
-    AZ::RHI::ResultCode OpenXRVk::System::InitInstance()
+    void System::EndView()
     {
     }
 
     // System Tick to poll input data
-    void OpenXRVk::System::OnSystemTick()
-    {
-        m_input->PollEvents();
-        if (exitRenderLoop)
-        {
-            break;
-        }
-
-        if (IsSessionRunning())
-        {
-            m_input->PollActions();
-        }
+    void System::OnSystemTick()
+    {
+//         m_input->PollEvents();
+//         if (exitRenderLoop)
+//         {
+//             break;
+//         }
+// 
+//         if (IsSessionRunning())
+//         {
+//             m_input->PollActions();
+//         }
     }
 }

+ 2 - 1
Gems/OpenXRVk/Code/Source/OpenXRVkUtils.cpp

@@ -7,6 +7,7 @@
  */
 
 #include <OpenXRVk/OpenXRVkUtils.h>
+//#include <AzCore/Debug/Trace.h>
 
 namespace OpenXRVk
 {
@@ -27,7 +28,7 @@ namespace OpenXRVk
     {
         if (result != XR_SUCCESS)
         {
-            AZ_Error("XR", false, "ERROR: XR API method failed: %s", GetResultString(result));
+            //AZ_Error("XR", false, "ERROR: XR API method failed: %s", GetResultString(result));
             return false;
         }
         return true;