[Mesa-dev] [PATCH 1/2] mesa: enum checks for GL_EXT_occlusion_query_boolean
Eric Anholt
eric at anholt.net
Tue Oct 24 18:56:25 UTC 2017
Tapani Pälli <tapani.palli at intel.com> writes:
> Some of the checks are valid for generic ES 3.2 as well.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> src/mesa/main/queryobj.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 46535d7b4c..d966814a76 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -165,6 +165,20 @@ get_pipe_stats_binding_point(struct gl_context *ctx,
> static struct gl_query_object **
> get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
> {
> +
> + /* From GL_EXT_occlusion_query_boolean spec:
> + *
> + * "Accepted by the <target> parameter of BeginQueryEXT, EndQueryEXT,
> + * and GetQueryivEXT:
> + *
> + * ANY_SAMPLES_PASSED_EXT 0x8C2F
> + * ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A"
> + */
> + if ((_mesa_is_gles(ctx) && ctx->Version == 20) &&
> + (target != GL_ANY_SAMPLES_PASSED &&
> + target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE))
> + return NULL;
> +
> switch (target) {
> case GL_SAMPLES_PASSED_ARB:
> if (ctx->Extensions.ARB_occlusion_query)
> @@ -649,6 +663,19 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
> if (!query_error_check_index(ctx, target, index))
> return;
>
> + /* From the GL_EXT_occlusion_query_boolean spec:
> + *
> + * "The error INVALID_ENUM is generated if GetQueryivEXT is called where
> + * <pname> is not CURRENT_QUERY_EXT."
> + *
> + * Same rule is present also in ES 3.2 spec.
> + */
> + if (_mesa_is_gles(ctx) && pname != GL_CURRENT_QUERY) {
> + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivEXT(%s)",
> + _mesa_enum_to_string(pname));
> + return;
> + }
Huh, apparently QUERY_COUNTER_BITS isn't valid on GLES at all until
disjoint_timer_query shows up!
Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171024/85e79b77/attachment.sig>
More information about the mesa-dev
mailing list