From d8a250ce5edc3da092ede6d62d433fbb37aa6cf6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 23 Jul 2015 10:23:36 +1000 Subject: [PATCH] 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 Signed-off-by: Dave Airlie --- src/mesa/main/context.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 7d256b18d47..0f7529ad975 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. -- 2.30.2