-GLlocation = Handle("location", GLint, key=('program', GLuint))
-GLlocationARB = Handle("locationARB", GLint, key=('programObj', GLhandleARB))
+
+# Share the same mapping table for uniform locations of both core and
+# GL_ARB_shader_objects programs. For a combination of reasons:
+#
+# - all OpenGL implementations appear to alias the names for both kind of
+# programs;
+#
+# - most applications will use only one kind of shader programs;
+#
+# - some applications actually mix glUniformXxx calls with
+# GL_ARB_shader_objects programs and glUniformXxxARB calls with core
+# programs, and therefore, rely on a joint implementation.
+#
+# We use GLhandleARB as program key, since it is wider (void *) on MacOSX.
+#
+GLlocation = Handle("location", GLint, key=('program', GLhandleARB))
+GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB))
+
+contextKey = ('reinterpret_cast<uintptr_t>(glretrace::getCurrentContext())', UIntPtr)
+