Right now I want to generate a mesh with a tessellation shader and have that go into a different program/vertex/tessellation shader...

I got the mesh generating just fine with the tessellation shader, which outputs 'quads'. I'm having issues with the transform feedback aspect though so I can't even start the second pass yet...

The initialization looks like:
Code :
	//Transform feedback output buffer
	glGenBuffers(1, &TransformFeedbackBuffer);
	glBindBuffer(GL_ARRAY_BUFFER, TransformFeedbackBuffer);
	glBufferData(GL_ARRAY_BUFFER, 4096*3*4, 0, GL_STATIC_DRAW);
	glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
 
	//transform feedback object
	glGenTransformFeedbacks(1, &TransformFeedbackObject);
	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, TransformFeedbackObject);	
	glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, TransformFeedbackBuffer);
	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);

And in the render loop:

Code :
		// enable / disable wireframe
		glPolygonMode( GL_FRONT_AND_BACK, wireframe ? GL_LINE : GL_FILL);printGLError();
 
		glEnable(GL_RASTERIZER_DISCARD);printGLError(); 
		//set up the program
		glUseProgram(program);printGLError();
 
		glBindBufferBase( GL_UNIFORM_BUFFER , 1, ubo);printGLError();
		glBufferData(GL_UNIFORM_BUFFER, sizeof(TessellationParams), &tessellationParameters, GL_STREAM_DRAW);printGLError();
 
		GLint numfeedbackwritten;
 
		glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, TransformFeedbackObject);printGLError();
		glBeginTransformFeedback(GL_TRIANGLES);printGLError();
		{
			glBindBuffer(GL_ARRAY_BUFFER, vbo);
			glEnableVertexAttribArray(0);
			glPatchParameteri( GL_PATCH_VERTICES, 1);
 
			//draw a single patch
			GLuint queryObject;
			glGenQueries(1, &queryObject);printGLError();
 
			glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, queryObject);printGLError();
				glDrawArrays( GL_PATCHES, 0, 1);printGLError();
			glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);printGLError();
 
 
			glGetQueryObjectiv(queryObject, GL_QUERY_RESULT, &numfeedbackwritten);
			printf("Tris drawn to feedback buffer: %d\n", numfeedbackwritten);
 
			glDisableVertexAttribArray(0);
			glBindBuffer(GL_ARRAY_BUFFER, 0);
		}
		glEndTransformFeedback();printGLError();
		glDisable(GL_RASTERIZER_DISCARD);printGLError();

The printGLError() says Invalid Operation on the glDrawArrays call... Also, I'm not sure how to render it to the screen afterwards. I think this is right?

Code :
		glUseProgram(0);
		glBindBuffer(GL_ARRAY_BUFFER, TransformFeedbackBuffer);printGLError();
		glEnableVertexAttribArray(0);
 
		GLuint queryObject2;
		glGenQueries(1, &queryObject2);printGLError();
 
		glBeginQuery(GL_PRIMITIVES_GENERATED, queryObject2);
			glDrawArrays( GL_TRIANGLES, 0, numfeedbackwritten);printGLError();
		glEndQuery(GL_PRIMITIVES_GENERATED);
 
		glGetQueryObjectiv(queryObject2, GL_QUERY_RESULT, &numfeedbackwritten);
		printf("Tris drawn to display: %d\n", numfeedbackwritten);

But it's hard to tell since I'm getting no tris being drawn in either case. I think glDrawTransformFeedback should work too...

Is this setup even possible? The feedback says it only works on points, lines and tris, and the tess shader I want to have it as a quad input (but triangle output).