mesa: add function to check if shader subroutines are enabled.
authorDave Airlie <airlied@redhat.com>
Thu, 23 Jul 2015 00:23:36 +0000 (10:23 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 23 Jul 2015 07:25:31 +0000 (17:25 +1000)
This checks if core profile and shader subroutine extension
is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/context.h

index 7d256b18d47bdfa205fa4cb13ab4a52bfba57a02..0f7529ad9754bc2adb7bd5784a75b68475474d98 100644 (file)
@@ -343,6 +343,15 @@ _mesa_has_compute_shaders(const struct gl_context *ctx)
       (ctx->API == API_OPENGLES2 && ctx->Version >= 31);
 }
 
+/**
+ * Checks if the context supports shader subroutines.
+ */
+static inline bool
+_mesa_has_shader_subroutine(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGL_CORE &&
+      (ctx->Version >= 40 || ctx->Extensions.ARB_shader_subroutine);
+}
 
 /**
  * Checks if the context supports tessellation.