FViewExtensionPreDrawCommand

I’m experiencing similar issues with this call, but on a more consistent basis. I think it’s related to something with the HMD, but I have not been able to narrow down what exactly is causing it or how to fix it. Any insight from others would be very helpful.

I’m looking for more info as to what FViewExtensionPreDrawCommand actually does. In my VR project this piece of code gets called randomly with up to 14+ ms (according to Frontend profilier), with normal values at around 4 ms (both screenshots attached). There’s nothing specific going on when recording the gameplay, I just stand, doing nothing with this function dropping frames randomly every x seconds.

Looking forward to any info that may narrow down the cause.

We’ve been heavily optimizing our VR project. At this moment we are able to pull off stable 90 frames with 970 GPU. FViewExtensionPreDrawCommand seems to stabilize after the optimizations been done.

What this function does is simply outputting what’s on the monitor screen to HMD (commenting this function out from the engine results in black screen in HMD and normal window on PC monitor). I’m guessing that running low on performance ups the time for this function to get called.

To anyone reading this. After running optimization tweaks the function in the subject seems to go back to normal, stable values. Please refer to my comment above for more info.

Hy @Shin_ji, what do you mean with “outputting what’s on the monitor screen to HMD”? Shouldn’t it be the opposite? Rendering to the monitor a portion of what is beeing rendered on the HMD?

Also, during optimization didn you find or notice something that could reasonable be the offender of the high time consumption of the function?

Thanks for investigating this. We currently have the same issue. Would you mind telling us what you did optimize? Did you optimize rendering oder game logic?

The FExtensionPreDrawCommand issue also exists in VR and was severe enough to prevent App submission to the Oculus Store.

I was able to reduce FExtensionPreDrawCommand to under 11ms from 22ms by turning off dynamic shadows and volumetric shadows on the scene’s directional light source. I also removed all widgets and converted to hierarchical instanced static meshes.

Overall it appears that once a certain render time threshold is exceeded, the FExtensionPreDrawCommand time jumps up non-linearly to a much higher time. Doing the optimizations above may or may not bring your render time back under the point where it went non-linear, so the general answer is- optimize your per frame computation until it comes down below the threshold. Working on this optimization was exceptionally frustrating because nothing seemed to affect the FExtensionPreDrawCommand time until one final optimization (dynamic shadows off) caused it to go back to normal.

A helpful discussion can be found at this link.

hey I have this problem. But what if my lights are all static? how do we do the dynamic shadows off optimization???