Jump to content

render cost time


xulzee

Recommended Posts

Hi everyone,

I did some time-consuming tests on rendering. I found it took a long time in

WVR_SubmitFrame(WVR_Eye_Right, &rightEyeTexture);

Can anyone tell me where something went wrong? Or should it be?

My test code is as follows:

// Left eye
start_1 = nanotime();
WVR_TextureParams_t leftEyeTexture = WVR_GetTexture(mLeftEyeQ, mIndexLeft);
WVR_SubmitError e;
end_1 = nanotime();
start_2 = nanotime();
updateHMDMatrixPose(); // update hmd pose to reduce judder
e = WVR_SubmitFrame(WVR_Eye_Left, &leftEyeTexture);
if (e != WVR_SubmitError_None) return true;
end_2 = nanotime();

// Right eye
start_3 = nanotime();
WVR_TextureParams_t rightEyeTexture = WVR_GetTexture(mRightEyeQ, mIndexRight);
end_3 = nanotime();
start_4 = nanotime();
e = WVR_SubmitFrame(WVR_Eye_Right, &rightEyeTexture);
if (e != WVR_SubmitError_None) return true;
end_4 = nanotime();
LOGD("render a frame part 1 cost %.2f ms part 2 cost %.2f ms part 3 cost %.2f ms part 4 cost %.2f ms sum %.2f ms",
(end_1 - start_1) / 1.0e6, (end_2 - start_2) / 1.0e6, (end_3 - start_3) / 1.0e6,
(end_4 - start_4) / 1.0e6,
(end_1 - start_1) / 1.0e6 + (end_2 - start_2) / 1.0e6 + (end_3 - start_3) / 1.0e6 +
(end_4 - start_4) / 1.0e6);

 I got the following results:

render a frame part 1 cost 0.01 ms part 2 cost 0.07 ms part 3 cost 0.01 ms part 4 cost 10.20 ms sum 10.29 ms
render a frame part 1 cost 0.01 ms part 2 cost 0.07 ms part 3 cost 0.01 ms part 4 cost 11.78 ms sum 11.87 ms
render a frame part 1 cost 0.01 ms part 2 cost 0.06 ms part 3 cost 0.01 ms part 4 cost 11.58 ms sum 11.66 ms
render a frame part 1 cost 0.01 ms part 2 cost 0.06 ms part 3 cost 0.01 ms part 4 cost 10.96 ms sum 11.04 ms
render a frame part 1 cost 0.01 ms part 2 cost 0.06 ms part 3 cost 0.01 ms part 4 cost 10.93 ms sum 11.01 ms
render a frame part 1 cost 0.01 ms part 2 cost 0.09 ms part 3 cost 0.01 ms part 4 cost 11.74 ms sum 11.85 ms
render a frame part 1 cost 0.02 ms part 2 cost 0.06 ms part 3 cost 0.01 ms part 4 cost 11.72 ms sum 11.81 ms

 You can see that 

e = WVR_SubmitFrame(WVR_Eye_Left, &leftEyeTexture);

only takes a short time at a time(~ 0.1ms), while

e = WVR_SubmitFrame(WVR_Eye_Right, &rightEyeTexture);

 takes a long time(~12ms).  

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...