Browse Source

Fix open xr test project (includes no-unity compile fixes and rendering artifacts) (#188)

* - Add MultiView and Low end pipeline to the openxrtest project so that it renders correctly.
- Various non unity compile fixes

Signed-off-by: moudgils <[email protected]>

* Minor cleanup

Signed-off-by: moudgils <[email protected]>

---------

Signed-off-by: moudgils <[email protected]>
moudgils 2 years ago
parent
commit
c9a8fe7ee7

+ 2 - 2
Gems/XR/Code/Include/XR/XRDevice.h

@@ -13,12 +13,12 @@
 #include <Atom/RPI.Public/XR/XRRenderingInterface.h>
 #include <XR/XRBase.h>
 #include <XR/XRInstance.h>
-#include <XR/XRSwapChain.h>
 #include <XR/XRObject.h>
+#include <XR/XRSession.h>
 
 namespace XR
 {
-    class Session;
+    class SwapChain;
 
     //! Base XR device class which will provide access to the back-end concrete object
     class Device

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

@@ -12,10 +12,9 @@
 #include <AzCore/std/containers/vector.h>
 
 #include <XR/XRBase.h>
-#include <XR/XRInstance.h>
 #include <XR/XRDevice.h>
-#include <XR/XRSession.h>
 #include <XR/XRInput.h>
+#include <XR/XRInstance.h>
 #include <XR/XRSpace.h>
 #include <XR/XRSwapChain.h>
 

+ 1 - 4
Gems/XR/Code/Include/XR/XRInput.h

@@ -10,14 +10,11 @@
 
 #include <AzCore/Memory/SystemAllocator.h>
 #include <XR/XRBase.h>
+#include <XR/XRDevice.h>
 #include <XR/XRObject.h>
 
 namespace XR
 {
-    class Session;
-    class Instance;
-    class Device;
-
     // This class will be responsible for creating XR::Input
     // which manage event queue or poll actions
     class Input

+ 3 - 2
Gems/XR/Code/Include/XR/XRSession.h

@@ -9,15 +9,16 @@
 #pragma once
 
 #include <AzCore/Memory/SystemAllocator.h>
-
+#include <Atom/RPI.Public/XR/XRRenderingInterface.h>
 #include <XR/XRBase.h>
-#include <XR/XRInput.h>
+#include <XR/XRInstance.h>
 #include <XR/XRObject.h>
 #include <XR/XRSpace.h>
 
 namespace XR
 {
     class Device;
+    class Input;
 
     // This class will be responsible for creating XR::Session and
     // all the code around managing the session state

+ 2 - 0
Gems/XR/Code/Include/XR/XRSpace.h

@@ -10,6 +10,8 @@
 
 #include <AzCore/Memory/SystemAllocator.h>
 #include <AzCore/std/smart_ptr/intrusive_base.h>
+#include <Atom/RHI/ValidationLayer.h>
+#include <XR/XRBase.h>
 #include <XR/XRObject.h>
 
 namespace XR

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

@@ -11,14 +11,15 @@
 #include <AzCore/Memory/SystemAllocator.h>
 #include <AzCore/std/containers/vector.h>
 #include <AzCore/std/smart_ptr/intrusive_ptr.h>
+#include <Atom/RHI/ValidationLayer.h>
 #include <Atom/RHI.Reflect/Format.h>
+#include <XR/XRBase.h>
+#include <XR/XRDevice.h>
 #include <XR/XRObject.h>
+#include <XR/XRSession.h>
 
 namespace XR
 {
-    class Session;
-    class Device;
-
     //! 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

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

@@ -11,12 +11,11 @@
 #include <AzCore/base.h>
 #include <AzCore/Component/TickBus.h>
 #include <AzCore/Memory/SystemAllocator.h>
-#include <Atom/RHI/XRRenderingInterface.h>
 #include <Atom/RHI/ValidationLayer.h>
+#include <Atom/RHI/XRRenderingInterface.h>
 #include <Atom/RPI.Public/XR/XRRenderingInterface.h>
-#include <XR/XRInstance.h>
 #include <XR/XRDevice.h>
-#include <XR/XRSession.h>
+#include <XR/XRInstance.h>
 #include <XR/XRSwapChain.h>
 
 namespace XR

+ 1 - 0
Gems/XR/Code/Source/XRSession.cpp

@@ -9,6 +9,7 @@
 #include <XR/XRSession.h>
 #include <XR/XRFactory.h>
 #include <XR/XRDevice.h>
+#include <XR/XRInput.h>
 
 namespace XR
 {

+ 13 - 0
Projects/OpenXRTest/Registry/material_pipelines.setreg

@@ -0,0 +1,13 @@
+{
+    "O3DE": {
+        "Atom": {
+            "RPI": {
+                "MaterialPipelineFiles": [
+                    "@gemroot:Atom_Feature_Common@/Assets/Materials/Pipelines/MainPipeline/MainPipeline.materialpipeline",
+                    "@gemroot:Atom_Feature_Common@/Assets/Materials/Pipelines/LowEndPipeline/LowEndPipeline.materialpipeline",
+                    "@gemroot:Atom_Feature_Common@/Assets/Materials/Pipelines/MultiView/MultiViewPipeline.materialpipeline"
+                ]
+            }
+        }
+    }
+}