Jump to content

[PATCH] How to resolve if Foveated rendering does not work on IL2CPP builds


Tony PH Lin

Recommended Posts

To All,

Here is the patch if you have encountered the issue that Foveated Rendering doesn't work when using IL2CPP builds.

Attached the patch file.

Modify the 2 files(Assets/WaveVR/Platform/WVR_Android.cs, Assets/WaveVR/Platform/wvr.cs b/plugin/Assets/WaveVR/Platform/wvr.cs).

 

--- a/plugin/Assets/WaveVR/Platform/WVR_Android.cs

+++ b/plugin/Assets/WaveVR/Platform/WVR_Android.cs

@@ -520,8 +520,8 @@ public class WVR_Android : wvr.Interop.WVR_Base

               }

 

                [DllImportAttribute("wvr_api", EntryPoint = "WVR_PreRenderEye", CallingConvention = CallingConvention.Cdecl)]

-               public static extern void WVR_PreRenderEye_Android(WVR_Eye eye, [Out] WVR_TextureParams_t[] param, [Out] WVR_RenderFoveationParams[] foveationParams);

-               public override void PreRenderEye(WVR_Eye eye, [Out] WVR_TextureParams_t[] param, [Out] WVR_RenderFoveationParams[] foveationParams)

+              public static extern void WVR_PreRenderEye_Android(WVR_Eye eye, [In, Out] WVR_TextureParams_t[] param, [In, Out] WVR_RenderFoveationParams[] foveationParams);

+              public override void PreRenderEye(WVR_Eye eye, [In, Out] WVR_TextureParams_t[] param, [In, Out] WVR_RenderFoveationParams[] foveationParams)

               {

                       WVR_PreRenderEye_Android(eye, param, foveationParams);

               }

diff --git a/plugin/Assets/WaveVR/Platform/wvr.cs b/plugin/Assets/WaveVR/Platform/wvr.cs

index 0c4a779..9529879 100644

--- a/plugin/Assets/WaveVR/Platform/wvr.cs

+++ b/plugin/Assets/WaveVR/Platform/wvr.cs

@@ -1054,7 +1054,7 @@ namespace wvr

                       return WVR_Base.Instance.SubmitFrame(eye, param, pose, extendMethod);

               }

 

-               public static void WVR_PreRenderEye(WVR_Eye eye, [Out] WVR_TextureParams_t[] param, [Out] WVR_RenderFoveationParams[] foveationParams)

+              public static void WVR_PreRenderEye(WVR_Eye eye, [In, Out] WVR_TextureParams_t[] param, [In, Out] WVR_RenderFoveationParams[] foveationParams)

               {

                       WVR_Base.Instance.PreRenderEye(eye, param, foveationParams);

               }

forveation.zip

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...