summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-07-23 10:23:36 +1000
committerDave Airlie <airlied@redhat.com>2015-07-23 17:25:31 +1000
commitd8a250ce5edc3da092ede6d62d433fbb37aa6cf6 (patch)
treeee20c7687c79f7646fddcc94021e8c46a6b0a7e0 /src/mesa/main/context.h
parent670b9e56da588581c90d6c68f0a55ecd9153504d (diff)
downloadexternal_mesa3d-d8a250ce5edc3da092ede6d62d433fbb37aa6cf6.zip
external_mesa3d-d8a250ce5edc3da092ede6d62d433fbb37aa6cf6.tar.gz
external_mesa3d-d8a250ce5edc3da092ede6d62d433fbb37aa6cf6.tar.bz2
mesa: add function to check if shader subroutines are enabled.
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>
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 7d256b1..0f7529a 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -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.