Jump to content

TvEgNUP

Verified Members
  • Posts

    1
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey guys. Where should I report GC allocations to make sure they will be fixed in upcoming SDK updates? I found these allocations which occur every frame, allocating for GC at the rate of 1.6 KB per frame: Class: WaveVR\Scripts\WaveVR_Render.cs Method: private IEnumerator RenderLoop() Line: var wait = new WaitForEndOfFrame(); This allocates heap memory each time WaitForEndOfFrame instance is created. Please cache it at the private class field and instantiate only once, then just reuse: private WaitForEndOfFrame cachedWaitForEndOfFrame;// ...private IEnumerator RenderLoop(){ if (cachedWaitForEndOfFrame == null) { cachedWaitForEndOfFrame = new WaitForEndOfFrame(); } yield return cachedWaitForEndOfFrame; // ....} Class: WaveVR\Scripts\WaveVR_Render.cs Method: private void RenderEye(Camera camera, WVR_Eye eye) Lines: WaveVR_Utils.Trace.BeginSection("Render_" + eye);Log.gpl.d(LOG_TAG, "Render_" + eye); String concatenation implicitly leads to the String.Concat() call and it allocates memory on heap too. Please avoid string concatenation each frame, and cache concatenated value for reuse outside the main loop. Class: WaveVR\Scripts\WaveVR_Distortion.cs Method: public void RenderEye(WVR_Eye eye, RenderTexture texture) Line: WaveVR_Utils.Trace.BeginSection("Distortion_" + eye); Same as previous, string concatenation. please let me know if it's possible to pass this to the Unity plugin devs, as per-frame allocations absence is very crucial for the smoothness of the VR experience - unfortunately Unity still uses old GC which collects garbage on main thread and this takes a lot of time leading to the performance drops (cpu usage spikes) which is very noticeable when doing anything in VR. Thanks!
×
×
  • Create New...