How do I clean memory from a shader?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

How do I clean memory from a shader?

Post by sylpheed »

I have this in my app for creating a shader:

Code: Select all

id_material = gpu->addHighLevelShaderMaterial(
							vs_code.c_str (), vs_main_name.c_str (), vsType,
							ps_code.c_str (), ps_main_name.c_str (), psType,
							callback, (E_MATERIAL_TYPE)material_type);
I use this shader for a time to render a object, later I don't need it so I would like to free memory for this shader. How do I clean the material with "id_material" from the scene?

Thanks and sorry for my English
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

nice question. :) have googled and not found anything. Have you really so many shaders in your game that this can become an issue?
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess it wasn't added to the API in the past because we do not grab the material renderers from the materials that use them. So it's kind of hard to make sure that your material is not used anymore. So right now it's probably only possible by dropping the device.
Post Reply