From fff1738d5793eb57a1f024c46c583b2b295687d3 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 7 Nov 2018 13:22:41 +0100 Subject: [PATCH] mesa/main: fix validation of GL_SAMPLES_PASSED MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ctx->Extensions.ARB_occlusion_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_occlusion_query(ctx) instead to figure out if the extension is really supported. We also need to check for ARB_occlusion_query2, as ARB_occlusion_query isn't available in core contexts. This turns usage of GL_SAMPLES_PASSED into an error on ES 3, as is required by the spec. Signed-off-by: Erik Faye-Lund Reviewed-by: Tapani Pälli --- src/mesa/main/queryobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 96b1c6bb30a..4c8e4df98bb 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -179,7 +179,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index) switch (target) { case GL_SAMPLES_PASSED: - if (ctx->Extensions.ARB_occlusion_query) + if (_mesa_has_ARB_occlusion_query(ctx) || + _mesa_has_ARB_occlusion_query2(ctx)) return &ctx->Query.CurrentOcclusionObject; else return NULL; -- 2.30.2