Jump to content
  • Advertisement
Sign in to follow this  

A problem at abundant FBO calculate

This topic is 3791 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

// Bind program 10000000 times
for( kkk = 0; kkk<1000000; kkk++ )

// Disable sharder code

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!