Copy link to clipboard
Copied
Hi guys! Real noob here, probably doing something wrong, but....
I am having some hard time with video memory and GLator.
When I keyframe and ram preview a comp with my effect, everything is normal, but, If I keep changing the effects parameters on the UI, the memory keeps growing until there is no more and wont flush it until I terminate AE.
I am guessing that the AE ui interrupts (somehow) opengl before it executes glDeleteTextures, and that does not happen with Ram preview.
If I remove the glDeleteTextures from my scripts for debugging, the Ram preview has the same behaviour.
Any Ideas if its possible to fix this?
Thanks a lot!
indeed it is. could it be that an exception is thrown from within the openGL calls during an interrupt? in that case the code would skip the glDeleteTextures and skip straight to catch blocks. put a break point in the catch blocks and see if it's hit during interaction.
Copy link to clipboard
Copied
i would gusess you code is arranged so that checking the interrupt exits before freeing the memory. is that not something you control?
the interrupt is checked using PF_ABORT(). what happens in your code after that check?
Copy link to clipboard
Copied
Hi there! Thanks for the help!
I think my abort is setup after the delete textures, like so:
// - get back to CPU the result, and inside the output world
DownloadTexture(renderContext, suites, input_worldP, output_worldP, in_data,
format, pixSize, glFmt);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glBindTexture(GL_TEXTURE_2D, 0);
glDeleteTextures(1, &inputFrameTexture);
glDeleteTextures(1, &inputFrameTexture2);
}
catch (PF_Err& thrown_err)
{
err = thrown_err;
}
catch (...)
{
err = PF_Err_OUT_OF_MEMORY;
}
}
// If you have PF_ABORT or PF_PROG higher up, you must set
// the AE context back before calling them, and then take it back again
// if you want to call some more OpenGL.
ERR(PF_ABORT(in_data));
ERR2(AEFX_ReleaseSuite(in_data,
out_data,
kPFWorldSuite,
kPFWorldSuiteVersion2,
"Couldn't release suite."));
ERR2(PF_CHECKIN_PARAM(in_data, &slider_param));
ERR2(extra->cb->checkin_layer_pixels(in_data->effect_ref, GLATOR_INPUT));
return err;
}
Copy link to clipboard
Copied
indeed it is. could it be that an exception is thrown from within the openGL calls during an interrupt? in that case the code would skip the glDeleteTextures and skip straight to catch blocks. put a break point in the catch blocks and see if it's hit during interaction.
Copy link to clipboard
Copied
They do get hit!
Putting the glDeleteTextures inside the catch wont solve it.
Is there anything I can do?
Sorry for being so noob and thanks a lot for all the help!
Copy link to clipboard
Copied
OHH ok, Ive figured it out!
I had to reinitialize opengl inside the catch, so it could delete the textures.
Its now freeing up the memory properly
THANK YOU!
Maybe this is something Adobe should add to their SDK?
Copy link to clipboard
Copied
we're all but glorified noobs here. 🙂
i don't think this belongs in the SDK, as openGL is one of many 3rd party infrastructures used by devs. no point in addressing them all in the SDK.
anyways, i'm glad you got it solved. nice!
Copy link to clipboard
Copied
Ahh I see, it just crossed my mind because the GLator example in the SDK has the same memory problems.
Thanks again! Cheers!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more