2
0
byrcolin 3 жил өмнө
parent
commit
2fd03d908e

+ 5 - 1
Gems/XR/Code/Include/XR/XRDevice.h

@@ -8,6 +8,7 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
@@ -16,7 +17,8 @@ namespace XR
         : public AZ::RPI::XRDeviceDescriptor
     {
     public:
-        AZ_RTTI(DeviceDescriptor, "{1FF2D68D-DA6A-47B3-A5BE-18E3A100C830}");
+        AZ_CLASS_ALLOCATOR(DeviceDescriptor, AZ::SystemAllocator, 0);
+        AZ_RTTI(DeviceDescriptor, "{1FF2D68D-DA6A-47B3-A5BE-18E3A100C830}", AZ::RPI::XRDeviceDescriptor);
 
         DeviceDescriptor() = default;
         virtual ~DeviceDescriptor() = default;
@@ -25,8 +27,10 @@ namespace XR
     };
 
     class Device
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(Device, AZ::SystemAllocator, 0);
         AZ_RTTI(Device, "{A31B0DC2-BD54-443E-9350-EB1B10670FF9}");
 
         Device() = default;

+ 3 - 1
Gems/XR/Code/Include/XR/XRFactory.h

@@ -8,6 +8,7 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
 #include <AzCore/std/containers/vector.h>
 #include <AzCore/std/smart_ptr/intrusive_ptr.h>
 #include <AzCore/Interface/Interface.h>
@@ -27,7 +28,8 @@ namespace XR
     class Factory
     {
     public:
-        AZ_TYPE_INFO(Factory, "{A3D7271A-64FD-442C-9116-DBC32224222F}");
+        AZ_CLASS_ALLOCATOR(Factory, AZ::SystemAllocator, 0);
+        AZ_RTTI(Factory, "{A3D7271A-64FD-442C-9116-DBC32224222F}");
 
         Factory() = default;
         virtual ~Factory() = default;

+ 4 - 0
Gems/XR/Code/Include/XR/XRGraphicsBinding.h

@@ -8,6 +8,8 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
+
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
@@ -16,6 +18,7 @@ namespace XR
         : public AZ::RPI::XRGraphicsBindingDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(GraphicsBindingDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(GraphicsBindingDescriptor, "{6027891C-8920-4B36-83B6-FDF4E3DDDEC7}");
 
         GraphicsBindingDescriptor() = default;
@@ -27,6 +30,7 @@ namespace XR
     class GraphicsBinding
     {
     public:
+        AZ_CLASS_ALLOCATOR(GraphicsBinding, AZ::SystemAllocator, 0);
         AZ_RTTI(GraphicsBinding, "{0520401C-26B2-49E0-8EFD-6AD8E0720E84}");
 
         GraphicsBinding() = default;

+ 7 - 2
Gems/XR/Code/Include/XR/XRInput.h

@@ -8,14 +8,17 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
 #include <AzCore/std/smart_ptr/intrusive_ptr.h>
 #include <XR/XRSession.h>
 
 namespace XR
 {
-    class InputDescriptor
+    class InputDescriptor 
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(InputDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(InputDescriptor, "{C690ABBF-D8A9-4348-98E6-45BBF432D673}");
 
         InputDescriptor() = default;
@@ -28,14 +31,16 @@ namespace XR
     // This class will be responsible for creating XR::Input
     // which manage event queue or poll actions
     class Input
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(Input, AZ::SystemAllocator, 0);
         AZ_RTTI(Input, "{DCDFC6A7-B457-414B-BC24-0831C2AC628B}");
 
         Input() = default;
         virtual ~Input() = default;
 
-        AZ::RHI::ResultCode Init();
+        virtual AZ::RHI::ResultCode Init();
 
         virtual void InitializeActions() = 0;
         virtual void PollActions() = 0;

+ 5 - 0
Gems/XR/Code/Include/XR/XRInstance.h

@@ -8,6 +8,8 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
+
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
@@ -16,6 +18,7 @@ namespace XR
         : public AZ::RPI::XRInstanceDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(InstanceDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(InstanceDescriptor, "{1C457924-56A4-444F-BC72-4D31A097BA70}");
 
         InstanceDescriptor() = default;
@@ -25,8 +28,10 @@ namespace XR
     };
 
     class Instance
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(Instance, AZ::SystemAllocator, 0);
         AZ_RTTI(Instance, "{1C457924-56A4-444F-BC72-4D31A097BA70}");
 
         Instance() = default;

+ 7 - 1
Gems/XR/Code/Include/XR/XRPhysicalDevice.h

@@ -8,13 +8,17 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
+
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
 {
-    class PhysicalDeviceDescriptor
+    class PhysicalDeviceDescriptor 
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(PhysicalDeviceDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(PhysicalDeviceDescriptor, "{4E11244B-FDED-4CD6-89D7-DC3B4A1C33A8}");
 
         PhysicalDeviceDescriptor() = default;
@@ -26,8 +30,10 @@ namespace XR
     // This class will be responsible for iterating over all the compatible physical
     // devices and picking one that will be used for the app
     class PhysicalDevice
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(PhysicalDevice, AZ::SystemAllocator, 0);
         AZ_RTTI(PhysicalDevice, "{E7B78CC5-53A9-492E-AA1C-8815FB882E0A}");
 
         PhysicalDevice() = default;

+ 7 - 1
Gems/XR/Code/Include/XR/XRSession.h

@@ -8,13 +8,17 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
+
 #include <XR/XRGraphicsBinding.h>
 
 namespace XR
 {
-    class SessionDescriptor
+    class SessionDescriptor 
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(SessionDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SessionDescriptor, "{F76B99EF-ED66-4AAA-BA35-578339CAB428}");
 
         SessionDescriptor() = default;
@@ -27,8 +31,10 @@ namespace XR
     // This class will be responsible for creating XR::Session and
     // all the code around managing the session state
     class Session
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(Session, AZ::SystemAllocator, 0);
         AZ_RTTI(Session, "{E7276FE1-94B8-423A-9C1D-1BCF1A0066BC}");
 
         Session() = default;

+ 5 - 1
Gems/XR/Code/Include/XR/XRSpace.h

@@ -8,14 +8,18 @@
 
 #pragma once
 
-#include <XR/XRResult.h>
+#include <AzCore/Memory/SystemAllocator.h>
+
+#include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
 {
     // This class will be responsible for managing XR Space
     class Space
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(Space, AZ::SystemAllocator, 0);
         AZ_RTTI(Space, "{A78A37F1-8861-4EB4-8FC6-0E9C11394EF1}");
 
         virtual AZ::RHI::ResultCode InitInternal() = 0;

+ 15 - 4
Gems/XR/Code/Include/XR/XRSwapChain.h

@@ -8,15 +8,19 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
 #include <AzCore/std/containers/vector.h>
 #include <AzCore/std/smart_ptr/intrusive_ptr.h>
+
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
 {
-    class SwapChainDescriptor
+    class SwapChainDescriptor 
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChainDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SwapChainDescriptor, "{EC10B9A1-9D32-4BC0-AE21-216B1503BBDA}");
 
         SwapChainDescriptor() = default;
@@ -29,6 +33,7 @@ namespace XR
         : public AZ::RPI::XRSwapChainImageDescriptor
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChainImageDescriptor, AZ::SystemAllocator, 0);
         AZ_RTTI(SwapChainImageDescriptor, "{A42444A3-D1E1-489B-8E6F-C0285C7482F3}", AZ::RPI::XRSwapChainImageDescriptor);
 
         SwapChainImageDescriptor() = default;
@@ -43,17 +48,21 @@ namespace XR
     // This class will be responsible for creating multiple XR::SwapChain::ViewSwapchains
     // (one per view). Each XR::SwapChain::ViewSwapchain will then be responsible
     // for manging and synchronizing multiple swap chain images
-    class SwapChain
+    class SwapChain 
+        : public AZStd::intrusive_base
     {
     public:
+        AZ_CLASS_ALLOCATOR(SwapChain, AZ::SystemAllocator, 0);
         AZ_RTTI(SwapChain, "{0C666E76-E4B7-4097-8D14-713DC2C446EF}");
 
         SwapChain() = default;
         virtual ~SwapChain() = default;
 
-        class Image
+        class Image 
+            : public AZStd::intrusive_base
         {
         public:
+            AZ_CLASS_ALLOCATOR(Image, AZ::SystemAllocator, 0);
             AZ_RTTI(Image, "{4037835D-F1BB-4407-BC98-2299CC7BE0A3}");
 
             Image() = default;
@@ -62,9 +71,11 @@ namespace XR
             AZStd::intrusive_ptr<SwapChainImageDescriptor> m_descriptor;
         };
 
-        class View
+        class View 
+            : public AZStd::intrusive_base
         {
         public:
+            AZ_CLASS_ALLOCATOR(View, AZ::SystemAllocator, 0);
             AZ_RTTI(View, "{774EB724-8261-4684-AA78-EDF6BBECD48A}");
 
             View() = default;

+ 6 - 3
Gems/XR/Code/Include/XR/XRSystem.h

@@ -8,6 +8,8 @@
 
 #pragma once
 
+#include <AzCore/Memory/SystemAllocator.h>
+
 #include <Atom/RPI.Public/XR/XRSystemInterface.h>
 
 namespace XR
@@ -16,7 +18,8 @@ namespace XR
         : public AZ::RPI::XRSystemInterface
     {
     public:
-        AZ_RTTI(System, "{C3E0291D-FB30-4E27-AB0D-14606A8C3C1F}" AZ::RPI::XRSystemInterface);
+        AZ_CLASS_ALLOCATOR(System, AZ::SystemAllocator, 0);
+        AZ_RTTI(System, "{C3E0291D-FB30-4E27-AB0D-14606A8C3C1F}", AZ::RPI::XRSystemInterface);
 
         AZ_DISABLE_COPY_MOVE(System);
 
@@ -47,7 +50,7 @@ namespace XR
 
         // Create a swap chain which will responsible for managing
         // multiple XR swap chains and multiple swap chain images within it
-        virtual void CreateSwapchain() = 0;
+        virtual AZ::RHI::ResultCode CreateSwapchain() = 0;
 
         // This will allow XR gem to provide device related data to RHI
         virtual AZ::RPI::XRDeviceDescriptor* GetDeviceDescriptor() = 0;
@@ -56,7 +59,7 @@ namespace XR
         virtual AZ::RPI::XRInstanceDescriptor* GetInstanceDescriptor() = 0;
 
         // Provide swap chain specific data to RHI
-        virtual AZ::RPI::XRSwapChainImageDescriptor* GetSwapChainImageDescriptor(int swapchainIndex) = 0;
+        virtual AZ::RPI::XRSwapChainImageDescriptor* GetSwapChainImageDescriptor(AZ::u16 swapchainIndex) = 0;
 
         // Provide access to Graphics Binding specific data that RHI can populate
         virtual AZ::RPI::XRGraphicsBindingDescriptor* GetGraphicsBindingDescriptor() = 0;

+ 1 - 4
Gems/XR/Code/Source/XRSpace.cpp

@@ -10,8 +10,5 @@
 
 namespace XR
 {
-    ResultCode Space::InitInternal()
-    {
-        return ResultCode::Success;
-    }
+
 } // namespace XR