PDA

View Full Version : Regarding pause/resume transform feedback api



mobeen
09-21-2011, 11:03 PM
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?

Ilian Dinev
09-22-2011, 11:23 AM
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();
}

mobeen
09-22-2011, 04:14 PM
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.

Ilian Dinev
09-23-2011, 10:58 AM
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.

mobeen
09-24-2011, 07:34 PM
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.