Sign in to follow this  

A problem at abundant FBO calculate

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use CG to do some calculate and output solution on a FBO(200*200pixels) than use glReadPixles to get the data on FBO. After I do this process more than 36000 times the program will stop on a line which I set CGparameters. The stop point may different, but every tiem is the code to set CGparameters. when I debug the program will tell me something like "the memory 0x695fc884 cannot written" Is this memory problem? If yes how to solve this problem? following is the flow chart of my program inside the for function: //opne CG cgGLEnableProfile(cgVertexProfile); cgGLEnableProfile(cgFragmentProfile); //Open FBO glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, b_fb1); glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); glClearDepth(1.0f); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glDepthFunc(GL_LESS); //Bind sharder code cgGLBindProgram(cgFragmentPassOne); //set CG Parameter and draw cgGLSetStateMatrixParameter(cgparam_vp_ModelViewProjection, CG_GL_MODELVIEW_PROJECTION_MATRIX,CG_GL_MATRIX_IDENTITY); cgGLSetParameter3f(cgparam_vp_eyePosition, invmodelview[12]+transform.x, invmodelview[13]+transform.y, invmodelview[14]+transform.z); glCallList (displayLists); //draw model GPGPU //Cloce CG cgGLDisableProfile(cgVertexProfile); cgGLDisableProfile(cgFragmentProfile);

Share this post


Link to post
Share on other sites
I did a experiment as follow:

//Open FBO
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, b_fb1);

//Enable sharder code
cgGLEnableProfile(cgVertexProfile);
cgGLEnableProfile(cgFragmentProfile);

// Bind program 10000000 times
for( kkk = 0; kkk<1000000; kkk++ )
{
cgGLBindProgram(cgFragmentPassOne);
}

// Disable sharder code
cgGLDisableProfile(cgVertexProfile);
cgGLDisableProfile(cgFragmentProfile);

The program will shut down at "cgGLBindProgram" when kkk=331723
But if I don't open FBO just Enable, Bind, and Disable sharder code the process is OK.
Could anybody tell me where is the problme?

Share this post


Link to post
Share on other sites

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this