XR Texture objects allocating 800MB at runtime, Meta Quest 3 OpenXR

Hi,

I have issues where my Unity OpenXR URP + Vulkan app is crashing on first load on Quest3. When I switch to OpenGL, it doesn’t crash.

As I was looking for clues in the memory profiler, I noticed three render textures (XR Texture[…] )that use a huge amount of graphics memory. At first I thought this were the textures for passthrough, but they are still here even after disabling passthrough, and using the same amount of memory…


Does someone know what these are ?

Thanks

Also, why is the graphics memory usage doubled from Vulkan to OpenGL ?

These are the exact same app, the only difference is Vulkan vs OpenGLES3 in player settings.




I’m seeing the same (“XR Texture [7]” x3), but mine are only 248.5MB.

I have no idea what they are, but if we’re both seeing these, odds are they are supposed to be there. Maybe? The different sizes could be render settings, or version/settings of some random xr plugin. I don’t feel motivated enough to investigate further. I just wanted to reassure you that someone else is seeing this too (and give this a bump in case someone that knows what they are could reply).

Please file a bug report so Unity can look at it

I have the same problem. Is there any solution?

Those look like the output framebuffers for the OpenXR swapchain, where the application renders the frames to be displayed on the headset. The sizes seem to be feasible for the texture settings, array textures with 2 x 3360 x 3520 x (32 bit color + 24 bit depth + 8 bit stencil) x 4x MSAA = 0.72 GiB.

The runtime controls the number of framebuffers created, and it’s usually triple-buffered.

I don’t have crashes anymore with most recent versions of the MetaXR SDK, but I still encounter serious performance issues, for which I have a few workarounds :

		public void SetDynamicResolutionToMaxPerformance(bool forceState = false)
		{
			if (_isMaxQualityMode || forceState)
			{
#if METAQUEST
				ovrManager.quest3MaxDynamicResolutionScale = MAX_PERFORMANCE_SCALE;
#endif
				XRSettings.eyeTextureResolutionScale = MAX_PERFORMANCE_SCALE;
				if (GraphicsSettings.currentRenderPipeline is UniversalRenderPipelineAsset urpPipelineAsset)
					urpPipelineAsset.renderScale = MAX_PERFORMANCE_SCALE;

				_isMaxQualityMode = false;
			}
		}

		public void SetDynamicResolutionToMaxQuality(bool forceState=false)
		{
			if (!_isMaxQualityMode || forceState)
			{
#if METAQUEST
				ovrManager.quest3MaxDynamicResolutionScale = MAX_QUALITY_SCALE;
#endif
				XRSettings.eyeTextureResolutionScale = MAX_QUALITY_SCALE;
				if (GraphicsSettings.currentRenderPipeline is UniversalRenderPipelineAsset urpPipelineAsset)
					urpPipelineAsset.renderScale = MAX_QUALITY_SCALE;
				_isMaxQualityMode = true;
			}
		}
  • I am using the Meta override of URP from here

  • I enabled Meta XR foveated rendering and set it to :

OVRPlugin.foveatedRenderingLevel = OVRPlugin.FoveatedRenderingLevel.Low;

Thank you very much for your reply. I also try to optimize the performance.
This is very helpful to me, I’ll follow your tips to do it.
Thanks again!