On 09/04/2012 04:53 AM, Oliver McFadden wrote:
From: Oliver McFadden <oliver.mcfad...@intel.com>

Signed-off-by: Oliver McFadden <oliver.mcfad...@intel.com>
---
  src/mesa/main/context.h |   20 ++++++++++++++++++++
  1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index e238752..b37ddc7 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -311,6 +311,26 @@ _mesa_is_gles(const struct gl_context *ctx)


  /**
+ * Checks if the context is for GLES 1.x
+ */
+static inline GLboolean
+_mesa_is_gles1(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGLES && (ctx->Version / 10 == 1);
+}

This is redundant. ctx->API == API_OPENGLES means GLES 1.x. You don't need to check the version.

+
+
+/**
+ * Checks if the context is for GLES 2.x
+ */
+static inline GLboolean
+_mesa_is_gles2(const struct gl_context *ctx)
+{
+   return ctx->API == API_OPENGLES2 && (ctx->Version / 10 == 2);
+}

Maybe ctx->Version < 30 instead? Looking at the next patch, I'm not sure this helper function has any utility (see my comment about GLES3 there).

+
+
+/**
   * Checks if the context is for GLES 3.x
   */
  static inline GLboolean


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to