Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged pull requests 138, 139, and 140

 - Default to hidden visibility for Regal and statically linked library dependencies.
 - Update boost headers to 1.56.0 to get newer compiler support for Visual Studio 2013
 - Add Linux support for abi-dumper output for Regal and Regalw shared library targets.
Don't include <machine/cpu-features.h> as this was causing compile issues on Android.
Fix the paths of ES & EGL libraries to load on Android.
Bump 'export'ed version to 4.5 and regen all the files.

Initial version of script to convert khronos xml files into Regal's .py format.
See https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api
Includes a lot of reconciliation of Regal's gl.py and Khronos gl.xml.
  • Loading branch information...
commit 5e14ae7d62a1dcc673744a9709b4a68d27c674ba 1 parent 586b2e1
Scott Nations authored
Showing with 98,565 additions and 27,664 deletions.
  1. +2 −0  Makefile.apitrace
  2. +2 −0  Makefile.glsloptlib
  3. +2 −0  Makefile.libpng
  4. +1 −0  Makefile.pcrelib
  5. +4 −1 Makefile.regal
  6. +3 −0  Makefile.regalw
  7. +2 −0  Makefile.snappy
  8. +2 −0  Makefile.zlib
  9. +10 −9 build/common.inc
  10. +3 −0  config/Makefile.linux
  11. +392 −526 include/GL/Regal.h
  12. +1 −1  scripts/EmuFilter.py
  13. +1 −1  scripts/api/Api.py
  14. +2 −2 scripts/api/ApiWrite.py
  15. +22,167 −22,068 scripts/api/gl.py
  16. +1 −1  scripts/api/glew2py.py
  17. +137 −137 scripts/api/glx.py
  18. +13 −19 scripts/api/wgl.py
  19. +2 −0  scripts/regal/RegalDispatchTraceExclude.py
  20. +72 −0 scripts/xml/khronos/Makefile
  21. +2 −0  scripts/xml/khronos/README.txt
  22. +3 −0  scripts/xml/khronos/README_FIRST.txt
  23. +2,028 −0 scripts/xml/khronos/egl.xml
  24. +578 −0 scripts/xml/khronos/genheaders.py
  25. +43,891 −0 scripts/xml/khronos/gl.xml
  26. +2,098 −0 scripts/xml/khronos/glx.xml
  27. BIN  scripts/xml/khronos/readme.pdf
  28. +1,002 −0 scripts/xml/khronos/readme.tex
  29. +1,162 −0 scripts/xml/khronos/reg.py
  30. +285 −0 scripts/xml/khronos/registry.rnc
  31. +1,967 −0 scripts/xml/khronos/wgl.xml
  32. +320 −0 scripts/xml/khronosxml2py.py
  33. +16,856 −0 scripts/xml/regal/regal_gl.py
  34. +9 −12 src/boost/boost/config.hpp
  35. +7 −1 src/boost/boost/config/auto_link.hpp
  36. +7 −6 src/boost/boost/config/compiler/borland.hpp
  37. +60 −4 src/boost/boost/config/compiler/clang.hpp
  38. +12 −1 src/boost/boost/config/compiler/codegear.hpp
  39. +19 −9 src/boost/boost/config/compiler/common_edg.hpp
  40. +31 −5 src/boost/boost/config/compiler/cray.hpp
  41. +9 −18 src/boost/boost/config/compiler/digitalmars.hpp
  42. +75 −69 src/boost/boost/config/compiler/gcc.hpp
  43. +11 −6 src/boost/boost/config/compiler/gcc_xml.hpp
  44. +14 −9 src/boost/boost/config/compiler/hp_acc.hpp
  45. +68 −16 src/boost/boost/config/compiler/intel.hpp
  46. +15 −10 src/boost/boost/config/compiler/metrowerks.hpp
  47. +9 −5 src/boost/boost/config/compiler/mpw.hpp
  48. +0 −12 src/boost/boost/config/compiler/nvcc.hpp
  49. +7 −3 src/boost/boost/config/compiler/pathscale.hpp
  50. +8 −0 src/boost/boost/config/compiler/pgi.hpp
  51. +15 −10 src/boost/boost/config/compiler/sunpro_cc.hpp
  52. +18 −16 src/boost/boost/config/compiler/vacpp.hpp
  53. +58 −116 src/boost/boost/config/compiler/visualc.hpp
  54. +353 −15 src/boost/boost/config/platform/vxworks.hpp
  55. +15 −6 src/boost/boost/config/platform/win32.hpp
  56. +39 −8 src/boost/boost/config/select_compiler_config.hpp
  57. +24 −0 src/boost/boost/config/select_platform_config.hpp
  58. +15 −1 src/boost/boost/config/select_stdlib_config.hpp
  59. +24 −15 src/boost/boost/config/stdlib/dinkumware.hpp
  60. +3 −0  src/boost/boost/config/stdlib/libcomo.hpp
  61. +9 −0 src/boost/boost/config/stdlib/libcpp.hpp
  62. +16 −3 src/boost/boost/config/stdlib/libstdcpp3.hpp
  63. +3 −0  src/boost/boost/config/stdlib/modena.hpp
  64. +3 −0  src/boost/boost/config/stdlib/msl.hpp
  65. +3 −0  src/boost/boost/config/stdlib/roguewave.hpp
  66. +3 −0  src/boost/boost/config/stdlib/sgi.hpp
  67. +3 −0  src/boost/boost/config/stdlib/stlport.hpp
  68. +3 −0  src/boost/boost/config/stdlib/vacpp.hpp
  69. +123 −72 src/boost/boost/config/suffix.hpp
  70. +4 −5 src/boost/boost/config/user.hpp
  71. +128 −91 src/boost/boost/cstdint.hpp
  72. +1 −1  src/boost/boost/limits.hpp
  73. +0 −6 src/boost/boost/print/detail.hpp
  74. +468 −470 src/regal/Regal.cpp
  75. +1 −1  src/regal/RegalContext.cpp
  76. +1 −1  src/regal/RegalContext.h
  77. +4 −13 src/regal/RegalContextInfo.cpp
  78. +2 −5 src/regal/RegalContextInfo.h
  79. +111 −114 src/regal/RegalDispatch.h
  80. +470 −470 src/regal/RegalDispatchCode.cpp
  81. +257 −262 src/regal/RegalDispatchDebug.cpp
  82. +376 −384 src/regal/RegalDispatchEmu.cpp
  83. +337 −342 src/regal/RegalDispatchError.cpp
  84. +1 −1  src/regal/RegalDispatchGLX.cpp
  85. +329 −334 src/regal/RegalDispatchHttp.cpp
  86. +239 −244 src/regal/RegalDispatchLoader.cpp
  87. +355 −360 src/regal/RegalDispatchLog.cpp
  88. +293 −298 src/regal/RegalDispatchMissing.cpp
  89. +33 −33 src/regal/RegalDispatchPpapi.cpp
  90. +1 −1  src/regal/RegalDispatchStaticEGL.cpp
  91. +13 −13 src/regal/RegalDispatchStaticES2.cpp
  92. +351 −308 src/regal/RegalDispatchStatistics.cpp
  93. +358 −378 src/regal/RegalDispatchTrace.cpp
  94. +1 −1  src/regal/RegalEmuInfo.cpp
  95. +1 −1  src/regal/RegalEmuInfo.h
  96. +2 −1  src/regal/RegalEnum.h
  97. +1 −1  src/regal/RegalLookup.cpp
  98. +1 −1  src/regal/RegalLookup.h
  99. +239 −241 src/regal/RegalPlugin.cpp
  100. +7 −13 src/regal/RegalStatistics.cpp
  101. +7 −13 src/regal/RegalStatistics.h
  102. +1 −1  src/regal/RegalSystem.h
  103. +16 −13 src/regal/RegalToken.cpp
  104. +1 −1  src/regal/RegalToken.h
  105. +31 −7 src/regal/RegalUtil.cpp
  106. +21 −21 tests/RegalDispatchGMock.cpp
  107. +1 −1  tests/RegalDispatchGMock.h
View
2  Makefile.apitrace
@@ -40,6 +40,8 @@ APITRACE.DEPS := $(APITRACE.OBJS:.o=.d)
-include $(APITRACE.DEPS)
+APITRACE.CFLAGS += -fvisibility=hidden
+
ifneq ($(filter linux%,$(SYSTEM)),)
APITRACE.CFLAGS += -DHAVE_X11=1
endif
View
2  Makefile.glsloptlib
@@ -27,6 +27,8 @@ GLSLOPT.OBJS := $(GLSLOPT.OBJS:.c=.o) $(GLSLOPT.OBJS:.cpp=.o)
GLSLOPT.OBJS := $(filter %.o,$(GLSLOPT.OBJS))
GLSLOPT.DEPS := $(GLSLOPT.OBJS:.o=.d)
GLSLOPT.CFLAGS := $(GLSLOPT.INCLUDE)
+GLSLOPT.CFLAGS += -fvisibility=hidden
+
# quiet build for this thirdparty code for now
GLSLOPT.CFLAGS += -Wno-sign-compare
View
2  Makefile.libpng
@@ -29,6 +29,8 @@ LIBPNG.DEPS := $(LIBPNG.DEPS:.o=.d)
-include $(LIBPNG.DEPS)
+LIBPNG.CFLAGS += -fvisibility=hidden
+
ifeq ($(filter-out linux% darwin% nacl%,$(SYSTEM)),)
LIBPNG.CFLAGS += -DHAVE_UNISTD_H
endif
View
1  Makefile.pcrelib
@@ -29,6 +29,7 @@ PCRE.OBJS := $(filter %.o,$(PCRE.OBJS))
PCRE.DEPS := $(PCRE.OBJS:.o=.d)
PCRE.CFLAGS := $(PCRE.INCLUDE)
PCRE.CFLAGS += -DHAVE_CONFIG_H
+PCRE.CFLAGS += -fvisibility=hidden
ifeq ($(MODE),release)
PCRE.CFLAGS += -DNDEBUG
View
5 Makefile.regal
@@ -16,7 +16,7 @@ include build/regal.inc
#
export:
- python scripts/Export.py --api gl 4.4 --api wgl 4.4 --api glx 4.4 --api cgl 1.4 --api egl 1.0 --outdir .
+ python scripts/Export.py --api gl 4.5 --api wgl 4.5 --api glx 4.5 --api cgl 1.4 --api egl 1.0 --outdir .
# Shared library target not currently supported for NaCL or emscripten
@@ -304,6 +304,9 @@ endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
+ifneq ($(ABIDUMP),)
+ $(LOG_ABIDUMP)$(ABIDUMP) $@ -o $@.dump
+endif
endif
tmp/$(SYSTEM)/regal/static/%.o: src/regal/%.cpp $(REGAL.HEADERS)
View
3  Makefile.regalw
@@ -137,6 +137,9 @@ endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
+ifneq ($(ABIDUMP),)
+ $(LOG_ABIDUMP)$(ABIDUMP) $@ -o $@.dump
+endif
endif
tmp/$(SYSTEM)/regalw/static/%.o: src/regal/%.cpp $(REGALW.HEADERS)
View
2  Makefile.snappy
@@ -28,6 +28,8 @@ SNAPPY.DEPS := $(SNAPPY.DEPS:.o=.d)
-include $(SNAPPY.DEPS)
+SNAPPY.CFLAGS += -fvisibility=hidden
+
ifeq ($(filter-out linux% darwin% nacl%,$(SYSTEM)),)
SNAPPY.CFLAGS += -DHAVE_UNISTD_H
endif
View
2  Makefile.zlib
@@ -24,6 +24,8 @@ ZLIB.DEPS := $(ZLIB.OBJS:.o=.d)
-include $(ZLIB.DEPS)
+ZLIB.CFLAGS += -fvisibility=hidden
+
ifeq ($(filter-out linux% darwin% nacl%,$(SYSTEM)),)
ZLIB.CFLAGS += -DHAVE_UNISTD_H
endif
View
19 build/common.inc
@@ -53,15 +53,16 @@ OPT ?= $(CFLAGS.RELEASE)
endif
ifndef V
-LOG_CXX ?= @echo " [CXX] $@";
-LOG_CC ?= @echo " [CC] $@";
-LOG_LD ?= @echo " [LD] $@";
-LOG_AR ?= @echo " [AR] $@";
-LOG_RANLIB ?= @echo " [RANLIB] $@";
-LOG_STRIP ?= @echo " [STRIP] $@";
-LOG_LN ?= @echo " [LN] $@";
-LOG_CP ?= @echo " [CP] $@";
-LOG_MKDIR ?= @echo " [MKDIR] $@";
+LOG_CXX ?= @echo " [CXX] $@";
+LOG_CC ?= @echo " [CC] $@";
+LOG_LD ?= @echo " [LD] $@";
+LOG_AR ?= @echo " [AR] $@";
+LOG_RANLIB ?= @echo " [RANLIB] $@";
+LOG_STRIP ?= @echo " [STRIP] $@";
+LOG_LN ?= @echo " [LN] $@";
+LOG_CP ?= @echo " [CP] $@";
+LOG_MKDIR ?= @echo " [MKDIR] $@";
+LOG_ABIDUMP ?= @echo " [ABIDUMP] $@";
endif
INCLUDE ?= -Iinclude
View
3  config/Makefile.linux
@@ -3,6 +3,9 @@ CC = cc
CXX = c++
LD = cc
RANLIB :=
+# don't use abi-dumper by default
+# ABIDUMP = abi-dumper -bin-only -lver HEAD
+ABIDUMP =
EXT.DYNAMIC = so
PICFLAG = -fPIC
M_ARCH ?= $(shell uname -m)
View
918 include/GL/Regal.h
392 additions, 526 deletions not shown
View
2  scripts/EmuFilter.py
@@ -677,7 +677,7 @@
'impl' : [
'if (REGAL_FORCE_ES2_PROFILE || !_context->info->gl_ext_draw_buffers2)',
'{',
- ' if (!buf)'
+ ' if (!index)'
' {',
' DispatchTableGL *_next = _context->dispatcher.emulation.next();',
' RegalAssert(_next);',
View
2  scripts/api/Api.py
@@ -89,7 +89,7 @@ def add(self, parameter):
class Return:
- def __init__(self, type = '', default = '', cast = None, binary = False, size = None, maxSize = None, intercept = None, trace = True, play = True, filter = None, regalLog = None):
+ def __init__(self, type = 'void', default = '', cast = None, binary = False, size = None, maxSize = None, intercept = None, trace = True, play = True, filter = None, regalLog = None):
self.type = type # Type string, e.g. int
self.default = default # Default value, e.g. 0
View
4 scripts/api/ApiWrite.py
@@ -209,9 +209,9 @@ def writeExtensions(file,name,extensions):
if getattr(i,'category') != None and len(i.category):
print >>file, '%s.category = \'%s\''%(i.name,i.category)
if len(i.enumerants):
- print >>file, '%s.enumerants = [\'%s\']'%(i.name,'\',\''.join(i.enumerants))
+ print >>file, '%s.enumerants = [\'%s\']'%(i.name,'\',\''.join(sorted(i.enumerants)))
if len(i.functions):
- print >>file, '%s.functions = [\'%s\']'%(i.name,'\',\''.join(i.functions))
+ print >>file, '%s.functions = [\'%s\']'%(i.name,'\',\''.join(sorted(i.functions)))
if len(i.emulatedBy):
print >>file, '%s.emulatedBy = \'%s\''%(i.name,i.emulatedBy)
if len(i.emulatedIf):
View
44,235 scripts/api/gl.py
22,167 additions, 22,068 deletions not shown
View
2  scripts/api/glew2py.py
@@ -9,7 +9,7 @@
# glew2py.py -help
#
# Example usage:
-# private/glew2py.py -a gl -o gl.py ~/dev/glew/auto/extensions/gles/*
+# scripts/glew2py.py -a gl -o gl.py ~/dev/glew/auto/extensions/gles/*
import sys
sys.path.insert(0,'scripts/api')
View
274 scripts/api/glx.py
@@ -275,6 +275,12 @@
defines.add(GLX_TEXTURE_RGB_ATI)
defines.add(GLX_TEXTURE_TARGET_ATI)
+# GLX_EXT_buffer_age
+
+GLX_BACK_BUFFER_AGE_EXT = Enumerant('GLX_BACK_BUFFER_AGE_EXT', 0x20f4, 'GLX_EXT_buffer_age')
+
+defines.add(GLX_BACK_BUFFER_AGE_EXT)
+
# GLX_EXT_create_context_es2_profile
GLX_CONTEXT_ES2_PROFILE_BIT_EXT = Enumerant('GLX_CONTEXT_ES2_PROFILE_BIT_EXT', 0x0004, 'GLX_EXT_create_context_es2_profile')
@@ -309,6 +315,16 @@
defines.add(GLX_SHARE_CONTEXT_EXT)
defines.add(GLX_VISUAL_ID_EXT)
+# GLX_EXT_stereo_tree
+
+GLX_STEREO_NOTIFY_EXT = Enumerant('GLX_STEREO_NOTIFY_EXT', 0x0000, 'GLX_EXT_stereo_tree')
+GLX_STEREO_NOTIFY_MASK_EXT = Enumerant('GLX_STEREO_NOTIFY_MASK_EXT', 0x0001, 'GLX_EXT_stereo_tree')
+GLX_STEREO_TREE_EXT = Enumerant('GLX_STEREO_TREE_EXT', 0x20f5, 'GLX_EXT_stereo_tree')
+
+defines.add(GLX_STEREO_NOTIFY_EXT)
+defines.add(GLX_STEREO_NOTIFY_MASK_EXT)
+defines.add(GLX_STEREO_TREE_EXT)
+
# GLX_EXT_swap_control
GLX_MAX_SWAP_INTERVAL_EXT = Enumerant('GLX_MAX_SWAP_INTERVAL_EXT', 0x20f2, 'GLX_EXT_swap_control')
@@ -447,6 +463,34 @@
defines.add(GLX_EXCHANGE_COMPLETE_INTEL)
defines.add(GLX_FLIP_COMPLETE_INTEL)
+# GLX_MESA_query_renderer
+
+GLX_RENDERER_ACCELERATED_MESA = Enumerant('GLX_RENDERER_ACCELERATED_MESA', 0x8186, 'GLX_MESA_query_renderer')
+GLX_RENDERER_DEVICE_ID_MESA = Enumerant('GLX_RENDERER_DEVICE_ID_MESA', 0x8184, 'GLX_MESA_query_renderer')
+GLX_RENDERER_ID_MESA = Enumerant('GLX_RENDERER_ID_MESA', 0x818e, 'GLX_MESA_query_renderer')
+GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA', 0x818b, 'GLX_MESA_query_renderer')
+GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA', 0x818a, 'GLX_MESA_query_renderer')
+GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA', 0x818d, 'GLX_MESA_query_renderer')
+GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA', 0x818c, 'GLX_MESA_query_renderer')
+GLX_RENDERER_PREFERRED_PROFILE_MESA = Enumerant('GLX_RENDERER_PREFERRED_PROFILE_MESA', 0x8189, 'GLX_MESA_query_renderer')
+GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA = Enumerant('GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA', 0x8188, 'GLX_MESA_query_renderer')
+GLX_RENDERER_VENDOR_ID_MESA = Enumerant('GLX_RENDERER_VENDOR_ID_MESA', 0x8183, 'GLX_MESA_query_renderer')
+GLX_RENDERER_VERSION_MESA = Enumerant('GLX_RENDERER_VERSION_MESA', 0x8185, 'GLX_MESA_query_renderer')
+GLX_RENDERER_VIDEO_MEMORY_MESA = Enumerant('GLX_RENDERER_VIDEO_MEMORY_MESA', 0x8187, 'GLX_MESA_query_renderer')
+
+defines.add(GLX_RENDERER_ACCELERATED_MESA)
+defines.add(GLX_RENDERER_DEVICE_ID_MESA)
+defines.add(GLX_RENDERER_ID_MESA)
+defines.add(GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA)
+defines.add(GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA)
+defines.add(GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA)
+defines.add(GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA)
+defines.add(GLX_RENDERER_PREFERRED_PROFILE_MESA)
+defines.add(GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA)
+defines.add(GLX_RENDERER_VENDOR_ID_MESA)
+defines.add(GLX_RENDERER_VERSION_MESA)
+defines.add(GLX_RENDERER_VIDEO_MEMORY_MESA)
+
# GLX_MESA_set_3dfx_mode
GLX_3DFX_FULLSCREEN_MODE_MESA = Enumerant('GLX_3DFX_FULLSCREEN_MODE_MESA', 0x0002, 'GLX_MESA_set_3dfx_mode')
@@ -1160,6 +1204,52 @@
glXCreateGLXPixmapMESA.play = True
glx.add(glXCreateGLXPixmapMESA)
+# GLX_MESA_query_renderer
+
+glXQueryCurrentRendererIntegerMESA = Function('glXQueryCurrentRendererIntegerMESA')
+glXQueryCurrentRendererIntegerMESA.ret = Return('Bool')
+glXQueryCurrentRendererIntegerMESA.add( Input( 'attribute','int' ))
+glXQueryCurrentRendererIntegerMESA.add( Input( 'value','unsigned int *' ))
+glXQueryCurrentRendererIntegerMESA.version = ''
+glXQueryCurrentRendererIntegerMESA.category = 'GLX_MESA_query_renderer'
+glXQueryCurrentRendererIntegerMESA.trace = True
+glXQueryCurrentRendererIntegerMESA.play = True
+glx.add(glXQueryCurrentRendererIntegerMESA)
+
+glXQueryCurrentRendererStringMESA = Function('glXQueryCurrentRendererStringMESA')
+glXQueryCurrentRendererStringMESA.ret = Return('const char *')
+glXQueryCurrentRendererStringMESA.add( Input( 'attribute','int' ))
+glXQueryCurrentRendererStringMESA.version = ''
+glXQueryCurrentRendererStringMESA.category = 'GLX_MESA_query_renderer'
+glXQueryCurrentRendererStringMESA.trace = True
+glXQueryCurrentRendererStringMESA.play = True
+glx.add(glXQueryCurrentRendererStringMESA)
+
+glXQueryRendererIntegerMESA = Function('glXQueryRendererIntegerMESA')
+glXQueryRendererIntegerMESA.ret = Return('Bool')
+glXQueryRendererIntegerMESA.add( Input( 'dpy','Display *' ))
+glXQueryRendererIntegerMESA.add( Input( 'screen','int' ))
+glXQueryRendererIntegerMESA.add( Input( 'renderer','int' ))
+glXQueryRendererIntegerMESA.add( Input( 'attribute','int' ))
+glXQueryRendererIntegerMESA.add( Input( 'value','unsigned int *' ))
+glXQueryRendererIntegerMESA.version = ''
+glXQueryRendererIntegerMESA.category = 'GLX_MESA_query_renderer'
+glXQueryRendererIntegerMESA.trace = True
+glXQueryRendererIntegerMESA.play = True
+glx.add(glXQueryRendererIntegerMESA)
+
+glXQueryRendererStringMESA = Function('glXQueryRendererStringMESA')
+glXQueryRendererStringMESA.ret = Return('const char *')
+glXQueryRendererStringMESA.add( Input( 'dpy','Display *' ))
+glXQueryRendererStringMESA.add( Input( 'screen','int' ))
+glXQueryRendererStringMESA.add( Input( 'renderer','int' ))
+glXQueryRendererStringMESA.add( Input( 'attribute','int' ))
+glXQueryRendererStringMESA.version = ''
+glXQueryRendererStringMESA.category = 'GLX_MESA_query_renderer'
+glXQueryRendererStringMESA.trace = True
+glXQueryRendererStringMESA.play = True
+glx.add(glXQueryRendererStringMESA)
+
# GLX_MESA_release_buffers
glXReleaseBuffersMESA = Function('glXReleaseBuffersMESA')
@@ -1202,6 +1292,40 @@
glXSwapIntervalMESA.play = True
glx.add(glXSwapIntervalMESA)
+# GLX_NV_copy_buffer
+
+glXCopyBufferSubDataNV = Function('glXCopyBufferSubDataNV')
+glXCopyBufferSubDataNV.ret = Return('void')
+glXCopyBufferSubDataNV.add( Input( 'dpy','Display *' ))
+glXCopyBufferSubDataNV.add( Input( 'readCtx','GLXContext' ))
+glXCopyBufferSubDataNV.add( Input( 'writeCtx','GLXContext' ))
+glXCopyBufferSubDataNV.add( Input( 'readTarget','GLenum' ))
+glXCopyBufferSubDataNV.add( Input( 'writeTarget','GLenum' ))
+glXCopyBufferSubDataNV.add( Input( 'readOffset','GLintptr' ))
+glXCopyBufferSubDataNV.add( Input( 'writeOffset','GLintptr' ))
+glXCopyBufferSubDataNV.add( Input( 'size','GLsizeiptr' ))
+glXCopyBufferSubDataNV.version = ''
+glXCopyBufferSubDataNV.category = 'GLX_NV_copy_buffer'
+glXCopyBufferSubDataNV.trace = True
+glXCopyBufferSubDataNV.play = True
+glx.add(glXCopyBufferSubDataNV)
+
+glXNamedCopyBufferSubDataNV = Function('glXNamedCopyBufferSubDataNV')
+glXNamedCopyBufferSubDataNV.ret = Return('void')
+glXNamedCopyBufferSubDataNV.add( Input( 'dpy','Display *' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'readCtx','GLXContext' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'writeCtx','GLXContext' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'readBuffer','GLuint' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'writeBuffer','GLuint' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'readOffset','GLintptr' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'writeOffset','GLintptr' ))
+glXNamedCopyBufferSubDataNV.add( Input( 'size','GLsizeiptr' ))
+glXNamedCopyBufferSubDataNV.version = ''
+glXNamedCopyBufferSubDataNV.category = 'GLX_NV_copy_buffer'
+glXNamedCopyBufferSubDataNV.trace = True
+glXNamedCopyBufferSubDataNV.play = True
+glx.add(glXNamedCopyBufferSubDataNV)
+
# GLX_NV_copy_image
glXCopyImageSubDataNV = Function('glXCopyImageSubDataNV')
@@ -1230,6 +1354,19 @@
glXCopyImageSubDataNV.play = True
glx.add(glXCopyImageSubDataNV)
+# GLX_NV_delay_before_swap
+
+glXDelayBeforeSwapNV = Function('glXDelayBeforeSwapNV')
+glXDelayBeforeSwapNV.ret = Return('Bool')
+glXDelayBeforeSwapNV.add( Input( 'dpy','Display *' ))
+glXDelayBeforeSwapNV.add( Input( 'drawable','GLXDrawable' ))
+glXDelayBeforeSwapNV.add( Input( 'seconds','GLfloat' ))
+glXDelayBeforeSwapNV.version = ''
+glXDelayBeforeSwapNV.category = 'GLX_NV_delay_before_swap'
+glXDelayBeforeSwapNV.trace = True
+glXDelayBeforeSwapNV.play = True
+glx.add(glXDelayBeforeSwapNV)
+
# GLX_NV_present_video
glXBindVideoDeviceNV = Function('glXBindVideoDeviceNV')
@@ -2415,140 +2552,3 @@
glXGetProcAddress.play = True
glx.add(glXGetProcAddress)
-############################## OpenGL 4.5
-
-# GLX_ARB_robustness_application_isolation
-
-GLX_CONTEXT_RESET_ISOLATION_BIT_ARB = Enumerant('GLX_CONTEXT_RESET_ISOLATION_BIT_ARB', 0x0008, 'GLX_ARB_robustness_application_isolation')
-
-defines.add(GLX_CONTEXT_RESET_ISOLATION_BIT_ARB)
-
-# GLX_EXT_buffer_age
-
-GLX_BACK_BUFFER_AGE_EXT = Enumerant('GLX_BACK_BUFFER_AGE_EXT', 0x20f4, 'GLX_EXT_buffer_age')
-
-defines.add(GLX_BACK_BUFFER_AGE_EXT)
-
-# GLX_EXT_stereo_tree
-
-GLX_STEREO_NOTIFY_EXT = Enumerant('GLX_STEREO_NOTIFY_EXT', 0x0000, 'GLX_EXT_stereo_tree')
-GLX_STEREO_NOTIFY_MASK_EXT = Enumerant('GLX_STEREO_NOTIFY_MASK_EXT', 0x0001, 'GLX_EXT_stereo_tree')
-GLX_STEREO_TREE_EXT = Enumerant('GLX_STEREO_TREE_EXT', 0x20f5, 'GLX_EXT_stereo_tree')
-
-defines.add(GLX_STEREO_NOTIFY_EXT)
-defines.add(GLX_STEREO_NOTIFY_MASK_EXT)
-defines.add(GLX_STEREO_TREE_EXT)
-
-# GLX_MESA_query_renderer
-
-GLX_RENDERER_ACCELERATED_MESA = Enumerant('GLX_RENDERER_ACCELERATED_MESA', 0x8186, 'GLX_MESA_query_renderer')
-GLX_RENDERER_DEVICE_ID_MESA = Enumerant('GLX_RENDERER_DEVICE_ID_MESA', 0x8184, 'GLX_MESA_query_renderer')
-GLX_RENDERER_ID_MESA = Enumerant('GLX_RENDERER_ID_MESA', 0x818e, 'GLX_MESA_query_renderer')
-GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA', 0x818b, 'GLX_MESA_query_renderer')
-GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA', 0x818a, 'GLX_MESA_query_renderer')
-GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA', 0x818d, 'GLX_MESA_query_renderer')
-GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA = Enumerant('GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA', 0x818c, 'GLX_MESA_query_renderer')
-GLX_RENDERER_PREFERRED_PROFILE_MESA = Enumerant('GLX_RENDERER_PREFERRED_PROFILE_MESA', 0x8189, 'GLX_MESA_query_renderer')
-GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA = Enumerant('GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA', 0x8188, 'GLX_MESA_query_renderer')
-GLX_RENDERER_VENDOR_ID_MESA = Enumerant('GLX_RENDERER_VENDOR_ID_MESA', 0x8183, 'GLX_MESA_query_renderer')
-GLX_RENDERER_VERSION_MESA = Enumerant('GLX_RENDERER_VERSION_MESA', 0x8185, 'GLX_MESA_query_renderer')
-GLX_RENDERER_VIDEO_MEMORY_MESA = Enumerant('GLX_RENDERER_VIDEO_MEMORY_MESA', 0x8187, 'GLX_MESA_query_renderer')
-
-defines.add(GLX_RENDERER_ACCELERATED_MESA)
-defines.add(GLX_RENDERER_DEVICE_ID_MESA)
-defines.add(GLX_RENDERER_ID_MESA)
-defines.add(GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA)
-defines.add(GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA)
-defines.add(GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA)
-defines.add(GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA)
-defines.add(GLX_RENDERER_PREFERRED_PROFILE_MESA)
-defines.add(GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA)
-defines.add(GLX_RENDERER_VENDOR_ID_MESA)
-defines.add(GLX_RENDERER_VERSION_MESA)
-defines.add(GLX_RENDERER_VIDEO_MEMORY_MESA)
-
-# GLX_MESA_query_renderer
-
-glXQueryCurrentRendererIntegerMESA = Function('glXQueryCurrentRendererIntegerMESA')
-glXQueryCurrentRendererIntegerMESA.ret = Return('Bool')
-glXQueryCurrentRendererIntegerMESA.add( Input( 'attribute','int' ))
-glXQueryCurrentRendererIntegerMESA.add( Input( 'value','unsigned int *' ))
-glXQueryCurrentRendererIntegerMESA.category = 'GLX_MESA_query_renderer'
-glXQueryCurrentRendererIntegerMESA.trace = True
-glXQueryCurrentRendererIntegerMESA.play = True
-glx.add(glXQueryCurrentRendererIntegerMESA)
-
-glXQueryRendererIntegerMESA = Function('glXQueryRendererIntegerMESA')
-glXQueryRendererIntegerMESA.ret = Return('Bool')
-glXQueryRendererIntegerMESA.add( Input( 'dpy','Display *' ))
-glXQueryRendererIntegerMESA.add( Input( 'screen','int' ))
-glXQueryRendererIntegerMESA.add( Input( 'renderer','int' ))
-glXQueryRendererIntegerMESA.add( Input( 'attribute','int' ))
-glXQueryRendererIntegerMESA.add( Input( 'value','unsigned int *' ))
-glXQueryRendererIntegerMESA.category = 'GLX_MESA_query_renderer'
-glXQueryRendererIntegerMESA.trace = True
-glXQueryRendererIntegerMESA.play = True
-glx.add(glXQueryRendererIntegerMESA)
-
-glXQueryCurrentRendererStringMESA = Function('glXQueryCurrentRendererStringMESA')
-glXQueryCurrentRendererStringMESA.ret = Return('const char *')
-glXQueryCurrentRendererStringMESA.add( Input( 'attribute','int' ))
-glXQueryCurrentRendererStringMESA.category = 'GLX_MESA_query_renderer'
-glXQueryCurrentRendererStringMESA.trace = True
-glXQueryCurrentRendererStringMESA.play = True
-glx.add(glXQueryCurrentRendererStringMESA)
-
-glXQueryRendererStringMESA = Function('glXQueryRendererStringMESA')
-glXQueryRendererStringMESA.ret = Return('const char *')
-glXQueryRendererStringMESA.add( Input( 'dpy','Display *' ))
-glXQueryRendererStringMESA.add( Input( 'screen','int' ))
-glXQueryRendererStringMESA.add( Input( 'renderer','int' ))
-glXQueryRendererStringMESA.add( Input( 'attribute','int' ))
-glXQueryRendererStringMESA.category = 'GLX_MESA_query_renderer'
-glXQueryRendererStringMESA.trace = True
-glXQueryRendererStringMESA.play = True
-glx.add(glXQueryRendererStringMESA)
-
-# GLX_NV_copy_buffer
-
-glXCopyBufferSubDataNV = Function('glXCopyBufferSubDataNV')
-glXCopyBufferSubDataNV.ret = Return('void')
-glXCopyBufferSubDataNV.add( Input( 'dpy','Display *' ))
-glXCopyBufferSubDataNV.add( Input( 'readCtx','GLXContext' ))
-glXCopyBufferSubDataNV.add( Input( 'writeCtx','GLXContext' ))
-glXCopyBufferSubDataNV.add( Input( 'readTarget','GLenum' ))
-glXCopyBufferSubDataNV.add( Input( 'writeTarget','GLenum' ))
-glXCopyBufferSubDataNV.add( Input( 'readOffset','GLintptr' ))
-glXCopyBufferSubDataNV.add( Input( 'writeOffset','GLintptr' ))
-glXCopyBufferSubDataNV.add( Input( 'size','GLsizeiptr' ))
-glXCopyBufferSubDataNV.category = 'GLX_NV_copy_buffer'
-glXCopyBufferSubDataNV.trace = True
-glXCopyBufferSubDataNV.play = True
-glx.add(glXCopyBufferSubDataNV)
-
-glXNamedCopyBufferSubDataNV = Function('glXNamedCopyBufferSubDataNV')
-glXNamedCopyBufferSubDataNV.ret = Return('void')
-glXNamedCopyBufferSubDataNV.add( Input( 'dpy','Display *' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'readCtx','GLXContext' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'writeCtx','GLXContext' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'readBuffer','GLuint' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'writeBuffer','GLuint' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'readOffset','GLintptr' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'writeOffset','GLintptr' ))
-glXNamedCopyBufferSubDataNV.add( Input( 'size','GLsizeiptr' ))
-glXNamedCopyBufferSubDataNV.category = 'GLX_NV_copy_buffer'
-glXNamedCopyBufferSubDataNV.trace = True
-glXNamedCopyBufferSubDataNV.play = True
-glx.add(glXNamedCopyBufferSubDataNV)
-
-# GLX_NV_delay_before_swap
-
-glXDelayBeforeSwapNV = Function('glXDelayBeforeSwapNV')
-glXDelayBeforeSwapNV.ret = Return('Bool')
-glXDelayBeforeSwapNV.add( Input( 'dpy','Display *' ))
-glXDelayBeforeSwapNV.add( Input( 'drawable','GLXDrawable' ))
-glXDelayBeforeSwapNV.add( Input( 'seconds','GLfloat' ))
-glXDelayBeforeSwapNV.category = 'GLX_NV_delay_before_swap'
-glXDelayBeforeSwapNV.trace = True
-glXDelayBeforeSwapNV.play = True
-glx.add(glXDelayBeforeSwapNV)
View
32 scripts/api/wgl.py
@@ -1793,6 +1793,18 @@
wglCopyImageSubDataNV.play = True
wgl.add(wglCopyImageSubDataNV)
+# WGL_NV_delay_before_swap
+
+wglDelayBeforeSwapNV = Function('wglDelayBeforeSwapNV')
+wglDelayBeforeSwapNV.ret = Return('BOOL')
+wglDelayBeforeSwapNV.add( Input( 'hDC','HDC' ))
+wglDelayBeforeSwapNV.add( Input( 'seconds','GLfloat' ))
+wglDelayBeforeSwapNV.version = ''
+wglDelayBeforeSwapNV.category = 'WGL_NV_delay_before_swap'
+wglDelayBeforeSwapNV.trace = True
+wglDelayBeforeSwapNV.play = True
+wgl.add(wglDelayBeforeSwapNV)
+
# WGL_NV_gpu_affinity
wglCreateAffinityDCNV = Function('wglCreateAffinityDCNV')
@@ -2384,25 +2396,6 @@
wglUseFontOutlinesW.play = True
wgl.add(wglUseFontOutlinesW)
-########### OpenGL 4.5
-
-# WGL_ARB_robustness_application_isolation
-
-WGL_CONTEXT_RESET_ISOLATION_BIT_ARB = Enumerant('WGL_CONTEXT_RESET_ISOLATION_BIT_ARB', 0x0008, 'WGL_ARB_robustness_application_isolation')
-
-defines.add(WGL_CONTEXT_RESET_ISOLATION_BIT_ARB)
-
-# WGL_NV_delay_before_swap
-
-wglDelayBeforeSwapNV = Function('wglDelayBeforeSwapNV')
-wglDelayBeforeSwapNV.ret = Return('BOOL')
-wglDelayBeforeSwapNV.add( Input( 'hDC','HDC' ))
-wglDelayBeforeSwapNV.add( Input( 'seconds','GLfloat' ))
-wglDelayBeforeSwapNV.category = 'WGL_NV_delay_before_swap'
-wglDelayBeforeSwapNV.trace = True
-wglDelayBeforeSwapNV.play = True
-wgl.add(wglDelayBeforeSwapNV)
-
WGL_3DFX_multisample = Extension('WGL_3DFX_multisample')
WGL_3DFX_multisample.url = 'http://www.opengl.org/registry/specs/3DFX/3dfx_multisample.txt'
WGL_3DFX_multisample.enumerants = ['WGL_SAMPLES_3DFX','WGL_SAMPLE_BUFFERS_3DFX']
@@ -2684,3 +2677,4 @@
WGL_OML_sync_control.url = 'http://www.opengl.org/registry/specs/OML/wgl_sync_control.txt'
WGL_OML_sync_control.functions = ['wglGetMscRateOML','wglGetSyncValuesOML','wglSwapBuffersMscOML','wglSwapLayerBuffersMscOML','wglWaitForMscOML','wglWaitForSbcOML']
wgl.add(WGL_OML_sync_control)
+
View
2  scripts/regal/RegalDispatchTraceExclude.py
@@ -1,6 +1,8 @@
# we need to exclude these functions from the dispatch becuse they do not exist in apitrace
exclude = [
+ 'glTransformFeedbackAttribsNV',
+
'glMatrixIndexPointerOES',
'glWeightPointerOES',
View
72 scripts/xml/khronos/Makefile
@@ -0,0 +1,72 @@
+# Copyright (c) 2013-2014 The Khronos Group Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and/or associated documentation files (the
+# "Materials"), to deal in the Materials without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Materials, and to
+# permit persons to whom the Materials are furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Materials.
+#
+# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+# Generator scripts and options
+# GENOPTS can be e.g. '-noprotect'
+
+PYFILES = genheaders.py reg.py
+GENOPTS =
+GENHEADERS = genheaders.py $(GENOPTS)
+
+# Generate all headers for GL / GLES / WGL / GLX / EGL
+# Different headers depend on different XML registry files
+
+GLHEADERS = GL/glext.h GL/glcorearb.h \
+ GLES/gl.h GLES/glext.h \
+ GLES2/gl2.h GLES2/gl2ext.h \
+ GLES3/gl3.h
+GLXHEADERS = GL/glx.h GL/glxext.h
+WGLHEADERS = GL/wgl.h GL/wglext.h
+EGLHEADERS = EGL/egl.h EGL/eglext.h
+ALLHEADERS = $(GLHEADERS) $(GLXHEADERS) $(WGLHEADERS) $(EGLHEADERS)
+
+default: $(ALLHEADERS)
+
+$(GLHEADERS): gl.xml $(PYFILES)
+ $(GENHEADERS) $@
+
+$(GLXHEADERS): glx.xml $(PYFILES)
+ $(GENHEADERS) $@ -registry glx.xml
+
+$(WGLHEADERS): wgl.xml $(PYFILES)
+ $(GENHEADERS) $@ -registry wgl.xml
+
+# Not finished yet
+$(EGLHEADERS): egl.xml $(PYFILES)
+ $(GENHEADERS) $@ -registry egl.xml
+
+# Generate Relax NG XML schema from Compact schema
+
+registry.rng: registry.rnc
+ trang registry.rnc registry.rng
+
+# Verify all registry XML files against the schema
+
+validate:
+ jing -c registry.rnc gl.xml
+ jing -c registry.rnc glx.xml
+ jing -c registry.rnc wgl.xml
+ jing -c registry.rnc egl.xml
+
+clean:
+
+clobber: clean
+ -rm -f diag.txt dumpReg.txt errwarn.txt
View
2  scripts/xml/khronos/README.txt
@@ -0,0 +1,2 @@
+This text document has been replaced by a PDF. See readme.pdf . The PDF
+is generated using LaTeX from readme.tex .
View
3  scripts/xml/khronos/README_FIRST.txt
@@ -0,0 +1,3 @@
+Downloaded on 8/14/2014 from
+
+ https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/
View
2,028 scripts/xml/khronos/egl.xml
2,028 additions, 0 deletions not shown
View
578 scripts/xml/khronos/genheaders.py
@@ -0,0 +1,578 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2013-2014 The Khronos Group Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and/or associated documentation files (the
+# "Materials"), to deal in the Materials without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Materials, and to
+# permit persons to whom the Materials are furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Materials.
+#
+# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+import sys, time, pdb, string, cProfile
+from reg import *
+
+# debug - start header generation in debugger
+# dump - dump registry after loading
+# profile - enable Python profiling
+# protect - whether to use #ifndef protections
+# registry <filename> - use specified XML registry instead of gl.xml
+# target - string name of target header, or all targets if None
+# timeit - time length of registry loading & header generation
+# validate - validate return & parameter group tags against <group>
+debug = False
+dump = False
+profile = False
+protect = True
+target = None
+timeit = False
+validate= False
+# Default input / log files
+errFilename = None
+diagFilename = 'diag.txt'
+regFilename = 'gl.xml'
+
+if __name__ == '__main__':
+ i = 1
+ while (i < len(sys.argv)):
+ arg = sys.argv[i]
+ i = i + 1
+ if (arg == '-debug'):
+ write('Enabling debug (-debug)', file=sys.stderr)
+ debug = True
+ elif (arg == '-dump'):
+ write('Enabling dump (-dump)', file=sys.stderr)
+ dump = True
+ elif (arg == '-noprotect'):
+ write('Disabling inclusion protection in output headers', file=sys.stderr)
+ protect = False
+ elif (arg == '-profile'):
+ write('Enabling profiling (-profile)', file=sys.stderr)
+ profile = True
+ elif (arg == '-registry'):
+ regFilename = sys.argv[i]
+ i = i+1
+ write('Using registry ', regFilename, file=sys.stderr)
+ elif (arg == '-time'):
+ write('Enabling timing (-time)', file=sys.stderr)
+ timeit = True
+ elif (arg == '-validate'):
+ write('Enabling group validation (-validate)', file=sys.stderr)
+ validate = True
+ elif (arg[0:1] == '-'):
+ write('Unrecognized argument:', arg, file=sys.stderr)
+ exit(1)
+ else:
+ target = arg
+ write('Using target', target, file=sys.stderr)
+
+# Simple timer functions
+startTime = None
+def startTimer():
+ global startTime
+ startTime = time.clock()
+def endTimer(msg):
+ global startTime
+ endTime = time.clock()
+ if (timeit):
+ write(msg, endTime - startTime)
+ startTime = None
+
+# Load & parse registry
+reg = Registry()
+
+startTimer()
+tree = etree.parse(regFilename)
+endTimer('Time to make ElementTree =')
+
+startTimer()
+reg.loadElementTree(tree)
+endTimer('Time to parse ElementTree =')
+
+if (validate):
+ reg.validateGroups()
+
+if (dump):
+ write('***************************************')
+ write('Performing Registry dump to regdump.txt')
+ write('***************************************')
+ reg.dumpReg(filehandle = open('regdump.txt','w'))
+
+# Turn a list of strings into a regexp string matching exactly those strings
+def makeREstring(list):
+ return '^(' + '|'.join(list) + ')$'
+
+# These are "mandatory" OpenGL ES 1 extensions, to
+# be included in the core GLES/gl.h header.
+es1CoreList = [
+ 'GL_OES_read_format',
+ 'GL_OES_compressed_paletted_texture',
+ 'GL_OES_point_size_array',
+ 'GL_OES_point_sprite'
+]
+
+# Descriptive names for various regexp patterns used to select
+# versions and extensions
+
+allVersions = allExtensions = '.*'
+noVersions = noExtensions = None
+gl12andLaterPat = '1\.[2-9]|[234]\.[0-9]'
+gles2onlyPat = '2\.[0-9]'
+gles2and30Pat = '2\.[0-9]|3.0'
+gles2and30and31Pat = '2.[0-9]|3.[01]'
+es1CorePat = makeREstring(es1CoreList)
+# Extensions in old glcorearb.h but not yet tagged accordingly in gl.xml
+glCoreARBPat = None
+glx13andLaterPat = '1\.[3-9]'
+
+# Copyright text prefixing all headers (list of strings).
+prefixStrings = [
+ '/*',
+ '** Copyright (c) 2013-2014 The Khronos Group Inc.',
+ '**',
+ '** Permission is hereby granted, free of charge, to any person obtaining a',
+ '** copy of this software and/or associated documentation files (the',
+ '** "Materials"), to deal in the Materials without restriction, including',
+ '** without limitation the rights to use, copy, modify, merge, publish,',
+ '** distribute, sublicense, and/or sell copies of the Materials, and to',
+ '** permit persons to whom the Materials are furnished to do so, subject to',
+ '** the following conditions:',
+ '**',
+ '** The above copyright notice and this permission notice shall be included',
+ '** in all copies or substantial portions of the Materials.',
+ '**',
+ '** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,',
+ '** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF',
+ '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.',
+ '** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY',
+ '** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,',
+ '** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE',
+ '** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.',
+ '*/',
+ '/*',
+ '** This header is generated from the Khronos OpenGL / OpenGL ES XML',
+ '** API Registry. The current version of the Registry, generator scripts',
+ '** used to make the header, and the header can be found at',
+ '** http://www.opengl.org/registry/',
+ '**',
+ '** Khronos $' + 'Revision$ on $' + 'Date$',
+ '*/',
+ ''
+]
+
+# glext.h / glcorearb.h define calling conventions inline (no GL *platform.h)
+glExtPlatformStrings = [
+ '#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)',
+ '#ifndef WIN32_LEAN_AND_MEAN',
+ '#define WIN32_LEAN_AND_MEAN 1',
+ '#endif',
+ '#include <windows.h>',
+ '#endif',
+ '',
+ '#ifndef APIENTRY',
+ '#define APIENTRY',
+ '#endif',
+ '#ifndef APIENTRYP',
+ '#define APIENTRYP APIENTRY *',
+ '#endif',
+ '#ifndef GLAPI',
+ '#define GLAPI extern',
+ '#endif',
+ ''
+]
+
+glCorearbPlatformStrings = glExtPlatformStrings + [
+ '/* glcorearb.h is for use with OpenGL core profile implementations.',
+ '** It should should be placed in the same directory as gl.h and',
+ '** included as <GL/glcorearb.h>.',
+ '**',
+ '** glcorearb.h includes only APIs in the latest OpenGL core profile',
+ '** implementation together with APIs in newer ARB extensions which ',
+ '** can be supported by the core profile. It does not, and never will',
+ '** include functionality removed from the core profile, such as',
+ '** fixed-function vertex and fragment processing.',
+ '**',
+ '** Do not #include both <GL/glcorearb.h> and either of <GL/gl.h> or',
+ '** <GL/glext.h> in the same source file.',
+ '*/',
+ ''
+]
+
+# wglext.h needs Windows include
+wglPlatformStrings = [
+ '#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)',
+ '#define WIN32_LEAN_AND_MEAN 1',
+ '#include <windows.h>',
+ '#endif',
+ '',
+]
+
+# GLES 1/2/3 core .h have separate *platform.h files to define calling conventions
+gles1PlatformStrings = [ '#include <GLES/glplatform.h>', '' ]
+gles2PlatformStrings = [ '#include <GLES2/gl2platform.h>', '' ]
+gles3PlatformStrings = [ '#include <GLES3/gl3platform.h>', '' ]
+eglPlatformStrings = [ '#include <EGL/eglplatform.h>', '' ]
+
+# GLES 1/2 extension .h have small addition to calling convention headers
+gles1ExtPlatformStrings = gles2ExtPlatformStrings = [
+ '#ifndef GL_APIENTRYP',
+ '#define GL_APIENTRYP GL_APIENTRY*',
+ '#endif',
+ ''
+]
+
+# Insert generation date in a comment for headers not having *GLEXT_VERSION macros
+genDateCommentString = [
+ format("/* Generated on date %s */" % time.strftime("%Y%m%d")),
+ ''
+]
+
+# GL_GLEXT_VERSION is defined only in glext.h
+glextVersionStrings = [
+ format("#define GL_GLEXT_VERSION %s" % time.strftime("%Y%m%d")),
+ ''
+]
+# WGL_WGLEXT_VERSION is defined only in wglext.h
+wglextVersionStrings = [
+ format("#define WGL_WGLEXT_VERSION %s" % time.strftime("%Y%m%d")),
+ ''
+]
+# GLX_GLXEXT_VERSION is defined only in glxext.h
+glxextVersionStrings = [
+ format("#define GLX_GLXEXT_VERSION %s" % time.strftime("%Y%m%d")),
+ ''
+]
+# EGL_EGLEXT_VERSION is defined only in eglext.h
+eglextVersionStrings = [
+ format("#define EGL_EGLEXT_VERSION %s" % time.strftime("%Y%m%d")),
+ ''
+]
+
+# Defaults for generating re-inclusion protection wrappers (or not)
+protectFile = protect
+protectFeature = protect
+protectProto = protect
+
+buildList = [
+ # GL API 1.2+ + extensions - GL/glext.h
+ CGeneratorOptions(
+ filename = 'GL/glext.h',
+ apiname = 'gl',
+ profile = 'compatibility',
+ versions = allVersions,
+ emitversions = gl12andLaterPat,
+ defaultExtensions = 'gl', # Default extensions for GL
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + glExtPlatformStrings + glextVersionStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GLAPI ',
+ apientry = 'APIENTRY ',
+ apientryp = 'APIENTRYP '),
+ # GL core profile + extensions - GL/glcorearb.h
+ CGeneratorOptions(
+ filename = 'GL/glcorearb.h',
+ apiname = 'gl',
+ profile = 'core',
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = 'glcore', # Default extensions for GL core profile (only)
+ addExtensions = glCoreARBPat,
+ removeExtensions = None,
+ prefixText = prefixStrings + glCorearbPlatformStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GLAPI ',
+ apientry = 'APIENTRY ',
+ apientryp = 'APIENTRYP '),
+ # GLES 1.x API + mandatory extensions - GLES/gl.h (no function pointers)
+ CGeneratorOptions(
+ filename = 'GLES/gl.h',
+ apiname = 'gles1',
+ profile = 'common',
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = es1CorePat, # Add mandatory ES1 extensions in GLES1/gl.h
+ removeExtensions = None,
+ prefixText = prefixStrings + gles1PlatformStrings + genDateCommentString,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = False, # Core ES API functions are in the static link libraries
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_API ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # GLES 1.x extensions - GLES/glext.h
+ CGeneratorOptions(
+ filename = 'GLES/glext.h',
+ apiname = 'gles1',
+ profile = 'common',
+ versions = allVersions,
+ emitversions = noVersions,
+ defaultExtensions = 'gles1', # Default extensions for GLES 1
+ addExtensions = None,
+ removeExtensions = es1CorePat, # Remove mandatory ES1 extensions in GLES1/glext.h
+ prefixText = prefixStrings + gles1ExtPlatformStrings + genDateCommentString,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_API ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # GLES 2.0 API - GLES2/gl2.h (no function pointers)
+ CGeneratorOptions(
+ filename = 'GLES2/gl2.h',
+ apiname = 'gles2',
+ profile = 'common',
+ versions = gles2onlyPat,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + gles2PlatformStrings + genDateCommentString,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = False, # Core ES API functions are in the static link libraries
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_APICALL ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # GLES 3.1 / 3.0 / 2.0 extensions - GLES2/gl2ext.h
+ CGeneratorOptions(
+ filename = 'GLES2/gl2ext.h',
+ apiname = 'gles2',
+ profile = 'common',
+ versions = gles2onlyPat,
+ emitversions = None,
+ defaultExtensions = 'gles2', # Default extensions for GLES 2
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + gles2ExtPlatformStrings + genDateCommentString,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_APICALL ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # GLES 3.1 API - GLES3/gl31.h (no function pointers)
+ CGeneratorOptions(
+ filename = 'GLES3/gl31.h',
+ apiname = 'gles2',
+ profile = 'common',
+ versions = gles2and30and31Pat,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + gles3PlatformStrings + genDateCommentString,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = False, # Core ES API functions are in the static link libraries
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_APICALL ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # GLES 3.0 API - GLES3/gl3.h (no function pointers)
+ CGeneratorOptions(
+ filename = 'GLES3/gl3.h',
+ apiname = 'gles2',
+ profile = 'common',
+ versions = gles2and30Pat,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + gles3PlatformStrings + genDateCommentString,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = False, # Core ES API functions are in the static link libraries
+ protectProtoStr = 'GL_GLEXT_PROTOTYPES',
+ apicall = 'GL_APICALL ',
+ apientry = 'GL_APIENTRY ',
+ apientryp = 'GL_APIENTRYP '),
+ # EGL API - EGL/egl.h (no function pointers, yet @@@)
+ CGeneratorOptions(
+ filename = 'EGL/egl.h',
+ apiname = 'egl',
+ profile = None,
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + eglPlatformStrings + genDateCommentString,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = False,
+ protectProtoStr = 'EGL_EGLEXT_PROTOTYPES',
+ apicall = 'EGLAPI ',
+ apientry = 'EGLAPIENTRY ',
+ apientryp = 'EGLAPIENTRYP '),
+ # EGL extensions - EGL/eglext.h (no function pointers, yet @@@)
+ CGeneratorOptions(
+ filename = 'EGL/eglext.h',
+ apiname = 'egl',
+ profile = None,
+ versions = allVersions,
+ emitversions = None,
+ defaultExtensions = 'egl', # Default extensions for EGL
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + eglPlatformStrings + eglextVersionStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'EGL_EGLEXT_PROTOTYPES',
+ apicall = 'EGLAPI ',
+ apientry = 'EGLAPIENTRY ',
+ apientryp = 'EGLAPIENTRYP '),
+ # GLX 1.* API - GL/glx.h
+ CGeneratorOptions(
+ filename = 'GL/glx.h',
+ apiname = 'glx',
+ profile = None,
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = None, # No default extensions
+ addExtensions = None,
+ removeExtensions = None,
+ # add glXPlatformStrings?
+ prefixText = prefixStrings + genDateCommentString,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GLX_GLXEXT_PROTOTYPES',
+ apicall = '',
+ apientry = '',
+ apientryp = ' *'),
+ # GLX 1.3+ API + extensions - GL/glxext.h (no function pointers, yet @@@)
+ CGeneratorOptions(
+ filename = 'GL/glxext.h',
+ apiname = 'glx',
+ profile = None,
+ versions = allVersions,
+ emitversions = glx13andLaterPat,
+ defaultExtensions = 'glx', # Default extensions for GLX
+ addExtensions = None,
+ removeExtensions = None,
+ # add glXPlatformStrings?
+ prefixText = prefixStrings + glxextVersionStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'GLX_GLXEXT_PROTOTYPES',
+ apicall = '',
+ apientry = '',
+ apientryp = ' *'),
+ # WGL API + extensions - GL/wgl.h (no function pointers, yet @@@)
+ CGeneratorOptions(
+ filename = 'GL/wgl.h',
+ apiname = 'wgl',
+ profile = None,
+ versions = allVersions,
+ emitversions = allVersions,
+ defaultExtensions = 'wgl', # Default extensions for WGL
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + wglPlatformStrings + genDateCommentString,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'WGL_WGLEXT_PROTOTYPES',
+ apicall = '',
+ apientry = 'WINAPI ',
+ apientryp = 'WINAPI * '),
+ # WGL extensions - GL/wglext.h (no function pointers, yet @@@)
+ CGeneratorOptions(
+ filename = 'GL/wglext.h',
+ apiname = 'wgl',
+ profile = None,
+ versions = allVersions,
+ emitversions = None,
+ defaultExtensions = 'wgl', # Default extensions for WGL
+ addExtensions = None,
+ removeExtensions = None,
+ prefixText = prefixStrings + wglPlatformStrings + wglextVersionStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = protectFeature,
+ protectProto = protectProto,
+ protectProtoStr = 'WGL_WGLEXT_PROTOTYPES',
+ apicall = '',
+ apientry = 'WINAPI ',
+ apientryp = 'WINAPI * '),
+ # End of list
+ None
+]
+
+# create error/warning & diagnostic files
+if (errFilename):
+ errWarn = open(errFilename,'w')
+else:
+ errWarn = sys.stderr
+diag = open(diagFilename, 'w')
+
+def genHeaders():
+ # Loop over targets, building each
+ generated = 0
+ for genOpts in buildList:
+ if (genOpts == None):
+ break
+ if (target and target != genOpts.filename):
+ # write('*** Skipping', genOpts.filename)
+ continue
+ write('*** Building', genOpts.filename)
+ generated = generated + 1
+ startTimer()
+ gen = COutputGenerator(errFile=errWarn,
+ warnFile=errWarn,
+ diagFile=diag)
+ reg.setGenerator(gen)
+ reg.apiGen(genOpts)
+ write('** Generated', genOpts.filename)
+ endTimer('Time to generate ' + genOpts.filename + ' =')
+ if (target and generated == 0):
+ write('Failed to generate target:', target)
+
+if (debug):
+ pdb.run('genHeaders()')
+elif (profile):
+ import cProfile, pstats
+ cProfile.run('genHeaders()', 'profile.txt')
+ p = pstats.Stats('profile.txt')
+ p.strip_dirs().sort_stats('time').print_stats(50)
+else:
+ genHeaders()
View
43,891 scripts/xml/khronos/gl.xml
43,891 additions, 0 deletions not shown
View
2,098 scripts/xml/khronos/glx.xml
2,098 additions, 0 deletions not shown
View
BIN  scripts/xml/khronos/readme.pdf
Binary file not shown
View
1,002 scripts/xml/khronos/readme.tex
@@ -0,0 +1,1002 @@
+\documentclass{article}
+
+% Various packages of possible use. {index} creates problems for some reason.
+% \usepackage{index}
+\def\specpdftitle{The Khronos XML API Registry}
+\usepackage[pdftex,bookmarksnumbered=true,linktocpage,plainpages=false,pdftitle={\specpdftitle},colorlinks=true]{hyperref}
+\usepackage{amsmath,enumerate,epsfig,framed,mdframed,multicol,longtable,times,url}
+\usepackage[normalem]{ulem}
+% underscore allows use of _ instead of \_ in text. [strings] allows _ in file names
+\usepackage[strings]{underscore}
+\usepackage[breakwords,fit]{truncate}
+
+\makeatletter
+\makeatother
+\makeindex
+
+% Some commonly used abbreviations
+
+\def\code#1{{\tt #1}}
+\def\tag#1{{\tt <#1>\index{<#1>}}}
+\def\attr#1{{\tt #1\index{#1}}}
+
+\begin{document}
+
+\title{The Khronos XML API Registry}
+\author{Jon Leech}
+\date{Last updated 2014/06/16}
+\maketitle
+
+\begin{abstract}
+
+This document describes the Khronos XML API Registry schema, and
+provides some additional information about using the registry and
+scripts to generate C header files. The underlying XML files and scripts
+can be obtained starting on the OpenGL.org registry pages at URL
+
+\begin{center}
+{\bf \href{http://www.opengl.org/registry/}
+ {http://www.opengl.org/registry/}}
+\end{center}
+
+\end{abstract}
+
+\tableofcontents
+
+\section{Introduction}
+
+The Registry is the successor to the ancient \code{.spec} files used for
+many years to describe the GL, WGL, and GLX APIs. The \code{.spec} files
+had a number of issues including:
+
+\begin{itemize}
+\item Almost completely undocumented
+\item Used ancient Perl scripts to read and process the registry.
+\item Hard to extend and did not semantically capture a variety of
+ things we would like to know about an API.
+\item Attempted to represent data types using a syntax that bore no
+ description to any actual programming language. Generating this
+ syntax from OpenGL extensions, which describe C bindings, was
+ error-prone and painful for the registry maintainer.
+\item Could not easily represent related APIs such as OpenGL ES.
+\item There was an annoying inconsistency about presence of
+ function/token prefixes and vendor suffixes depending on which of
+ the GL, WGL, and GLX \code{.spec} files was being used.
+\end{itemize}
+
+The new registry uses an XML representation of the API and a set of
+Python 3 scripts to manipulate the XML, based on the lxml Python
+bindings. It comes with an XML schema and validator, is somewhat better
+documented, and we will be much more responsive about updating it.
+
+Some groups outside Khronos have their own XML based API descriptions,
+often used for additional purposes such as library code generators or
+extension loaders, and it may be desirable to construct XSLT or other
+translators between the schema.
+
+
+\section{Downloading the Registry}
+
+You can get the processed C header files from the registry pages on the
+OpenGL.org webserver at URL
+
+\begin{center}
+{\bf \href{http://www.opengl.org/registry/}
+ {http://www.opengl.org/registry/}}
+\end{center}
+
+However, to modify the XML database or the generator scripts for other
+purposes, you'll need to install a Subversion client and download
+the registry subrepository at
+
+\begin{center}
+\end{center}
+\begin{center}
+{\bf \href{https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/}
+ {https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/}}
+\end{center}
+
+
+\section{Getting Started}
+
+Once the registry has been obtained from Subversion, if you're running
+in a Linux command-line environment and have Python 3, the lxml Python
+bindings, and libxml installed, you should just be able to invoke
+\code{make} and generate C/C++ header files for all the following
+targets:
+
+\begin{itemize}
+\item \code{GL/glext.h} - OpenGL 1.2 (and later) compatibility profile
+ API + extensions
+\item \code{GL/glcorearb.h} - OpenGL core profile API + extensions
+\item \code{GLES/gl.h} - OpenGL compatibility profile API
+\item \code{GLES/glext.h} - OpenGL ES 1.x extensions
+\item \code{GLES2/gl2.h} - OpenGL ES 2.x API
+\item \code{GLES2/gl2ext.h} - OpenGL ES 2.x extensions
+\item \code{GLES3/gl3.h} - OpenGL ES 3.x API
+\item \code{GL/glx.h} - GLX API
+\item \code{GL/glxext.h} - GLX 1.3 (and later) API + extensions
+\item \code{GL/wgl.h} - WGL API
+\item \code{GL/wglext.h} - WGL extensions
+\item \code{EGL/egl.h} - EGL (still being worked on)
+\end{itemize}
+
+Starting with the Makefile rules and inspecting the files \code{gl.xml},
+\code{genheaders.py}, and \code{reg.py} will be necessary if you want to
+repurpose the registry for reasons other than header file generation, or
+to generate headers for languages other than C.
+
+If you're running in a Windows, MaxOS X, or other environment, there are
+equivalent versions of Python and GNU Make, although we haven't tested
+this ourselves. Feedback would be helpful.
+
+\subsection{Header Generation Script - \code{genheaders.py}}
+
+When generating header files using the \code{genheaders.py} script, an
+API name and profile name are required, as shown in the Makefile
+examples. Additionally, specific versions and extensions can be required
+or excluded. Based on this information, the generator script extracts
+the relevant interfaces and creates a C-language header file for them.
+\code{genheaders.py} contains predefined generator options for OpenGL,
+OpenGL core profile, OpenGL ES 1 / 2 / 3, GLX, and WGL headers.
+
+The generator script is intended to be generalizable to other languages
+by writing new generator classes. Such generators would have to rewrite
+the C types and definitions in the XML to something appropriate to their
+language.
+
+\subsection{Registry Processing Script - \code{reg.py}}
+
+Actual XML registry processing is done in \code{reg.py}, which contains
+several objects and methods for loading registries and extracting
+interfaces and extensions for use in header generation. There is some
+internal documentation in the form of comments although nothing more
+extensive exists yet, and it's possible the Python scripts will evolve
+significantly based on public feedback.
+
+
+\section{XML Registry Schema}
+\label{schema}
+
+The format of an XML registry is a top level \tag{registry} tag
+containing \tag{types}, \tag{enums}, \tag{commands}, \tag{feature}, and
+\tag{extension} tags describing the different elements of an API, as
+explained below. This description corresponds to a formal Relax NG
+schema file, \code{registry.rnc}, against which the XML registry files
+can be validated.
+
+At present there are separate registries for:
+
+\begin{itemize}
+\item OpenGL and OpenGL ES - \code{gl.xml}
+\item GLX - \code{glx.xml}
+\item WGL - \code{wgl.xml}
+\item EGL - \code{egl.xml} (still in development)
+\end{itemize}
+
+\subsection{Profiles}
+\label{schema:profile}
+
+Types and enumerants can have different definitions depending on the API
+profile requested, which allows us to accomodate minor incompatibilities
+in the OpenGL and OpenGL ES APIs, for example. Features and extensions
+can include some elements conditionally depending on the API profile
+requested.
+
+\subsection{API Names}
+\label{schema:apiname}
+
+Several tags use a \attr{api} attribute. This is an arbitrary string,
+specified at header generation time, for labelling properties of a
+specific API. The string can be, but is not necessarily, an actual API
+name. As used in \code{genheaders.py} and \code{gl.xml}, the API names
+are \code{gl}, \code{gles1}, and \code{gles2}, corresponding to OpenGL,
+OpenGL ES 1, and OpenGL ES 2/3, respectively.
+
+
+\section{Registry Root (\tag{registry} tag)}
+\label{schema:root}
+
+A \tag{registry} contains the entire definition of one or more related
+APIs.
+
+\subsection{Attributes of \tag{registry} tags}
+
+None.
+
+\subsection{Contents of \tag{registry} tags}
+
+Zero or more of each of the following tags, normally in this order
+(although order shouldn't be important):
+
+\begin{itemize}
+\item \tag{comment} - Contains arbitrary text, such as a copyright
+ statement. Unused.
+\item \tag{types} (see section~\ref{tag:types}) - defines API types.
+ Usually only one tag is used.
+\item \tag{groups} (see section~\ref{tag:groups}) - defines named groups
+ of tokens for possible parameter validation in API bindings for
+ languages other than C. Usually only one tag is used.
+\item \tag{enums} (see section~\ref{tag:enums}) - defines API enumerants
+ (tokens). Usually multiple tags are used.
+\item \tag{commands} (see section~\ref{tag:commands}) - defines API
+ commands (functions). Usually only one tag is used.
+\item \tag{feature} (see section~\ref{tag:feature}) - defines API
+ feature interfaces (API versions, more or less). One tag per
+ feature set.
+\item \tag{extensions} (see section~\ref{tag:extensions}) - defines API
+ extension interfaces. Usually only one tag is used, wrapping many
+ extensions.
+\end{itemize}
+
+
+\section{API types (\tag{types} tag)}
+\label{tag:types}
+
+The \tag{types} tag contains individual \tag{type} tags describing each
+of the derived types used in the API.
+
+Each \tag{type} tag contains legal C code, with attributes or embedded
+tags denoting the type name.
+
+\subsection{Attributes of \tag{type} tags}
+
+\begin{itemize}
+\item \attr{requires} - another type name this type requires to complete
+ its definition.
+\item \attr{name} - name of this type (if not defined in the tag body).
+\item \attr{api} - an API name (see \tag{feature} below) which
+ specializes this definition of the named type, so that the same
+ API types may have different definitions for e.g. GL ES and GL.
+\item \attr{comment} - arbitrary string (unused).
+\end{itemize}
+
+\subsection{Contents of \tag{type} tags}
+
+\tag{type} contains text which is legal C code for a type declaration.
+It may also contain embedded tags:
+
+\begin{itemize}
+\item \tag{apientry/} - insert a platform calling convention macro here
+ during header generation, used mostly for function pointer types.
+\item \tag{name} - contains the name of this type (if not defined in the
+ tag attributes).
+\end{itemize}
+
+\subsection{Example of a \tag{types} tag}
+
+\begin{verbatim}
+<types>
+ <type name="stddef"><![CDATA[#include <stddef.h>]]></type>
+ <type requires="stddef">typedef ptrdiff_t <name>GLintptr</name>;</type>
+</types>
+\end{verbatim}
+
+If the {\tt GLint64} type is required by a command, this will result in
+the following declarations:
+
+\begin{verbatim}
+#include <stddef.h>
+typedef ptrdiff_t GLintptr;
+\end{verbatim}
+
+
+\section{Enumerant Groups (\tag{groups} tag)}
+\label{tag:groups}
+
+The \tag{groups} tags contain individual \tag{group} tags describing
+some of the group annotations used for return and parameter types.
+
+\subsection{Attributes of \tag{groups} tags}
+
+None.
+
+\subsection{Contents of \tag{groups} tags}
+
+Each \tag{groups} block contains zero or more \tag{group} tags, in
+arbitrary order (although they are typically ordered by group name, to
+improve human readability).
+
+\subsection{Example of \tag{groups} tags}
+
+\begin{verbatim}
+<groups>
+ <group name="AccumOp">
+ <enum name="GL_ACCUM"/>
+ </group>
+
+ <group name="AttribMask">
+ <enum name="GL_ACCUM_BUFFER_BIT"/>
+ <enum name="GL_ALL_ATTRIB_BITS"/>
+ </group>
+</groups>
+\end{verbatim}
+
+
+\section{Enumerant Group (\tag{group} tag)}
+\label{tag:group}
+
+Each \tag{group} tag defines a single group annotation.
+
+\subsection{Attributes of \tag{group} tags}
+
+\begin{itemize}
+\item \attr{name} - group name, an arbitrary string for grouping a set
+ of enums together within a broader namespace.
+\end{itemize}
+
+\subsection{Contents of \tag{group} tags}
+
+\tag{group} tags may contain zero or more \tag{enum} tags. Each
+\tag{enum} tag may contain only a \attr{name} attribute, which should
+correspond to a \tag{enum} definition in an \tag{enums} block.
+
+\subsection{Meaning of \tag{group} tags}
+\label{tag:group:meaning}
+
+If a \tag{proto} or \tag{param} tag of a \tag{command} has a
+\attr{group} attribute defined, and that attribute matches a \tag{group}
+name, then the return type or parameter type is considered to be
+constrained to values defined by the corresponding \tag{group}. C
+language bindings do not attempt to enforce this constraint in any way,
+but other language bindings may try to do so.
+
+
+\section{Enumerant Blocks (\tag{enums} tag)}
+\label{tag:enums}
+
+The \tag{enums} tags contain individual \tag{enum} tags describing each of the
+token (enumerant) names used in the API.
+
+\subsection{Attributes of \tag{enums} tags}
+
+\begin{itemize}
+\item \attr{namespace} - a string for grouping many different enums
+ together, currently unused but typically something like \code{GL}
+ for all enums in the OpenGL / OpenGL ES shared namespace. Multiple
+ \tag{enums} tags can share the same namespace.
+\item \attr{type} - a string describing the data type of the values of
+ this group of enums, currently unused. The only string used at
+ present in the is \code{bitmask}.
+\item \attr{start}, \attr{end} - integers defining the start and end of
+ a reserved range of enumerants for a particular vendor or purpose.
+ \attr{start} must be $\leq$ \attr{end}. These fields define formal
+ enumerant allocations within a namespace, and are made by the
+ Khronos Registrar on request from implementers following the enum
+ allocation policy.
+\item \attr{vendor} - string describing the vendor or purposes to whom a
+ reserved range of enumerants is allocated.
+\item \attr{comment} - arbitrary string (unused)
+\end{itemize}
+
+\subsection{Contents of \tag{enums} tags}
+
+Each \tag{enums} block contains zero or more \tag{enum} and \tag{unused}
+tags, in arbitrary order (although they are typically ordered by sorting
+on enumerant values, to improve human readability).
+
+\subsection{Example of \tag{enums} tags}
+
+\begin{verbatim}
+<enums namespace="AttribMask" type="bitmask">
+ <enum value="0x00000001" name="GL_CURRENT_BIT" />
+ <enum value="0x00000002" name="GL_POINT_BIT" />
+</enums>
+<enums namespace="GL" start="0x80E0" end="0x810F" vendor="MS">
+ <enum value="0x80E0" name="GL_BGR" />
+ <unused start="0x80E1" end="0x810F" />
+</enums>
+\end{verbatim}
+
+When processed into a C header, and assuming all these tokens were
+required, this results in
+
+\begin{verbatim}
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000001
+#define GL_BGR 0x80E0
+\end{verbatim}
+
+
+\section{Enumerants (\tag{enum} tag)}
+\label{tag:enum}
+
+Each \tag{enum} tag defines a single GL (or other API) token.
+
+\subsection{Attributes of \tag{enum} tags}
+
+\begin{itemize}
+\item \attr{value} - enumerant value, a legal C constant (usually a
+ hexadecimal integer).
+\item \attr{name} - enumerant name, a legal C preprocessor token name.
+\item \attr{api} - an API name which specializes this definition of the
+ named enum, so that different APIs may have different values for
+ the same token (used to address a few accidental incompatibilities
+ between GL and GL ES).
+\item \attr{type} - legal C suffix for the value to force it to a
+ specific type. Currently only \code{u} and \code{ull} are used,
+ for \code{unsigned} 32- and 64-bit integer values, respectively.
+ Separated from the \attr{value} field since this eases parsing and
+ sorting of values, and is rarely used.
+\item \attr{alias} - name of another enumerant this is an alias of, used
+ where token names have been changed as a result of profile changes
+ or for consistency purposes. An enumerant alias is simply a
+ different \attr{name} for the exact same \attr{value}. At present,
+ enumerants which are promoted from extension to core API status
+ are not tagged as aliases - just enumerants tagged as aliases in
+ the {\em Changed Tokens} sections of appendices to the OpenGL
+ Specification. This might change in the future.
+\end{itemize}
+
+\subsection{Contents of \tag{enum} tags}
+
+\tag{enum} tags have no allowed contents. All information is contained
+in the attributes.
+
+
+\section{Unused Enumerants (\tag{unused} tag)}
+\label{tag:unused}
+
+Each \tag{unused} tag defines a range of enumerants which is allocated,
+but not yet assigned to specific enums. This just tracks the unused
+values and is not needed for header generation.
+
+\subsection{Attributes of \tag{unused} tags}
+
+\begin{itemize}
+\item \attr{start}, \attr{end} - integers defining the start and end of
+ an unused range of enumerants. \attr{start} must be $\leq$
+ \attr{end}. This range should not exceed the range reserved by the
+ surrounding \tag{enums} tag.
+\item \attr{vendor} - string describing the vendor or purposes to whom a
+ reserved range of enumerants is allocated. Usually identical to
+ the \attr{vendor} attribute of the surrounding \attr{enums} block.
+\item \attr{comment} - arbitrary string (unused)
+\end{itemize}
+
+\subsection{Contents of \tag{unused} tags}
+
+None.
+
+
+\section{Command Blocks (\tag{commands} tag)}
+\label{tag:commands}
+
+The \tag{commands} tag contains definitions of each of the functions
+(commands) used in the API.
+
+\subsection{Attributes of \tag{commands} tags}
+
+\begin{itemize}
+\item \attr{namespace} - a string defining the namespace in which
+ commands live, currently unused but typically something like
+ \code{GL}.
+\end{itemize}
+
+\subsection{Contents of \tag{commands} tags}
+
+Each \tag{commands} block contains zero or more \tag{command} tags, in
+arbitrary order (although they are typically ordered by sorting on the
+command name, to improve human readability).
+
+
+\section{Commands (\tag{command} tag)}
+\label{tag:command}
+
+The \tag{command} tag contains a structured definition of a single API
+command (function).
+
+\subsection{Attributes of \tag{command} tags}
+
+\begin{itemize}
+\item \attr{comment} - arbitrary string (unused).
+\end{itemize}
+
+\subsection{Contents of \tag{command} tags}
+
+\begin{itemize}
+\item \tag{proto} must be the first element, and is a tag defining the C
+ function prototype of a command as described below, up to the
+ function name but not including function parameters.
+\item \tag{param} elements for each command parameter follow, defining
+ its name and type, as described below. If a command takes no
+ arguments, it has no \tag{param} tags.
+\end{itemize}
+
+Following these elements, the remaining elements in a \tag{command}
+tag are optional and may be in any order:
+
+\begin{itemize}
+\item \tag{alias} has no attributes and contains a string which is the
+ name of another command this command is an alias of, used when
+ promoting a function from extension to ARB or ARB to API status. A
+ command alias describes the case where there are two function
+ names which resolve to the {\bf same} client library code, so (for
+ example) the case where a command is promoted but is also given
+ different GLX protocol would {\bf not} be an alias in this sense.
+\item \tag{vecequiv} has no attributes and contains a string which is
+ the name of another command which is the {\em vector equivalent}
+ of this command. For example, the vector equivalent of
+ \code{glVertex3f} is \code{glVertex3fv}.
+\item \tag{glx} defines GLX protocol information for this command, as
+ described below. Many GL commands don't have GLX protocol defined,
+ and other APIs such as EGL and WGL don't use GLX at all.
+\end{itemize}
+
+
+\subsection{Command prototype (\tag{proto} tags)}
+\label{tag:command:proto}
+
+The \tag{proto} tag defines the return type and name of a command.
+
+\subsubsection{Attributes of \tag{proto} tags}
+
+\begin{itemize}
+\item \attr{group} - group name, an arbitrary string.
+\end{itemize}
+
+If the group name is defined, it may be interpreted as described in
+section~\ref{tag:group:meaning}.
+
+\subsubsection{Contents of \tag{proto} tags}
+
+The text elements of a \tag{proto} tag, with all other tags removed, is
+legal C code describing the return type and name of a command. In addition
+it may contain two semantic tags:
+
+\begin{itemize}
+\item The \tag{ptype} tag is optional, and contains text which is a
+ valid type name found in \tag{type} tag, and indicates that this
+ type must be previously defined for the definition of the command
+ to succeed. Builtin C types, and any derived types which are
+ expected to be found in other header files, should not be wrapped
+ in \tag{ptype} tags.
+\item The \tag{name} tag is required, and contains the command name
+ being described.
+\end{itemize}
+
+\subsection{Command parameter (\tag{param} tags)}
+\label{tag:command:param}
+
+The \tag{param} tag defines the type and name of a parameter.
+
+\subsubsection{Attributes of \tag{param} tags}
+
+\begin{itemize}
+\item \attr{group} - group name, an arbitrary string.
+\item \attr{len} - parameter length, either an integer specifying the
+ number of elements of the parameter \tag{ptype}, or a complex
+ string expression with poorly defined syntax, usually representing
+ a length that is computed as a combination of other command
+ parameter values, and possibly current GL state as well.
+\end{itemize}
+
+If the group name is defined, it may be interpreted as described in
+section~\ref{tag:group:meaning}.
+
+\subsubsection{Contents of \tag{param} tags}
+
+The text elements of a \tag{param} tag, with all other tags removed, is
+legal C code describing the type and name of a function parameter. In
+addition it may contain two semantic tags:
+
+\begin{itemize}
+\item The \tag{ptype} tag is optional, and contains text which is a
+ valid type name found in \tag{type} tag, and indicates that this
+ type must be previously defined for the definition of the command
+ to succeed. Builtin C types, and any derived types which are
+ expected to be found in other header files, should not be wrapped
+ in \tag{ptype} tags.
+\item The \tag{name} tag is required, and contains the command name
+ being described.
+\end{itemize}
+
+\subsection{Example of a \tag{commands} tag}
+
+\begin{verbatim}
+<commands>
+ <command>
+ <proto>void <name>glBeginConditionalRenderNV</name></proto>
+ <param><ptype>GLuint</ptype> <name>id</name></param>
+ <param><ptype>GLenum</ptype> <name>mode</name></param>
+ <alias name="glBeginConditionalRender" />
+ <glx type="render" opcode="348" />
+ </command>
+</commands>
+\end{verbatim}
+
+When processed into a C header, this results in
+
+\begin{verbatim}
+void glBeginConditionalRenderNV(GLuint id, GLenum mode);
+\end{verbatim}
+
+
+\section{API Features / Versions (\tag{feature} tag)}
+\label{tag:feature}
+
+API features are described in individual \tag{feature} tags. A feature
+is the set of interfaces (enumerants and commands) defined by a
+particular API and version, such as OpenGL 4.0 or OpenGL ES 3.0, and
+includes all API profiles of that version.
+
+\subsection{Attributes of \tag{feature} tags}
+
+\begin{itemize}
+\item \attr{api} - API name this feature is for (see
+ section~\ref{schema:apiname}), such as \code{gl} or \code{gles2}.
+\item \attr{name} - version name, used as the C preprocessor token under
+ which the version's interfaces are protected against multiple
+ inclusion. Example: \code{GL\_VERSION\_4\_2}.
+\item \attr{protect} - an additional preprocessor token used to protect
+ a feature definition. Usually another feature or extension
+ \attr{name}. Rarely used, for odd circumstances where the
+ definition of a feature or extension requires another to be
+ defined first.
+\item \attr{number} - feature version number, usually a string
+ interpreted as $majorNumber.minorNumber$. Example: \code{4.2}.
+\item \attr{comment} - arbitrary string (unused)
+\end{itemize}
+
+\subsection{Contents of \tag{feature} tags}
+
+Zero or more \tag{require} and \tag{remove} tags (see
+section~\ref{tag:required}), in arbitrary order. Each tag describes a
+set of interfaces that is respectively required for, or removed from,
+this feature, as described below.
+
+\subsection{Example of a \tag{feature} tag}
+
+\begin{verbatim}
+<feature api="gl" name="GL_VERSION_3_0" number="3.0">
+ <require>
+ <enum name="GL_COMPARE_REF_TO_TEXTURE" />
+ <enum name="GL_CLIP_DISTANCE0" />
+ <command name="glEndTransformFeedback" />
+ </require>
+ <require profile="compatibility">
+ <enum name="GL_INDEX" />
+ </require>
+</feature>
+\end{verbatim}
+
+When processed into a C header for the \code{compatibility} profile of
+OpenGL, this results in (assuming the usual definitions of these GL
+interfaces):
+
+\begin{verbatim}
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#define GL_CLIP_DISTANCE0 0x3000
+#define GL_INDEX 0x8222
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEndTransformFeedback (void);
+#endif
+#endif /* GL_VERSION_3_0 */
+\end{verbatim}
+
+If processed into a header for the \code{core} profile, the definition of
+\code{GL\_INDEX} would not appear.
+
+
+\section{Extension Blocks (\tag{extensions} tag)}
+\label{tag:extensions}
+
+The \tag{extensions} tag contains definitions of each of the extenions
+which are defined for the API.
+
+\subsection{Attributes of \tag{extensions} tags}
+
+None.
+
+\subsection{Contents of \tag{extensions} tags}
+
+Each \tag{extensions} block contains zero or more \tag{extension} tags,
+each describing an API extension, in arbitrary order (although they are
+typically ordered by sorting on the extension name, to improve human
+readability).
+
+
+\section{API Extensions (\tag{extension} tag)}
+\label{tag:extension}
+
+API extensions are described in individual \tag{extension} tags. An
+extension is the set of interfaces defined by a particular API extension
+specification, such as \code{ARB\_multitexture}. \tag{extension} is
+similar to \tag{feature}, but instead of having \attr{version} and
+\attr{profile} attributes, instead has a \attr{supported} attribute,
+which describes the set of API names which the extension can potentially
+be implemented against.
+
+\subsection{Attributes of \tag{extension} tags}
+
+\begin{itemize}
+\item \attr{supported} - a regular expression, with an implicit
+ \code{\^{}} and \code{\$} bracketing it, which should match the
+ \attr{api} tag of a set of \tag{feature} tags.
+\item \attr{protect} - an additional preprocessor token used to protect
+ an extension definition. Usually another feature or extension
+ \attr{name}. Rarely used, for odd circumstances where the
+ definition of an extension requires another to be defined first.
+\item \attr{comment} - arbitrary string (unused)
+\end{itemize}
+
+\subsection{Contents of \tag{extension} tags}
+
+Zero or more \tag{require} and \tag{remove} tags (see
+section~\ref{tag:required}), in arbitrary order. Each tag describes a
+set of interfaces that is respectively required for, or removed from,
+this extension, as described below.
+
+\subsection{Example of an \tag{extensions} tag}
+
+\begin{verbatim}
+<extensions>
+ <extension name="GL_ARB_robustness" supported="gl|glcore" >
+ <require>
+ <enum name="GL_NO_ERROR" />
+ <command name="glGetGraphicsResetStatusARB" />
+ </require>
+ <require api="gl" profile="compatibility">
+ <command name="glGetnMapdvARB" />
+ </require>
+ </extension>
+</extensions>
+\end{verbatim}
+
+The \attr{supported} attribute says that the extension can be supported for
+either the GL compatibility (\code{gl}) or GL core (\code{glcore}) API
+profiles, but not for other APIs. When processed into a C header for the
+\code{core} profile of OpenGL, this results in (assuming the usual
+definitions of these GL interfaces):
+
+\begin{verbatim}
+#ifndef GL_ARB_robustness
+#define GL_ARB_robustness 1
+#define GL_NO_ERROR 0
+typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
+#endif
+#endif /* GL_ARB_robustness */
+\end{verbatim}
+
+
+\section{Required and Removed Interfaces (\tag{require} and \tag{remove} tags)}
+\label{tag:required}
+
+A \tag{require} block defines a set of interfaces (types, enumerants and
+commands) {\em required} by a \tag{feature} or \tag{extension}. A
+\tag{remove} block defines a set of interfaces {\em removed} by a
+\tag{feature} (this is primarily useful for the OpenGL core profile,
+which removed many interfaces - extensions should never remove
+interfaces, although this usage is allowed by the schema). Except for
+the tag name and behavior, the contents of \tag{require} and
+\tag{remove} tags are identical.
+
+\subsection{Attributes of \tag{require} and \tag{remove} tags}
+
+\begin{itemize}
+\item \attr{profile} - string name of an API profile. Interfaces in the
+ tag are only required (or removed) if the specified profile is
+ being generated. If not specified, interfaces are required (or
+ removed) for all API profiles.
+\item \attr{comment} - arbitrary string (unused)
+\item \attr{api} - an API name (see section~\ref{schema:apiname}). Interfaces
+ in the tag are only required (or removed) if the specified API is
+ being generated. If not specified, interfaces are required (or
+ removed) for all APIs.
+
+ {\bf The \attr{api} attribute is only supported inside
+ \tag{extension} tags,} since \tag{feature} tags already define a
+ specific API.
+\end{itemize}
+
+\subsection{Contents of \tag{require} and \tag{remove} tags}
+
+Zero or more of the following tags, in any order:
+
+\begin{itemize}
+\item \tag{command} specifies an required (or removed) command defined
+ in a \tag{commands} block. The tag has no content, but contains
+ elements:
+
+ \begin{itemize}
+ \item \attr{name} - name of the command (required).
+ \item \attr{comment} - arbitrary string (optional and unused).
+ \end{itemize}
+\item \tag{enum} specifies an required (or removed) enumerant defined in
+ a \tag{enums} block. The tag has no content, but contains
+ elements:
+
+ \begin{itemize}
+ \item \attr{name} - name of the enumerant (required).
+ \item \attr{comment} - arbitrary string (optional and unused).
+ \end{itemize}
+\item \tag{type} specifies a required (or removed) type defined in a
+ \tag{types} block. Most types are picked up implicitly by using
+ the \tag{ptype} tags of commands, but in a few cases, additional
+ types need to be specified explicitly (it is unlikely that a type
+ would ever be removed, although this usage is allowed by the
+ schema). The tag has no content, but contains elements:
+
+ \begin{itemize}
+ \item \attr{name} - name of the type (required).
+ \item \attr{comment} - arbitrary string (optional and unused).
+ \end{itemize}
+\end{itemize}
+
+
+\section{General Discussion}
+\label{general}
+
+
+\subsection{Stability of the XML Database and Schema}
+\label{general:stability}
+
+The new registry schema, scripts, and databases are evolving in response
+to feedback and to Khronos' own wishlist. This means the XML schema is
+subject to change, although most such change will probably be confined
+to adding attributes to existing tags. The XML databases such as
+\code{gl.xml} will evolve in response to schema changes, to new
+extensions and API versions, and to general cleanup, such as
+canonicalization of the XML or sorting of \tag{command} and
+\tag{extension} tags by name. Changes to the schema will be described in
+the change log of this document (see section~\ref{changelog}). Changes
+to the \code{.xml} files will be described in Subversion revision
+history.
+
+
+\subsection{Feature Enhancements to the Registry}
+\label{general:enhancements}
+
+There are lots of tools and additional tags that would make the XML
+format more expressive and the tools more capable. Khronos is open to
+hosting additional processing scripts for other purposes. We're hoping
+to be much more responsive to bugs filed in the Khronos public bugzilla
+now that there's a more modern and maintainable framework to build on.
+
+A partial wishlist follows:
+
+\begin{itemize}
+\item Enhance \tag{command} \tag{alias} tags to describe more relaxed
+ sorts of aliases, such as commands equivalent in behavior and
+ interface, but using different GLX protocol (this might be called
+ a {\em client-side alias} or something of the sort).
+\end{itemize}
+
+\subsection{Type Annotations and Relationship to \code{.spec} Files}
+\label{general:annotations}
+
+The initial releases of the XML Registry did not include type annotation
+and array length information from the old \code{.spec} files, which
+generated a number of complaints from people writing bindings of OpenGL
+to languages other than C. The majority of these annotations have now
+been added to the XML, in the form of \tag{group} tags (see
+section~\ref{tag:group}) defining groups of related enumerants,
+\attr{group} attributes on \tag{proto} and \tag{param} tags specifying
+that the corresponding return type belongs to a group, and \attr{len}
+attributes on \tag{param} tags specifying the array length of the
+corresponding parameter.
+
+There are many caveats regarding these annotations. For the most part
+they date from SGI's OpenGL 1.1 implementation, and have not been
+updated. The defined \tag{group}s therefore do not cover many API
+parameters which {\bf could} be given a group, and in many cases, the
+defined \tag{group}s have not been updated to add new enumerants from
+later versions of OpenGL and OpenGL extensions. The group names are
+often somewhat misleading (with imbedded vendor extension tags, while
+the corresponding features have been promoted).
+
+The \tag{group}s added to \code{gl.xml} are the enumerant groups defined
+in \code{enum.spec}, and \code{enumext.spec}. Many additional group
+names were used in the annotations in \code{gl.spec}, and they
+fall in several categories discussed below.
+
+
+\subsubsection{Simple API Type Aliases}
+
+Group names that were simply an alias for a GL type have been left
+entirely out of \code{gl.xml}, since they offer no useful additional
+information.
+
+For example, a parameter described as \code{UInt32} in \code{gl.spec} is
+not annotated with \code{group="UInt32"} in \code{gl.xml}, because this
+offers no information about the parameter not already present in its
+declaration as \code{<ptype>GLuint</ptype>}.
+
+A few examples of such groups are \code{cl\_context},
+\code{handleARB}, \code{Int32}, and \code{sync}.
+
+
+\subsubsection{Numeric Constraints}
+
+Group names representing some type of numerical constraint on a value
+are retained in \tag{proto} and \tag{param} \attr{group} attributes, but
+no definition exists. This is because the existing \tag{group} mechanism
+can only describe constraints to specific enumerant names.
+
+This is not a regression relative to the \code{.spec} files, which also
+did not describe the meaning of these groups.
+
+A few examples of such groups are \code{CheckedFloat32},
+\code{ClampedFixed}, and \code{CoordD}.
+
+
+\subsubsection{GL Object Names}
+
+Group names representing an object name obtained from e.g. a
+\code{glGen*} command, such as a display list name, are retained in in
+\tag{proto} and \tag{param} \attr{group} attributes, but no definition
+exists. This is because the existing \tag{group} mechanism can only
+describe constraints to specific enumerant names.
+
+This is not a regression relative to the \code{.spec} files, which also
+did not describe the meaning of these groups.
+
+A few examples of such groups are \code{List} and \code{Path}.
+
+
+\subsubsection{Groups Not Defined Yet}
+
+Group names representing enumerant groups which were not defined in
+\code{enum.spec} and \code{enumext.spec} are retained in \tag{proto} and
+\tag{param} \attr{group} attributes, but no definition exists. Such
+groups usually are a result of vendors contributing \code{gl.spec}
+entries for an extension without contributing corresponding
+\code{enum.spec} entries.
+
+This is not a regression relative to the \code{.spec} files, which also
+did not describe the meaning of these groups.
+
+A few examples of such groups are \code{ArrayObjectPNameATI},
+\code{BinormalPointerTypeEXT}, and \code{SpriteParameterNameSGIX}.
+
+
+\subsubsection{Other Groups}
+
+There are probably a few groups which are present in \code{gl.xml} but
+should not be. These can be gradually cleaned up over time.
+
+
+\subsubsection{Validating Groups}
+
+The \code{genheaders.py} script has been enhanced to allow validating
+groups during header generation. Invoking it with the
+\code{-validate} option, for example via:
+
+\code{\$ genheaders.py -validate -registry gl.xml}
+
+\noindent will generate a text dump on standard output showing all
+parameter type \attr{group} attributes which do {\bf not} have
+corresponding \tag{group} tags.
+
+
+\section{Change Log}
+\label{changelog}
+
+\begin{itemize}
+\item 2014/06/16 - Add \tag{vendor} attribute to \tag{unused} tags.
+\item 2013/09/17 - Add \tag{comment} attribute to \tag{command} tags
+ within \tag{commands}.
+\item 2013/06/24 - Add \tag{groups} and \tag{group} tags, renamed
+ \tag{enums} attribute \attr{class} to \attr{group}, and add
+ parameter type annotation attributes \attr{group} and \attr{len}
+ to both \tag{proto} and \tag{param}. Add
+ section~\ref{general:annotations} discussing limitations of these
+ annotations. Still need to add examples of the annotation
+ attributes.
+\item 2013/06/19 - Added \tag{extensions} tag block as a wrapper around
+ groups of \tag{extension} tags, to ease XML transformations such
+ as sorting extensions by name.
+\item 2013/06/14 - Expanded description of tags, better formatting
+\item 2013/06/12 - First release, text file format
+\end{itemize}
+
+\input{readme.ind}
+
+% \printindex
+
+\end{document}
View
1,162 scripts/xml/khronos/reg.py
@@ -0,0 +1,1162 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2013-2014 The Khronos Group Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and/or associated documentation files (the
+# "Materials"), to deal in the Materials without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Materials, and to
+# permit persons to whom the Materials are furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Materials.
+#
+# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+import io,os,re,string,sys
+from lxml import etree
+
+def write( *args, **kwargs ):
+ file = kwargs.pop('file',sys.stdout)
+ end = kwargs.pop( 'end','\n')
+ file.write( ' '.join([str(arg) for arg in args]) )
+ file.write( end )
+
+# noneStr - returns string argument, or "" if argument is None.
+# Used in converting lxml Elements into text.
+# str - string to convert
+def noneStr(str):
+ if (str):
+ return str
+ else:
+ return ""
+
+# matchAPIProfile - returns whether an API and profile
+# being generated matches an element's profile
+# api - string naming the API to match
+# profile - string naming the profile to match
+# elem - Element which (may) have 'api' and 'profile'
+# attributes to match to.
+# If a tag is not present in the Element, the corresponding API
+# or profile always matches.
+# Otherwise, the tag must exactly match the API or profile.
+# Thus, if 'profile' = core: