mesa: Add _mesa_has_compute_shaders
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 14 Feb 2015 20:53:42 +0000 (12:53 -0800)
committerBen Widawsky <benjamin.widawsky@intel.com>
Wed, 18 Feb 2015 07:00:15 +0000 (23:00 -0800)
v2 (Ben): Change GLboolean to bool as requested by Ian

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
src/mesa/main/context.h

index d902ea76e17effc0b39367012772846787dce848..d5650877ed048c37f5d9e6e51a593bda6b1c6acf 100644 (file)
@@ -326,6 +326,17 @@ _mesa_has_geometry_shaders(const struct gl_context *ctx)
 }
 
 
+/**
+ * Checks if the context supports compute shaders.
+ */
+static inline bool
+_mesa_has_compute_shaders(const struct gl_context *ctx)
+{
+   return (ctx->API == API_OPENGL_CORE && ctx->Extensions.ARB_compute_shader) ||
+      (ctx->API == API_OPENGLES2 && ctx->Version >= 31);
+}
+
+
 #ifdef __cplusplus
 }
 #endif