The glsl compiler has been reworked to avoid passing gl_context around
so that we can avoid expensive recompiles across the code base for
minor changes. This helper will help us avoid passing gl_context around
where its otherwise unrequired.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22305>
static inline bool
_mesa_is_gles2(const struct gl_context *ctx)
{
-#if HAVE_OPENGL_ES_2
- return ctx->API == API_OPENGLES2;
-#else
- return false;
-#endif
+ return _mesa_is_api_gles2(ctx->API);
}
/**
#ifndef MENUMS_H
#define MENUMS_H
+#include <stdbool.h>
#include "util/macros.h"
/**
} gl_api;
/**
+ * Checks if the api is for GLES 2.0 or later
+ */
+static inline bool
+_mesa_is_api_gles2(gl_api api)
+{
+#if HAVE_OPENGL_ES_2
+ return api == API_OPENGLES2;
+#else
+ return false;
+#endif
+}
+
+/**
* An index for each type of texture object. These correspond to the GL
* texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
* Note: the order is from highest priority to lowest priority.