[Mesa-dev] [PATCH 08/46] mesa: add _mesa_has_tessellation

Marek Olšák maraeo at gmail.com
Tue Jun 16 16:01:04 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

---
 src/mesa/main/context.h  | 11 +++++++++++
 src/mesa/main/queryobj.c |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 6f3c941..7d256b1 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -344,6 +344,17 @@ _mesa_has_compute_shaders(const struct gl_context *ctx)
 }
 
 
+/**
+ * Checks if the context supports tessellation.
+ */
+static inline GLboolean
+_mesa_has_tessellation(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGL_CORE &&
+          ctx->Extensions.ARB_tessellation_shader;
+}
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 5ff1b95..282aab5 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -217,7 +217,7 @@ get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
 
    case GL_TESS_CONTROL_SHADER_PATCHES_ARB:
    case GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB:
-      if (ctx->Extensions.ARB_tessellation_shader)
+      if (_mesa_has_tessellation(ctx))
          return get_pipe_stats_binding_point(ctx, target);
       else
          return NULL;
-- 
2.1.0



More information about the mesa-dev mailing list