If <parameter>target</parameter> is <constant>GL_ANY_SAMPLES_PASSED</constant>, <parameter>target</parameter> must be an unused name,
or the name of an existing boolean occlusion query object.
When <function>glBeginQuery</function> is executed, the query object's samples-passed flag is reset to <constant>GL_FALSE</constant>.
Subsequent rendering causes the flag to be set to <constant>GL_TRUE</constant> if any sample passes the depth test. When
<function>glEndQuery</function> is executed, the samples-passed flag is assigned to the query object's result value. This value can
be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PRIMITIVES_GENERATED</constant>, <parameter>target</parameter> must be an unused
name, or the name of an existing primitive query object previously bound to the <constant>GL_PRIMITIVES_GENERATED</constant> query binding.
When <function>glBeginQuery</function> is executed, the query object's primitives-generated counter is reset to 0. Subsequent
rendering will increment the counter once for every vertex that is emitted from the geometry shader, or from the vertex shader if
no geometry shader is present. When <function>glEndQuery</function> is executed, the primitives-generated counter is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing primitive query object previously bound to the <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>
query binding. When <function>glBeginQuery</function> is executed, the query object's primitives-written counter is reset to 0. Subsequent
rendering will increment the counter once for every vertex that is written into the bound transform feedback buffer(s). If transform feedback
mode is not activated between the call to <function>glBeginQuery</function> and <function>glEndQuery</function>, the counter will not be
incremented. When <function>glEndQuery</function> is executed, the primitives-written counter is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TIME_ELAPSED</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing timer query object previously bound to the <constant>GL_TIME_ELAPSED</constant>
query binding. When <function>glBeginQuery</function> is executed, the query object's time counter is reset to 0. When <function>glEndQuery</function>
is executed, the elapsed server time that has passed since the call to <function>glBeginQuery</function> is written into the query object's
time counter. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>