From 7b6832419f5cade1990f29e6938ef0edd8a07d11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 27 Oct 2011 14:35:07 +0100 Subject: [PATCH] Retrace applications with mix ARB and core uniform calls correctly. A bit of an hack. --- specs/gltypes.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/specs/gltypes.py b/specs/gltypes.py index 1d9206b..829f0d8 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -74,8 +74,24 @@ GLquery = Handle("query", GLuint) GLfenceNV = Handle("fenceNV", GLuint) GLprogram = Handle("program", GLuint) GLshader = Handle("shader", GLuint) -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)) + GLprogramARB = Handle("programARB", GLuint) GLframebuffer = Handle("framebuffer", GLuint) GLrenderbuffer = Handle("renderbuffer", GLuint) -- 2.43.0