360 video compositor layer make memory leak when re-open video file repeat many times
the post https://forums.oculusvr.com/developer/discussion/68089/compositor-layer-using-for-render-360-video-make-render-result-judder#latest tell me how to prevent video judder, but another problem which occurs in great probability is memory leak while i close & reopen same video file over and over again (rendering with overlay). the log repeat 3 - 7 times, showing below:
the phenomenon is beyond comprehension, when i first open video, no matter how many times deactive & reactive overlay ( recreate layertexture & do not close video), everything is fine, no error log.
but while i reopen the same video file, the error log occurs, which shows that error is texture memory error. if i do not copy texture from PopulateLayer, there will be nothing rendered, and no error log occurs.
could someone give me an infer for what i do wrong in reopen video and caused memory leak?
should i write data directly into swapchain's et and abandon videotexture copy?
the phenomenon is beyond comprehension, when i first open video, no matter how many times deactive & reactive overlay ( recreate layertexture & do not close video), everything is fine, no error log.
but while i reopen the same video file, the error log occurs, which shows that error is texture memory error. if i do not copy texture from PopulateLayer, there will be nothing rendered, and no error log occurs.
private bool PopulateLayer(int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount)
{
for (int eyeId = 0; eyeId < texturesPerStage; ++eyeId)
{
int stage = frameIndex % stageCount;
Texture et = layerTextures[eyeId].swapChain[stage];
if (et == null)
continue;
// disable copy texture can prevent the error if i reopen the video, but there will be nothing rendered
Graphics.CopyTexture(videotexture, 0, 0,
0, 0, videotexture.width, videotexture.height,
et, 0, 0, 0, 0);
}
}1.the videotexture is unity texture2d, which data copied from surfacetexture in native plugin. videotexture will re-new if reopen video
2.if i always copy a static empty texture into swapchain's et, error still occurs when i reopened file
3.the videotexture & swapchain texture format both are rgba32could someone give me an infer for what i do wrong in reopen video and caused memory leak?
should i write data directly into swapchain's et and abandon videotexture copy?
