Regarding pause/resume transform feedback api

Hi all,
I am trying to use the pause/resume API on my NVIDIA Quadro FX 5800 card. I am using ARB_transform_feedback2. In my code I toggle the pause/resume tf calls using the ‘p’ key and to only call the pause/resume tf functions once I wrap the calls inside an if check. The code is as follows,


glBeginTransformFeedback(GL_POINTS);
   if(!bDoneOnce) {
      if(bPause) {
         glPauseTransformFeedback();
      } else {
         glResumeTransformFeedback();			
      }
      bDoneOnce=true;
   }
   glDrawArrays(GL_POINTS, 0, total_points);	     
glEndTransformFeedback();

The call to end tf following the pause tf function call generates INVALID_OPERATION error. According to the registry [http://www.opengl.org/registry/specs/ARB/transform_feedback2.txt],

The error INVALID_OPERATION is generated by EndTransformFeedback if transform feedback is inactive.

Clearly, my tf object is active still the end tf function generates an invalid operation error. Could anyone tell me what I am doing wrong? Is this a driver bug? In case it is, where do i report this?

Try something along the lines:



void init(){
	glBeginTransformFeedback(GL_POINTS);
	glPauseTransformFeedback();
}

void onframe(){
	static bool paused = true;
	
	if(keys['P']){
		if(paused)glResumeTransformFeedback();
		else glPauseTransformFeedback();
		paused = !paused;
	}
}

void onexit(){
	glEndTransformFeedback();
}

Hi ilian,
Thanks for the reply. I am doing a simulation using TF and each frame I need to do beginTF/endTF following which I give a call to render my geometry. In this case how do i setup the pause/resume TF? The way u r saying, this will only do a single tf step.

Hmm, then why do you need the pause/resume?

TF1 was like a strcpy(), while
TF2 adds the strcat() functionality. So basically you need it only when you want to append to a previous TF.

So do u mean that pause/resume is useful only when I want to append to an existing TF? So if that’s the case, i dont thing pause/resume is a feasible thing for me. I’d rather just return from the physics calc. function in case pause is enabled. I wanted to know why pause/resume tf is given.