Mesa (master): mesa/main: fix validation of transform-feedback queries

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 23 09:48:59 UTC 2018


Module: Mesa
Branch: master
Commit: f09d94fbd113f6fd0e9583b6c21826281c39ea97
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f09d94fbd113f6fd0e9583b6c21826281c39ea97

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Nov  7 16:00:59 2018 +0100

mesa/main: fix validation of transform-feedback queries

ctx->Extensions.EXT_transform_feedback is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_EXT_transform_feedback(ctx) instead to figure out if the
extension is really supported. We also need to check for
OES_geometry_shader.

This turns usage of GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN into an
error on ES 2, as well as usage of GL_PRIMITIVES_GENERATED on ES 3, both
as required by the spec.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/mesa/main/queryobj.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 9b3671f90a..bda94ccc70 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -203,12 +203,13 @@ get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
       else
          return NULL;
    case GL_PRIMITIVES_GENERATED:
-      if (ctx->Extensions.EXT_transform_feedback)
+      if (_mesa_has_EXT_transform_feedback(ctx) ||
+          _mesa_has_OES_geometry_shader(ctx))
          return &ctx->Query.PrimitivesGenerated[index];
       else
          return NULL;
    case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-      if (ctx->Extensions.EXT_transform_feedback)
+      if (_mesa_has_EXT_transform_feedback(ctx) || _mesa_is_gles3(ctx))
          return &ctx->Query.PrimitivesWritten[index];
       else
          return NULL;




More information about the mesa-commit mailing list