Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[SDK] Video memory problems with GLator

Explorer ,
Apr 27, 2021 Apr 27, 2021

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!

TOPICS
Error or problem , SDK
556
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 27, 2021 Apr 27, 2021

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.

Translate
Community Expert ,
Apr 27, 2021 Apr 27, 2021

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 27, 2021 Apr 27, 2021

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;
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2021 Apr 27, 2021

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 27, 2021 Apr 27, 2021

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 27, 2021 Apr 27, 2021

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2021 Apr 27, 2021

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 27, 2021 Apr 27, 2021
LATEST

Ahh I see, it just crossed my mind because the GLator example in the SDK has the same memory problems.
Thanks again! Cheers!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines