Primitive Queries

Transform feedback was introduced in “Transform Feedback” on Page 239 as a method to record the output of a vertex shader into a buffer that could be used in subsequent rendering. Because the vertex shader is a simple, one-in, one-out pipeline stage, it is known up front how many vertices the vertex shader will generate. Assuming that the transform feedback buffer is large enough to hold all of the output data, the number of vertices stored in the transform feedback buffer is simply the number of vertices processed by the vertex shader. Such a simple relationship is not present for the geometry shader. Because the geometry shader can emit a variable number of vertices per invocation, the number of vertices recorded into transform ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.