GL Starter
05-11-2011, 06:10 AM
Dear Experts,
Please help to solve a problem observed in GLSL shader.
Memory leak identified when a shader program delete and create it again.
I'm developing an application which uses GLSL shader program with texture operations.
This application uses different shader programs at different time.
When create and delete a shader program I got a memory leak.
Here is the normal call sequence without memory leak.
Initialize() // This function called once at startup of application.
{
// Create Shader program
// Set parameters to shader.
}
Render() // This function called during each frame render.
{
// Enable shader.
// Render.
// Disable Shader.
}
Release()// This function called once at exit of application.
{
// Delete Shader program
}
But When I change shader program creation to Render(), I got memory leak.
Initialize() // This function called once at startup of application.
{
// Nothing to do.
}
Render() // This function called during each frame render.
{
// Create Shader program
// Set parameters to shader.
// Enable shader.
// Render.
// Disable Shader.
// Delete Shader program
}
Release()// This function called once at exit of application.
{
// Nothing to do.
}
Is there any delete[DestroyShader or DeleteShader] call missing in my code?
Please find the attached .zip[ogl_arb_shader_simple_vs2ps.vcproj.7.10.zip] file contain source code of my application.
Please help to solve a problem observed in GLSL shader.
Memory leak identified when a shader program delete and create it again.
I'm developing an application which uses GLSL shader program with texture operations.
This application uses different shader programs at different time.
When create and delete a shader program I got a memory leak.
Here is the normal call sequence without memory leak.
Initialize() // This function called once at startup of application.
{
// Create Shader program
// Set parameters to shader.
}
Render() // This function called during each frame render.
{
// Enable shader.
// Render.
// Disable Shader.
}
Release()// This function called once at exit of application.
{
// Delete Shader program
}
But When I change shader program creation to Render(), I got memory leak.
Initialize() // This function called once at startup of application.
{
// Nothing to do.
}
Render() // This function called during each frame render.
{
// Create Shader program
// Set parameters to shader.
// Enable shader.
// Render.
// Disable Shader.
// Delete Shader program
}
Release()// This function called once at exit of application.
{
// Nothing to do.
}
Is there any delete[DestroyShader or DeleteShader] call missing in my code?
Please find the attached .zip[ogl_arb_shader_simple_vs2ps.vcproj.7.10.zip] file contain source code of my application.