glapi: Move to src/mapi/.

Move glapi to src/mapi/{glapi,es1api,es2api}.
This commit is contained in:
Chia-I Wu
2010-04-26 12:56:44 +08:00
parent 73ded0624d
commit 296adbd545
120 changed files with 282 additions and 163 deletions
+60
View File
@@ -0,0 +1,60 @@
# src/mapi/es1api/Makefile
TOP := ../../..
include $(TOP)/configs/current
# this Makefile can build both libes1api.a and libes2api.a
ifeq ($(ES),)
ES := es1
endif
ESAPI = $(ES)api
GLAPI := ../glapi
include $(GLAPI)/sources.mak
ESAPI_SOURCES := $(addprefix $(GLAPI)/, $(GLAPI_SOURCES))
ESAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
ESAPI_ASM_SOURCES := $(addprefix glapi/, $(GLAPI_ASM_SOURCES))
ESAPI_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi/$(ESAPI) \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa
.PHONY: default
default: depend lib$(ESAPI).a
lib$(ESAPI).a: $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
@$(MKLIB) -o $(ESAPI) -static $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
$(ESAPI_OBJECTS): %.o: $(GLAPI)/%.c
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(ESAPI_ASM_OBJECTS): %.o: glapi/%.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(ESAPI_SOURCES) $(ESAPI_ASM_SOURCES): | glapi-stamp
glapi-stamp:
@$(MAKE) -C $(GLAPI)/gen-es $(ES)
@touch $@
.PHONY: clean
clean:
-rm -f $(ESAPI_OBJECTS) $(ESAPI_ASM_OBJECTS)
-rm -f lib$(ESAPI).a
-rm -f depend depend.bak
@$(MAKE) -C $(GLAPI)/gen-es clean-$(ES)
-rm -f glapi-stamp
# nothing to install
install:
depend: $(ESAPI_SOURCES)
@echo "running $(MKDEP)"
@touch depend
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
$(ESAPI_SOURCES) 2>/dev/null | \
sed -e 's,^$(GLAPI)/,,' > depend
+3
View File
@@ -0,0 +1,3 @@
# src/mapi/es2api/Makefile
ES := es2
include ../es1api/Makefile
+11
View File
@@ -0,0 +1,11 @@
.cvsignore
glX_proto_common.pyo
glX_proto_common.pyc
typeexpr.pyo
typeexpr.pyc
license.pyo
license.pyc
gl_XML.pyo
gl_XML.pyc
glX_XML.pyo
glX_XML.pyc
+38
View File
@@ -0,0 +1,38 @@
# src/mapi/glapi/Makefile
TOP = ../../..
include $(TOP)/configs/current
include sources.mak
GLAPI_OBJECTS = $(GLAPI_SOURCES:.c=.o)
GLAPI_ASM_OBJECTS = $(GLAPI_ASM_SOURCES:.S=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa
default: depend libglapi.a
libglapi.a: $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
$(GLAPI_OBJECTS): %.o: %.c
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
$(GLAPI_ASM_OBJECTS): %.o: %.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
install:
clean:
-rm -f $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS)
-rm -f depend depend.bak libglapi.a
depend: $(GLAPI_SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
@$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(GLAPI_SOURCES) \
> /dev/null 2>/dev/null
-include depend
+64
View File
@@ -0,0 +1,64 @@
#######################################################################
# SConscript for Mesa
Import('*')
if env['platform'] != 'winddk':
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
])
glapi_sources = [
'glapi.c',
'glapi_dispatch.c',
'glapi_entrypoint.c',
'glapi_execmem.c',
'glapi_getproc.c',
'glapi_nop.c',
'glthread.c',
]
#
# Assembly sources
#
if gcc and env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',
'USE_MMX_ASM',
'USE_3DNOW_ASM',
'USE_SSE_ASM',
])
glapi_sources += [
'glapi_x86.S',
]
elif gcc and env['machine'] == 'x86_64':
env.Append(CPPDEFINES = [
'USE_X86_64_ASM',
])
glapi_sources += [
'glapi_x86-64.S'
]
elif gcc and env['machine'] == 'ppc':
env.Append(CPPDEFINES = [
'USE_PPC_ASM',
'USE_VMX_ASM',
])
glapi_sources += [
]
elif gcc and env['machine'] == 'sparc':
glapi_sources += [
'glapi_sparc.S'
]
else:
pass
glapi = env.ConvenienceLibrary(
target = 'glapi',
source = glapi_sources,
)
Export('glapi')
+96
View File
@@ -0,0 +1,96 @@
TOP = ../../../..
GLAPI = ../gen
include $(TOP)/configs/current
OUTPUTS := \
glapi/glapidispatch.h \
glapi/glapioffsets.h \
glapi/glapitable.h \
glapi/glapitemp.h \
glapi/glprocs.h \
glapi/glapi_sparc.S \
glapi/glapi_x86-64.S \
glapi/glapi_x86.S \
main/remap_helper.h
COMMON = gl_XML.py glX_XML.py license.py typeexpr.py
COMMON := $(addprefix $(GLAPI)/, $(COMMON))
ES1_APIXML := es1_API.xml
ES2_APIXML := es2_API.xml
ES1_OUTPUT_DIR := $(TOP)/src/mapi/es1api
ES2_OUTPUT_DIR := $(TOP)/src/mapi/es2api
ES1_DEPS = $(ES1_APIXML) base1_API.xml es1_EXT.xml es_EXT.xml \
es1_COMPAT.xml es_COMPAT.xml
ES2_DEPS = $(ES2_APIXML) base2_API.xml es2_EXT.xml es_EXT.xml \
es2_COMPAT.xml es_COMPAT.xml
ES1_OUTPUTS := $(addprefix $(ES1_OUTPUT_DIR)/, $(OUTPUTS))
ES2_OUTPUTS := $(addprefix $(ES2_OUTPUT_DIR)/, $(OUTPUTS))
all: es1 es2
es1: $(ES1_OUTPUTS)
es2: $(ES2_OUTPUTS)
$(ES1_OUTPUTS): APIXML := $(ES1_APIXML)
$(ES2_OUTPUTS): APIXML := $(ES2_APIXML)
$(ES1_OUTPUTS): $(ES1_DEPS)
$(ES2_OUTPUTS): $(ES2_DEPS)
define gen-glapi
@mkdir -p $(dir $@)
$(PYTHON2) $(PYTHON_FLAGS) $< -f $(APIXML) $(1) > $@
endef
%/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON)
$(call gen-glapi,-c -m remap_table)
%/glapioffsets.h: $(GLAPI)/gl_offsets.py $(COMMON)
$(call gen-glapi,-c)
%/glapitable.h: $(GLAPI)/gl_table.py $(COMMON)
$(call gen-glapi,-c)
%/glapitemp.h: $(GLAPI)/gl_apitemp.py $(COMMON)
$(call gen-glapi,-c)
%/glprocs.h: $(GLAPI)/gl_procs.py $(COMMON)
$(call gen-glapi,-c)
%/glapi_sparc.S: $(GLAPI)/gl_SPARC_asm.py $(COMMON)
$(call gen-glapi)
%/glapi_x86-64.S: $(GLAPI)/gl_x86-64_asm.py $(COMMON)
$(call gen-glapi)
%/glapi_x86.S: $(GLAPI)/gl_x86_asm.py $(COMMON)
$(call gen-glapi)
%/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON)
$(call gen-glapi)
verify_xml:
@if [ ! -f gl.h ]; then \
echo "Please copy gl.h and gl2.h to this directory"; \
exit 1; \
fi
@echo "Verifying that es1_API.xml covers OpenGL ES 1.1..."
@$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl.h > tmp.xml
@$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es1_API.xml
@echo "Verifying that es2_API.xml covers OpenGL ES 2.0..."
@$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl2.h > tmp.xml
@$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es2_API.xml
@rm -f tmp.xml
clean-es1:
-rm -rf $(ES1_OUTPUT_DIR)/glapi
-rm -rf $(ES1_OUTPUT_DIR)/main
clean-es2:
-rm -rf $(ES2_OUTPUT_DIR)/glapi
-rm -rf $(ES2_OUTPUT_DIR)/main
clean: clean-es1 clean-es2
-rm -f *~ *.pyc *.pyo
+744
View File
@@ -0,0 +1,744 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL and OpenGL ES 1.x APIs
This file defines the base categories that can be shared by all APIs.
They are defined in an incremental fashion.
-->
<OpenGLAPI>
<!-- base subset of OpenGL 1.0 -->
<category name="base1.0">
<enum name="FALSE" value="0x0"/>
<enum name="TRUE" value="0x1"/>
<enum name="ZERO" value="0x0"/>
<enum name="ONE" value="0x1"/>
<enum name="NO_ERROR" value="0x0"/>
<enum name="POINTS" value="0x0000"/>
<enum name="LINES" value="0x0001"/>
<enum name="LINE_LOOP" value="0x0002"/>
<enum name="LINE_STRIP" value="0x0003"/>
<enum name="TRIANGLES" value="0x0004"/>
<enum name="TRIANGLE_STRIP" value="0x0005"/>
<enum name="TRIANGLE_FAN" value="0x0006"/>
<enum name="NEVER" value="0x0200"/>
<enum name="LESS" value="0x0201"/>
<enum name="EQUAL" value="0x0202"/>
<enum name="LEQUAL" value="0x0203"/>
<enum name="GREATER" value="0x0204"/>
<enum name="NOTEQUAL" value="0x0205"/>
<enum name="GEQUAL" value="0x0206"/>
<enum name="ALWAYS" value="0x0207"/>
<enum name="SRC_COLOR" value="0x0300"/>
<enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/>
<enum name="SRC_ALPHA" value="0x0302"/>
<enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/>
<enum name="DST_ALPHA" value="0x0304"/>
<enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/>
<enum name="DST_COLOR" value="0x0306"/>
<enum name="ONE_MINUS_DST_COLOR" value="0x0307"/>
<enum name="SRC_ALPHA_SATURATE" value="0x0308"/>
<enum name="FRONT" value="0x0404"/>
<enum name="BACK" value="0x0405"/>
<enum name="FRONT_AND_BACK" value="0x0408"/>
<enum name="INVALID_ENUM" value="0x0500"/>
<enum name="INVALID_VALUE" value="0x0501"/>
<enum name="INVALID_OPERATION" value="0x0502"/>
<enum name="OUT_OF_MEMORY" value="0x0505"/>
<enum name="CW" value="0x0900"/>
<enum name="CCW" value="0x0901"/>
<enum name="CULL_FACE" count="1" value="0x0B44">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_TEST" count="1" value="0x0B71">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_TEST" count="1" value="0x0B90">
<size name="Get" mode="get"/>
</enum>
<enum name="DITHER" count="1" value="0x0BD0">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND" count="1" value="0x0BE2">
<size name="Get" mode="get"/>
</enum>
<enum name="SCISSOR_TEST" count="1" value="0x0C11">
<size name="Get" mode="get"/>
</enum>
<enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5">
<size name="Get" mode="get"/>
</enum>
<enum name="PACK_ALIGNMENT" count="1" value="0x0D05">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A">
<size name="Get" mode="get"/>
</enum>
<enum name="SUBPIXEL_BITS" count="1" value="0x0D50">
<size name="Get" mode="get"/>
</enum>
<enum name="RED_BITS" count="1" value="0x0D52">
<size name="Get" mode="get"/>
</enum>
<enum name="GREEN_BITS" count="1" value="0x0D53">
<size name="Get" mode="get"/>
</enum>
<enum name="BLUE_BITS" count="1" value="0x0D54">
<size name="Get" mode="get"/>
</enum>
<enum name="ALPHA_BITS" count="1" value="0x0D55">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_BITS" count="1" value="0x0D56">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_BITS" count="1" value="0x0D57">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE_2D" count="1" value="0x0DE1">
<size name="Get" mode="get"/>
</enum>
<enum name="DONT_CARE" value="0x1100"/>
<enum name="FASTEST" value="0x1101"/>
<enum name="NICEST" value="0x1102"/>
<enum name="BYTE" count="1" value="0x1400">
<size name="CallLists"/>
</enum>
<enum name="UNSIGNED_BYTE" count="1" value="0x1401">
<size name="CallLists"/>
</enum>
<enum name="SHORT" count="2" value="0x1402">
<size name="CallLists"/>
</enum>
<enum name="UNSIGNED_SHORT" count="2" value="0x1403">
<size name="CallLists"/>
</enum>
<enum name="FLOAT" count="4" value="0x1406">
<size name="CallLists"/>
</enum>
<enum name="INVERT" value="0x150A"/>
<enum name="TEXTURE" value="0x1702"/>
<enum name="ALPHA" value="0x1906"/>
<enum name="RGB" value="0x1907"/>
<enum name="RGBA" value="0x1908"/>
<enum name="LUMINANCE" value="0x1909"/>
<enum name="LUMINANCE_ALPHA" value="0x190A"/>
<enum name="KEEP" value="0x1E00"/>
<enum name="REPLACE" value="0x1E01"/>
<enum name="INCR" value="0x1E02"/>
<enum name="DECR" value="0x1E03"/>
<enum name="VENDOR" value="0x1F00"/>
<enum name="RENDERER" value="0x1F01"/>
<enum name="VERSION" value="0x1F02"/>
<enum name="EXTENSIONS" value="0x1F03"/>
<enum name="NEAREST" value="0x2600"/>
<enum name="LINEAR" value="0x2601"/>
<enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/>
<enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/>
<enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/>
<enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/>
<enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800">
<size name="TexParameterfv"/>
<size name="TexParameteriv"/>
<size name="GetTexParameterfv" mode="get"/>
<size name="GetTexParameteriv" mode="get"/>
</enum>
<enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801">
<size name="TexParameterfv"/>
<size name="TexParameteriv"/>
<size name="GetTexParameterfv" mode="get"/>
<size name="GetTexParameteriv" mode="get"/>
</enum>
<enum name="TEXTURE_WRAP_S" count="1" value="0x2802">
<size name="TexParameterfv"/>
<size name="TexParameteriv"/>
<size name="GetTexParameterfv" mode="get"/>
<size name="GetTexParameteriv" mode="get"/>
</enum>
<enum name="TEXTURE_WRAP_T" count="1" value="0x2803">
<size name="TexParameterfv"/>
<size name="TexParameteriv"/>
<size name="GetTexParameterfv" mode="get"/>
<size name="GetTexParameteriv" mode="get"/>
</enum>
<enum name="REPEAT" value="0x2901"/>
<enum name="DEPTH_BUFFER_BIT" value="0x00000100"/>
<enum name="STENCIL_BUFFER_BIT" value="0x00000400"/>
<enum name="COLOR_BUFFER_BIT" value="0x00004000"/>
<type name="float" size="4" float="true" glx_name="FLOAT32"/>
<type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
<type name="int" size="4" glx_name="CARD32"/>
<type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
<type name="sizei" size="4" glx_name="CARD32"/>
<type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
<type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
<type name="short" size="2" glx_name="CARD16"/>
<type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
<type name="byte" size="1" glx_name="CARD8"/>
<type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
<type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
<type name="void" size="1"/>
<function name="BlendFunc" offset="241">
<param name="sfactor" type="GLenum"/>
<param name="dfactor" type="GLenum"/>
<glx rop="160"/>
</function>
<function name="Clear" offset="203">
<param name="mask" type="GLbitfield"/>
<glx rop="127"/>
</function>
<function name="ClearColor" offset="206">
<param name="red" type="GLclampf"/>
<param name="green" type="GLclampf"/>
<param name="blue" type="GLclampf"/>
<param name="alpha" type="GLclampf"/>
<glx rop="130"/>
</function>
<function name="ClearStencil" offset="207">
<param name="s" type="GLint"/>
<glx rop="131"/>
</function>
<function name="ColorMask" offset="210">
<param name="red" type="GLboolean"/>
<param name="green" type="GLboolean"/>
<param name="blue" type="GLboolean"/>
<param name="alpha" type="GLboolean"/>
<glx rop="134"/>
</function>
<function name="CullFace" offset="152">
<param name="mode" type="GLenum"/>
<glx rop="79"/>
</function>
<function name="DepthFunc" offset="245">
<param name="func" type="GLenum"/>
<glx rop="164"/>
</function>
<function name="DepthMask" offset="211">
<param name="flag" type="GLboolean"/>
<glx rop="135"/>
</function>
<function name="Disable" offset="214">
<param name="cap" type="GLenum"/>
<glx rop="138" handcode="client"/>
</function>
<function name="Enable" offset="215">
<param name="cap" type="GLenum"/>
<glx rop="139" handcode="client"/>
</function>
<function name="Finish" offset="216">
<glx sop="108" handcode="true"/>
</function>
<function name="Flush" offset="217">
<glx sop="142" handcode="true"/>
</function>
<function name="FrontFace" offset="157">
<param name="mode" type="GLenum"/>
<glx rop="84"/>
</function>
<function name="GetError" offset="261">
<return type="GLenum"/>
<glx sop="115" handcode="client"/>
</function>
<function name="GetIntegerv" offset="263">
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="117" handcode="client"/>
</function>
<function name="GetString" offset="275">
<param name="name" type="GLenum"/>
<return type="const GLubyte *"/>
<glx sop="129" handcode="true"/>
</function>
<function name="Hint" offset="158">
<param name="target" type="GLenum"/>
<param name="mode" type="GLenum"/>
<glx rop="85"/>
</function>
<function name="LineWidth" offset="168">
<param name="width" type="GLfloat"/>
<glx rop="95"/>
</function>
<function name="PixelStorei" offset="250">
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx sop="110" handcode="client"/>
</function>
<function name="ReadPixels" offset="256">
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
<glx sop="111"/>
</function>
<function name="Scissor" offset="176">
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="103"/>
</function>
<function name="StencilFunc" offset="243">
<param name="func" type="GLenum"/>
<param name="ref" type="GLint"/>
<param name="mask" type="GLuint"/>
<glx rop="162"/>
</function>
<function name="StencilMask" offset="209">
<param name="mask" type="GLuint"/>
<glx rop="133"/>
</function>
<function name="StencilOp" offset="244">
<param name="fail" type="GLenum"/>
<param name="zfail" type="GLenum"/>
<param name="zpass" type="GLenum"/>
<glx rop="163"/>
</function>
<function name="TexParameterf" offset="178">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="105"/>
</function>
<function name="Viewport" offset="305">
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="191"/>
</function>
<!-- these are not in OpenGL ES 1.0 -->
<enum name="LINE_WIDTH" count="1" value="0x0B21">
<size name="Get" mode="get"/>
</enum>
<enum name="CULL_FACE_MODE" count="1" value="0x0B45">
<size name="Get" mode="get"/>
</enum>
<enum name="FRONT_FACE" count="1" value="0x0B46">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_RANGE" count="2" value="0x0B70">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_WRITEMASK" count="1" value="0x0B72">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_FUNC" count="1" value="0x0B74">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_FUNC" count="1" value="0x0B92">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_FAIL" count="1" value="0x0B94">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_REF" count="1" value="0x0B97">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_WRITEMASK" count="1" value="0x0B98">
<size name="Get" mode="get"/>
</enum>
<enum name="VIEWPORT" count="4" value="0x0BA2">
<size name="Get" mode="get"/>
</enum>
<enum name="SCISSOR_BOX" count="4" value="0x0C10">
<size name="Get" mode="get"/>
</enum>
<enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22">
<size name="Get" mode="get"/>
</enum>
<enum name="COLOR_WRITEMASK" count="4" value="0x0C23">
<size name="Get" mode="get"/>
</enum>
<function name="TexParameterfv" offset="179">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="106"/>
</function>
<function name="TexParameteri" offset="180">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx rop="107"/>
</function>
<function name="TexParameteriv" offset="181">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLint *" variable_param="pname"/>
<glx rop="108"/>
</function>
<function name="GetBooleanv" offset="258">
<param name="pname" type="GLenum"/>
<param name="params" type="GLboolean *" output="true" variable_param="pname"/>
<glx sop="112" handcode="client"/>
</function>
<function name="GetFloatv" offset="262">
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="116" handcode="client"/>
</function>
<function name="GetTexParameterfv" offset="282">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="136"/>
</function>
<function name="GetTexParameteriv" offset="283">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="137"/>
</function>
<function name="IsEnabled" offset="286">
<param name="cap" type="GLenum"/>
<return type="GLboolean"/>
<glx sop="140" handcode="client"/>
</function>
</category>
<!-- base subset of OpenGL 1.1 -->
<category name="base1.1">
<enum name="POLYGON_OFFSET_FILL" value="0x8037"/>
<function name="BindTexture" offset="307">
<param name="target" type="GLenum"/>
<param name="texture" type="GLuint"/>
<glx rop="4117"/>
</function>
<function name="CopyTexImage2D" offset="324">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLenum"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="border" type="GLint"/>
<glx rop="4120"/>
</function>
<function name="CopyTexSubImage2D" offset="326">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4122"/>
</function>
<function name="DeleteTextures" offset="327">
<param name="n" type="GLsizei" counter="true"/>
<param name="textures" type="const GLuint *" count="n"/>
<glx sop="144"/>
</function>
<function name="DrawArrays" offset="310">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
<glx rop="193" handcode="true"/>
</function>
<function name="DrawElements" offset="311">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<glx handcode="true"/>
</function>
<function name="GenTextures" offset="328">
<param name="n" type="GLsizei" counter="true"/>
<param name="textures" type="GLuint *" output="true" count="n"/>
<glx sop="145" always_array="true"/>
</function>
<function name="PolygonOffset" offset="319">
<param name="factor" type="GLfloat"/>
<param name="units" type="GLfloat"/>
<glx rop="192"/>
</function>
<function name="TexSubImage2D" offset="333">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="UNUSED" type="GLuint" padding="true"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
<glx rop="4100" large="true"/>
</function>
<!-- these are not in OpenGL ES 1.0 -->
<enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00">
<size name="Get" mode="get"/>
</enum>
<enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE_BINDING_2D" count="1" value="0x8069">
<size name="Get" mode="get"/>
</enum>
<function name="IsTexture" offset="330">
<param name="texture" type="GLuint"/>
<return type="GLboolean"/>
<glx sop="146"/>
</function>
</category>
<!-- base subset of OpenGL 1.2 -->
<category name="base1.2">
<enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/>
<enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/>
<enum name="CLAMP_TO_EDGE" value="0x812F"/>
<enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
<enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D">
<size name="Get" mode="get"/>
</enum>
<enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E">
<size name="Get" mode="get"/>
</enum>
</category>
<!-- base subset of OpenGL 1.3 -->
<category name="base1.3">
<enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E">
<size name="Get" mode="get"/>
</enum>
<enum name="SAMPLE_COVERAGE" count="1" value="0x80A0">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE0" value="0x84C0"/>
<enum name="TEXTURE1" value="0x84C1"/>
<enum name="TEXTURE2" value="0x84C2"/>
<enum name="TEXTURE3" value="0x84C3"/>
<enum name="TEXTURE4" value="0x84C4"/>
<enum name="TEXTURE5" value="0x84C5"/>
<enum name="TEXTURE6" value="0x84C6"/>
<enum name="TEXTURE7" value="0x84C7"/>
<enum name="TEXTURE8" value="0x84C8"/>
<enum name="TEXTURE9" value="0x84C9"/>
<enum name="TEXTURE10" value="0x84CA"/>
<enum name="TEXTURE11" value="0x84CB"/>
<enum name="TEXTURE12" value="0x84CC"/>
<enum name="TEXTURE13" value="0x84CD"/>
<enum name="TEXTURE14" value="0x84CE"/>
<enum name="TEXTURE15" value="0x84CF"/>
<enum name="TEXTURE16" value="0x84D0"/>
<enum name="TEXTURE17" value="0x84D1"/>
<enum name="TEXTURE18" value="0x84D2"/>
<enum name="TEXTURE19" value="0x84D3"/>
<enum name="TEXTURE20" value="0x84D4"/>
<enum name="TEXTURE21" value="0x84D5"/>
<enum name="TEXTURE22" value="0x84D6"/>
<enum name="TEXTURE23" value="0x84D7"/>
<enum name="TEXTURE24" value="0x84D8"/>
<enum name="TEXTURE25" value="0x84D9"/>
<enum name="TEXTURE26" value="0x84DA"/>
<enum name="TEXTURE27" value="0x84DB"/>
<enum name="TEXTURE28" value="0x84DC"/>
<enum name="TEXTURE29" value="0x84DD"/>
<enum name="TEXTURE30" value="0x84DE"/>
<enum name="TEXTURE31" value="0x84DF"/>
<enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2">
<size name="Get" mode="get"/>
</enum>
<enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3">
<size name="Get" mode="get"/>
</enum>
<function name="ActiveTexture" offset="374">
<param name="texture" type="GLenum"/>
<glx rop="197"/>
</function>
<function name="CompressedTexImage2D" offset="assign">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="imageSize" type="GLsizei" counter="true"/>
<param name="data" type="const GLvoid *" count="imageSize"/>
<glx rop="215" handcode="client"/>
</function>
<function name="CompressedTexSubImage2D" offset="assign">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="imageSize" type="GLsizei" counter="true"/>
<param name="data" type="const GLvoid *" count="imageSize"/>
<glx rop="218" handcode="client"/>
</function>
<function name="SampleCoverage" offset="assign">
<param name="value" type="GLclampf"/>
<param name="invert" type="GLboolean"/>
<glx rop="229"/>
</function>
<!-- these are not in OpenGL ES 1.0 -->
<enum name="SAMPLE_BUFFERS" count="1" value="0x80A8">
<size name="Get" mode="get"/>
</enum>
<enum name="SAMPLES" count="1" value="0x80A9">
<size name="Get" mode="get"/>
</enum>
<enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA">
<size name="Get" mode="get"/>
</enum>
<enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB">
<size name="Get" mode="get"/>
</enum>
<enum name="ACTIVE_TEXTURE" count="1" value="0x84E0">
<size name="Get" mode="get"/>
</enum>
</category>
<!-- base subset of OpenGL 1.4 -->
<category name="base1.4">
<enum name="GENERATE_MIPMAP_HINT" value="0x8192"/>
</category>
<!-- base subset of OpenGL 1.5 -->
<category name="base1.5">
<enum name="BUFFER_SIZE" value="0x8764"/>
<enum name="BUFFER_USAGE" value="0x8765"/>
<enum name="ARRAY_BUFFER" value="0x8892"/>
<enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/>
<enum name="ARRAY_BUFFER_BINDING" value="0x8894"/>
<enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/>
<enum name="STATIC_DRAW" value="0x88E4"/>
<enum name="DYNAMIC_DRAW" value="0x88E8"/>
<type name="intptr" size="4" glx_name="CARD32"/>
<type name="sizeiptr" size="4" glx_name="CARD32"/>
<function name="BindBuffer" offset="assign">
<param name="target" type="GLenum"/>
<param name="buffer" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="BufferData" offset="assign">
<param name="target" type="GLenum"/>
<param name="size" type="GLsizeiptr" counter="true"/>
<param name="data" type="const GLvoid *" count="size" img_null_flag="true"/>
<param name="usage" type="GLenum"/>
<glx ignore="true"/>
</function>
<function name="BufferSubData" offset="assign">
<param name="target" type="GLenum"/>
<param name="offset" type="GLintptr"/>
<param name="size" type="GLsizeiptr" counter="true"/>
<param name="data" type="const GLvoid *" count="size"/>
<glx ignore="true"/>
</function>
<function name="DeleteBuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="buffer" type="const GLuint *" count="n"/>
<glx ignore="true"/>
</function>
<function name="GenBuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="buffer" type="GLuint *" output="true" count="n"/>
<glx ignore="true"/>
</function>
<function name="GetBufferParameteriv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx ignore="true"/>
</function>
<function name="IsBuffer" offset="assign">
<param name="buffer" type="GLuint"/>
<return type="GLboolean"/>
<glx ignore="true"/>
</function>
</category>
</OpenGLAPI>
+533
View File
@@ -0,0 +1,533 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL and OpenGL ES 2.x APIs -->
<OpenGLAPI>
<xi:include href="base1_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- base subset of OpenGL 2.0 -->
<category name="base2.0">
<enum name="BLEND_EQUATION_RGB" count="1" value="0x8009"> <!-- same as BLEND_EQUATION -->
<size name="Get" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_ENABLED" count="1" value="0x8622">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_SIZE" count="1" value="0x8623">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_STRIDE" count="1" value="0x8624">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_TYPE" count="1" value="0x8625">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="CURRENT_VERTEX_ATTRIB" count="1" value="0x8626">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
<enum name="STENCIL_BACK_FUNC" count="1" value="0x8800">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_BACK_FAIL" count="1" value="0x8801">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_BACK_PASS_DEPTH_FAIL" count="1" value="0x8802">
<size name="Get" mode="get"/>
</enum>
<enum name="STENCIL_BACK_PASS_DEPTH_PASS" count="1" value="0x8803">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_EQUATION_ALPHA" count="1" value="0x883D">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_VERTEX_ATTRIBS" count="1" value="0x8869">
<size name="Get" mode="get"/>
</enum>
<enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
<enum name="MAX_TEXTURE_IMAGE_UNITS" count="1" value="0x8872">
<size name="Get" mode="get"/>
</enum>
<enum name="FRAGMENT_SHADER" value="0x8B30"/>
<enum name="VERTEX_SHADER" value="0x8B31"/>
<enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
<enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
<enum name="SHADER_TYPE" value="0x8B4F"/>
<enum name="FLOAT_VEC2" value="0x8B50"/>
<enum name="FLOAT_VEC3" value="0x8B51"/>
<enum name="FLOAT_VEC4" value="0x8B52"/>
<enum name="INT_VEC2" value="0x8B53"/>
<enum name="INT_VEC3" value="0x8B54"/>
<enum name="INT_VEC4" value="0x8B55"/>
<enum name="BOOL" value="0x8B56"/>
<enum name="BOOL_VEC2" value="0x8B57"/>
<enum name="BOOL_VEC3" value="0x8B58"/>
<enum name="BOOL_VEC4" value="0x8B59"/>
<enum name="FLOAT_MAT2" value="0x8B5A"/>
<enum name="FLOAT_MAT3" value="0x8B5B"/>
<enum name="FLOAT_MAT4" value="0x8B5C"/>
<enum name="SAMPLER_2D" value="0x8B5E"/>
<enum name="SAMPLER_CUBE" value="0x8B60"/>
<enum name="DELETE_STATUS" value="0x8B80"/>
<enum name="COMPILE_STATUS" value="0x8B81"/>
<enum name="LINK_STATUS" value="0x8B82"/>
<enum name="VALIDATE_STATUS" value="0x8B83"/>
<enum name="INFO_LOG_LENGTH" value="0x8B84"/>
<enum name="ATTACHED_SHADERS" value="0x8B85"/>
<enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
<enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
<enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
<enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
<enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
<enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
<enum name="CURRENT_PROGRAM" value="0x8B8D"/>
<enum name="STENCIL_BACK_REF" value="0x8CA3"/>
<enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
<enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
<type name="char" size="1" glx_name="CARD8"/>
<function name="AttachShader" offset="assign">
<param name="program" type="GLuint"/>
<param name="shader" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="BindAttribLocation" offset="assign">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="name" type="const GLchar *"/>
<glx ignore="true"/>
</function>
<function name="BlendEquationSeparate" offset="assign">
<param name="modeRGB" type="GLenum"/>
<param name="modeA" type="GLenum"/>
<glx rop="4228"/>
</function>
<function name="CompileShader" offset="assign">
<param name="shader" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="CreateProgram" offset="assign">
<return type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="CreateShader" offset="assign">
<param name="type" type="GLenum"/>
<return type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="DeleteProgram" offset="assign">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="DeleteShader" offset="assign">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="DetachShader" offset="assign">
<param name="program" type="GLuint"/>
<param name="shader" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="DisableVertexAttribArray" offset="assign">
<param name="index" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="EnableVertexAttribArray" offset="assign">
<param name="index" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="GetActiveAttrib" offset="assign">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="bufSize" type="GLsizei "/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
<param name="name" type="GLchar *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetActiveUniform" offset="assign">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
<param name="name" type="GLchar *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetAttachedShaders" offset="assign">
<param name="program" type="GLuint"/>
<param name="maxCount" type="GLsizei"/>
<param name="count" type="GLsizei *" output="true"/>
<param name="obj" type="GLuint *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetAttribLocation" offset="assign">
<param name="program" type="GLuint"/>
<param name="name" type="const GLchar *"/>
<return type="GLint"/>
<glx ignore="true"/>
</function>
<function name="GetProgramiv" offset="assign">
<param name="program" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *"/>
<glx ignore="true"/>
</function>
<function name="GetProgramInfoLog" offset="assign">
<param name="program" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="infoLog" type="GLchar *"/>
<glx ignore="true"/>
</function>
<function name="GetShaderiv" offset="assign">
<param name="shader" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *"/>
<glx ignore="true"/>
</function>
<function name="GetShaderInfoLog" offset="assign">
<param name="shader" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="infoLog" type="GLchar *"/>
<glx ignore="true"/>
</function>
<function name="GetShaderSource" offset="assign">
<param name="shader" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="source" type="GLchar *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetUniformfv" offset="assign">
<param name="program" type="GLuint"/>
<param name="location" type="GLint"/>
<param name="params" type="GLfloat *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetUniformiv" offset="assign">
<param name="program" type="GLuint"/>
<param name="location" type="GLint"/>
<param name="params" type="GLint *"/>
<glx ignore="true"/>
</function>
<function name="GetUniformLocation" offset="assign">
<param name="program" type="GLuint"/>
<param name="name" type="const GLchar *"/>
<return type="GLint"/>
<glx ignore="true"/>
</function>
<function name="GetVertexAttribfv" offset="assign">
<param name="index" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx ignore="true"/>
</function>
<function name="GetVertexAttribiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx ignore="true"/>
</function>
<function name="GetVertexAttribPointerv" offset="assign">
<param name="index" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="pointer" type="GLvoid **" output="true"/>
<glx ignore="true"/>
</function>
<function name="IsProgram" offset="assign">
<param name="program" type="GLuint"/>
<return type="GLboolean"/>
<glx ignore="true"/>
</function>
<function name="IsShader" offset="assign">
<param name="shader" type="GLuint"/>
<return type="GLboolean"/>
<glx ignore="true"/>
</function>
<function name="LinkProgram" offset="assign">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="ShaderSource" offset="assign">
<param name="shader" type="GLuint"/>
<param name="count" type="GLsizei"/>
<param name="string" type="const GLchar **"/>
<param name="length" type="const GLint *"/>
<glx ignore="true"/>
</function>
<function name="StencilFuncSeparate" offset="assign">
<param name="face" type="GLenum"/>
<param name="func" type="GLenum"/>
<param name="ref" type="GLint"/>
<param name="mask" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="StencilOpSeparate" offset="assign">
<param name="face" type="GLenum"/>
<param name="sfail" type="GLenum"/>
<param name="zfail" type="GLenum"/>
<param name="zpass" type="GLenum"/>
<glx ignore="true"/>
</function>
<function name="StencilMaskSeparate" offset="assign">
<param name="face" type="GLenum"/>
<param name="mask" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="Uniform1f" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLfloat"/>
<glx ignore="true"/>
</function>
<function name="Uniform1fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="Uniform1i" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLint"/>
<glx ignore="true"/>
</function>
<function name="Uniform1iv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLint *"/>
<glx ignore="true"/>
</function>
<function name="Uniform2f" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLfloat"/>
<param name="v1" type="GLfloat"/>
<glx ignore="true"/>
</function>
<function name="Uniform2fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="Uniform2i" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLint"/>
<param name="v1" type="GLint"/>
<glx ignore="true"/>
</function>
<function name="Uniform2iv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLint *"/>
<glx ignore="true"/>
</function>
<function name="Uniform3f" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLfloat"/>
<param name="v1" type="GLfloat"/>
<param name="v2" type="GLfloat"/>
<glx ignore="true"/>
</function>
<function name="Uniform3fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="Uniform3i" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLint"/>
<param name="v1" type="GLint"/>
<param name="v2" type="GLint"/>
<glx ignore="true"/>
</function>
<function name="Uniform3iv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLint *"/>
<glx ignore="true"/>
</function>
<function name="Uniform4f" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLfloat"/>
<param name="v1" type="GLfloat"/>
<param name="v2" type="GLfloat"/>
<param name="v3" type="GLfloat"/>
<glx ignore="true"/>
</function>
<function name="Uniform4fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="Uniform4i" offset="assign">
<param name="location" type="GLint"/>
<param name="v0" type="GLint"/>
<param name="v1" type="GLint"/>
<param name="v2" type="GLint"/>
<param name="v3" type="GLint"/>
<glx ignore="true"/>
</function>
<function name="Uniform4iv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLint *"/>
<glx ignore="true"/>
</function>
<function name="UniformMatrix2fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="transpose" type="GLboolean"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="UniformMatrix3fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="transpose" type="GLboolean"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="UniformMatrix4fv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="transpose" type="GLboolean"/>
<param name="value" type="const GLfloat *"/>
<glx ignore="true"/>
</function>
<function name="UseProgram" offset="assign">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="ValidateProgram" offset="assign">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>
<function name="VertexAttrib1f" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLfloat"/>
</function>
<function name="VertexAttrib1fv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLfloat *"/>
</function>
<function name="VertexAttrib2f" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
</function>
<function name="VertexAttrib2fv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLfloat *"/>
</function>
<function name="VertexAttrib3f" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
</function>
<function name="VertexAttrib3fv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLfloat *"/>
</function>
<function name="VertexAttrib4f" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
<param name="w" type="GLfloat"/>
</function>
<function name="VertexAttrib4fv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLfloat *"/>
</function>
<function name="VertexAttribPointer" offset="assign">
<param name="index" type="GLuint"/>
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="normalized" type="GLboolean"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
</function>
</category>
</OpenGLAPI>
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<OpenGLAPI>
<!-- This file defines the functions that are needed by Mesa. It
makes sure the generated glapi headers are compatible with Mesa.
It mainly consists of missing functions and aliases in OpenGL ES.
-->
<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- except for those defined by es_COMPAT.xml, these are also needed -->
<category name="compat">
<!-- OpenGL 1.0 -->
<function name="TexGenf" alias="TexGenfOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="117"/>
</function>
<function name="TexGenfv" alias="TexGenfvOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="118"/>
</function>
<function name="TexGeni" alias="TexGeniOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx rop="119"/>
</function>
<function name="TexGeniv" alias="TexGenivOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLint *" variable_param="pname"/>
<glx rop="120"/>
</function>
<function name="GetTexGenfv" alias="GetTexGenfvOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="133"/>
</function>
<function name="GetTexGeniv" alias="GetTexGenivOES" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="134"/>
</function>
<!-- OpenGL 1.2 -->
<function name="BlendColor" offset="336" static_dispatch="false">
<param name="red" type="GLclampf"/>
<param name="green" type="GLclampf"/>
<param name="blue" type="GLclampf"/>
<param name="alpha" type="GLclampf"/>
<glx rop="4096"/>
</function>
<function name="BlendEquation" alias="BlendEquationOES" static_dispatch="false">
<param name="mode" type="GLenum"/>
<glx rop="4097"/>
</function>
<function name="TexImage3D" offset="371" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
<glx rop="4114" large="true"/>
</function>
<function name="TexSubImage3D" offset="372" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="UNUSED" type="GLuint" padding="true"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
<glx rop="4115" large="true"/>
</function>
<function name="CopyTexSubImage3D" offset="373" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4123"/>
</function>
<!-- GL_ARB_multitexture -->
<function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false">
<param name="texture" type="GLenum"/>
<glx rop="197"/>
</function>
<function name="ClientActiveTextureARB" alias="ClientActiveTexture" static_dispatch="false">
<param name="texture" type="GLenum"/>
<glx handcode="true"/>
</function>
<function name="MultiTexCoord4fARB" alias="MultiTexCoord4f" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="s" type="GLfloat"/>
<param name="t" type="GLfloat"/>
<param name="r" type="GLfloat"/>
<param name="q" type="GLfloat"/>
</function>
</category>
</OpenGLAPI>
+699
View File
@@ -0,0 +1,699 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 1.x extensions -->
<OpenGLAPI>
<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- part of es1.1 extension pack -->
<category name="GL_OES_blend_equation_separate" number="1">
<enum name="BLEND_EQUATION_RGB_OES" count="1" value="0x8009">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_EQUATION_ALPHA_OES" count="1" value="0x883D">
<size name="Get" mode="get"/>
</enum>
<function name="BlendEquationSeparateOES" offset="assign">
<param name="modeRGB" type="GLenum"/>
<param name="modeA" type="GLenum"/>
<glx rop="4228"/>
</function>
</category>
<!-- part of es1.1 extension pack -->
<category name="GL_OES_blend_func_separate" number="2">
<enum name="BLEND_DST_RGB_OES" count="1" value="0x80C8">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_SRC_RGB_OES" count="1" value="0x80C9">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_DST_ALPHA_OES" count="1" value="0x80CA">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_SRC_ALPHA_OES" count="1" value="0x80CB">
<size name="Get" mode="get"/>
</enum>
<function name="BlendFuncSeparateOES" offset="assign">
<param name="sfactorRGB" type="GLenum"/>
<param name="dfactorRGB" type="GLenum"/>
<param name="sfactorAlpha" type="GLenum"/>
<param name="dfactorAlpha" type="GLenum"/>
<glx rop="4134"/>
</function>
</category>
<!-- part of es1.1 extension pack -->
<category name="GL_OES_blend_subtract" number="3">
<enum name="FUNC_ADD_OES" value="0x8006"/>
<enum name="BLEND_EQUATION_OES" count="1" value="0x8009">
<size name="Get" mode="get"/>
</enum>
<enum name="FUNC_SUBTRACT_OES" value="0x800A"/>
<enum name="FUNC_REVERSE_SUBTRACT_OES" value="0x800B"/>
<function name="BlendEquationOES" offset="337">
<param name="mode" type="GLenum"/>
<glx rop="4097"/>
</function>
</category>
<!-- core addition to es1.0 and later -->
<category name="GL_OES_byte_coordinates" number="4">
<enum name="BYTE" value="0x1400"/>
</category>
<!-- optional for es1.1 -->
<category name="GL_OES_draw_texture" number="7">
<enum name="TEXTURE_CROP_RECT_OES" value="0x8B9D"/>
<function name="DrawTexiOES" offset="assign">
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="z" type="GLint"/>
<param name="width" type="GLint"/>
<param name="height" type="GLint"/>
</function>
<function name="DrawTexivOES" offset="assign">
<param name="coords" type="const GLint *" count="5"/>
</function>
<function name="DrawTexfOES" offset="assign">
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
<param name="width" type="GLfloat"/>
<param name="height" type="GLfloat"/>
</function>
<function name="DrawTexfvOES" offset="assign">
<param name="coords" type="const GLfloat *" count="5"/>
</function>
<function name="DrawTexsOES" offset="assign">
<param name="x" type="GLshort"/>
<param name="y" type="GLshort"/>
<param name="z" type="GLshort"/>
<param name="width" type="GLshort"/>
<param name="height" type="GLshort"/>
</function>
<function name="DrawTexsvOES" offset="assign">
<param name="coords" type="const GLshort *" count="5"/>
</function>
<function name="DrawTexxOES" offset="assign">
<param name="x" type="GLfixed"/>
<param name="y" type="GLfixed"/>
<param name="z" type="GLfixed"/>
<param name="width" type="GLfixed"/>
<param name="height" type="GLfixed"/>
</function>
<function name="DrawTexxvOES" offset="assign">
<param name="coords" type="const GLfixed *" count="5"/>
</function>
<!-- TexParameter{ifx}v is skipped here -->
</category>
<!-- core addition to es1.0 and later -->
<category name="GL_OES_fixed_point" number="9">
<enum name="FIXED_OES" value="0x140C"/>
<!-- additon to es1.0 -->
<function name="AlphaFuncxOES" alias="AlphaFuncx">
<param name="func" type="GLenum"/>
<param name="ref" type="GLclampx"/>
</function>
<function name="ClearColorxOES" alias="ClearColorx">
<param name="red" type="GLclampx"/>
<param name="green" type="GLclampx"/>
<param name="blue" type="GLclampx"/>
<param name="alpha" type="GLclampx"/>
</function>
<function name="ClearDepthxOES" alias="ClearDepthx">
<param name="depth" type="GLclampx"/>
</function>
<function name="Color4xOES" alias="Color4x">
<param name="red" type="GLfixed"/>
<param name="green" type="GLfixed"/>
<param name="blue" type="GLfixed"/>
<param name="alpha" type="GLfixed"/>
</function>
<function name="DepthRangexOES" alias="DepthRangex">
<param name="zNear" type="GLclampx"/>
<param name="zFar" type="GLclampx"/>
</function>
<function name="FogxOES" alias="Fogx">
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="FogxvOES" alias="Fogxv">
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
<function name="FrustumxOES" alias="Frustumx">
<param name="left" type="GLfixed"/>
<param name="right" type="GLfixed"/>
<param name="bottom" type="GLfixed"/>
<param name="top" type="GLfixed"/>
<param name="zNear" type="GLfixed"/>
<param name="zFar" type="GLfixed"/>
</function>
<function name="LightModelxOES" alias="LightModelx">
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="LightModelxvOES" alias="LightModelxv">
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
<function name="LightxOES" alias="Lightx">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="LightxvOES" alias="Lightxv">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
<function name="LineWidthxOES" alias="LineWidthx">
<param name="width" type="GLfixed"/>
</function>
<function name="LoadMatrixxOES" alias="LoadMatrixx">
<param name="m" type="const GLfixed *" count="16"/>
</function>
<function name="MaterialxOES" alias="Materialx">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="MaterialxvOES" alias="Materialxv">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
<function name="MultiTexCoord4xOES" alias="MultiTexCoord4x">
<param name="target" type="GLenum"/>
<param name="s" type="GLfixed"/>
<param name="t" type="GLfixed"/>
<param name="r" type="GLfixed"/>
<param name="q" type="GLfixed"/>
</function>
<function name="MultMatrixxOES" alias="MultMatrixx">
<param name="m" type="const GLfixed *" count="16"/>
</function>
<function name="Normal3xOES" alias="Normal3x">
<param name="nx" type="GLfixed"/>
<param name="ny" type="GLfixed"/>
<param name="nz" type="GLfixed"/>
</function>
<function name="OrthoxOES" alias="Orthox">
<param name="left" type="GLfixed"/>
<param name="right" type="GLfixed"/>
<param name="bottom" type="GLfixed"/>
<param name="top" type="GLfixed"/>
<param name="zNear" type="GLfixed"/>
<param name="zFar" type="GLfixed"/>
</function>
<function name="PointSizexOES" alias="PointSizex">
<param name="size" type="GLfixed"/>
</function>
<function name="PolygonOffsetxOES" alias="PolygonOffsetx">
<param name="factor" type="GLfixed"/>
<param name="units" type="GLfixed"/>
</function>
<function name="RotatexOES" alias="Rotatex">
<param name="angle" type="GLfixed"/>
<param name="x" type="GLfixed"/>
<param name="y" type="GLfixed"/>
<param name="z" type="GLfixed"/>
</function>
<function name="SampleCoveragexOES" alias="SampleCoveragex">
<param name="value" type="GLclampx"/>
<param name="invert" type="GLboolean"/>
</function>
<function name="ScalexOES" alias="Scalex">
<param name="x" type="GLfixed"/>
<param name="y" type="GLfixed"/>
<param name="z" type="GLfixed"/>
</function>
<function name="TexEnvxOES" alias="TexEnvx">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="TexEnvxvOES" alias="TexEnvxv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
<function name="TexParameterxOES" alias="TexParameterx">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="TranslatexOES" alias="Translatex">
<param name="x" type="GLfixed"/>
<param name="y" type="GLfixed"/>
<param name="z" type="GLfixed"/>
</function>
<!-- additon to es1.1 -->
<function name="ClipPlanexOES" alias="ClipPlanex">
<param name="plane" type="GLenum"/>
<param name="equation" type="const GLfixed *" count="4"/>
</function>
<function name="GetClipPlanexOES" alias="GetClipPlanex">
<param name="plane" type="GLenum"/>
<param name="equation" type="GLfixed *" output="true" count="4"/>
</function>
<function name="GetFixedvOES" alias="GetFixedv">
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="GetLightxvOES" alias="GetLightxv">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="GetMaterialxvOES" alias="GetMaterialxv">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="GetTexEnvxvOES" alias="GetTexEnvxv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="GetTexParameterxvOES" alias="GetTexParameterxv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="PointParameterxOES" alias="PointParameterx">
<param name="pname" type="GLenum"/>
<param name="param" type="GLfixed"/>
</function>
<function name="PointParameterxvOES" alias="PointParameterxv">
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *"/>
</function>
<function name="TexParameterxvOES" alias="TexParameterxv">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
</category>
<!-- part of es1.1 extension pack -->
<category name="GL_OES_framebuffer_object" number="10">
<enum name="NONE_OES" value="0"/>
<enum name="INVALID_FRAMEBUFFER_OPERATION_OES" value="0x0506"/>
<enum name="RGBA4_OES" value="0x8056"/>
<enum name="RGB5_A1_OES" value="0x8057"/>
<enum name="DEPTH_COMPONENT16_OES" value="0x81A5"/>
<enum name="MAX_RENDERBUFFER_SIZE_OES" value="0x84E8"/>
<enum name="FRAMEBUFFER_BINDING_OES" value="0x8CA6"/>
<enum name="RENDERBUFFER_BINDING_OES" value="0x8CA7"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" value="0x8CD0"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" value="0x8CD1"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" value="0x8CD2"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" value="0x8CD3"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
<enum name="FRAMEBUFFER_COMPLETE_OES" value="0x8CD5"/>
<enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES" value="0x8CD6"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES" value="0x8CD7"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES" value="0x8CD9"/>
<enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_OES" value="0x8CDA"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES" value="0x8CDB"/>
<enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES" value="0x8CDC"/>
<enum name="FRAMEBUFFER_UNSUPPORTED_OES" value="0x8CDD"/>
<enum name="COLOR_ATTACHMENT0_OES" value="0x8CE0"/>
<enum name="DEPTH_ATTACHMENT_OES" value="0x8D00"/>
<enum name="STENCIL_ATTACHMENT_OES" value="0x8D20"/>
<enum name="FRAMEBUFFER_OES" value="0x8D40"/>
<enum name="RENDERBUFFER_OES" value="0x8D41"/>
<enum name="RENDERBUFFER_WIDTH_OES" value="0x8D42"/>
<enum name="RENDERBUFFER_HEIGHT_OES" value="0x8D43"/>
<enum name="RENDERBUFFER_INTERNAL_FORMAT_OES" value="0x8D44"/>
<enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
<enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
<enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
<enum name="RENDERBUFFER_RED_SIZE_OES" value="0x8D50"/>
<enum name="RENDERBUFFER_GREEN_SIZE_OES" value="0x8D51"/>
<enum name="RENDERBUFFER_BLUE_SIZE_OES" value="0x8D52"/>
<enum name="RENDERBUFFER_ALPHA_SIZE_OES" value="0x8D53"/>
<enum name="RENDERBUFFER_DEPTH_SIZE_OES" value="0x8D54"/>
<enum name="RENDERBUFFER_STENCIL_SIZE_OES" value="0x8D55"/>
<enum name="RGB565_OES" value="0x8D62"/>
<function name="BindFramebufferOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
</function>
<function name="BindRenderbufferOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="CheckFramebufferStatusOES" offset="assign">
<param name="target" type="GLenum"/>
<return type="GLenum"/>
</function>
<function name="DeleteFramebuffersOES" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="const GLuint *" count="n"/>
</function>
<function name="DeleteRenderbuffersOES" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="const GLuint *" count="n"/>
</function>
<function name="FramebufferRenderbufferOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="renderbuffertarget" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="FramebufferTexture2DOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
<function name="GenerateMipmapOES" offset="assign">
<param name="target" type="GLenum"/>
</function>
<function name="GenFramebuffersOES" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="GenRenderbuffersOES" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="GetFramebufferAttachmentParameterivOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="GetRenderbufferParameterivOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="IsFramebufferOES" offset="assign">
<param name="framebuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="IsRenderbufferOES" offset="assign">
<param name="renderbuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="RenderbufferStorageOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
</function>
</category>
<!-- core addition to es1.1 -->
<category name="GL_OES_matrix_get" number="11">
<enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/>
<enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/>
<enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/>
</category>
<!-- optional for es1.1 -->
<category name="GL_OES_matrix_palette" number="12">
<enum name="MAX_VERTEX_UNITS_OES" value="0x86A4"/>
<enum name="WEIGHT_ARRAY_TYPE_OES" value="0x86A9"/>
<enum name="WEIGHT_ARRAY_STRIDE_OES" value="0x86AA"/>
<enum name="WEIGHT_ARRAY_SIZE_OES" value="0x86AB"/>
<enum name="WEIGHT_ARRAY_POINTER_OES" value="0x86AC"/>
<enum name="WEIGHT_ARRAY_OES" value="0x86AD"/>
<enum name="MATRIX_PALETTE_OES" value="0x8840"/>
<enum name="MAX_PALETTE_MATRICES_OES" value="0x8842"/>
<enum name="CURRENT_PALETTE_MATRIX_OES" value="0x8843"/>
<enum name="MATRIX_INDEX_ARRAY_OES" value="0x8844"/>
<enum name="MATRIX_INDEX_ARRAY_SIZE_OES" value="0x8846"/>
<enum name="MATRIX_INDEX_ARRAY_TYPE_OES" value="0x8847"/>
<enum name="MATRIX_INDEX_ARRAY_STRIDE_OES" value="0x8848"/>
<enum name="MATRIX_INDEX_ARRAY_POINTER_OES" value="0x8849"/>
<enum name="WEIGHT_ARRAY_BUFFER_BINDING_OES" value="0x889E"/>
<enum name="MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES" value="0x8B9E"/>
<function name="CurrentPaletteMatrixOES">
<param name="matrixpaletteindex" type="GLuint"/>
</function>
<function name="LoadPaletteFromModelViewMatrixOES">
</function>
<function name="MatrixIndexPointerOES">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
</function>
<function name="WeightPointerOES">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
</function>
</category>
<!-- required for es1.1 -->
<category name="GL_OES_point_size_array" number="14">
<enum name="POINT_SIZE_ARRAY_TYPE_OES" value="0x898A"/>
<enum name="POINT_SIZE_ARRAY_STRIDE_OES" value="0x898B"/>
<enum name="POINT_SIZE_ARRAY_POINTER_OES" value="0x898C"/>
<enum name="POINT_SIZE_ARRAY_OES" value="0x8B9C"/>
<enum name="POINT_SIZE_ARRAY_BUFFER_BINDING_OES" value="0x8B9F"/>
<function name="PointSizePointerOES" offset="assign">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
</function>
</category>
<!-- required for es1.1 -->
<category name="GL_OES_point_sprite" number="15">
<enum name="POINT_SPRITE_OES" value="0x8861"/>
<enum name="COORD_REPLACE_OES" value="0x8862"/>
</category>
<!-- optional for es1.0 -->
<category name="GL_OES_query_matrix" number="16">
<function name="QueryMatrixxOES" offset="assign">
<param name="mantissa" type="GLfixed *" count="16" />
<param name="exponent" type="GLint *" count="16" />
<return type="GLbitfield"/>
</function>
</category>
<!-- required for es1.0 and later -->
<category name="GL_OES_read_format" number="17">
<enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/>
<enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/>
</category>
<!-- core addition to es1.0 and later -->
<category name="GL_OES_single_precision" number="18">
<!-- additon to es1.0 -->
<function name="ClearDepthfOES" alias="ClearDepthf">
<param name="depth" type="GLclampf"/>
</function>
<function name="DepthRangefOES" alias="DepthRangef">
<param name="zNear" type="GLclampf"/>
<param name="zFar" type="GLclampf"/>
</function>
<function name="FrustumfOES" alias="Frustumf">
<param name="left" type="GLfloat"/>
<param name="right" type="GLfloat"/>
<param name="bottom" type="GLfloat"/>
<param name="top" type="GLfloat"/>
<param name="zNear" type="GLfloat"/>
<param name="zFar" type="GLfloat"/>
</function>
<function name="OrthofOES" alias="Orthof">
<param name="left" type="GLfloat"/>
<param name="right" type="GLfloat"/>
<param name="bottom" type="GLfloat"/>
<param name="top" type="GLfloat"/>
<param name="zNear" type="GLfloat"/>
<param name="zFar" type="GLfloat"/>
</function>
<!-- additon to es1.1 -->
<function name="ClipPlanefOES" alias="ClipPlanef">
<param name="plane" type="GLenum"/>
<param name="equation" type="const GLfloat *" count="4"/>
</function>
<function name="GetClipPlanefOES" alias="GetClipPlanef">
<param name="plane" type="GLenum"/>
<param name="equation" type="GLfloat *" output="true" count="4"/>
</function>
</category>
<!-- part of es1.1 extension pack -->
<category name="GL_OES_texture_cube_map" number="20">
<enum name="TEXTURE_GEN_MODE_OES" value="0x2500"/>
<enum name="NORMAL_MAP_OES" value="0x8511"/>
<enum name="REFLECTION_MAP_OES" value="0x8512"/>
<enum name="TEXTURE_CUBE_MAP_OES" value="0x8513"/>
<enum name="TEXTURE_BINDING_CUBE_MAP_OES" value="0x8514"/>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_X_OES" value="0x8515"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_OES" value="0x8516"/>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_OES" value="0x8517"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" value="0x8518"/>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_OES" value="0x8519"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" value="0x851A"/>
<enum name="MAX_CUBE_MAP_TEXTURE_SIZE_OES" value="0x851C"/>
<enum name="TEXTURE_GEN_STR_OES" value="0x8D60"/>
<function name="GetTexGenfvOES" offset="279">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="133"/>
</function>
<function name="GetTexGenivOES" offset="280">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="134"/>
</function>
<function name="GetTexGenxvOES" offset="assign">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
</function>
<function name="TexGenfOES" offset="190">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="117"/>
</function>
<function name="TexGenfvOES" offset="191">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="118"/>
</function>
<function name="TexGeniOES" offset="192">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx rop="119"/>
</function>
<function name="TexGenivOES" offset="193">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLint *" variable_param="pname"/>
<glx rop="120"/>
</function>
<function name="TexGenxOES" offset="assign">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
</function>
<function name="TexGenxvOES" offset="assign">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfixed *" variable_param="pname"/>
</function>
</category>
<category name="GL_OES_texture_env_crossbar" number="21">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_OES_texture_mirrored_repeat" number="22">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_EXT_texture_lod_bias" number="60">
<enum name="TEXTURE_FILTER_CONTROL_EXT" value="0x8500"/>
<enum name="TEXTURE_LOD_BIAS_EXT" value="0x8501"/>
<enum name="MAX_TEXTURE_LOD_BIAS_EXT" value="0x84FD"/>
</category>
</OpenGLAPI>
+294
View File
@@ -0,0 +1,294 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 2.x API -->
<OpenGLAPI>
<xi:include href="base2_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- core subset of OpenGL 2.0 defined in OpenGL ES 2.0 -->
<category name="core2.0">
<!-- addition to base1.0 -->
<enum name="NONE" value="0x0"/>
<enum name="INT" count="4" value="0x1404">
<size name="CallLists"/>
</enum>
<enum name="UNSIGNED_INT" count="4" value="0x1405">
<size name="CallLists"/>
</enum>
<enum name="STENCIL_INDEX" value="0x1901"/>
<enum name="DEPTH_COMPONENT" value="0x1902"/>
<function name="TexImage2D" offset="183">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLint"/> <!-- XXX the actual type is GLenum... -->
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
<glx rop="110" large="true"/>
</function>
<!-- addition to base1.1 -->
<enum name="RGBA4" value="0x8056"/>
<enum name="RGB5_A1" value="0x8057"/>
<!-- addition to base1.2 -->
<enum name="CONSTANT_COLOR" value="0x8001"/>
<enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/>
<enum name="CONSTANT_ALPHA" value="0x8003"/>
<enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/>
<enum name="BLEND_COLOR" count="4" value="0x8005">
<size name="Get" mode="get"/>
</enum>
<enum name="FUNC_ADD" value="0x8006"/>
<enum name="BLEND_EQUATION" count="1" value="0x8009">
<size name="Get" mode="get"/>
</enum>
<enum name="FUNC_SUBTRACT" value="0x800A"/>
<enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/>
<function name="BlendColor" offset="336">
<param name="red" type="GLclampf"/>
<param name="green" type="GLclampf"/>
<param name="blue" type="GLclampf"/>
<param name="alpha" type="GLclampf"/>
<glx rop="4096"/>
</function>
<function name="BlendEquation" offset="337">
<param name="mode" type="GLenum"/>
<glx rop="4097"/>
</function>
<!-- addition to base1.3 -->
<enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/>
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/>
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/>
<enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C">
<size name="Get" mode="get"/>
</enum>
<!-- addition to base1.4 -->
<enum name="BLEND_DST_RGB" count="1" value="0x80C8">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_SRC_RGB" count="1" value="0x80C9">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_DST_ALPHA" count="1" value="0x80CA">
<size name="Get" mode="get"/>
</enum>
<enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB">
<size name="Get" mode="get"/>
</enum>
<enum name="DEPTH_COMPONENT16" value="0x81A5"/>
<enum name="MIRRORED_REPEAT" value="0x8370"/>
<enum name="INCR_WRAP" value="0x8507"/>
<enum name="DECR_WRAP" value="0x8508"/>
<function name="BlendFuncSeparate" offset="assign">
<param name="sfactorRGB" type="GLenum"/>
<param name="dfactorRGB" type="GLenum"/>
<param name="sfactorAlpha" type="GLenum"/>
<param name="dfactorAlpha" type="GLenum"/>
<glx rop="4134"/>
</function>
<!-- addition to base1.5 -->
<enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" count="1" value="0x889F">
<size name="GetVertexAttribdv" mode="get"/>
<size name="GetVertexAttribfv" mode="get"/>
<size name="GetVertexAttribiv" mode="get"/>
</enum>
<enum name="STREAM_DRAW" value="0x88E0"/>
<!-- addition to base2.0 -->
<!-- base2.0 should have everything defined -->
</category>
<!-- OpenGL ES 2.0 -->
<category name="es2.0">
<!-- addition to core2.0 -->
<enum name="LOW_FLOAT" value="0x8DF0"/>
<enum name="MEDIUM_FLOAT" value="0x8DF1"/>
<enum name="HIGH_FLOAT" value="0x8DF2"/>
<enum name="LOW_INT" value="0x8DF3"/>
<enum name="MEDIUM_INT" value="0x8DF4"/>
<enum name="HIGH_INT" value="0x8DF5"/>
<enum name="SHADER_BINARY_FORMATS" value="0x8DF8"/>
<enum name="NUM_SHADER_BINARY_FORMATS" value="0x8DF9"/>
<enum name="SHADER_COMPILER" value="0x8DFA"/>
<enum name="MAX_VERTEX_UNIFORM_VECTORS" value="0x8DFB"/>
<enum name="MAX_VARYING_VECTORS" value="0x8DFC"/>
<enum name="MAX_FRAGMENT_UNIFORM_VECTORS" value="0x8DFD"/>
<function name="GetShaderPrecisionFormat" offset="assign">
<param name="shadertype" type="GLenum"/>
<param name="precisiontype" type="GLenum"/>
<param name="range" type="GLint *"/>
<param name="precision" type="GLint *"/>
</function>
<function name="ReleaseShaderCompiler" offset="assign">
</function>
<function name="ShaderBinary" offset="assign">
<param name="n" type="GLsizei"/>
<param name="shaders" type="const GLuint *"/>
<param name="binaryformat" type="GLenum"/>
<param name="binary" type="const GLvoid *"/>
<param name="length" type="GLsizei"/>
</function>
<!-- from GL_OES_fixed_point -->
<enum name="FIXED" value="0x140C"/>
<type name="fixed" size="4" />
<!-- from GL_OES_framebuffer_object -->
<enum name="INVALID_FRAMEBUFFER_OPERATION" value="0x0506"/>
<enum name="MAX_RENDERBUFFER_SIZE" value="0x84E8"/>
<enum name="FRAMEBUFFER_BINDING" value="0x8CA6"/>
<enum name="RENDERBUFFER_BINDING" value="0x8CA7"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" value="0x8CD0"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" value="0x8CD1"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" value="0x8CD2"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" value="0x8CD3"/>
<enum name="FRAMEBUFFER_COMPLETE" value="0x8CD5"/>
<enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT" value="0x8CD6"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" value="0x8CD7"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS" value="0x8CD9"/>
<enum name="FRAMEBUFFER_UNSUPPORTED" value="0x8CDD"/>
<enum name="COLOR_ATTACHMENT0" value="0x8CE0"/>
<enum name="DEPTH_ATTACHMENT" value="0x8D00"/>
<enum name="STENCIL_ATTACHMENT" value="0x8D20"/>
<enum name="FRAMEBUFFER" value="0x8D40"/>
<enum name="RENDERBUFFER" value="0x8D41"/>
<enum name="RENDERBUFFER_WIDTH" value="0x8D42"/>
<enum name="RENDERBUFFER_HEIGHT" value="0x8D43"/>
<enum name="RENDERBUFFER_INTERNAL_FORMAT" value="0x8D44"/>
<enum name="STENCIL_INDEX8" value="0x8D48"/>
<enum name="RENDERBUFFER_RED_SIZE" value="0x8D50"/>
<enum name="RENDERBUFFER_GREEN_SIZE" value="0x8D51"/>
<enum name="RENDERBUFFER_BLUE_SIZE" value="0x8D52"/>
<enum name="RENDERBUFFER_ALPHA_SIZE" value="0x8D53"/>
<enum name="RENDERBUFFER_DEPTH_SIZE" value="0x8D54"/>
<enum name="RENDERBUFFER_STENCIL_SIZE" value="0x8D55"/>
<enum name="RGB565" value="0x8D62"/>
<function name="BindFramebuffer" offset="assign">
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
</function>
<function name="BindRenderbuffer" offset="assign">
<param name="target" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="CheckFramebufferStatus" offset="assign">
<param name="target" type="GLenum"/>
<return type="GLenum"/>
</function>
<function name="DeleteFramebuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="const GLuint *" count="n"/>
</function>
<function name="DeleteRenderbuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="const GLuint *" count="n"/>
</function>
<function name="FramebufferRenderbuffer" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="renderbuffertarget" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="FramebufferTexture2D" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
<function name="GenerateMipmap" offset="assign">
<param name="target" type="GLenum"/>
</function>
<function name="GenFramebuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="GenRenderbuffers" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="GetFramebufferAttachmentParameteriv" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="GetRenderbufferParameteriv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="IsFramebuffer" offset="assign">
<param name="framebuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="IsRenderbuffer" offset="assign">
<param name="renderbuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="RenderbufferStorage" offset="assign">
<param name="target" type="GLenum"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
</function>
<!-- from GL_OES_read_format -->
<enum name="IMPLEMENTATION_COLOR_READ_TYPE" value="0x8B9A"/>
<enum name="IMPLEMENTATION_COLOR_READ_FORMAT" value="0x8B9B"/>
<!-- from GL_OES_single_precision -->
<function name="ClearDepthf" offset="assign">
<param name="depth" type="GLclampf"/>
</function>
<function name="DepthRangef" offset="assign">
<param name="zNear" type="GLclampf"/>
<param name="zFar" type="GLclampf"/>
</function>
</category>
<xi:include href="es2_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="es2_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</OpenGLAPI>
+368
View File
@@ -0,0 +1,368 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<OpenGLAPI>
<!-- This file defines the functions that are needed by Mesa. It
makes sure the generated glapi headers are compatible with Mesa.
It mainly consists of missing functions and aliases in OpenGL ES.
-->
<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- except for those defined by es_COMPAT.xml, these are also needed -->
<category name="compat">
<!-- OpenGL 1.0 -->
<function name="Color4f" offset="29" vectorequiv="Color4fv" static_dispatch="false">
<param name="red" type="GLfloat"/>
<param name="green" type="GLfloat"/>
<param name="blue" type="GLfloat"/>
<param name="alpha" type="GLfloat"/>
</function>
<function name="Color4ub" offset="35" vectorequiv="Color4ubv" static_dispatch="false">
<param name="red" type="GLubyte"/>
<param name="green" type="GLubyte"/>
<param name="blue" type="GLubyte"/>
<param name="alpha" type="GLubyte"/>
</function>
<function name="Normal3f" offset="56" vectorequiv="Normal3fv" static_dispatch="false">
<param name="nx" type="GLfloat"/>
<param name="ny" type="GLfloat"/>
<param name="nz" type="GLfloat"/>
</function>
<function name="Fogf" offset="153" static_dispatch="false">
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="80"/>
</function>
<function name="Fogfv" offset="154" static_dispatch="false">
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="81"/>
</function>
<function name="Lightf" offset="159" static_dispatch="false">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="86"/>
</function>
<function name="Lightfv" offset="160" static_dispatch="false">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="87"/>
</function>
<function name="LightModelf" offset="163" static_dispatch="false">
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="90"/>
</function>
<function name="LightModelfv" offset="164" static_dispatch="false">
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="91"/>
</function>
<function name="Materialf" offset="169" static_dispatch="false">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="96"/>
</function>
<function name="Materialfv" offset="170" static_dispatch="false">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="97"/>
</function>
<function name="PointSize" offset="173" static_dispatch="false">
<param name="size" type="GLfloat"/>
<glx rop="100"/>
</function>
<function name="ShadeModel" offset="177" static_dispatch="false">
<param name="mode" type="GLenum"/>
<glx rop="104"/>
</function>
<function name="TexEnvf" offset="184" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="111"/>
</function>
<function name="TexEnvfv" offset="185" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="112"/>
</function>
<function name="TexEnvi" offset="186" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx rop="113"/>
</function>
<function name="TexEnviv" offset="187" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLint *" variable_param="pname"/>
<glx rop="114"/>
</function>
<function name="TexGenf" offset="190" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLfloat"/>
<glx rop="117"/>
</function>
<function name="TexGenfv" offset="191" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLfloat *" variable_param="pname"/>
<glx rop="118"/>
</function>
<function name="TexGeni" offset="192" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="param" type="GLint"/>
<glx rop="119"/>
</function>
<function name="TexGeniv" offset="193" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="const GLint *" variable_param="pname"/>
<glx rop="120"/>
</function>
<function name="AlphaFunc" offset="240" static_dispatch="false">
<param name="func" type="GLenum"/>
<param name="ref" type="GLclampf"/>
<glx rop="159"/>
</function>
<function name="LogicOp" offset="242" static_dispatch="false">
<param name="opcode" type="GLenum"/>
<glx rop="161"/>
</function>
<function name="GetLightfv" offset="264" static_dispatch="false">
<param name="light" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="118"/>
</function>
<function name="GetMaterialfv" offset="269" static_dispatch="false">
<param name="face" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="123"/>
</function>
<function name="GetTexEnvfv" offset="276" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="130"/>
</function>
<function name="GetTexEnviv" offset="277" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="131"/>
</function>
<function name="GetTexGenfv" offset="279" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
<glx sop="133"/>
</function>
<function name="GetTexGeniv" offset="280" static_dispatch="false">
<param name="coord" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true" variable_param="pname"/>
<glx sop="134"/>
</function>
<function name="LoadIdentity" offset="290" static_dispatch="false">
<glx rop="176"/>
</function>
<function name="LoadMatrixf" offset="291" static_dispatch="false">
<param name="m" type="const GLfloat *" count="16"/>
<glx rop="177"/>
</function>
<function name="MatrixMode" offset="293" static_dispatch="false">
<param name="mode" type="GLenum"/>
<glx rop="179"/>
</function>
<function name="MultMatrixf" offset="294" static_dispatch="false">
<param name="m" type="const GLfloat *" count="16"/>
<glx rop="180"/>
</function>
<function name="PopMatrix" offset="297" static_dispatch="false">
<glx rop="183"/>
</function>
<function name="PushMatrix" offset="298" static_dispatch="false">
<glx rop="184"/>
</function>
<function name="Rotatef" offset="300" static_dispatch="false">
<param name="angle" type="GLfloat"/>
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
<glx rop="186"/>
</function>
<function name="Scalef" offset="302" static_dispatch="false">
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
<glx rop="188"/>
</function>
<function name="Translatef" offset="304" static_dispatch="false">
<param name="x" type="GLfloat"/>
<param name="y" type="GLfloat"/>
<param name="z" type="GLfloat"/>
<glx rop="190"/>
</function>
<!-- OpenGL 1.1 -->
<function name="ColorPointer" offset="308" static_dispatch="false">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<glx handcode="true"/>
</function>
<function name="DisableClientState" offset="309" static_dispatch="false">
<param name="array" type="GLenum"/>
<glx handcode="true"/>
</function>
<function name="EnableClientState" offset="313" static_dispatch="false">
<param name="array" type="GLenum"/>
<glx handcode="true"/>
</function>
<function name="NormalPointer" offset="318" static_dispatch="false">
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<glx handcode="true"/>
</function>
<function name="TexCoordPointer" offset="320" static_dispatch="false">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<glx handcode="true"/>
</function>
<function name="VertexPointer" offset="321" static_dispatch="false">
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
<glx handcode="true"/>
</function>
<function name="GetPointerv" offset="329" static_dispatch="false">
<param name="pname" type="GLenum"/>
<param name="params" type="GLvoid **" output="true"/>
<glx handcode="true"/>
</function>
<!-- OpenGL 1.2 -->
<function name="TexImage3D" alias="TexImage3DOES" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
<glx rop="4114" large="true"/>
</function>
<function name="TexSubImage3D" alias="TexSubImage3DOES" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="UNUSED" type="GLuint" padding="true"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
<glx rop="4115" large="true"/>
</function>
<function name="CopyTexSubImage3D" alias="CopyTexSubImage3DOES" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4123"/>
</function>
<!-- GL_ARB_multitexture -->
<function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false">
<param name="texture" type="GLenum"/>
<glx rop="197"/>
</function>
<function name="ClientActiveTextureARB" offset="375" static_dispatch="false">
<param name="texture" type="GLenum"/>
<glx handcode="true"/>
</function>
<function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false">
<param name="target" type="GLenum"/>
<param name="s" type="GLfloat"/>
<param name="t" type="GLfloat"/>
<param name="r" type="GLfloat"/>
<param name="q" type="GLfloat"/>
</function>
</category>
</OpenGLAPI>
+162
View File
@@ -0,0 +1,162 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES 2.x extensions -->
<OpenGLAPI>
<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<category name="GL_OES_texture_3D" number="34">
<enum name="TEXTURE_BINDING_3D_OES" value="0x806A"/>
<enum name="TEXTURE_3D_OES" value="0x806F"/>
<enum name="TEXTURE_WRAP_R_OES" value="0x8072"/>
<enum name="MAX_3D_TEXTURE_SIZE_OES" value="0x8073"/>
<enum name="SAMPLER_3D_OES" value="0x8B5F"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
<function name="CompressedTexImage3DOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="imageSize" type="GLsizei" counter="true"/>
<param name="data" type="const GLvoid *" count="imageSize"/>
<glx rop="216" handcode="client"/>
</function>
<function name="CompressedTexSubImage3DOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="imageSize" type="GLsizei" counter="true"/>
<param name="data" type="const GLvoid *" count="imageSize"/>
<glx rop="219" handcode="client"/>
</function>
<function name="CopyTexSubImage3DOES" offset="373">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4123"/>
</function>
<function name="FramebufferTexture3DOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="zoffset" type="GLint"/>
<glx rop="4323"/>
</function>
<function name="TexImage3DOES" offset="371">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
<glx rop="4114" large="true"/>
</function>
<function name="TexSubImage3DOES" offset="372">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="UNUSED" type="GLuint" padding="true"/>
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
<glx rop="4115" large="true"/>
</function>
</category>
<!-- the other name is OES_texture_float_linear -->
<category name="OES_texture_half_float_linear" number="35">
<!-- No new functions, types, enums. -->
</category>
<!-- the other name is OES_texture_float -->
<category name="OES_texture_half_float" number="36">
<enum name="HALF_FLOAT_OES" value="0x8D61"/>
</category>
<category name="GL_OES_texture_npot" number="37">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_OES_vertex_half_float" number="38">
<enum name="HALF_FLOAT_OES" value="0x8D61"/>
</category>
<category name="GL_EXT_texture_type_2_10_10_10_REV" number="42">
<enum name="UNSIGNED_INT_2_10_10_10_REV_EXT" value="0x8368"/>
</category>
<category name="GL_OES_packed_depth_stencil" number="43">
<enum name="DEPTH_STENCIL_OES" value="0x84F9"/>
<enum name="UNSIGNED_INT_24_8_OES" value="0x84FA"/>
<enum name="DEPTH24_STENCIL8_OES" value="0x88F0"/>
</category>
<category name="GL_OES_depth_texture" number="44">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_OES_standard_derivatives" number="45">
<enum name="FRAGMENT_SHADER_DERIVATIVE_HINT_OES" value="0x8B8B"/>
</category>
<category name="GL_OES_vertex_type_10_10_10_2" number="46">
<enum name="UNSIGNED_INT_10_10_10_2_OES" value="0x8DF6"/>
<enum name="INT_10_10_10_2_OES" value="0x8DF7"/>
</category>
<category name="GL_OES_get_program_binary" number="47">
<enum name="PROGRAM_BINARY_LENGTH_OES" value="0x8741"/>
<enum name="NUM_PROGRAM_BINARY_FORMATS_OES" value="0x87FE"/>
<enum name="PROGRAM_BINARY_FORMATS_OES" value="0x87FF"/>
<function name="GetProgramBinaryOES" offset="assign">
<param name="program" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="binaryFormat" type="GLenum *"/>
<param name="binary" type="GLvoid *"/>
</function>
<function name="ProgramBinaryOES" offset="assign">
<param name="program" type="GLuint"/>
<param name="binaryFormat" type="GLenum"/>
<param name="binary" type="const GLvoid *"/>
<param name="length" type="GLint"/>
</function>
</category>
</OpenGLAPI>
File diff suppressed because it is too large Load Diff
+125
View File
@@ -0,0 +1,125 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
<!-- OpenGL ES extensions -->
<OpenGLAPI>
<category name="GL_OES_compressed_paletted_texture" number="6">
<enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
<enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
<enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
<enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
<enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
<enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
<enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
<enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
<enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
<enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
</category>
<!-- 23. GL_OES_EGL_image -->
<xi:include href="../gen/OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<category name="GL_OES_depth24" number="24">
<enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/>
</category>
<category name="GL_OES_depth32" number="25">
<enum name="DEPTH_COMPONENT32_OES" value="0x81A7"/>
</category>
<category name="GL_OES_element_index_uint" number="26">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_OES_fbo_render_mipmap" number="27">
<!-- No new functions, types, enums. -->
</category>
<category name="GL_OES_mapbuffer" number="29">
<enum name="WRITE_ONLY_OES" value="0x88B9"/>
<enum name="BUFFER_ACCESS_OES" value="0x88BB"/>
<enum name="BUFFER_MAPPED_OES" value="0x88BC"/>
<enum name="BUFFER_MAP_POINTER_OES" value="0x88BD"/>
<function name="GetBufferPointervOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLvoid **"/>
</function>
<function name="MapBufferOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="access" type="GLenum"/>
<return type="GLvoid *"/>
</function>
<function name="UnmapBufferOES" offset="assign">
<param name="target" type="GLenum"/>
<return type="GLboolean"/>
</function>
</category>
<category name="GL_OES_rgb8_rgba8" number="30">
<enum name="RGB8_OES" value="0x8051"/>
<enum name="RGBA8_OES" value="0x8058"/>
</category>
<category name="GL_OES_stencil1" number="31">
<enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
</category>
<category name="GL_OES_stencil4" number="32">
<enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
</category>
<category name="GL_OES_stencil8" number="33">
<enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
</category>
<category name="GL_EXT_texture_filter_anisotropic" number="41">
<enum name="TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FE"/>
<enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FF"/>
</category>
<category name="GL_EXT_texture_compression_dxt1" number="49">
<enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
<enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
</category>
<category name="GL_EXT_texture_format_BGRA8888" number="51">
<enum name="BGRA_EXT" value="0x80E1"/>
</category>
<category name="GL_EXT_blend_minmax" number="65">
<enum name="MIN_EXT" value="0x8007"/>
<enum name="MAX_EXT" value="0x8008"/>
</category>
<category name="GL_EXT_read_format_bgra" number="66">
<enum name="BGRA_EXT" value="0x80E1"/>
<enum name="UNSIGNED_SHORT_4_4_4_4_REV_EXT" value="0x8365"/>
<enum name="UNSIGNED_SHORT_1_5_5_5_REV_EXT" value="0x8366"/>
</category>
<category name="GL_EXT_multi_draw_arrays" number="69">
<function name="MultiDrawArraysEXT" offset="assign">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint *"/> <!-- Spec bug. Should be const. -->
<param name="count" type="GLsizei *"/> <!-- Spec bug. Should be const. -->
<param name="primcount" type="GLsizei"/>
<glx handcode="true"/>
</function>
<function name="MultiDrawElementsEXT" offset="assign">
<param name="mode" type="GLenum"/>
<param name="count" type="const GLsizei *"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid **"/>
<param name="primcount" type="GLsizei"/>
<glx handcode="true"/>
</function>
</category>
</OpenGLAPI>
+354
View File
@@ -0,0 +1,354 @@
#!/usr/bin/python
#
# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import sys
import os.path
import getopt
GLAPI = "../../glapi/gen"
sys.path.append(GLAPI)
import gl_XML
import glX_XML
class ApiSet(object):
def __init__(self, api, elts=["enum", "type", "function"]):
self.api = api
self.elts = elts
def _check_enum(self, e1, e2, strict=True):
if e1.name != e2.name:
raise ValueError("%s: name mismatch" % e1.name)
if e1.value != e2.value:
raise ValueError("%s: value 0x%04x != 0x%04x"
% (e1.name, e1.value, e2.value))
def _check_type(self, t1, t2, strict=True):
if t1.name != t2.name:
raise ValueError("%s: name mismatch" % t1.name)
if t1.type_expr.string() != t2.type_expr.string():
raise ValueError("%s: type %s != %s"
% (t1.name, t1.type_expr.string(), t2.type_expr.string()))
def _check_function(self, f1, f2, strict=True):
if f1.name != f2.name:
raise ValueError("%s: name mismatch" % f1.name)
if f1.return_type != f2.return_type:
raise ValueError("%s: return type %s != %s"
% (f1.name, f1.return_type, f2.return_type))
# there might be padded parameters
if strict and len(f1.parameters) != len(f2.parameters):
raise ValueError("%s: parameter length %d != %d"
% (f1.name, len(f1.parameters), len(f2.parameters)))
if f1.assign_offset != f2.assign_offset:
if ((f1.assign_offset and f2.offset < 0) or
(f2.assign_offset and f1.offset < 0)):
raise ValueError("%s: assign offset %d != %d"
% (f1.name, f1.assign_offset, f2.assign_offset))
elif not f1.assign_offset:
if f1.offset != f2.offset:
raise ValueError("%s: offset %d != %d"
% (f1.name, f1.offset, f2.offset))
if strict:
l1 = f1.entry_points
l2 = f2.entry_points
l1.sort()
l2.sort()
if l1 != l2:
raise ValueError("%s: entry points %s != %s"
% (f1.name, l1, l2))
l1 = f1.static_entry_points
l2 = f2.static_entry_points
l1.sort()
l2.sort()
if l1 != l2:
raise ValueError("%s: static entry points %s != %s"
% (f1.name, l1, l2))
pad = 0
for i in xrange(len(f1.parameters)):
p1 = f1.parameters[i]
p2 = f2.parameters[i + pad]
if not strict and p1.is_padding != p2.is_padding:
if p1.is_padding:
pad -= 1
continue
else:
pad += 1
p2 = f2.parameters[i + pad]
if strict and p1.name != p2.name:
raise ValueError("%s: parameter %d name %s != %s"
% (f1.name, i, p1.name, p2.name))
if p1.type_expr.string() != p2.type_expr.string():
if (strict or
# special case
f1.name == "TexImage2D" and p1.name != "internalformat"):
raise ValueError("%s: parameter %s type %s != %s"
% (f1.name, p1.name, p1.type_expr.string(),
p2.type_expr.string()))
def union(self, other):
union = gl_XML.gl_api(None)
if "enum" in self.elts:
union.enums_by_name = other.enums_by_name.copy()
for key, val in self.api.enums_by_name.iteritems():
if key not in union.enums_by_name:
union.enums_by_name[key] = val
else:
self._check_enum(val, other.enums_by_name[key])
if "type" in self.elts:
union.types_by_name = other.types_by_name.copy()
for key, val in self.api.types_by_name.iteritems():
if key not in union.types_by_name:
union.types_by_name[key] = val
else:
self._check_type(val, other.types_by_name[key])
if "function" in self.elts:
union.functions_by_name = other.functions_by_name.copy()
for key, val in self.api.functions_by_name.iteritems():
if key not in union.functions_by_name:
union.functions_by_name[key] = val
else:
self._check_function(val, other.functions_by_name[key])
return union
def intersection(self, other):
intersection = gl_XML.gl_api(None)
if "enum" in self.elts:
for key, val in self.api.enums_by_name.iteritems():
if key in other.enums_by_name:
self._check_enum(val, other.enums_by_name[key])
intersection.enums_by_name[key] = val
if "type" in self.elts:
for key, val in self.api.types_by_name.iteritems():
if key in other.types_by_name:
self._check_type(val, other.types_by_name[key])
intersection.types_by_name[key] = val
if "function" in self.elts:
for key, val in self.api.functions_by_name.iteritems():
if key in other.functions_by_name:
self._check_function(val, other.functions_by_name[key])
intersection.functions_by_name[key] = val
return intersection
def difference(self, other):
difference = gl_XML.gl_api(None)
if "enum" in self.elts:
for key, val in self.api.enums_by_name.iteritems():
if key not in other.enums_by_name:
difference.enums_by_name[key] = val
else:
self._check_enum(val, other.enums_by_name[key])
if "type" in self.elts:
for key, val in self.api.types_by_name.iteritems():
if key not in other.types_by_name:
difference.types_by_name[key] = val
else:
self._check_type(val, other.types_by_name[key])
if "function" in self.elts:
for key, val in self.api.functions_by_name.iteritems():
if key not in other.functions_by_name:
difference.functions_by_name[key] = val
else:
self._check_function(val, other.functions_by_name[key], False)
return difference
def cmp_enum(e1, e2):
if e1.value < e2.value:
return -1
elif e1.value > e2.value:
return 1
else:
return 0
def cmp_type(t1, t2):
return t1.size - t2.size
def cmp_function(f1, f2):
if f1.name > f2.name:
return 1
elif f1.name < f2.name:
return -1
else:
return 0
def spaces(n, str=""):
spaces = n - len(str)
if spaces < 1:
spaces = 1
return " " * spaces
def output_enum(e, indent=0):
attrs = 'name="%s"' % e.name
if e.default_count > 0:
tab = spaces(37, attrs)
attrs += '%scount="%d"' % (tab, e.default_count)
tab = spaces(48, attrs)
val = "%04x" % e.value
val = "0x" + val.upper()
attrs += '%svalue="%s"' % (tab, val)
# no child
if not e.functions:
print '%s<enum %s/>' % (spaces(indent), attrs)
return
print '%s<enum %s>' % (spaces(indent), attrs)
for key, val in e.functions.iteritems():
attrs = 'name="%s"' % key
if val[0] != e.default_count:
attrs += ' count="%d"' % val[0]
if not val[1]:
attrs += ' mode="get"'
print '%s<size %s/>' % (spaces(indent * 2), attrs)
print '%s</enum>' % spaces(indent)
def output_type(t, indent=0):
tab = spaces(16, t.name)
attrs = 'name="%s"%ssize="%d"' % (t.name, tab, t.size)
ctype = t.type_expr.string()
if ctype.find("unsigned") != -1:
attrs += ' unsigned="true"'
elif ctype.find("signed") == -1:
attrs += ' float="true"'
print '%s<type %s/>' % (spaces(indent), attrs)
def output_function(f, indent=0):
attrs = 'name="%s"' % f.name
if f.offset > 0:
if f.assign_offset:
attrs += ' offset="assign"'
else:
attrs += ' offset="%d"' % f.offset
print '%s<function %s>' % (spaces(indent), attrs)
for p in f.parameters:
attrs = 'name="%s" type="%s"' \
% (p.name, p.type_expr.original_string)
print '%s<param %s/>' % (spaces(indent * 2), attrs)
if f.return_type != "void":
attrs = 'type="%s"' % f.return_type
print '%s<return %s/>' % (spaces(indent * 2), attrs)
print '%s</function>' % spaces(indent)
def output_category(api, indent=0):
enums = api.enums_by_name.values()
enums.sort(cmp_enum)
types = api.types_by_name.values()
types.sort(cmp_type)
functions = api.functions_by_name.values()
functions.sort(cmp_function)
for e in enums:
output_enum(e, indent)
if enums and types:
print
for t in types:
output_type(t, indent)
if enums or types:
print
for f in functions:
output_function(f, indent)
if f != functions[-1]:
print
def is_api_empty(api):
return bool(not api.enums_by_name and
not api.types_by_name and
not api.functions_by_name)
def show_usage(ops):
print "Usage: %s [-k elts] <%s> <file1> <file2>" % (sys.argv[0], "|".join(ops))
print " -k elts A comma separated string of types of elements to"
print " skip. Possible types are enum, type, and function."
sys.exit(1)
def main():
ops = ["union", "intersection", "difference"]
elts = ["enum", "type", "function"]
try:
options, args = getopt.getopt(sys.argv[1:], "k:")
except Exception, e:
show_usage(ops)
if len(args) != 3:
show_usage(ops)
op, file1, file2 = args
if op not in ops:
show_usage(ops)
skips = []
for opt, val in options:
if opt == "-k":
skips = val.split(",")
for elt in skips:
try:
elts.remove(elt)
except ValueError:
show_usage(ops)
api1 = gl_XML.parse_GL_API(file1, glX_XML.glx_item_factory())
api2 = gl_XML.parse_GL_API(file2, glX_XML.glx_item_factory())
set = ApiSet(api1, elts)
func = getattr(set, op)
result = func(api2)
if not is_api_empty(result):
cat_name = "%s_of_%s_and_%s" \
% (op, os.path.basename(file1), os.path.basename(file2))
print '<?xml version="1.0"?>'
print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI
print
print '<OpenGLAPI>'
print
print '<category name="%s">' % (cat_name)
output_category(result, 4)
print '</category>'
print
print '</OpenGLAPI>'
if __name__ == "__main__":
main()
+450
View File
@@ -0,0 +1,450 @@
#!/usr/bin/python
#
# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import sys
import os.path
import getopt
import re
GLAPI = "../../glapi/gen"
sys.path.append(GLAPI)
class HeaderParser(object):
"""Parser for GL header files."""
def __init__(self, verbose=0):
# match #if and #ifdef
self.IFDEF = re.compile('#\s*if(n?def\s+(?P<ifdef>\w+)|\s+(?P<if>.+))')
# match #endif
self.ENDIF = re.compile('#\s*endif')
# match typedef abc def;
self.TYPEDEF = re.compile('typedef\s+(?P<from>[\w ]+)\s+(?P<to>\w+);')
# match #define XYZ VAL
self.DEFINE = re.compile('#\s*define\s+(?P<key>\w+)(?P<value>\s+[\w"]*)?')
# match GLAPI
self.GLAPI = re.compile('^GL_?API(CALL)?\s+(?P<return>[\w\s*]+[\w*])\s+(GL)?_?APIENTRY\s+(?P<name>\w+)\s*\((?P<params>[\w\s(,*\[\])]+)\)\s*;')
self.split_params = re.compile('\s*,\s*')
self.split_ctype = re.compile('(\W)')
# ignore GL_VERSION_X_Y
self.ignore_enum = re.compile('GL(_ES)?_VERSION(_ES_C[ML])?_\d_\d')
self.verbose = verbose
self._reset()
def _reset(self):
"""Reset to initial state."""
self.ifdef_levels = []
self.need_char = False
# use typeexpr?
def _format_ctype(self, ctype, fix=True):
"""Format a ctype string, optionally fix it."""
# split the type string
tmp = self.split_ctype.split(ctype)
tmp = [s for s in tmp if s and s != " "]
pretty = ""
for i in xrange(len(tmp)):
# add missing GL prefix
if (fix and tmp[i] != "const" and tmp[i] != "*" and
not tmp[i].startswith("GL")):
tmp[i] = "GL" + tmp[i]
if i == 0:
pretty = tmp[i]
else:
sep = " "
if tmp[i - 1] == "*":
sep = ""
pretty += sep + tmp[i]
return pretty
# use typeexpr?
def _get_ctype_attrs(self, ctype):
"""Get the attributes of a ctype."""
is_float = (ctype.find("float") != -1 or ctype.find("double") != -1)
is_signed = not (ctype.find("unsigned") != -1)
size = 0
if ctype.find("char") != -1:
size = 1
elif ctype.find("short") != -1:
size = 2
elif ctype.find("int") != -1:
size = 4
elif is_float:
if ctype.find("float") != -1:
size = 4
else:
size = 8
return (size, is_float, is_signed)
def _parse_define(self, line):
"""Parse a #define line for an <enum>."""
m = self.DEFINE.search(line)
if not m:
if self.verbose and line.find("#define") >= 0:
print "ignore %s" % (line)
return None
key = m.group("key").strip()
val = m.group("value").strip()
# enum must begin with GL_ and be all uppercase
if ((not (key.startswith("GL_") and key.isupper())) or
(self.ignore_enum.match(key) and val == "1")):
if self.verbose:
print "ignore enum %s" % (key)
return None
return (key, val)
def _parse_typedef(self, line):
"""Parse a typedef line for a <type>."""
m = self.TYPEDEF.search(line)
if not m:
if self.verbose and line.find("typedef") >= 0:
print "ignore %s" % (line)
return None
f = m.group("from").strip()
t = m.group("to").strip()
if not t.startswith("GL"):
if self.verbose:
print "ignore type %s" % (t)
return None
attrs = self._get_ctype_attrs(f)
return (f, t, attrs)
def _parse_gl_api(self, line):
"""Parse a GLAPI line for a <function>."""
m = self.GLAPI.search(line)
if not m:
if self.verbose and line.find("APIENTRY") >= 0:
print "ignore %s" % (line)
return None
rettype = m.group("return")
rettype = self._format_ctype(rettype)
if rettype == "GLvoid":
rettype = ""
name = m.group("name")
param_str = m.group("params")
chunks = self.split_params.split(param_str)
chunks = [s.strip() for s in chunks]
if len(chunks) == 1 and (chunks[0] == "void" or chunks[0] == "GLvoid"):
chunks = []
params = []
for c in chunks:
# split type and variable name
idx = c.rfind("*")
if idx < 0:
idx = c.rfind(" ")
if idx >= 0:
idx += 1
ctype = c[:idx]
var = c[idx:]
else:
ctype = c
var = "unnamed"
# convert array to pointer
idx = var.find("[")
if idx >= 0:
var = var[:idx]
ctype += "*"
ctype = self._format_ctype(ctype)
var = var.strip()
if not self.need_char and ctype.find("GLchar") >= 0:
self.need_char = True
params.append((ctype, var))
return (rettype, name, params)
def _change_level(self, line):
"""Parse a #ifdef line and change level."""
m = self.IFDEF.search(line)
if m:
ifdef = m.group("ifdef")
if not ifdef:
ifdef = m.group("if")
self.ifdef_levels.append(ifdef)
return True
m = self.ENDIF.search(line)
if m:
self.ifdef_levels.pop()
return True
return False
def _read_header(self, header):
"""Open a header file and read its contents."""
lines = []
try:
fp = open(header, "rb")
lines = fp.readlines()
fp.close()
except IOError, e:
print "failed to read %s: %s" % (header, e)
return lines
def _cmp_enum(self, enum1, enum2):
"""Compare two enums."""
# sort by length of the values as strings
val1 = enum1[1]
val2 = enum2[1]
ret = len(val1) - len(val2)
# sort by the values
if not ret:
val1 = int(val1, 16)
val2 = int(val2, 16)
ret = val1 - val2
# in case int cannot hold the result
if ret > 0:
ret = 1
elif ret < 0:
ret = -1
# sort by the names
if not ret:
if enum1[0] < enum2[0]:
ret = -1
elif enum1[0] > enum2[0]:
ret = 1
return ret
def _cmp_type(self, type1, type2):
"""Compare two types."""
attrs1 = type1[2]
attrs2 = type2[2]
# sort by type size
ret = attrs1[0] - attrs2[0]
# float is larger
if not ret:
ret = attrs1[1] - attrs2[1]
# signed is larger
if not ret:
ret = attrs1[2] - attrs2[2]
# reverse
ret = -ret
return ret
def _cmp_function(self, func1, func2):
"""Compare two functions."""
name1 = func1[1]
name2 = func2[1]
ret = 0
# sort by the names
if name1 < name2:
ret = -1
elif name1 > name2:
ret = 1
return ret
def _postprocess_dict(self, hdict):
"""Post-process a header dict and return an ordered list."""
hlist = []
largest = 0
for key, cat in hdict.iteritems():
size = len(cat["enums"]) + len(cat["types"]) + len(cat["functions"])
# ignore empty category
if not size:
continue
cat["enums"].sort(self._cmp_enum)
# remove duplicates
dup = []
for i in xrange(1, len(cat["enums"])):
if cat["enums"][i] == cat["enums"][i - 1]:
dup.insert(0, i)
for i in dup:
e = cat["enums"].pop(i)
if self.verbose:
print "remove duplicate enum %s" % e[0]
cat["types"].sort(self._cmp_type)
cat["functions"].sort(self._cmp_function)
# largest category comes first
if size > largest:
hlist.insert(0, (key, cat))
largest = size
else:
hlist.append((key, cat))
return hlist
def parse(self, header):
"""Parse a header file."""
self._reset()
if self.verbose:
print "Parsing %s" % (header)
hdict = {}
lines = self._read_header(header)
for line in lines:
if self._change_level(line):
continue
# skip until the first ifdef (i.e. __gl_h_)
if not self.ifdef_levels:
continue
cat_name = os.path.basename(header)
# check if we are in an extension
if (len(self.ifdef_levels) > 1 and
self.ifdef_levels[-1].startswith("GL_")):
cat_name = self.ifdef_levels[-1]
try:
cat = hdict[cat_name]
except KeyError:
cat = {
"enums": [],
"types": [],
"functions": []
}
hdict[cat_name] = cat
key = "enums"
elem = self._parse_define(line)
if not elem:
key = "types"
elem = self._parse_typedef(line)
if not elem:
key = "functions"
elem = self._parse_gl_api(line)
if elem:
cat[key].append(elem)
if self.need_char:
if self.verbose:
print "define GLchar"
elem = self._parse_typedef("typedef char GLchar;")
cat["types"].append(elem)
return self._postprocess_dict(hdict)
def spaces(n, str=""):
spaces = n - len(str)
if spaces < 1:
spaces = 1
return " " * spaces
def output_xml(name, hlist):
"""Output a parsed header in OpenGLAPI XML."""
for i in xrange(len(hlist)):
cat_name, cat = hlist[i]
print '<category name="%s">' % (cat_name)
indent = 4
for enum in cat["enums"]:
name = enum[0][3:]
value = enum[1]
tab = spaces(41, name)
attrs = 'name="%s"%svalue="%s"' % (name, tab, value)
print '%s<enum %s/>' % (spaces(indent), attrs)
if cat["enums"] and cat["types"]:
print
for type in cat["types"]:
ctype = type[0]
size, is_float, is_signed = type[2]
attrs = 'name="%s"' % (type[1][2:])
attrs += spaces(16, attrs) + 'size="%d"' % (size)
if is_float:
attrs += ' float="true"'
elif not is_signed:
attrs += ' unsigned="true"'
print '%s<type %s/>' % (spaces(indent), attrs)
for func in cat["functions"]:
print
ret = func[0]
name = func[1][2:]
params = func[2]
attrs = 'name="%s" offset="assign"' % name
print '%s<function %s>' % (spaces(indent), attrs)
for param in params:
attrs = 'name="%s" type="%s"' % (param[1], param[0])
print '%s<param %s/>' % (spaces(indent * 2), attrs)
if ret:
attrs = 'type="%s"' % ret
print '%s<return %s/>' % (spaces(indent * 2), attrs)
print '%s</function>' % spaces(indent)
print '</category>'
print
def show_usage():
print "Usage: %s [-v] <header> ..." % sys.argv[0]
sys.exit(1)
def main():
try:
args, headers = getopt.getopt(sys.argv[1:], "v")
except Exception, e:
show_usage()
if not headers:
show_usage()
verbose = 0
for arg in args:
if arg[0] == "-v":
verbose += 1
need_xml_header = True
parser = HeaderParser(verbose)
for h in headers:
h = os.path.abspath(h)
hlist = parser.parse(h)
if need_xml_header:
print '<?xml version="1.0"?>'
print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI
need_xml_header = False
print
print '<!-- %s -->' % (h)
print '<OpenGLAPI>'
print
output_xml(h, hlist)
print '</OpenGLAPI>'
if __name__ == '__main__':
main()
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_APPLE_object_purgeable" number="371">
<enum name="RELEASED_APPLE" value="0x8A19"/>
<enum name="VOLATILE_APPLE" value="0x8A1A"/>
<enum name="RETAINED_APPLE" value="0x8A1B"/>
<enum name="UNDEFINED_APPLE" value="0x8A1C"/>
<enum name="PURGEABLE_APPLE" count="1" value="0x8A1D">
<size name="GetObjectParameterivAPPLE" count="1" mode="get"/>
</enum>
<enum name="BUFFER_OBJECT_APPLE" value="0x85B3"/>
<function name="ObjectPurgeableAPPLE" offset="assign">
<param name="objectType" type="GLenum"/>
<param name="name" type="GLuint"/>
<param name="option" type="GLenum"/>
<return type="GLenum"/>
</function>
<function name="ObjectUnpurgeableAPPLE" offset="assign">
<param name="objectType" type="GLenum"/>
<param name="name" type="GLuint"/>
<param name="option" type="GLenum"/>
<return type="GLenum"/>
</function>
<function name="GetObjectParameterivAPPLE" offset="assign">
<param name="objectType" type="GLenum"/>
<param name="name" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="value" type="GLint *" output="true"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_APPLE_vertex_array_object" number="273">
<enum name="VERTEX_ARRAY_BINDING_APPLE" value="0x85B5"/>
<function name="BindVertexArrayAPPLE" offset="assign" static_dispatch="false">
<param name="array" type="GLuint"/>
</function>
<function name="DeleteVertexArraysAPPLE" offset="assign" static_dispatch="false">
<param name="n" type="GLsizei"/>
<param name="arrays" type="const GLuint *" count="n"/>
</function>
<function name="GenVertexArraysAPPLE" offset="assign" static_dispatch="false">
<param name="n" type="GLsizei"/>
<param name="arrays" type="GLuint *" count="n" output="true"/>
</function>
<function name="IsVertexArrayAPPLE" offset="assign" static_dispatch="false">
<param name="array" type="GLuint"/>
<return type="GLboolean"/>
</function>
</category>
</OpenGLAPI>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_ARB_copy_buffer" number="59">
<enum name="COPY_READ_BUFFER" value="0x8F36"/>
<enum name="COPY_WRITE_BUFFER" value="0x8F37"/>
<function name="CopyBufferSubData" offset="assign">
<param name="readTarget" type="GLenum"/>
<param name="writeTarget" type="GLenum"/>
<param name="readOffset" type="GLintptr"/>
<param name="writeOffset" type="GLintptr"/>
<param name="size" type="GLsizeiptr"/>
</function>
</category>
</OpenGLAPI>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_ARB_depth_clamp" number="61">
<enum name="DEPTH_CLAMP" count="1" value="0x864F">
<size name="Get" mode="get"/>
</enum>
</category>
</OpenGLAPI>
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_ARB_draw_elements_base_vertex" number="62">
<function name="DrawElementsBaseVertex" offset="assign">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="basevertex" type="GLint"/>
</function>
<function name="DrawRangeElementsBaseVertex" offset="assign">
<param name="mode" type="GLenum"/>
<param name="start" type="GLuint"/>
<param name="end" type="GLuint"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="basevertex" type="GLint"/>
</function>
<function name="MultiDrawElementsBaseVertex" offset="assign">
<param name="mode" type="GLenum"/>
<param name="count" type="const GLsizei *"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid **"/>
<param name="primcount" type="GLsizei"/>
<param name="basevertex" type="const GLint *"/>
</function>
</category>
</OpenGLAPI>
+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="3.1">
<function name="DrawArraysInstanced" offset="assign">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="primcount" type="GLsizei"/>
</function>
<function name="DrawElementsInstanced" offset="assign">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="primcount" type="GLsizei"/>
</function>
</category>
<category name="GL_ARB_draw_instanced" number="44">
<function name="DrawArraysInstancedARB" alias="DrawArraysInstanced">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="primcount" type="GLsizei"/>
</function>
<function name="DrawElementsInstancedARB" alias="DrawElementsInstanced">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="primcount" type="GLsizei"/>
</function>
</category>
<category name="GL_EXT_draw_instanced" number="327">
<function name="DrawArraysInstancedEXT" alias="DrawArraysInstanced">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="primcount" type="GLsizei"/>
</function>
<function name="DrawElementsInstancedEXT" alias="DrawElementsInstanced">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="primcount" type="GLsizei"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,275 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_ARB_framebuffer_object" number="45">
<enum name="FRAMEBUFFER" value="0x8D40"/>
<enum name="READ_FRAMEBUFFER" value="0x8CA8"/>
<enum name="DRAW_FRAMEBUFFER" value="0x8CA9"/>
<enum name="RENDERBUFFER" value="0x8D41"/>
<enum name="STENCIL_INDEX1" value="0x8D46"/>
<enum name="STENCIL_INDEX4" value="0x8D47"/>
<enum name="STENCIL_INDEX8" value="0x8D48"/>
<enum name="STENCIL_INDEX16" value="0x8D49"/>
<enum name="RENDERBUFFER_WIDTH" value="0x8D42"/>
<enum name="RENDERBUFFER_HEIGHT" value="0x8D43"/>
<enum name="RENDERBUFFER_INTERNAL_FORMAT" value="0x8D44"/>
<enum name="RENDERBUFFER_RED_SIZE" value="0x8D50"/>
<enum name="RENDERBUFFER_GREEN_SIZE" value="0x8D51"/>
<enum name="RENDERBUFFER_BLUE_SIZE" value="0x8D52"/>
<enum name="RENDERBUFFER_ALPHA_SIZE" value="0x8D53"/>
<enum name="RENDERBUFFER_DEPTH_SIZE" value="0x8D54"/>
<enum name="RENDERBUFFER_STENCIL_SIZE" value="0x8D55"/>
<enum name="RENDERBUFFER_SAMPLES" value="0x8CAB"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" count="1" value="0x8CD0">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" count="1" value="0x8CD1">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" count="1" value="0x8CD2">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" count="1" value="0x8CD3">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" count="1" value="0x8CD4">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" count="1" value="0x8210">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" count="1" value="0x8211">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_RED_SIZE" count="1" value="0x8212">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" count="1" value="0x8213">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" count="1" value="0x8214">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" count="1" value="0x8215">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" count="1" value="0x8216">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" count="1" value="0x8217">
<size name="GetFramebufferAttachmentParameteriv" mode="get"/>
</enum>
<enum name="SRGB" value="0x8C40"/>
<enum name="UNSIGNED_NORMALIZED" value="0x8C17"/>
<enum name="FRAMEBUFFER_DEFAULT" value="0x8218"/>
<enum name="INDEX" value="0x8222"/>
<enum name="COLOR_ATTACHMENT0" value="0x8CE0"/>
<enum name="COLOR_ATTACHMENT1" value="0x8CE1"/>
<enum name="COLOR_ATTACHMENT2" value="0x8CE2"/>
<enum name="COLOR_ATTACHMENT3" value="0x8CE3"/>
<enum name="COLOR_ATTACHMENT4" value="0x8CE4"/>
<enum name="COLOR_ATTACHMENT5" value="0x8CE5"/>
<enum name="COLOR_ATTACHMENT6" value="0x8CE6"/>
<enum name="COLOR_ATTACHMENT7" value="0x8CE7"/>
<enum name="COLOR_ATTACHMENT8" value="0x8CE8"/>
<enum name="COLOR_ATTACHMENT9" value="0x8CE9"/>
<enum name="COLOR_ATTACHMENT10" value="0x8CEA"/>
<enum name="COLOR_ATTACHMENT11" value="0x8CEB"/>
<enum name="COLOR_ATTACHMENT12" value="0x8CEC"/>
<enum name="COLOR_ATTACHMENT13" value="0x8CED"/>
<enum name="COLOR_ATTACHMENT14" value="0x8CEE"/>
<enum name="COLOR_ATTACHMENT15" value="0x8CEF"/>
<enum name="DEPTH_ATTACHMENT" value="0x8D00"/>
<enum name="STENCIL_ATTACHMENT" value="0x8D20"/>
<enum name="DEPTH_STENCIL_ATTACHMENT" value="0x821A"/>
<enum name="MAX_SAMPLES" count="1" value="0x8D57">
<size name="Get" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_COMPLETE" value="0x8CD5"/>
<enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT" value="0x8CD6"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" value="0x8CD7"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER" value="0x8CDB"/>
<enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER" value="0x8CDC"/>
<enum name="FRAMEBUFFER_UNSUPPORTED" value="0x8CDD"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" value="0x8D56"/>
<enum name="FRAMEBUFFER_UNDEFINED" value="0x8219"/>
<enum name="FRAMEBUFFER_BINDING" count="1" value="0x8CA6">
<size name="Get" mode="get"/>
</enum>
<enum name="DRAW_FRAMEBUFFER_BINDING" count="1" value="0x8CA6">
<size name="Get" mode="get"/>
</enum>
<enum name="READ_FRAMEBUFFER_BINDING" count="1" value="0x8CAA">
<size name="Get" mode="get"/>
</enum>
<enum name="RENDERBUFFER_BINDING" count="1" value="0x8CA7">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_COLOR_ATTACHMENTS" count="1" value="0x8CDF">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_RENDERBUFFER_SIZE" count="1" value="0x84E8">
<size name="Get" mode="get"/>
</enum>
<enum name="INVALID_FRAMEBUFFER_OPERATION" value="0x0506"/>
<enum name="DEPTH_STENCIL" value="0x84F9"/>
<enum name="UNSIGNED_INT_24_8" value="0x84FA"/>
<enum name="DEPTH24_STENCIL8" value="0x88F0"/>
<enum name="TEXTURE_STENCIL_SIZE" count="1" value="0x88F1">
<size name="GetTexLevelParameterfv" mode="get"/>
<size name="GetTexLevelParameteriv" mode="get"/>
</enum>
<function name="IsRenderbuffer" alias="IsRenderbufferEXT">
<param name="renderbuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="BindRenderbuffer" alias="BindRenderbufferEXT">
<param name="target" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="DeleteRenderbuffers" alias="DeleteRenderbuffersEXT">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="const GLuint *" count="n"/>
</function>
<function name="GenRenderbuffers" alias="GenRenderbuffersEXT">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="RenderbufferStorage" alias="RenderbufferStorageEXT">
<param name="target" type="GLenum"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
</function>
<function name="RenderbufferStorageMultisample" offset="assign">
<param name="target" type="GLenum"/>
<param name="samples" type="GLsizei"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4331"/>
</function>
<function name="GetRenderbufferParameteriv" alias="GetRenderbufferParameterivEXT">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="IsFramebuffer" alias="IsFramebufferEXT">
<param name="framebuffer" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="BindFramebuffer" alias="BindFramebufferEXT">
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
</function>
<function name="DeleteFramebuffers" alias="DeleteFramebuffersEXT">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="const GLuint *" count="n"/>
</function>
<function name="GenFramebuffers" alias="GenFramebuffersEXT">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="GLuint *" count="n" output="true"/>
</function>
<function name="CheckFramebufferStatus" alias="CheckFramebufferStatusEXT">
<param name="target" type="GLenum"/>
<return type="GLenum"/>
</function>
<function name="FramebufferTexture1D" alias="FramebufferTexture1DEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
<function name="FramebufferTexture2D" alias="FramebufferTexture2DEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
<function name="FramebufferTexture3D" alias="FramebufferTexture3DEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="zoffset" type="GLint"/>
</function>
<function name="FramebufferTextureLayer" alias="FramebufferTextureLayerEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="layer" type="GLint"/>
</function>
<function name="FramebufferRenderbuffer" alias="FramebufferRenderbufferEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="renderbuffertarget" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</function>
<function name="GetFramebufferAttachmentParameteriv" alias="GetFramebufferAttachmentParameterivEXT">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
</function>
<function name="BlitFramebuffer" alias="BlitFramebufferEXT">
<param name="srcX0" type="GLint"/>
<param name="srcY0" type="GLint"/>
<param name="srcX1" type="GLint"/>
<param name="srcY1" type="GLint"/>
<param name="dstX0" type="GLint"/>
<param name="dstY0" type="GLint"/>
<param name="dstX1" type="GLint"/>
<param name="dstY1" type="GLint"/>
<param name="mask" type="GLbitfield"/>
<param name="filter" type="GLenum"/>
</function>
<function name="GenerateMipmap" alias="GenerateMipmapEXT">
<param name="target" type="GLenum"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_ARB_map_buffer_range" number="50">
<enum name="MAP_READ_BIT" value="0x0001"/>
<enum name="MAP_WRITE_BIT" value="0x0002"/>
<enum name="MAP_INVALIDATE_RANGE_BIT" value="0x0004"/>
<enum name="MAP_INVALIDATE_BUFFER_BIT" value="0x0008"/>
<enum name="MAP_FLUSH_EXPLICIT_BIT" value="0x0010"/>
<enum name="MAP_UNSYNCHRONIZED_BIT" value="0x0020"/>
<function name="MapBufferRange" offset="assign">
<param name="target" type="GLenum"/>
<param name="offset" type="GLintptr"/>
<param name="length" type="GLsizeiptr"/>
<param name="access" type="GLbitfield"/>
<return type="GLvoid *"/>
</function>
<function name="FlushMappedBufferRange" offset="assign">
<param name="target" type="GLenum"/>
<param name="offset" type="GLintptr"/>
<param name="length" type="GLsizeiptr"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_ARB_seamless_cube_map" number="65">
<enum name="TEXTURE_CUBE_MAP_SEAMLESS" count="1" value="0x88F4">
<size name="Get" mode="get"/>
</enum>
</category>
</OpenGLAPI>
+84
View File
@@ -0,0 +1,84 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_ARB_sync" number="61">
<type name="int64" size="8" glx_name="CARD64"/>
<type name="uint64" size="8" unsigned="true" glx_name="CARD64"/>
<type name="sync" size="8" unsigned="true" glx_name="CARD64"/>
<enum name="MAX_SERVER_WAIT_TIMEOUT" count="1" value="0x9111">
<size name="Get" mode="get"/>
</enum>
<enum name="OBJECT_TYPE" count="1" value="0x9112">
<size name="GetSynciv" mode="get"/>
</enum>
<enum name="SYNC_CONDITION" count="1" value="0x9113">
<size name="GetSynciv" mode="get"/>
</enum>
<enum name="SYNC_STATUS" count="1" value="0x9114">
<size name="GetSynciv" mode="get"/>
</enum>
<enum name="SYNC_FLAGS" count="1" value="0x9115">
<size name="GetSynciv" mode="get"/>
</enum>
<enum name="SYNC_FENCE" value="0x9116"/>
<enum name="SYNC_GPU_COMMANDS_COMPLETE" value="0x9117"/>
<enum name="UNSIGNALED" value="0x9118"/>
<enum name="SIGNALED" value="0x9119"/>
<enum name="ALREADY_SIGNALED" value="0x911A"/>
<enum name="TIMEOUT_EXPIRED" value="0x911B"/>
<enum name="CONDITION_SATISFIED" value="0x911C"/>
<enum name="WAIT_FAILED" value="0x911D"/>
<enum name="SYNC_FLUSH_COMMANDS_BIT" value="0x00000001"/>
<!-- Not really an enum:
<enum name="TIMEOUT_IGNORED" value="0xFFFFFFFFFFFFFFFF"/>
-->
<function name="FenceSync" offset="assign">
<param name="condition" type="GLenum"/>
<param name="flags" type="GLbitfield"/>
<return type="GLsync"/>
</function>
<function name="IsSync" offset="assign">
<param name="sync" type="GLsync"/>
<return type="GLboolean"/>
</function>
<function name="DeleteSync" offset="assign">
<param name="sync" type="GLsync"/>
</function>
<function name="ClientWaitSync" offset="assign">
<param name="sync" type="GLsync"/>
<param name="flags" type="GLbitfield"/>
<param name="timeout" type="GLuint64"/>
<return type="GLenum"/>
</function>
<function name="WaitSync" offset="assign">
<param name="sync" type="GLsync"/>
<param name="flags" type="GLbitfield"/>
<param name="timeout" type="GLuint64"/>
</function>
<function name="GetInteger64v" offset="assign">
<param name="pname" type="GLenum"/>
<param name="params" type="GLint64 *" output="true" variable_param="pname"/>
</function>
<function name="GetSynciv" offset="assign">
<param name="sync" type="GLsync"/>
<param name="pname" type="GLenum"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="values" type="GLint *" output="true" variable_param="pname"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_ARB_vertex_array_object" number="54">
<enum name="VERTEX_ARRAY_BINDING" value="0x85B5"/>
<function name="BindVertexArray" offset="assign">
<param name="array" type="GLuint"/>
</function>
<function name="DeleteVertexArrays" alias="DeleteVertexArraysAPPLE">
<param name="n" type="GLsizei"/>
<param name="arrays" type="const GLuint *"/>
</function>
<function name="GenVertexArrays" offset="assign">
<param name="n" type="GLsizei"/>
<param name="arrays" type="GLuint *"/>
</function>
<function name="IsVertexArray" alias="IsVertexArrayAPPLE">
<param name="array" type="GLuint"/>
<return type="GLboolean"/>
</function>
</category>
</OpenGLAPI>
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_EXT_draw_buffers2" number="340">
<function name="ColorMaskIndexedEXT" offset="assign">
<param name="buf" type="GLuint"/>
<param name="r" type="GLboolean"/>
<param name="g" type="GLboolean"/>
<param name="b" type="GLboolean"/>
<param name="a" type="GLboolean"/>
</function>
<function name="GetBooleanIndexedvEXT" offset="assign">
<param name="value" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="data" type="GLboolean *"/>
</function>
<function name="GetIntegerIndexedvEXT" offset="assign">
<param name="value" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="data" type="GLint *"/>
</function>
<function name="EnableIndexedEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
</function>
<function name="DisableIndexedEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
</function>
<function name ="IsEnabledIndexedEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<return type="GLboolean"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,235 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_EXT_framebuffer_object" number="310">
<enum name="FRAMEBUFFER_EXT" value="0x8D40"/>
<enum name="RENDERBUFFER_EXT" value="0x8D41"/>
<enum name="RENDERBUFFER_WIDTH_EXT" value="0x8D42"/>
<enum name="RENDERBUFFER_HEIGHT_EXT" value="0x8D43"/>
<enum name="RENDERBUFFER_INTERNAL_FORMAT_EXT" value="0x8D44"/>
<enum name="STENCIL_INDEX_EXT" value="0x8D45"/>
<enum name="STENCIL_INDEX1_EXT" value="0x8D46"/>
<enum name="STENCIL_INDEX4_EXT" value="0x8D47"/>
<enum name="STENCIL_INDEX8_EXT" value="0x8D48"/>
<enum name="STENCIL_INDEX16_EXT" value="0x8D49"/>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT" count="1" value="0x8CD0">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT" count="1" value="0x8CD1">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" count="1" value="0x8CD2">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" count="1" value="0x8CD3">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT" count="1" value="0x8CD4">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<enum name="COLOR_ATTACHMENT0_EXT" value="0x8CE0"/>
<enum name="COLOR_ATTACHMENT1_EXT" value="0x8CE1"/>
<enum name="COLOR_ATTACHMENT2_EXT" value="0x8CE2"/>
<enum name="COLOR_ATTACHMENT3_EXT" value="0x8CE3"/>
<enum name="COLOR_ATTACHMENT4_EXT" value="0x8CE4"/>
<enum name="COLOR_ATTACHMENT5_EXT" value="0x8CE5"/>
<enum name="COLOR_ATTACHMENT6_EXT" value="0x8CE6"/>
<enum name="COLOR_ATTACHMENT7_EXT" value="0x8CE7"/>
<enum name="COLOR_ATTACHMENT8_EXT" value="0x8CE8"/>
<enum name="COLOR_ATTACHMENT9_EXT" value="0x8CE9"/>
<enum name="COLOR_ATTACHMENT10_EXT" value="0x8CEA"/>
<enum name="COLOR_ATTACHMENT11_EXT" value="0x8CEB"/>
<enum name="COLOR_ATTACHMENT12_EXT" value="0x8CEC"/>
<enum name="COLOR_ATTACHMENT13_EXT" value="0x8CED"/>
<enum name="COLOR_ATTACHMENT14_EXT" value="0x8CEE"/>
<enum name="COLOR_ATTACHMENT15_EXT" value="0x8CEF"/>
<enum name="DEPTH_ATTACHMENT_EXT" value="0x8D00"/>
<enum name="STENCIL_ATTACHMENT_EXT" value="0x8D20"/>
<enum name="FRAMEBUFFER_COMPLETE_EXT" value="0x8CD5"/>
<enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT" value="0x8CD6"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT" value="0x8CD7"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT" value="0x8CD8"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT" value="0x8CD9"/>
<enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_EXT" value="0x8CDA"/>
<enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" value="0x8CDB"/>
<enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" value="0x8CDC"/>
<enum name="FRAMEBUFFER_UNSUPPORTED_EXT" value="0x8CDD"/>
<enum name="FRAMEBUFFER_STATUS_ERROR_EXT" value="0x8CDE"/>
<enum name="FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
<size name="Get" mode="get"/>
</enum>
<enum name="RENDERBUFFER_BINDING_EXT" count="1" value="0x8CA7">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_COLOR_ATTACHMENTS_EXT" count="1" value="0x8CDF">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_RENDERBUFFER_SIZE_EXT" count="1" value="0x84E8">
<size name="Get" mode="get"/>
</enum>
<enum name="INVALID_FRAMEBUFFER_OPERATION_EXT" value="0x0506"/>
<function name="IsRenderbufferEXT" offset="assign">
<param name="renderbuffer" type="GLuint"/>
<return type="GLboolean"/>
<glx vendorpriv="1422"/>
</function>
<function name="BindRenderbufferEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
<glx rop="4316"/>
</function>
<function name="DeleteRenderbuffersEXT" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="const GLuint *" count="n"/>
<glx rop="4317"/>
</function>
<function name="GenRenderbuffersEXT" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="renderbuffers" type="GLuint *" count="n" output="true"/>
<glx vendorpriv="1423" always_array="true"/>
</function>
<function name="RenderbufferStorageEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<glx rop="4318"/>
</function>
<function name="GetRenderbufferParameterivEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
<glx vendorpriv="1424"/>
</function>
<function name="IsFramebufferEXT" offset="assign">
<param name="framebuffer" type="GLuint"/>
<return type="GLboolean"/>
<glx vendorpriv="1425"/>
</function>
<function name="BindFramebufferEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
<glx rop="4319"/>
</function>
<function name="DeleteFramebuffersEXT" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="const GLuint *" count="n"/>
<glx rop="4320"/>
</function>
<function name="GenFramebuffersEXT" offset="assign">
<param name="n" type="GLsizei" counter="true"/>
<param name="framebuffers" type="GLuint *" count="n" output="true"/>
<glx vendorpriv="1426" always_array="true"/>
</function>
<function name="CheckFramebufferStatusEXT" offset="assign">
<param name="target" type="GLenum"/>
<return type="GLenum"/>
<glx vendorpriv="1427"/>
</function>
<function name="FramebufferTexture1DEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<glx rop="4321"/>
</function>
<function name="FramebufferTexture2DEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<glx rop="4322"/>
</function>
<function name="FramebufferTexture3DEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="textarget" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="zoffset" type="GLint"/>
<glx rop="4323"/>
</function>
<function name="FramebufferRenderbufferEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="renderbuffertarget" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
<glx rop="4324"/>
</function>
<function name="GetFramebufferAttachmentParameterivEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *" output="true"/>
<glx vendorpriv="1428"/>
</function>
<function name="GenerateMipmapEXT" offset="assign">
<param name="target" type="GLenum"/>
<glx rop="4325"/>
</function>
</category>
<category name="GL_EXT_framebuffer_blit" number="316">
<enum name="READ_FRAMEBUFFER_EXT" value="0x8CA8"/>
<enum name="DRAW_FRAMEBUFFER_EXT" value="0x8CA9"/>
<enum name="DRAW_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
<size name="Get" mode="get"/>
</enum>
<enum name="READ_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CAA">
<size name="Get" mode="get"/>
</enum>
<function name="BlitFramebufferEXT" offset="assign" static_dispatch="false">
<param name="srcX0" type="GLint"/>
<param name="srcY0" type="GLint"/>
<param name="srcX1" type="GLint"/>
<param name="srcY1" type="GLint"/>
<param name="dstX0" type="GLint"/>
<param name="dstY0" type="GLint"/>
<param name="dstX1" type="GLint"/>
<param name="dstY1" type="GLint"/>
<param name="mask" type="GLbitfield"/>
<param name="filter" type="GLenum"/>
<glx rop="4330"/>
</function>
</category>
<category name="GL_EXT_framebuffer_multisample" number="317">
<enum name="RENDERBUFFER_SAMPLES_EXT" value="0x8CAB"/>
<enum name="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT" value="0x8D56"/>
<enum name="MAX_SAMPLES_EXT" count="1" value="0x8D57">
<size name="Get" mode="get"/>
</enum>
<function name="RenderbufferStorageMultisampleEXT" alias="RenderbufferStorageMultisample">
<param name="target" type="GLenum"/>
<param name="samples" type="GLsizei"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_EXT_packed_depth_stencil" number="312">
<!-- These enums are shared with GL_NV_packed_depth_stencil. -->
<enum name="DEPTH_STENCIL_EXT" value="0x84F9"/>
<enum name="UNSIGNED_INT_24_8_EXT" value="0x84FA"/>
<enum name="DEPTH24_STENCIL8_EXT" value="0x88F0"/>
<enum name="TEXTURE_STENCIL_SIZE_EXT" count="1" value="0x88F1">
<size name="GetTexLevelParameterfv" mode="get"/>
<size name="GetTexLevelParameteriv" mode="get"/>
</enum>
</category>
</OpenGLAPI>
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_EXT_provoking_vertex" number="364">
<enum name="FIRST_VERTEX_CONVENTION_EXT" value="0x8E4D"/>
<enum name="LAST_VERTEX_CONVENTION_EXT" value="0x8E4E"/>
<enum name="PROVOKING_VERTEX_EXT" value="0x8E4F"/>
<enum name="QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT" value="0x8E4C"/>
<function name="ProvokingVertexEXT" offset="assign">
<param name="mode" type="GLenum"/>
</function>
</category>
<category name="GL_ARB_provoking_vertex" number="64">
<enum name="FIRST_VERTEX_CONVENTION" value="0x8E4D"/>
<enum name="LAST_VERTEX_CONVENTION" value="0x8E4E"/>
<enum name="PROVOKING_VERTEX" value="0x8E4F"/>
<enum name="QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION" value="0x8E4C"/>
<function name="ProvokingVertex" alias="ProvokingVertexEXT">
<param name="mode" type="GLenum"/>
</function>
</category>
</OpenGLAPI>
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_EXT_texture_array" number="329">
<enum name="TEXTURE_1D_ARRAY_EXT" value="0x8C18"/>
<enum name="PROXY_TEXTURE_1D_ARRAY_EXT" value="0x8C19"/>
<enum name="TEXTURE_2D_ARRAY_EXT" value="0x8C1A"/>
<enum name="PROXY_TEXTURE_2D_ARRAY_EXT" value="0x8C1B"/>
<enum name="TEXTURE_BINDING_1D_ARRAY_EXT" count="1" value="0x8C1C">
<size name="Get" mode="get"/>
</enum>
<enum name="TEXTURE_BINDING_2D_ARRAY_EXT" count="1" value="0x8C1D">
<size name="Get" mode="get"/>
</enum>
<enum name="MAX_ARRAY_TEXTURE_LAYERS_EXT" count="1" value="0x88FF">
<size name="Get" mode="get"/>
</enum>
<enum name="COMPARE_REF_DEPTH_TO_TEXTURE_EXT" count="1" value="0x884E">
<size name="Get" mode="get"/>
</enum>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT" count="1" value="0x8CD4">
<size name="GetFramebufferAttachmentParameterivEXT" mode="get"/>
</enum>
<function name="FramebufferTextureLayerEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="layer" type="GLint"/>
<glx rop="237"/>
</function>
</category>
</OpenGLAPI>
@@ -0,0 +1,123 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_EXT_transform_feedback" number="352">
<enum name="TRANSFORM_FEEDBACK_BUFFER_EXT" value="0x8C8E"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_START_EXT" value="0x8C84"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT" value="0x8C85"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT" value="0x8C8F"/>
<enum name="INTERLEAVED_ATTRIBS_EXT" value="0x8C8C"/>
<enum name="SEPARATE_ATTRIBS_EXT" value="0x8C8D"/>
<enum name="PRIMITIVES_GENERATED_EXT" value="0x8C87"/>
<enum name="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT" value="0x8C88"/>
<enum name="RASTERIZER_DISCARD_EXT" value="0x8C89"/>
<enum name="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT" value="0x8C8A"/>
<enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT" value="0x8C8B"/>
<enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT" value="0x8C80"/>
<enum name="TRANSFORM_FEEDBACK_VARYINGS_EXT" value="0x8C83"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_MODE_EXT" value="0x8C7F"/>
<enum name="TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT" value="0x8C76"/>
<function name="BindBufferRangeEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
<param name="size" type="GLsizeiptr"/>
</function>
<function name="BindBufferOffsetEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
</function>
<function name="BindBufferBaseEXT" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
</function>
<function name="BeginTransformFeedbackEXT" offset="assign">
<param name="mode" type="GLenum"/>
</function>
<function name="EndTransformFeedbackEXT" offset="assign">
</function>
<function name="TransformFeedbackVaryingsEXT" offset="assign">
<param name="program" type="GLuint"/>
<param name="count" type="GLsizei"/>
<param name="varyings" type="const char **"/>
<param name="bufferMode" type="GLenum"/>
</function>
<function name="GetTransformFeedbackVaryingEXT" offset="assign">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="size" type="GLsizei *"/>
<param name="type" type="GLenum *"/>
<param name="name" type="GLchar *"/>
</function>
<!-- Note: the glGetIntegerIndexedvEXT() and glGetBooleanIndexedvEXT
functions are defined in the EXT_draw_buffers2.xml file -->
</category>
<!-- Note: these 3.0 entrypoints might get moved to a new file -->
<category name="3.0">
<function name="BindBufferRange" alias="BindBufferRangeEXT">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
<param name="size" type="GLsizeiptr"/>
</function>
<function name="BindBufferBase" alias="BindBufferBaseEXT">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
</function>
<function name="BeginTransformFeedback" alias="BeginTransformFeedbackEXT">
<param name="mode" type="GLenum"/>
</function>
<function name="EndTransformFeedback" alias="EndTransformFeedbackEXT">
</function>
<function name="TransformFeedbackVaryings" alias="TransformFeedbackVaryingsEXT">
<param name="program" type="GLuint"/>
<param name="count" type="GLsizei"/>
<param name="varyings" type="const char **"/>
<param name="bufferMode" type="GLenum"/>
</function>
<function name="GetTransformFeedbackVarying" alias="GetTransformFeedbackVaryingEXT">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="size" type="GLsizei *"/>
<param name="type" type="GLenum *"/>
<param name="name" type="GLchar *"/>
</function>
</category>
</OpenGLAPI>
+581
View File
@@ -0,0 +1,581 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="3.0">
<enum name="COMPARE_REF_TO_TEXTURE" value="0x884E"/>
<enum name="CLIP_DISTANCE0" value="0x3000"/>
<enum name="CLIP_DISTANCE1" value="0x3001"/>
<enum name="CLIP_DISTANCE2" value="0x3002"/>
<enum name="CLIP_DISTANCE3" value="0x3003"/>
<enum name="CLIP_DISTANCE4" value="0x3004"/>
<enum name="CLIP_DISTANCE5" value="0x3005"/>
<enum name="CLIP_DISTANCE6" value="0x3006"/>
<enum name="CLIP_DISTANCE7" value="0x3007"/>
<enum name="MAX_CLIP_DISTANCES" value="0x0D32"/>
<enum name="MAJOR_VERSION" value="0x821B"/>
<enum name="MINOR_VERSION" value="0x821C"/>
<enum name="NUM_EXTENSIONS" value="0x821D"/>
<enum name="CONTEXT_FLAGS" value="0x821E"/>
<enum name="DEPTH_BUFFER" value="0x8223"/>
<enum name="STENCIL_BUFFER" value="0x8224"/>
<enum name="COMPRESSED_RED" value="0x8225"/>
<enum name="COMPRESSED_RG" value="0x8226"/>
<enum name="CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT" value="0x0001"/>
<enum name="RGBA32F" value="0x8814"/>
<enum name="RGB32F" value="0x8815"/>
<enum name="RGBA16F" value="0x881A"/>
<enum name="RGB16F" value="0x881B"/>
<enum name="VERTEX_ATTRIB_ARRAY_INTEGER" value="0x88FD"/>
<enum name="MAX_ARRAY_TEXTURE_LAYERS" value="0x88FF"/>
<enum name="MIN_PROGRAM_TEXEL_OFFSET" value="0x8904"/>
<enum name="MAX_PROGRAM_TEXEL_OFFSET" value="0x8905"/>
<enum name="CLAMP_READ_COLOR" value="0x891C"/>
<enum name="FIXED_ONLY" value="0x891D"/>
<enum name="MAX_VARYING_COMPONENTS" value="0x8B4B"/>
<enum name="TEXTURE_1D_ARRAY" value="0x8C18"/>
<enum name="PROXY_TEXTURE_1D_ARRAY" value="0x8C19"/>
<enum name="TEXTURE_2D_ARRAY" value="0x8C1A"/>
<enum name="PROXY_TEXTURE_2D_ARRAY" value="0x8C1B"/>
<enum name="TEXTURE_BINDING_1D_ARRAY" value="0x8C1C"/>
<enum name="TEXTURE_BINDING_2D_ARRAY" value="0x8C1D"/>
<enum name="R11F_G11F_B10F" value="0x8C3A"/>
<enum name="UNSIGNED_INT_10F_11F_11F_REV" value="0x8C3B"/>
<enum name="RGB9_E5" value="0x8C3D"/>
<enum name="UNSIGNED_INT_5_9_9_9_REV" value="0x8C3E"/>
<enum name="TEXTURE_SHARED_SIZE" value="0x8C3F"/>
<enum name="TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" value="0x8C76"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_MODE" value="0x8C7F"/>
<enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" value="0x8C80"/>
<enum name="TRANSFORM_FEEDBACK_VARYINGS" value="0x8C83"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_START" value="0x8C84"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_SIZE" value="0x8C85"/>
<enum name="PRIMITIVES_GENERATED" value="0x8C87"/>
<enum name="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" value="0x8C88"/>
<enum name="RASTERIZER_DISCARD" value="0x8C89"/>
<enum name="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" value="0x8C8A"/>
<enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" value="0x8C8B"/>
<enum name="INTERLEAVED_ATTRIBS" value="0x8C8C"/>
<enum name="SEPARATE_ATTRIBS" value="0x8C8D"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER" value="0x8C8E"/>
<enum name="TRANSFORM_FEEDBACK_BUFFER_BINDING" value="0x8C8F"/>
<enum name="RGBA32UI" value="0x8D70"/>
<enum name="RGB32UI" value="0x8D71"/>
<enum name="RGBA16UI" value="0x8D76"/>
<enum name="RGB16UI" value="0x8D77"/>
<enum name="RGBA8UI" value="0x8D7C"/>
<enum name="RGB8UI" value="0x8D7D"/>
<enum name="RGBA32I" value="0x8D82"/>
<enum name="RGB32I" value="0x8D83"/>
<enum name="RGBA16I" value="0x8D88"/>
<enum name="RGB16I" value="0x8D89"/>
<enum name="RGBA8I" value="0x8D8E"/>
<enum name="RGB8I" value="0x8D8F"/>
<enum name="RED_INTEGER" value="0x8D94"/>
<enum name="GREEN_INTEGER" value="0x8D95"/>
<enum name="BLUE_INTEGER" value="0x8D96"/>
<enum name="RGB_INTEGER" value="0x8D98"/>
<enum name="RGBA_INTEGER" value="0x8D99"/>
<enum name="BGR_INTEGER" value="0x8D9A"/>
<enum name="BGRA_INTEGER" value="0x8D9B"/>
<enum name="SAMPLER_1D_ARRAY" value="0x8DC0"/>
<enum name="SAMPLER_2D_ARRAY" value="0x8DC1"/>
<enum name="SAMPLER_1D_ARRAY_SHADOW" value="0x8DC3"/>
<enum name="SAMPLER_2D_ARRAY_SHADOW" value="0x8DC4"/>
<enum name="SAMPLER_CUBE_SHADOW" value="0x8DC5"/>
<enum name="UNSIGNED_INT_VEC2" value="0x8DC6"/>
<enum name="UNSIGNED_INT_VEC3" value="0x8DC7"/>
<enum name="UNSIGNED_INT_VEC4" value="0x8DC8"/>
<enum name="INT_SAMPLER_1D" value="0x8DC9"/>
<enum name="INT_SAMPLER_2D" value="0x8DCA"/>
<enum name="INT_SAMPLER_3D" value="0x8DCB"/>
<enum name="INT_SAMPLER_CUBE" value="0x8DCC"/>
<enum name="INT_SAMPLER_1D_ARRAY" value="0x8DCE"/>
<enum name="INT_SAMPLER_2D_ARRAY" value="0x8DCF"/>
<enum name="UNSIGNED_INT_SAMPLER_1D" value="0x8DD1"/>
<enum name="UNSIGNED_INT_SAMPLER_2D" value="0x8DD2"/>
<enum name="UNSIGNED_INT_SAMPLER_3D" value="0x8DD3"/>
<enum name="UNSIGNED_INT_SAMPLER_CUBE" value="0x8DD4"/>
<enum name="UNSIGNED_INT_SAMPLER_1D_ARRAY" value="0x8DD6"/>
<enum name="UNSIGNED_INT_SAMPLER_2D_ARRAY" value="0x8DD7"/>
<enum name="QUERY_WAIT" value="0x8E13"/>
<enum name="QUERY_NO_WAIT" value="0x8E14"/>
<enum name="QUERY_BY_REGION_WAIT" value="0x8E15"/>
<enum name="QUERY_BY_REGION_NO_WAIT" value="0x8E16"/>
<enum name="BUFFER_ACCESS_FLAGS" value="0x911F"/>
<enum name="BUFFER_MAP_LENGTH" value="0x9120"/>
<enum name="BUFFER_MAP_OFFSET" value="0x9121"/>
<function name="ClearBufferiv" offset="assign">
<param name="buffer" type="GLenum"/>
<param name="drawbuffer" type="GLint"/>
<param name="value" type="const GLint *"/>
</function>
<function name="ClearBufferuiv" offset="assign">
<param name="buffer" type="GLenum"/>
<param name="drawbuffer" type="GLint"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="ClearBufferfv" offset="assign">
<param name="buffer" type="GLenum"/>
<param name="drawbuffer" type="GLint"/>
<param name="value" type="const GLfloat *"/>
</function>
<function name="ClearBufferfi" offset="assign">
<param name="buffer" type="GLenum"/>
<param name="drawbuffer" type="GLint"/>
<param name="depth" type="const GLfloat"/>
<param name="stencil" type="const GLint"/>
</function>
<function name="GetStringi" offset="assign">
<param name="name" type="GLenum"/>
<param name="index" type="GLuint"/>
<return type="const GLubyte *"/>
</function>
<function name="IsEnabledi" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
<return type="GLboolean"/>
</function>
<function name="GetFragDataLocation" offset="assign">
<param name="program" type="GLuint"/>
<param name="name" type="const GLchar *"/>
<return type="GLint"/>
</function>
<function name="BindFragDataLocation" offset="assign">
<param name="program" type="GLuint"/>
<param name="color" type="GLuint"/>
<param name="name" type="const GLchar *"/>
</function>
<function name="ColorMaski" offset="assign">
<param name="index" type="GLuint"/>
<param name="r" type="GLboolean"/>
<param name="g" type="GLboolean"/>
<param name="b" type="GLboolean"/>
<param name="a" type="GLboolean"/>
</function>
<function name="GetBooleani_v" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="value" type="GLboolean *"/>
</function>
<function name="GetIntegeri_v" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="value" type="GLint *"/>
</function>
<function name="Enablei" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
</function>
<function name="Disablei" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
</function>
<function name="BeginTransformFeedback" offset="assign">
<param name="mode" type="GLenum"/>
</function>
<function name="EndTransformFeedback" offset="assign">
</function>
<function name="BindBufferRange" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
<param name="size" type="GLsizeiptr"/>
</function>
<function name="BindBufferBase" offset="assign">
<param name="target" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="buffer" type="GLuint"/>
</function>
<function name="TransformFeedbackVaryings" offset="assign">
<param name="program" type="GLuint"/>
<param name="count" type="GLsizei"/>
<param name="varyings" type="const GLchar* *"/>
<param name="bufferMode" type="GLenum"/>
</function>
<function name="GetTransformFeedbackVarying" offset="assign">
<param name="program" type="GLuint"/>
<param name="index" type="GLuint"/>
<param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *"/>
<param name="size" type="GLsizei *"/>
<param name="type" type="GLenum *"/>
<param name="name" type="GLchar *"/>
</function>
<function name="ClampColor" offset="assign">
<param name="target" type="GLenum"/>
<param name="clamp" type="GLenum"/>
</function>
<function name="BeginConditionalRender" offset="assign">
<param name="id" type="GLuint"/>
<param name="mode" type="GLenum"/>
</function>
<function name="EndConditionalRender" offset="assign">
</function>
<function name="VertexAttribIPointer" offset="assign">
<param name="index" type="GLuint"/>
<param name="size" type="GLint"/>
<param name="type" type="GLenum"/>
<param name="stride" type="GLsizei"/>
<param name="pointer" type="const GLvoid *"/>
</function>
<function name="GetVertexAttribIiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint *"/>
</function>
<function name="GetVertexAttribIuiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLuint *"/>
</function>
<function name="VertexAttribI1i" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLint"/>
</function>
<function name="VertexAttribI2i" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
</function>
<function name="VertexAttribI3i" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="z" type="GLint"/>
</function>
<function name="VertexAttribI4i" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="z" type="GLint"/>
<param name="w" type="GLint"/>
</function>
<function name="VertexAttribI1ui" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLuint"/>
</function>
<function name="VertexAttribI2ui" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
</function>
<function name="VertexAttribI3ui" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
<param name="z" type="GLuint"/>
</function>
<function name="VertexAttribI4ui" offset="assign">
<param name="index" type="GLuint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
<param name="z" type="GLuint"/>
<param name="w" type="GLuint"/>
</function>
<function name="VertexAttribI1iv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLint *"/>
</function>
<function name="VertexAttribI2iv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLint *"/>
</function>
<function name="VertexAttribI3iv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLint *"/>
</function>
<function name="VertexAttribI4iv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLint *"/>
</function>
<function name="VertexAttribI1uiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLuint *"/>
</function>
<function name="VertexAttribI2uiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLuint *"/>
</function>
<function name="VertexAttribI3uiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLuint *"/>
</function>
<function name="VertexAttribI4uiv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLuint *"/>
</function>
<function name="VertexAttribI4bv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLbyte *"/>
</function>
<function name="VertexAttribI4sv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLshort *"/>
</function>
<function name="VertexAttribI4ubv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLubyte *"/>
</function>
<function name="VertexAttribI4usv" offset="assign">
<param name="index" type="GLuint"/>
<param name="v" type="const GLushort *"/>
</function>
<function name="GetUniformuiv" offset="assign">
<param name="program" type="GLuint"/>
<param name="location" type="GLint"/>
<param name="params" type="GLuint *"/>
</function>
<function name="Uniform1ui" offset="assign">
<param name="locatoin" type="GLint"/>
<param name="x" type="GLuint"/>
</function>
<function name="Uniform2ui" offset="assign">
<param name="location" type="GLint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
</function>
<function name="Uniform3ui" offset="assign">
<param name="location" type="GLint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
<param name="z" type="GLuint"/>
</function>
<function name="Uniform4ui" offset="assign">
<param name="location" type="GLint"/>
<param name="x" type="GLuint"/>
<param name="y" type="GLuint"/>
<param name="z" type="GLuint"/>
<param name="w" type="GLuint"/>
</function>
<function name="Uniform1uiv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="Uniform2uiv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="Uniform3uiv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="Uniform4uiv" offset="assign">
<param name="location" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="TexParameterIiv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="value" type="const GLint *"/>
</function>
<function name="TexParameterIuiv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="value" type="const GLuint *"/>
</function>
<function name="GetTexParameterIiv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="value" type="GLint *"/>
</function>
<function name="GetTexParameterIuiv" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="value" type="GLuint *"/>
</function>
</category>
<category name="3.1">
<enum name="SAMPLER_2D_RECT" value="0x8B63"/>
<enum name="SAMPLER_2D_RECT_SHADOW" value="0x8B64"/>
<enum name="SAMPLER_BUFFER" value="0x8DC2"/>
<enum name="INT_SAMPLER_2D_RECT" value="0x8DCD"/>
<enum name="INT_SAMPLER_BUFFER" value="0x8DD0"/>
<enum name="UNSIGNED_INT_SAMPLER_2D_RECT" value="0x8DD5"/>
<enum name="UNSIGNED_INT_SAMPLER_BUFFER" value="0x8DD8"/>
<enum name="TEXTURE_BUFFER" value="0x8C2A"/>
<enum name="MAX_TEXTURE_BUFFER_SIZE" value="0x8C2B"/>
<enum name="TEXTURE_BINDING_BUFFER" value="0x8C2C"/>
<enum name="TEXTURE_BUFFER_DATA_STORE_BINDING" value="0x8C2D"/>
<enum name="TEXTURE_BUFFER_FORMAT" value="0x8C2E"/>
<enum name="TEXTURE_RECTANGLE" value="0x84F5"/>
<enum name="TEXTURE_BINDING_RECTANGLE" value="0x84F6"/>
<enum name="PROXY_TEXTURE_RECTANGLE" value="0x84F7"/>
<enum name="MAX_RECTANGLE_TEXTURE_SIZE" value="0x84F8"/>
<enum name="RED_SNORM" value="0x8F90"/>
<enum name="RG_SNORM" value="0x8F91"/>
<enum name="RGB_SNORM" value="0x8F92"/>
<enum name="RGBA_SNORM" value="0x8F93"/>
<enum name="R8_SNORM" value="0x8F94"/>
<enum name="RG8_SNORM" value="0x8F95"/>
<enum name="RGB8_SNORM" value="0x8F96"/>
<enum name="RGBA8_SNORM" value="0x8F97"/>
<enum name="R16_SNORM" value="0x8F98"/>
<enum name="RG16_SNORM" value="0x8F99"/>
<enum name="RGB16_SNORM" value="0x8F9A"/>
<enum name="RGBA16_SNORM" value="0x8F9B"/>
<enum name="SIGNED_NORMALIZED" value="0x8F9C"/>
<enum name="PRIMITIVE_RESTART" value="0x8F9D"/>
<enum name="PRIMITIVE_RESTART_INDEX" value="0x8F9E"/>
<function name="DrawArraysInstanced" offset="assign">
<param name="mode" type="GLenum"/>
<param name="first" type="GLint"/>
<param name="count" type="GLsizei"/>
<param name="primcount" type="GLsizei"/>
</function>
<function name="DrawElementsInstanced" offset="assign">
<param name="mode" type="GLenum"/>
<param name="count" type="GLsizei"/>
<param name="type" type="GLenum"/>
<param name="indices" type="const GLvoid *"/>
<param name="primcount" type="GLsizei"/>
</function>
<function name="TexBuffer" offset="assign">
<param name="target" type="GLenum"/>
<param name="internalFormat" type="GLenum"/>
<param name="buffer" type="GLuint"/>
</function>
<function name="glPrimitiveRestartIndex" offset="assign">
<param name="index" type="GLuint"/>
</function>
</category>
<category name="3.2">
<enum name="CONTEXT_CORE_PROFILE_BIT" value="0x00000001"/>
<enum name="CONTEXT_COMPATIBILITY_PROFILE_BIT" value="0x00000002"/>
<enum name="LINES_ADJACENCY" value="0x000A"/>
<enum name="LINE_STRIP_ADJACENCY" value="0x000B"/>
<enum name="TRIANGLES_ADJACENCY" value="0x000C"/>
<enum name="TRIANGLE_STRIP_ADJACENCY" value="0x000D"/>
<enum name="PROGRAM_POINT_SIZE" value="0x8642"/>
<enum name="MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" value="0x8C29"/>
<enum name="FRAMEBUFFER_ATTACHMENT_LAYERED" value="0x8DA7"/>
<enum name="FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS" value="0x8DA8"/>
<enum name="GEOMETRY_SHADER" value="0x8DD9"/>
<enum name="GEOMETRY_VERTICES_OUT" value="0x8916"/>
<enum name="GEOMETRY_INPUT_TYPE" value="0x8917"/>
<enum name="GEOMETRY_OUTPUT_TYPE" value="0x8918"/>
<enum name="MAX_GEOMETRY_UNIFORM_COMPONENTS" value="0x8DDF"/>
<enum name="MAX_GEOMETRY_OUTPUT_VERTICES" value="0x8DE0"/>
<enum name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" value="0x8DE1"/>
<enum name="MAX_VERTEX_OUTPUT_COMPONENTS" value="0x9122"/>
<enum name="MAX_GEOMETRY_INPUT_COMPONENTS" value="0x9123"/>
<enum name="MAX_GEOMETRY_OUTPUT_COMPONENTS" value="0x9124"/>
<enum name="MAX_FRAGMENT_INPUT_COMPONENTS" value="0x9125"/>
<enum name="CONTEXT_PROFILE_MASK" value="0x9126"/>
<function name="GetInteger64i_v" offset="assign">
<param name="cap" type="GLenum"/>
<param name="index" type="GLuint"/>
<param name="data" type="GLint64 *"/>
</function>
<function name="GetBufferParameteri64v" offset="assign">
<param name="target" type="GLenum"/>
<param name="pname" type="GLenum"/>
<param name="params" type="GLint64 *"/>
</function>
<function name="ProgramParameteri" offset="assign">
<param name="program" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="value" type="GLint"/>
</function>
<function name="FramebufferTexture" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
</function>
<function name="FramebufferTextureFace" offset="assign">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
<param name="level" type="GLint"/>
<param name="face" type="GLenum"/>
</function>
</category>
</OpenGLAPI>
+207
View File
@@ -0,0 +1,207 @@
# This file isn't used during a normal compilation since we don't want to
# require Python in order to compile Mesa.
# Instead, when the Mesa developers update/change the API interface it's
# up to him/her to re-run this makefile and check in the newly generated files.
TOP = ../../../..
include $(TOP)/configs/current
MESA_DIR = $(TOP)/src/mesa
MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi
MESA_GLX_DIR = $(TOP)/src/glx
MESA_GLAPI_OUTPUTS = \
$(MESA_GLAPI_DIR)/glprocs.h \
$(MESA_GLAPI_DIR)/glapitemp.h \
$(MESA_GLAPI_DIR)/glapioffsets.h \
$(MESA_GLAPI_DIR)/glapitable.h \
$(MESA_GLAPI_DIR)/glapidispatch.h
MESA_GLAPI_ASM_OUTPUTS = \
$(MESA_GLAPI_DIR)/glapi_x86.S \
$(MESA_GLAPI_DIR)/glapi_x86-64.S \
$(MESA_GLAPI_DIR)/glapi_sparc.S
MESA_OUTPUTS = \
$(MESA_GLAPI_OUTPUTS) \
$(MESA_GLAPI_ASM_OUTPUTS) \
$(MESA_DIR)/main/enums.c \
$(MESA_DIR)/main/remap_helper.h \
$(MESA_GLX_DIR)/indirect.c \
$(MESA_GLX_DIR)/indirect.h \
$(MESA_GLX_DIR)/indirect_init.c \
$(MESA_GLX_DIR)/indirect_size.h \
$(MESA_GLX_DIR)/indirect_size.c
######################################################################
XORG_GLX_DIR = $(XORG_BASE)/glx
XORG_GLAPI_DIR = $(XORG_BASE)/glx/glapi
XORG_GLAPI_FILES = \
$(XORG_GLAPI_DIR)/glapi.h \
$(XORG_GLAPI_DIR)/glapi.c \
$(XORG_GLAPI_DIR)/glapi_getproc.c \
$(XORG_GLAPI_DIR)/glapi_nop.c \
$(XORG_GLAPI_DIR)/glthread.c \
$(XORG_GLAPI_DIR)/glthread.h
XORG_GLAPI_OUTPUTS = \
$(XORG_GLAPI_DIR)/glprocs.h \
$(XORG_GLAPI_DIR)/glapitemp.h \
$(XORG_GLAPI_DIR)/glapioffsets.h \
$(XORG_GLAPI_DIR)/glapitable.h \
$(XORG_GLAPI_DIR)/glapidispatch.h
XORG_OUTPUTS = \
$(XORG_GLAPI_FILES) \
$(XORG_GLAPI_OUTPUTS) \
$(XORG_GLX_DIR)/indirect_dispatch.c \
$(XORG_GLX_DIR)/indirect_dispatch_swap.c \
$(XORG_GLX_DIR)/indirect_dispatch.h \
$(XORG_GLX_DIR)/indirect_reqsize.c \
$(XORG_GLX_DIR)/indirect_reqsize.h \
$(XORG_GLX_DIR)/indirect_size.h \
$(XORG_GLX_DIR)/indirect_size_get.c \
$(XORG_GLX_DIR)/indirect_size_get.h \
$(XORG_GLX_DIR)/indirect_table.c
######################################################################
API_XML = \
gl_API.xml \
ARB_copy_buffer.xml \
ARB_depth_clamp.xml \
ARB_draw_elements_base_vertex.xml \
ARB_draw_instanced.xml \
ARB_framebuffer_object.xml \
ARB_map_buffer_range.xml \
ARB_seamless_cube_map.xml \
ARB_sync.xml \
ARB_vertex_array_object.xml \
APPLE_object_purgeable.xml \
APPLE_vertex_array_object.xml \
EXT_draw_buffers2.xml \
EXT_framebuffer_object.xml \
EXT_packed_depth_stencil.xml \
EXT_provoking_vertex.xml \
EXT_texture_array.xml \
EXT_transform_feedback.xml \
NV_conditional_render.xml \
OES_EGL_image.xml
COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py
COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
######################################################################
all: mesa xorg
mesa: $(MESA_OUTPUTS)
xorg: check-xorg-source $(XORG_OUTPUTS)
check-xorg-source:
@if ! test -d $(XORG_GLX_DIR); then \
echo "ERROR: Must specify path to xserver/GL/GLX checkout; set XORG_GLX_DIR."; \
exit 1; \
fi
clean:
-rm -f *~ *.pyo
-rm -f $(MESA_OUTPUTS)
######################################################################
$(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c
cp $< $@
$(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h
cp $< $@
######################################################################
$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapioffsets.h: gl_offsets.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapidispatch.h: gl_table.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@
######################################################################
$(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
$(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
######################################################################
$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
$(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \
-f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \
-f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@
$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
######################################################################
$(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@
$(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@
$(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@
$(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \
| $(INDENT) $(INDENT_FLAGS) > $@
$(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \
| $(INDENT) $(INDENT_FLAGS) > $@
######################################################################
$(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@
$(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@
$(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@
$(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
| $(INDENT) $(INDENT_FLAGS) > $@
$(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@
$(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
| $(INDENT) $(INDENT_FLAGS) -l200 > $@
$(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@
$(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX)
$(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<!-- Note: no GLX protocol info yet. -->
<OpenGLAPI>
<category name="GL_NV_condtitional_render" number="346">
<enum name="QUERY_WAIT_NV" value="0x8E13"/>
<enum name="QUERY_NO_WAIT_NV" value="0x8E14"/>
<enum name="QUERY_BY_REGION_WAIT_NV" value="0x8E15"/>
<enum name="QUERY_BY_REGION_NO_WAIT_NV" value="0x8E16"/>
<function name="BeginConditionalRenderNV" offset="assign">
<param name="query" type="GLuint"/>
<param name="mode" type="GLenum"/>
</function>
<function name="EndConditionalRenderNV" offset="assign">
</function>
</category>
</OpenGLAPI>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<category name="GL_OES_EGL_image">
<function name="EGLImageTargetTexture2DOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="writeOffset" type="GLvoid *"/>
</function>
<function name="EGLImageTargetRenderbufferStorageOES" offset="assign">
<param name="target" type="GLenum"/>
<param name="writeOffset" type="GLvoid *"/>
</function>
</category>
</OpenGLAPI>
+324
View File
@@ -0,0 +1,324 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML
import license
import sys, getopt, string
vtxfmt = [
"ArrayElement", \
"Color3f", \
"Color3fv", \
"Color4f", \
"Color4fv", \
"EdgeFlag", \
"EdgeFlagv", \
"EvalCoord1f", \
"EvalCoord1fv", \
"EvalCoord2f", \
"EvalCoord2fv", \
"EvalPoint1", \
"EvalPoint2", \
"FogCoordfEXT", \
"FogCoordfvEXT", \
"Indexf", \
"Indexfv", \
"Materialfv", \
"MultiTexCoord1fARB", \
"MultiTexCoord1fvARB", \
"MultiTexCoord2fARB", \
"MultiTexCoord2fvARB", \
"MultiTexCoord3fARB", \
"MultiTexCoord3fvARB", \
"MultiTexCoord4fARB", \
"MultiTexCoord4fvARB", \
"Normal3f", \
"Normal3fv", \
"SecondaryColor3fEXT", \
"SecondaryColor3fvEXT", \
"TexCoord1f", \
"TexCoord1fv", \
"TexCoord2f", \
"TexCoord2fv", \
"TexCoord3f", \
"TexCoord3fv", \
"TexCoord4f", \
"TexCoord4fv", \
"Vertex2f", \
"Vertex2fv", \
"Vertex3f", \
"Vertex3fv", \
"Vertex4f", \
"Vertex4fv", \
"CallList", \
"CallLists", \
"Begin", \
"End", \
"VertexAttrib1fNV", \
"VertexAttrib1fvNV", \
"VertexAttrib2fNV", \
"VertexAttrib2fvNV", \
"VertexAttrib3fNV", \
"VertexAttrib3fvNV", \
"VertexAttrib4fNV", \
"VertexAttrib4fvNV", \
"VertexAttrib1fARB", \
"VertexAttrib1fvARB", \
"VertexAttrib2fARB", \
"VertexAttrib2fvARB", \
"VertexAttrib3fARB", \
"VertexAttrib3fvARB", \
"VertexAttrib4fARB", \
"VertexAttrib4fvARB", \
"Rectf", \
"DrawArrays", \
"DrawElements", \
"DrawRangeElements", \
"EvalMesh1", \
"EvalMesh2", \
]
def all_entrypoints_in_abi(f, abi, api):
for n in f.entry_points:
[category, num] = api.get_category_for_name( n )
if category not in abi:
return 0
return 1
def any_entrypoints_in_abi(f, abi, api):
for n in f.entry_points:
[category, num] = api.get_category_for_name( n )
if category in abi:
return 1
return 0
def condition_for_function(f, abi, all_not_in_ABI):
"""Create a C-preprocessor condition for the function.
There are two modes of operation. If all_not_in_ABI is set, a
condition is only created is all of the entry-point names for f are
not in the selected ABI. If all_not_in_ABI is not set, a condition
is created if any entryp-point name is not in the selected ABI.
"""
condition = []
for n in f.entry_points:
[category, num] = api.get_category_for_name( n )
if category not in abi:
condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) )
elif all_not_in_ABI:
return []
return condition
class PrintGlExtensionGlue(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "extension_helper.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def printRealHeader(self):
print '#include "utils.h"'
print '#include "main/dispatch.h"'
print ''
return
def printBody(self, api):
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
category_list = {}
print '#ifndef NULL'
print '# define NULL 0'
print '#endif'
print ''
for f in api.functionIterateAll():
condition = condition_for_function(f, abi, 0)
if len(condition):
print '#if %s' % (string.join(condition, " || "))
print 'static const char %s_names[] =' % (f.name)
parameter_signature = ''
for p in f.parameterIterator():
if p.is_padding:
continue
# FIXME: This is a *really* ugly hack. :(
tn = p.type_expr.get_base_type_node()
if p.is_pointer():
parameter_signature += 'p'
elif tn.integer:
parameter_signature += 'i'
elif tn.size == 4:
parameter_signature += 'f'
else:
parameter_signature += 'd'
print ' "%s\\0" /* Parameter signature */' % (parameter_signature)
for n in f.entry_points:
print ' "gl%s\\0"' % (n)
[category, num] = api.get_category_for_name( n )
if category not in abi:
c = gl_XML.real_category_name(category)
if not category_list.has_key(c):
category_list[ c ] = []
category_list[ c ].append( f )
print ' "";'
print '#endif'
print ''
keys = category_list.keys()
keys.sort()
for category in keys:
print '#if defined(need_%s)' % (category)
print 'static const struct dri_extension_function %s_functions[] = {' % (category)
for f in category_list[ category ]:
# A function either has an offset that is
# assigned by the ABI, or it has a remap
# index.
if any_entrypoints_in_abi(f, abi, api):
index_name = "-1"
offset = f.offset
else:
index_name = "%s_remap_index" % (f.name)
offset = -1
print ' { %s_names, %s, %d },' % (f.name, index_name, offset)
print ' { NULL, 0, 0 }'
print '};'
print '#endif'
print ''
return
class PrintInitDispatch(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "extension_helper.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def do_function_body(self, api, abi, vtxfmt_only):
last_condition_string = None
for f in api.functionIterateByOffset():
if (f.name in vtxfmt) and not vtxfmt_only:
continue
if (f.name not in vtxfmt) and vtxfmt_only:
continue
condition = condition_for_function(f, abi, 1)
condition_string = string.join(condition, " || ")
if condition_string != last_condition_string:
if last_condition_string:
print '#endif /* %s */' % (last_condition_string)
if condition_string:
print '#if %s' % (condition_string)
if vtxfmt_only:
print ' disp->%s = vfmt->%s;' % (f.name, f.name)
else:
print ' disp->%s = _mesa_%s;' % (f.name, f.name)
last_condition_string = condition_string
if last_condition_string:
print '#endif /* %s */' % (last_condition_string)
def printBody(self, api):
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
print 'void driver_init_exec_table(struct _glapi_table *disp)'
print '{'
self.do_function_body(api, abi, 0)
print '}'
print ''
print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)'
print '{'
self.do_function_body(api, abi, 1)
print '}'
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
except Exception,e:
show_usage()
mode = "extensions"
for (arg,val) in args:
if arg == "-f":
file_name = val
if arg == '-m':
mode = val
api = gl_XML.parse_GL_API( file_name )
if mode == "extensions":
printer = PrintGlExtensionGlue()
elif mode == "exec_init":
printer = PrintInitDispatch()
else:
show_usage()
printer.Print( api )
+220
View File
@@ -0,0 +1,220 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<!-- Right now this file is just used to generate the GLX protocol
decode tables on the server. The only information that is needed
for that purpose is the name of the function (or pseudo-function
in the case of Render of VendorPrivate) and its opcode. Once
this file is used for other purposes, additional information will
need to be added.
-->
<category name="1.0" window_system="glX">
<function name="Render">
<glx sop="1"/>
</function>
<function name="RenderLarge">
<glx sop="2"/>
</function>
<function name="CreateContext">
<glx sop="3"/>
</function>
<function name="DestroyContext">
<glx sop="4"/>
</function>
<function name="MakeCurrent">
<glx sop="5"/>
</function>
<function name="IsDirect">
<glx sop="6"/>
</function>
<function name="QueryVersion">
<glx sop="7"/>
</function>
<function name="WaitGL">
<glx sop="8"/>
</function>
<function name="WaitX">
<glx sop="9"/>
</function>
<function name="CopyContext">
<glx sop="10"/>
</function>
<function name="SwapBuffers">
<glx sop="11"/>
</function>
<function name="UseXFont">
<glx sop="12"/>
</function>
<function name="CreateGLXPixmap">
<glx sop="13"/>
</function>
<function name="GetVisualConfigs">
<glx sop="14"/>
</function>
<function name="DestroyGLXPixmap">
<glx sop="15"/>
</function>
<function name="VendorPrivate">
<glx sop="16"/>
</function>
<function name="VendorPrivateWithReply">
<glx sop="17"/>
</function>
<function name="QueryExtensionsString">
<glx sop="18"/>
</function>
</category>
<category name="1.1" window_system="glX">
<function name="QueryServerString">
<glx sop="19"/>
</function>
<function name="ClientInfo">
<glx sop="20"/>
</function>
</category>
<category name="1.3" window_system="glX">
<function name="GetFBConfigs">
<glx sop="21"/>
</function>
<function name="CreatePixmap">
<glx sop="22"/>
</function>
<function name="DestroyPixmap">
<glx sop="23"/>
</function>
<function name="CreateNewContext">
<glx sop="24"/>
</function>
<function name="QueryContext">
<glx sop="25"/>
</function>
<function name="MakeContextCurrent">
<glx sop="26"/>
</function>
<function name="CreatePbuffer">
<glx sop="27"/>
</function>
<function name="DestroyPbuffer">
<glx sop="28"/>
</function>
<function name="GetDrawableAttributes">
<glx sop="29"/>
</function>
<function name="ChangeDrawableAttributes">
<glx sop="30"/>
</function>
<function name="CreateWindow">
<glx sop="31"/>
</function>
<function name="DestroyWindow">
<glx sop="32"/>
</function>
</category>
<category name="GLX_SGI_swap_control" number="40" window_system="glX">
<function name="SwapIntervalSGI">
<return type="int"/>
<glx vendorpriv="65536"/>
</function>
</category>
<category name="GLX_SGI_make_current_read" number="42" window_system="glX">
<function name="MakeCurrentReadSGI">
<!-- <param name="dpy" type="Display *"/>
<param name="draw" type="GLXDrawable"/>
<param name="read" type="GLXDrawable"/>
<param name="ctx" type="GLXContext"/> -->
<return type="Bool"/>
<glx vendorpriv="65537"/>
</function>
</category>
<category name="GLX_EXT_import_context" number="47" window_system="glX">
<function name="QueryContextInfoEXT">
<glx vendorpriv="1024"/>
</function>
</category>
<category name="GLX_SGIX_fbconfig" number="49" window_system="glX">
<function name="GetFBConfigsSGIX">
<glx vendorpriv="65540"/>
</function>
<function name="CreateContextWithConfigSGIX">
<glx vendorpriv="65541"/>
</function>
<function name="CreateGLXPixmapWithConfigSGIX">
<glx vendorpriv="65542"/>
</function>
</category>
<category name="GLX_SGIX_pbuffer" number="50" window_system="glX">
<function name="CreateGLXPbufferSGIX">
<glx vendorpriv="65543"/>
</function>
<function name="DestroyGLXPbufferSGIX">
<glx vendorpriv="65544"/>
</function>
<function name="ChangeDrawableAttributesSGIX">
<glx vendorpriv="65545"/>
</function>
<function name="GetDrawableAttributesSGIX">
<glx vendorpriv="65546"/>
</function>
</category>
<category name="GLX_MESA_copy_sub_buffer" number="215">
<function name="CopySubBufferMESA">
<glx vendorpriv="5154"/>
</function>
</category>
<category name="GLX_EXT_texture_from_pixmap">
<function name="BindTexImageEXT">
<glx vendorpriv="1330"/>
</function>
<function name="ReleaseTexImageEXT">
<glx vendorpriv="1331"/>
</function>
</category>
</OpenGLAPI>
+570
View File
@@ -0,0 +1,570 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML
import license
import sys, getopt, string
class glx_item_factory(gl_XML.gl_item_factory):
"""Factory to create GLX protocol oriented objects derived from gl_item."""
def create_item(self, name, element, context):
if name == "function":
return glx_function(element, context)
elif name == "enum":
return glx_enum(element, context)
elif name == "api":
return glx_api(self)
else:
return gl_XML.gl_item_factory.create_item(self, name, element, context)
class glx_enum(gl_XML.gl_enum):
def __init__(self, element, context):
gl_XML.gl_enum.__init__(self, element, context)
self.functions = {}
child = element.children
while child:
if child.type == "element" and child.name == "size":
n = child.nsProp( "name", None )
c = child.nsProp( "count", None )
m = child.nsProp( "mode", None )
if not c:
c = self.default_count
else:
c = int(c)
if m == "get":
mode = 0
else:
mode = 1
if not self.functions.has_key(n):
self.functions[ n ] = [c, mode]
child = child.next
return
class glx_function(gl_XML.gl_function):
def __init__(self, element, context):
self.glx_rop = 0
self.glx_sop = 0
self.glx_vendorpriv = 0
self.glx_vendorpriv_names = []
# If this is set to true, it means that GLdouble parameters should be
# written to the GLX protocol packet in the order they appear in the
# prototype. This is different from the "classic" ordering. In the
# classic ordering GLdoubles are written to the protocol packet first,
# followed by non-doubles. NV_vertex_program was the first extension
# to break with this tradition.
self.glx_doubles_in_order = 0
self.vectorequiv = None
self.output = None
self.can_be_large = 0
self.reply_always_array = 0
self.dimensions_in_reply = 0
self.img_reset = None
self.server_handcode = 0
self.client_handcode = 0
self.ignore = 0
self.count_parameter_list = []
self.counter_list = []
self.parameters_by_name = {}
self.offsets_calculated = 0
gl_XML.gl_function.__init__(self, element, context)
return
def process_element(self, element):
gl_XML.gl_function.process_element(self, element)
# If the function already has a vector equivalent set, don't
# set it again. This can happen if an alias to a function
# appears after the function that it aliases.
if not self.vectorequiv:
self.vectorequiv = element.nsProp("vectorequiv", None)
name = element.nsProp("name", None)
if name == self.name:
for param in self.parameters:
self.parameters_by_name[ param.name ] = param
if len(param.count_parameter_list):
self.count_parameter_list.extend( param.count_parameter_list )
if param.counter and param.counter not in self.counter_list:
self.counter_list.append(param.counter)
child = element.children
while child:
if child.type == "element" and child.name == "glx":
rop = child.nsProp( 'rop', None )
sop = child.nsProp( 'sop', None )
vop = child.nsProp( 'vendorpriv', None )
if rop:
self.glx_rop = int(rop)
if sop:
self.glx_sop = int(sop)
if vop:
self.glx_vendorpriv = int(vop)
self.glx_vendorpriv_names.append(name)
self.img_reset = child.nsProp( 'img_reset', None )
# The 'handcode' attribute can be one of 'true',
# 'false', 'client', or 'server'.
handcode = child.nsProp( 'handcode', None )
if handcode == "false":
self.server_handcode = 0
self.client_handcode = 0
elif handcode == "true":
self.server_handcode = 1
self.client_handcode = 1
elif handcode == "client":
self.server_handcode = 0
self.client_handcode = 1
elif handcode == "server":
self.server_handcode = 1
self.client_handcode = 0
else:
raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name))
self.ignore = gl_XML.is_attr_true( child, 'ignore' )
self.can_be_large = gl_XML.is_attr_true( child, 'large' )
self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' )
self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' )
self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' )
child = child.next
# Do some validation of the GLX protocol information. As
# new tests are discovered, they should be added here.
for param in self.parameters:
if param.is_output and self.glx_rop != 0:
raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name))
return
def has_variable_size_request(self):
"""Determine if the GLX request packet is variable sized.
The GLX request packet is variable sized in several common
situations.
1. The function has a non-output parameter that is counted
by another parameter (e.g., the 'textures' parameter of
glDeleteTextures).
2. The function has a non-output parameter whose count is
determined by another parameter that is an enum (e.g., the
'params' parameter of glLightfv).
3. The function has a non-output parameter that is an
image.
4. The function must be hand-coded on the server.
"""
if self.glx_rop == 0:
return 0
if self.server_handcode or self.images:
return 1
for param in self.parameters:
if not param.is_output:
if param.counter or len(param.count_parameter_list):
return 1
return 0
def variable_length_parameter(self):
for param in self.parameters:
if not param.is_output:
if param.counter or len(param.count_parameter_list):
return param
return None
def calculate_offsets(self):
if not self.offsets_calculated:
# Calculate the offset of the first function parameter
# in the GLX command packet. This byte offset is
# measured from the end of the Render / RenderLarge
# header. The offset for all non-pixel commends is
# zero. The offset for pixel commands depends on the
# number of dimensions of the pixel data.
if len(self.images) and not self.images[0].is_output:
[dim, junk, junk, junk, junk] = self.images[0].get_dimensions()
# The base size is the size of the pixel pack info
# header used by images with the specified number
# of dimensions.
if dim <= 2:
offset = 20
elif dim <= 4:
offset = 36
else:
raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name))
else:
offset = 0
for param in self.parameterIterateGlxSend():
if param.img_null_flag:
offset += 4
if param.name != self.img_reset:
param.offset = offset
if not param.is_variable_length() and not param.is_client_only:
offset += param.size()
if self.pad_after( param ):
offset += 4
self.offsets_calculated = 1
return
def offset_of(self, param_name):
self.calculate_offsets()
return self.parameters_by_name[ param_name ].offset
def parameterIterateGlxSend(self, include_variable_parameters = 1):
"""Create an iterator for parameters in GLX request order."""
# The parameter lists are usually quite short, so it's easier
# (i.e., less code) to just generate a new list with the
# required elements than it is to create a new iterator class.
temp = [ [], [], [] ]
for param in self.parameters:
if param.is_output: continue
if param.is_variable_length():
temp[2].append( param )
elif not self.glx_doubles_in_order and param.is_64_bit():
temp[0].append( param )
else:
temp[1].append( param )
parameters = temp[0]
parameters.extend( temp[1] )
if include_variable_parameters:
parameters.extend( temp[2] )
return parameters.__iter__()
def parameterIterateCounters(self):
temp = []
for name in self.counter_list:
temp.append( self.parameters_by_name[ name ] )
return temp.__iter__()
def parameterIterateOutputs(self):
temp = []
for p in self.parameters:
if p.is_output:
temp.append( p )
return temp
def command_fixed_length(self):
"""Return the length, in bytes as an integer, of the
fixed-size portion of the command."""
if len(self.parameters) == 0:
return 0
self.calculate_offsets()
size = 0
for param in self.parameterIterateGlxSend(0):
if param.name != self.img_reset and not param.is_client_only:
if size == 0:
size = param.offset + param.size()
else:
size += param.size()
if self.pad_after( param ):
size += 4
for param in self.images:
if param.img_null_flag or param.is_output:
size += 4
return size
def command_variable_length(self):
"""Return the length, as a string, of the variable-sized
portion of the command."""
size_string = ""
for p in self.parameterIterateGlxSend():
if (not p.is_output) and (p.is_variable_length() or p.is_image()):
# FIXME Replace the 1 in the size_string call
# FIXME w/0 to eliminate some un-needed parnes
# FIXME This would already be done, but it
# FIXME adds some extra diffs to the generated
# FIXME code.
size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1))
return size_string
def command_length(self):
size = self.command_fixed_length()
if self.glx_rop != 0:
size += 4
size = ((size + 3) & ~3)
return "%u%s" % (size, self.command_variable_length())
def opcode_real_value(self):
"""Get the true numeric value of the GLX opcode
Behaves similarly to opcode_value, except for
X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands.
In these cases the value for the GLX opcode field (i.e.,
16 for X_GLXVendorPrivate or 17 for
X_GLXVendorPrivateWithReply) is returned. For other 'single'
commands, the opcode for the command (e.g., 101 for
X_GLsop_NewList) is returned."""
if self.glx_vendorpriv != 0:
if self.needs_reply():
return 17
else:
return 16
else:
return self.opcode_value()
def opcode_value(self):
"""Get the unique protocol opcode for the glXFunction"""
if (self.glx_rop == 0) and self.vectorequiv:
equiv = self.context.functions_by_name[ self.vectorequiv ]
self.glx_rop = equiv.glx_rop
if self.glx_rop != 0:
return self.glx_rop
elif self.glx_sop != 0:
return self.glx_sop
elif self.glx_vendorpriv != 0:
return self.glx_vendorpriv
else:
return -1
def opcode_rop_basename(self):
"""Return either the name to be used for GLX protocol enum.
Returns either the name of the function or the name of the
name of the equivalent vector (e.g., glVertex3fv for
glVertex3f) function."""
if self.vectorequiv == None:
return self.name
else:
return self.vectorequiv
def opcode_name(self):
"""Get the unique protocol enum name for the glXFunction"""
if (self.glx_rop == 0) and self.vectorequiv:
equiv = self.context.functions_by_name[ self.vectorequiv ]
self.glx_rop = equiv.glx_rop
self.glx_doubles_in_order = equiv.glx_doubles_in_order
if self.glx_rop != 0:
return "X_GLrop_%s" % (self.opcode_rop_basename())
elif self.glx_sop != 0:
return "X_GLsop_%s" % (self.name)
elif self.glx_vendorpriv != 0:
return "X_GLvop_%s" % (self.name)
else:
raise RuntimeError('Function "%s" has no opcode.' % (self.name))
def opcode_vendor_name(self, name):
if name in self.glx_vendorpriv_names:
return "X_GLvop_%s" % (name)
else:
raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name))
def opcode_real_name(self):
"""Get the true protocol enum name for the GLX opcode
Behaves similarly to opcode_name, except for
X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands.
In these cases the string 'X_GLXVendorPrivate' or
'X_GLXVendorPrivateWithReply' is returned. For other
single or render commands 'X_GLsop' or 'X_GLrop' plus the
name of the function returned."""
if self.glx_vendorpriv != 0:
if self.needs_reply():
return "X_GLXVendorPrivateWithReply"
else:
return "X_GLXVendorPrivate"
else:
return self.opcode_name()
def needs_reply(self):
try:
x = self._needs_reply
except Exception, e:
x = 0
if self.return_type != 'void':
x = 1
for param in self.parameters:
if param.is_output:
x = 1
break
self._needs_reply = x
return x
def pad_after(self, p):
"""Returns the name of the field inserted after the
specified field to pad out the command header."""
for image in self.images:
if image.img_pad_dimensions:
if not image.height:
if p.name == image.width:
return "height"
elif p.name == image.img_xoff:
return "yoffset"
elif not image.extent:
if p.name == image.depth:
# Should this be "size4d"?
return "extent"
elif p.name == image.img_zoff:
return "woffset"
return None
def has_different_protocol(self, name):
"""Returns true if the named version of the function uses different protocol from the other versions.
Some functions, such as glDeleteTextures and
glDeleteTexturesEXT are functionally identical, but have
different protocol. This function returns true if the
named function is an alias name and that named version uses
different protocol from the function that is aliased.
"""
return (name in self.glx_vendorpriv_names) and self.glx_sop
def static_glx_name(self, name):
if self.has_different_protocol(name):
for n in self.glx_vendorpriv_names:
if n in self.static_entry_points:
return n
return self.static_name(name)
def client_supported_for_indirect(self):
"""Returns true if the function is supported on the client
side for indirect rendering."""
return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode)
class glx_function_iterator:
"""Class to iterate over a list of glXFunctions"""
def __init__(self, context):
self.iterator = context.functionIterateByOffset()
return
def __iter__(self):
return self
def next(self):
f = self.iterator.next()
if f.client_supported_for_indirect():
return f
else:
return self.next()
class glx_api(gl_XML.gl_api):
def functionIterateGlx(self):
return glx_function_iterator(self)
+280
View File
@@ -0,0 +1,280 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML, glX_proto_common, license
import sys, getopt
class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory):
"""Factory to create GLX protocol documentation oriented objects derived from glItem."""
def create_item(self, name, element, context):
if name == "parameter":
return glx_doc_parameter(element, context)
else:
return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context)
class glx_doc_parameter(gl_XML.gl_parameter):
def packet_type(self, type_dict):
"""Get the type string for the packet header
GLX protocol documentation uses type names like CARD32,
FLOAT64, LISTofCARD8, and ENUM. This function converts the
type of the parameter to one of these names."""
list_of = ""
if self.is_array():
list_of = "LISTof"
t_name = self.get_base_type_string()
if not type_dict.has_key( t_name ):
type_name = "CARD8"
else:
type_name = type_dict[ t_name ]
return "%s%s" % (list_of, type_name)
def packet_size(self):
p = None
s = self.size()
if s == 0:
a_prod = "n"
b_prod = self.p_type.size
if not self.count_parameter_list and self.counter:
a_prod = self.counter
elif self.count_parameter_list and not self.counter or self.is_output:
pass
elif self.count_parameter_list and self.counter:
b_prod = self.counter
else:
raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name))
ss = "%s*%s" % (a_prod, b_prod)
return [ss, p]
else:
if s % 4 != 0:
p = "p"
return [str(s), p]
class PrintGlxProtoText(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.license = ""
def printHeader(self):
return
def body_size(self, f):
# At some point, refactor this function and
# glXFunction::command_payload_length.
size = 0;
size_str = ""
pad_str = ""
plus = ""
for p in f.parameterIterateGlxSend():
[s, pad] = p.packet_size()
try:
size += int(s)
except Exception,e:
size_str += "%s%s" % (plus, s)
plus = "+"
if pad != None:
pad_str = pad
return [size, size_str, pad_str]
def print_render_header(self, f):
[size, size_str, pad_str] = self.body_size(f)
size += 4;
if size_str == "":
s = "%u" % ((size + 3) & ~3)
elif pad_str != "":
s = "%u+%s+%s" % (size, size_str, pad_str)
else:
s = "%u+%s" % (size, size_str)
print ' 2 %-15s rendering command length' % (s)
print ' 2 %-4u rendering command opcode' % (f.glx_rop)
return
def print_single_header(self, f):
[size, size_str, pad_str] = self.body_size(f)
size = ((size + 3) / 4) + 2;
if f.glx_vendorpriv != 0:
size += 1
print ' 1 CARD8 opcode (X assigned)'
print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name())
if size_str == "":
s = "%u" % (size)
elif pad_str != "":
s = "%u+((%s+%s)/4)" % (size, size_str, pad_str)
else:
s = "%u+((%s)/4)" % (size, size_str)
print ' 2 %-15s request length' % (s)
if f.glx_vendorpriv != 0:
print ' 4 %-4u vendor specific opcode' % (f.opcode_value())
print ' 4 GLX_CONTEXT_TAG context tag'
return
def print_reply(self, f):
print ' =>'
print ' 1 1 reply'
print ' 1 unused'
print ' 2 CARD16 sequence number'
if f.output == None:
print ' 4 0 reply length'
elif f.reply_always_array:
print ' 4 m reply length'
else:
print ' 4 m reply length, m = (n == 1 ? 0 : n)'
output = None
for x in f.parameterIterateOutputs():
output = x
break
unused = 24
if f.return_type != 'void':
print ' 4 %-15s return value' % (f.return_type)
unused -= 4
elif output != None:
print ' 4 unused'
unused -= 4
if output != None:
print ' 4 CARD32 n'
unused -= 4
if output != None:
if not f.reply_always_array:
print ''
print ' if (n = 1) this follows:'
print ''
print ' 4 CARD32 %s' % (output.name)
print ' %-2u unused' % (unused - 4)
print ''
print ' otherwise this follows:'
print ''
print ' %-2u unused' % (unused)
[s, pad] = output.packet_size()
print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name)
if pad != None:
try:
bytes = int(s)
bytes = 4 - (bytes & 3)
print ' %-8u %-15s unused' % (bytes, "")
except Exception,e:
print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
else:
print ' %-2u unused' % (unused)
def print_body(self, f):
for p in f.parameterIterateGlxSend():
[s, pad] = p.packet_size()
print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name)
if pad != None:
try:
bytes = int(s)
bytes = 4 - (bytes & 3)
print ' %-8u %-15s unused' % (bytes, "")
except Exception,e:
print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
def printBody(self, api):
self.type_map = {}
for t in api.typeIterate():
self.type_map[ "GL" + t.name ] = t.glx_name
# At some point this should be expanded to support pixel
# functions, but I'm not going to lose any sleep over it now.
for f in api.functionIterateByOffset():
if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()):
continue
if f.glx_rop:
print ' %s' % (f.name)
self.print_render_header(f)
elif f.glx_sop or f.glx_vendorpriv:
print ' %s' % (f.name)
self.print_single_header(f)
else:
continue
self.print_body(f)
if f.needs_reply():
self.print_reply(f)
print ''
return
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == "-f":
file_name = val
api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() )
printer = PrintGlxProtoText()
printer.Print( api )
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML
import string
class glx_proto_item_factory(glX_XML.glx_item_factory):
"""Factory to create GLX protocol oriented objects derived from gl_item."""
def create_item(self, name, element, context):
if name == "type":
return glx_proto_type(element, context)
else:
return glX_XML.glx_item_factory.create_item(self, name, element, context)
class glx_proto_type(gl_XML.gl_type):
def __init__(self, element, context):
gl_XML.gl_type.__init__(self, element, context)
self.glx_name = element.nsProp( "glx_name", None )
return
class glx_print_proto(gl_XML.gl_print_base):
def size_call(self, func, outputs_also = 0):
"""Create C code to calculate 'compsize'.
Creates code to calculate 'compsize'. If the function does
not need 'compsize' to be calculated, None will be
returned."""
compsize = None
for param in func.parameterIterator():
if outputs_also or not param.is_output:
if param.is_image():
[dim, w, h, d, junk] = param.get_dimensions()
compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target)
if not param.img_send_null:
compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize)
return compsize
elif len(param.count_parameter_list):
parameters = string.join( param.count_parameter_list, "," )
compsize = "__gl%s_size(%s)" % (func.name, parameters)
return compsize
return None
def emit_packet_size_calculation(self, f, bias):
# compsize is only used in the command size calculation if
# the function has a non-output parameter that has a non-empty
# counter_parameter_list.
compsize = self.size_call(f)
if compsize:
print ' const GLuint compsize = %s;' % (compsize)
if bias:
print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias)
else:
print ' const GLuint cmdlen = %s;' % (f.command_length())
#print ''
return compsize
+554
View File
@@ -0,0 +1,554 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML, glX_proto_common, license
import sys, getopt, string
class PrintGlxDispatch_h(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "glX_proto_recv.py (from Mesa)"
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
self.header_tag = "_INDIRECT_DISPATCH_H_"
return
def printRealHeader(self):
self.printVisibility( "HIDDEN", "hidden" )
print 'struct __GLXclientStateRec;'
print ''
return
def printBody(self, api):
for func in api.functionIterateAll():
if not func.ignore and not func.vectorequiv:
if func.glx_rop:
print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name)
print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
elif func.glx_sop or func.glx_vendorpriv:
print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
if func.glx_sop and func.glx_vendorpriv:
n = func.glx_vendorpriv_names[0]
print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
return
class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
def __init__(self, do_swap):
gl_XML.gl_print_base.__init__(self)
self.name = "glX_proto_recv.py (from Mesa)"
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ]
self.do_swap = do_swap
return
def printRealHeader(self):
print '#include <X11/Xmd.h>'
print '#include <GL/gl.h>'
print '#include <GL/glxproto.h>'
print '#include <inttypes.h>'
print '#include "indirect_size.h"'
print '#include "indirect_size_get.h"'
print '#include "indirect_dispatch.h"'
print '#include "glxserver.h"'
print '#include "glxbyteorder.h"'
print '#include "indirect_util.h"'
print '#include "singlesize.h"'
print '#include "glapi.h"'
print '#include "glapitable.h"'
print '#include "glthread.h"'
print '#include "glapidispatch.h"'
print ''
print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
print ''
print 'typedef struct {'
print ' __GLX_PIXEL_3D_HDR;'
print '} __GLXpixel3DHeader;'
print ''
print 'extern GLboolean __glXErrorOccured( void );'
print 'extern void __glXClearErrorOccured( void );'
print ''
print 'static const unsigned dummy_answer[2] = {0, 0};'
print ''
return
def printBody(self, api):
if self.do_swap:
self.emit_swap_wrappers(api)
for func in api.functionIterateByOffset():
if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv):
self.printFunction(func, func.name)
if func.glx_sop and func.glx_vendorpriv:
self.printFunction(func, func.glx_vendorpriv_names[0])
return
def printFunction(self, f, name):
if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0):
return
if not self.do_swap:
base = '__glXDisp'
else:
base = '__glXDispSwap'
if f.glx_rop:
print 'void %s_%s(GLbyte * pc)' % (base, name)
else:
print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name)
print '{'
if f.glx_rop or f.vectorequiv:
self.printRenderFunction(f)
elif f.glx_sop or f.glx_vendorpriv:
if len(f.get_images()) == 0:
self.printSingleFunction(f, name)
else:
print "/* Missing GLX protocol for %s. */" % (name)
print '}'
print ''
return
def swap_name(self, bytes):
return 'bswap_%u_array' % (8 * bytes)
def emit_swap_wrappers(self, api):
self.type_map = {}
already_done = [ ]
for t in api.typeIterate():
te = t.get_type_expression()
t_size = te.get_element_size()
if t_size > 1 and t.glx_name:
t_name = "GL" + t.name
self.type_map[ t_name ] = t.glx_name
if t.glx_name not in already_done:
real_name = self.real_types[t_size]
print 'static %s' % (t_name)
print 'bswap_%s( const void * src )' % (t.glx_name)
print '{'
print ' union { %s dst; %s ret; } x;' % (real_name, t_name)
print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name)
print ' return x.ret;'
print '}'
print ''
already_done.append( t.glx_name )
for bits in [16, 32, 64]:
print 'static void *'
print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits)
print '{'
print ' unsigned i;'
print ''
print ' for ( i = 0 ; i < count ; i++ ) {'
print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits)
print ' src[i] = temp;'
print ' }'
print ''
print ' return src;'
print '}'
print ''
def fetch_param(self, param):
t = param.type_string()
o = param.offset
element_size = param.size() / param.get_element_count()
if self.do_swap and (element_size != 1):
if param.is_array():
real_name = self.real_types[ element_size ]
swap_func = self.swap_name( element_size )
return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count)
else:
t_name = param.get_base_type_string()
return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o)
else:
if param.is_array():
return ' (%-8s)(pc + %2u)' % (t, o)
else:
return '*(%-8s *)(pc + %2u)' % (t, o)
return None
def emit_function_call(self, f, retval_assign, indent):
list = []
for param in f.parameterIterator():
if param.is_padding:
continue
if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list):
location = param.name
else:
location = self.fetch_param(param)
list.append( '%s %s' % (indent, location) )
if len( list ):
print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name)
print string.join( list, ",\n" )
print '%s ) );' % (indent)
else:
print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name)
return
def common_func_print_just_start(self, f, indent):
align64 = 0
need_blank = 0
f.calculate_offsets()
for param in f.parameterIterateGlxSend():
# If any parameter has a 64-bit base type, then we
# have to do alignment magic for the while thing.
if param.is_64_bit():
align64 = 1
# FIXME img_null_flag is over-loaded. In addition to
# FIXME being used for images, it is used to signify
# FIXME NULL data pointers for vertex buffer object
# FIXME related functions. Re-name it to null_data
# FIXME or something similar.
if param.img_null_flag:
print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4)
cond = '(ptr_is_null != 0) ? NULL : '
else:
cond = ""
type_string = param.type_string()
if param.is_image():
offset = f.offset_of( param.name )
print '%s %s const %s = (%s) (%s(pc + %s));' % (indent, type_string, param.name, type_string, cond, offset)
if param.depth:
print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent)
else:
print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent)
need_blank = 1
elif param.is_counter or param.name in f.count_parameter_list:
location = self.fetch_param(param)
print '%s const %s %s = %s;' % (indent, type_string, param.name, location)
need_blank = 1
elif len(param.count_parameter_list):
if param.size() == 1 and not self.do_swap:
location = self.fetch_param(param)
print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location)
else:
print '%s %s %s;' % (indent, type_string, param.name)
need_blank = 1
if need_blank:
print ''
if align64:
print '#ifdef __GLX_ALIGN64'
if f.has_variable_size_request():
self.emit_packet_size_calculation(f, 4)
s = "cmdlen"
else:
s = str((f.command_fixed_length() + 3) & ~3)
print ' if ((unsigned long)(pc) & 7) {'
print ' (void) memmove(pc-4, pc, %s);' % (s)
print ' pc -= 4;'
print ' }'
print '#endif'
print ''
need_blank = 0
if self.do_swap:
for param in f.parameterIterateGlxSend():
if param.count_parameter_list:
o = param.offset
count = param.get_element_count()
type_size = param.size() / count
if param.counter:
count_name = param.counter
else:
count_name = str(count)
# This is basically an ugly special-
# case for glCallLists.
if type_size == 1:
x = []
x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] )
x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] )
x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] )
print ' switch(%s) {' % (param.count_parameter_list[0])
for sub in x:
for t_name in sub[1]:
print ' case GL_%s:' % (t_name)
if sub[0] == 1:
print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o)
else:
swap_func = self.swap_name(sub[0])
print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name)
print ' default:'
print ' return;'
print ' }'
else:
swap_func = self.swap_name(type_size)
compsize = self.size_call(f, 1)
print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize)
need_blank = 1
else:
for param in f.parameterIterateGlxSend():
if param.count_parameter_list:
print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset)
need_blank = 1
if need_blank:
print ''
return
def printSingleFunction(self, f, name):
if name not in f.glx_vendorpriv_names:
print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;'
else:
print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;'
print ' int error;'
if self.do_swap:
print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);'
else:
print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);'
print ''
if name not in f.glx_vendorpriv_names:
print ' pc += __GLX_SINGLE_HDR_SIZE;'
else:
print ' pc += __GLX_VENDPRIV_HDR_SIZE;'
print ' if ( cx != NULL ) {'
self.common_func_print_just_start(f, " ")
if f.return_type != 'void':
print ' %s retval;' % (f.return_type)
retval_string = "retval"
retval_assign = "retval = "
else:
retval_string = "0"
retval_assign = ""
type_size = 0
answer_string = "dummy_answer"
answer_count = "0"
is_array_string = "GL_FALSE"
for param in f.parameterIterateOutputs():
answer_type = param.get_base_type_string()
if answer_type == "GLvoid":
answer_type = "GLubyte"
c = param.get_element_count()
type_size = (param.size() / c)
if type_size == 1:
size_scale = ""
else:
size_scale = " * %u" % (type_size)
if param.count_parameter_list:
print ' const GLuint compsize = %s;' % (self.size_call(f, 1))
print ' %s answerBuffer[200];' % (answer_type)
print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size )
answer_string = param.name
answer_count = "compsize"
print ''
print ' if (%s == NULL) return BadAlloc;' % (param.name)
print ' __glXClearErrorOccured();'
print ''
elif param.counter:
print ' %s answerBuffer[200];' % (answer_type)
print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size)
answer_string = param.name
answer_count = param.counter
elif c >= 1:
print ' %s %s[%u];' % (answer_type, param.name, c)
answer_string = param.name
answer_count = "%u" % (c)
if f.reply_always_array:
is_array_string = "GL_TRUE"
self.emit_function_call(f, retval_assign, " ")
if f.needs_reply():
if self.do_swap:
for param in f.parameterIterateOutputs():
c = param.get_element_count()
type_size = (param.size() / c)
if type_size > 1:
swap_name = self.swap_name( type_size )
print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count)
reply_func = '__glXSendReplySwap'
else:
reply_func = '__glXSendReply'
print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string)
#elif f.note_unflushed:
# print ' cx->hasUnflushedCommands = GL_TRUE;'
print ' error = Success;'
print ' }'
print ''
print ' return error;'
return
def printRenderFunction(self, f):
# There are 4 distinct phases in a rendering dispatch function.
# In the first phase we compute the sizes and offsets of each
# element in the command. In the second phase we (optionally)
# re-align 64-bit data elements. In the third phase we
# (optionally) byte-swap array data. Finally, in the fourth
# phase we actually dispatch the function.
self.common_func_print_just_start(f, "")
images = f.get_images()
if len(images):
if self.do_swap:
pre = "bswap_CARD32( & "
post = " )"
else:
pre = ""
post = ""
img = images[0]
# swapBytes and lsbFirst are single byte fields, so
# the must NEVER be byte-swapped.
if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"):
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );'
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );'
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post)
if img.depth:
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post)
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post)
if img.depth:
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post)
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post)
print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post)
print ''
self.emit_function_call(f, "", "")
return
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:s")
except Exception,e:
show_usage()
mode = "dispatch_c"
do_swap = 0
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
elif arg == "-s":
do_swap = 1
if mode == "dispatch_c":
printer = PrintGlxDispatchFunctions(do_swap)
elif mode == "dispatch_h":
printer = PrintGlxDispatch_h()
else:
show_usage()
api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() )
printer.Print( api )
File diff suppressed because it is too large Load Diff
+704
View File
@@ -0,0 +1,704 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML
import license
import sys, getopt, copy, string
class glx_enum_function:
def __init__(self, func_name, enum_dict):
self.name = func_name
self.mode = 1
self.sig = None
# "enums" is a set of lists. The element in the set is the
# value of the enum. The list is the list of names for that
# value. For example, [0x8126] = {"POINT_SIZE_MIN",
# "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT",
# "POINT_SIZE_MIN_SGIS"}.
self.enums = {}
# "count" is indexed by count values. Each element of count
# is a list of index to "enums" that have that number of
# associated data elements. For example, [4] =
# {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION,
# GL_AMBIENT_AND_DIFFUSE} (the enum names are used here,
# but the actual hexadecimal values would be in the array).
self.count = {}
# Fill self.count and self.enums using the dictionary of enums
# that was passed in. The generic Get functions (e.g.,
# GetBooleanv and friends) are handled specially here. In
# the data the generic Get functions are refered to as "Get".
if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]:
match_name = "Get"
else:
match_name = func_name
mode_set = 0
for enum_name in enum_dict:
e = enum_dict[ enum_name ]
if e.functions.has_key( match_name ):
[count, mode] = e.functions[ match_name ]
if mode_set and mode != self.mode:
raise RuntimeError("Not all enums for %s have the same mode." % (func_name))
self.mode = mode
if self.enums.has_key( e.value ):
if e.name not in self.enums[ e.value ]:
self.enums[ e.value ].append( e )
else:
if not self.count.has_key( count ):
self.count[ count ] = []
self.enums[ e.value ] = [ e ]
self.count[ count ].append( e.value )
return
def signature( self ):
if self.sig == None:
self.sig = ""
for i in self.count:
if i == None:
raise RuntimeError("i is None. WTF?")
self.count[i].sort()
for e in self.count[i]:
self.sig += "%04x,%d," % (e, i)
return self.sig
def is_set( self ):
return self.mode
def PrintUsingTable(self):
"""Emit the body of the __gl*_size function using a pair
of look-up tables and a mask. The mask is calculated such
that (e & mask) is unique for all the valid values of e for
this function. The result of (e & mask) is used as an index
into the first look-up table. If it matches e, then the
same entry of the second table is returned. Otherwise zero
is returned.
It seems like this should cause better code to be generated.
However, on x86 at least, the resulting .o file is about 20%
larger then the switch-statment version. I am leaving this
code in because the results may be different on other
platforms (e.g., PowerPC or x86-64)."""
return 0
count = 0
for a in self.enums:
count += 1
if self.count.has_key(-1):
return 0
# Determine if there is some mask M, such that M = (2^N) - 1,
# that will generate unique values for all of the enums.
mask = 0
for i in [1, 2, 3, 4, 5, 6, 7, 8]:
mask = (1 << i) - 1
fail = 0;
for a in self.enums:
for b in self.enums:
if a != b:
if (a & mask) == (b & mask):
fail = 1;
if not fail:
break;
else:
mask = 0
if (mask != 0) and (mask < (2 * count)):
masked_enums = {}
masked_count = {}
for i in range(0, mask + 1):
masked_enums[i] = "0";
masked_count[i] = 0;
for c in self.count:
for e in self.count[c]:
i = e & mask
enum_obj = self.enums[e][0]
masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name )
masked_count[i] = c
print ' static const GLushort a[%u] = {' % (mask + 1)
for e in masked_enums:
print ' %s, ' % (masked_enums[e])
print ' };'
print ' static const GLubyte b[%u] = {' % (mask + 1)
for c in masked_count:
print ' %u, ' % (masked_count[c])
print ' };'
print ' const unsigned idx = (e & 0x%02xU);' % (mask)
print ''
print ' return (e == a[idx]) ? (GLint) b[idx] : 0;'
return 1;
else:
return 0;
def PrintUsingSwitch(self, name):
"""Emit the body of the __gl*_size function using a
switch-statement."""
print ' switch( e ) {'
for c in self.count:
for e in self.count[c]:
first = 1
# There may be multiple enums with the same
# value. This happens has extensions are
# promoted from vendor-specific or EXT to
# ARB and to the core. Emit the first one as
# a case label, and emit the others as
# commented-out case labels.
list = {}
for enum_obj in self.enums[e]:
list[ enum_obj.priority() ] = enum_obj.name
keys = list.keys()
keys.sort()
for k in keys:
j = list[k]
if first:
print ' case GL_%s:' % (j)
first = 0
else:
print '/* case GL_%s:*/' % (j)
if c == -1:
print ' return __gl%s_variable_size( e );' % (name)
else:
print ' return %u;' % (c)
print ' default: return 0;'
print ' }'
def Print(self, name):
print 'INTERNAL PURE FASTCALL GLint'
print '__gl%s_size( GLenum e )' % (name)
print '{'
if not self.PrintUsingTable():
self.PrintUsingSwitch(name)
print '}'
print ''
class glx_server_enum_function(glx_enum_function):
def __init__(self, func, enum_dict):
glx_enum_function.__init__(self, func.name, enum_dict)
self.function = func
return
def signature( self ):
if self.sig == None:
sig = glx_enum_function.signature(self)
p = self.function.variable_length_parameter()
if p:
sig += "%u" % (p.size())
self.sig = sig
return self.sig;
def Print(self, name, printer):
f = self.function
printer.common_func_print_just_header( f )
fixup = []
foo = {}
for param_name in f.count_parameter_list:
o = f.offset_of( param_name )
foo[o] = param_name
for param_name in f.counter_list:
o = f.offset_of( param_name )
foo[o] = param_name
keys = foo.keys()
keys.sort()
for o in keys:
p = f.parameters_by_name[ foo[o] ]
printer.common_emit_one_arg(p, "pc", 0)
fixup.append( p.name )
print ' GLsizei compsize;'
print ''
printer.common_emit_fixups(fixup)
print ''
print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ","))
p = f.variable_length_parameter()
print ' return __GLX_PAD(%s);' % (p.size_string())
print '}'
print ''
class PrintGlxSizeStubs_common(gl_XML.gl_print_base):
do_get = (1 << 0)
do_set = (1 << 1)
def __init__(self, which_functions):
gl_XML.gl_print_base.__init__(self)
self.name = "glX_proto_size.py (from Mesa)"
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM")
self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0)
self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0)
return
class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common):
def printRealHeader(self):
print ''
print '#include <GL/gl.h>'
if self.emit_get:
print '#include "indirect_size_get.h"'
print '#include "glxserver.h"'
print '#include "indirect_util.h"'
print '#include "indirect_size.h"'
print ''
self.printPure()
print ''
self.printFastcall()
print ''
self.printVisibility( "INTERNAL", "internal" )
print ''
print ''
print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)'
print '# undef HAVE_ALIAS'
print '#endif'
print '#ifdef HAVE_ALIAS'
print '# define ALIAS2(from,to) \\'
print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
print ' __attribute__ ((alias( # to )));'
print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )'
print '#else'
print '# define ALIAS(from,to) \\'
print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
print ' { return __gl ## to ## _size( e ); }'
print '#endif'
print ''
print ''
def printBody(self, api):
enum_sigs = {}
aliases = []
for func in api.functionIterateGlx():
ef = glx_enum_function( func.name, api.enums_by_name )
if len(ef.enums) == 0:
continue
if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get):
sig = ef.signature()
if enum_sigs.has_key( sig ):
aliases.append( [func.name, enum_sigs[ sig ]] )
else:
enum_sigs[ sig ] = func.name
ef.Print( func.name )
for [alias_name, real_name] in aliases:
print 'ALIAS( %s, %s )' % (alias_name, real_name)
class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common):
def printRealHeader(self):
print """/**
* \\file
* Prototypes for functions used to determine the number of data elements in
* various GLX protocol messages.
*
* \\author Ian Romanick <idr@us.ibm.com>
*/
"""
self.printPure();
print ''
self.printFastcall();
print ''
self.printVisibility( "INTERNAL", "internal" );
print ''
def printBody(self, api):
for func in api.functionIterateGlx():
ef = glx_enum_function( func.name, api.enums_by_name )
if len(ef.enums) == 0:
continue
if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get):
print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name)
class PrintGlxReqSize_common(gl_XML.gl_print_base):
"""Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h.
The main purpose of this common base class is to provide the infrastructure
for the derrived classes to iterate over the same set of functions.
"""
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "glX_proto_size.py (from Mesa)"
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
class PrintGlxReqSize_h(PrintGlxReqSize_common):
def __init__(self):
PrintGlxReqSize_common.__init__(self)
self.header_tag = "_INDIRECT_REQSIZE_H_"
def printRealHeader(self):
self.printVisibility("HIDDEN", "hidden")
print ''
self.printPure()
print ''
def printBody(self, api):
for func in api.functionIterateGlx():
if not func.ignore and func.has_variable_size_request():
print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name)
class PrintGlxReqSize_c(PrintGlxReqSize_common):
"""Create the server-side 'request size' functions.
Create the server-side functions that are used to determine what the
size of a varible length command should be. The server then uses
this value to determine if the incoming command packed it malformed.
"""
def __init__(self):
PrintGlxReqSize_common.__init__(self)
self.counter_sigs = {}
def printRealHeader(self):
print ''
print '#include <GL/gl.h>'
print '#include "glxserver.h"'
print '#include "glxbyteorder.h"'
print '#include "indirect_size.h"'
print '#include "indirect_reqsize.h"'
print ''
print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
print ''
print '#if defined(__CYGWIN__) || defined(__MINGW32__)'
print '# undef HAVE_ALIAS'
print '#endif'
print '#ifdef HAVE_ALIAS'
print '# define ALIAS2(from,to) \\'
print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\'
print ' __attribute__ ((alias( # to )));'
print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )'
print '#else'
print '# define ALIAS(from,to) \\'
print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\'
print ' { return __glX ## to ## ReqSize( pc, swap ); }'
print '#endif'
print ''
print ''
def printBody(self, api):
aliases = []
enum_functions = {}
enum_sigs = {}
for func in api.functionIterateGlx():
if not func.has_variable_size_request(): continue
ef = glx_server_enum_function( func, api.enums_by_name )
if len(ef.enums) == 0: continue
sig = ef.signature()
if not enum_functions.has_key(func.name):
enum_functions[ func.name ] = sig
if not enum_sigs.has_key( sig ):
enum_sigs[ sig ] = ef
for func in api.functionIterateGlx():
# Even though server-handcode fuctions are on "the
# list", and prototypes are generated for them, there
# isn't enough information to generate a size
# function. If there was enough information, they
# probably wouldn't need to be handcoded in the first
# place!
if func.server_handcode: continue
if not func.has_variable_size_request(): continue
if enum_functions.has_key(func.name):
sig = enum_functions[func.name]
ef = enum_sigs[ sig ]
if ef.name != func.name:
aliases.append( [func.name, ef.name] )
else:
ef.Print( func.name, self )
elif func.images:
self.printPixelFunction(func)
elif func.has_variable_size_request():
a = self.printCountedFunction(func)
if a: aliases.append(a)
for [alias_name, real_name] in aliases:
print 'ALIAS( %s, %s )' % (alias_name, real_name)
return
def common_emit_fixups(self, fixup):
"""Utility function to emit conditional byte-swaps."""
if fixup:
print ' if (swap) {'
for name in fixup:
print ' %s = bswap_32(%s);' % (name, name)
print ' }'
return
def common_emit_one_arg(self, p, pc, adjust):
offset = p.offset
dst = p.string()
src = '(%s *)' % (p.type_string())
print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust);
return
def common_func_print_just_header(self, f):
print 'int'
print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name)
print '{'
def printPixelFunction(self, f):
self.common_func_print_just_header(f)
f.offset_of( f.parameters[0].name )
[dim, w, h, d, junk] = f.get_images()[0].get_dimensions()
print ' GLint row_length = * (GLint *)(pc + 4);'
if dim < 3:
fixup = ['row_length', 'skip_rows', 'alignment']
print ' GLint image_height = 0;'
print ' GLint skip_images = 0;'
print ' GLint skip_rows = * (GLint *)(pc + 8);'
print ' GLint alignment = * (GLint *)(pc + 16);'
else:
fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment']
print ' GLint image_height = * (GLint *)(pc + 8);'
print ' GLint skip_rows = * (GLint *)(pc + 16);'
print ' GLint skip_images = * (GLint *)(pc + 20);'
print ' GLint alignment = * (GLint *)(pc + 32);'
img = f.images[0]
for p in f.parameterIterateGlxSend():
if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]:
self.common_emit_one_arg(p, "pc", 0)
fixup.append( p.name )
print ''
self.common_emit_fixups(fixup)
if img.img_null_flag:
print ''
print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4)
print ' return 0;'
print ''
print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d )
print ' image_height, row_length, skip_images,'
print ' skip_rows, alignment);'
print '}'
print ''
return
def printCountedFunction(self, f):
sig = ""
offset = 0
fixup = []
params = []
plus = ''
size = ''
param_offsets = {}
# Calculate the offset of each counter parameter and the
# size string for the variable length parameter(s). While
# that is being done, calculate a unique signature for this
# function.
for p in f.parameterIterateGlxSend():
if p.is_counter:
fixup.append( p.name )
params.append( p )
elif p.counter:
s = p.size()
if s == 0: s = 1
sig += "(%u,%u)" % (f.offset_of(p.counter), s)
size += '%s%s' % (plus, p.size_string())
plus = ' + '
# If the calculated signature matches a function that has
# already be emitted, don't emit this function. Instead, add
# it to the list of function aliases.
if self.counter_sigs.has_key(sig):
n = self.counter_sigs[sig];
alias = [f.name, n]
else:
alias = None
self.counter_sigs[sig] = f.name
self.common_func_print_just_header(f)
for p in params:
self.common_emit_one_arg(p, "pc", 0)
print ''
self.common_emit_fixups(fixup)
print ''
print ' return __GLX_PAD(%s);' % (size)
print '}'
print ''
return alias
def show_usage():
print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0]
print " -m output_mode Output mode can be one of 'size_c' or 'size_h'."
print " --only-get Only emit 'get'-type functions."
print " --only-set Only emit 'set'-type functions."
print ""
print "By default, both 'get' and 'set'-type functions are emitted."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"])
except Exception,e:
show_usage()
mode = None
header_tag = None
which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
elif arg == "--only-get":
which_functions = PrintGlxSizeStubs_common.do_get
elif arg == "--only-set":
which_functions = PrintGlxSizeStubs_common.do_set
elif (arg == '-h') or (arg == "--header-tag"):
header_tag = val
if mode == "size_c":
printer = PrintGlxSizeStubs_c( which_functions )
elif mode == "size_h":
printer = PrintGlxSizeStubs_h( which_functions )
if header_tag:
printer.header_tag = header_tag
elif mode == "reqsize_c":
printer = PrintGlxReqSize_c()
elif mode == "reqsize_h":
printer = PrintGlxReqSize_h()
else:
show_usage()
api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() )
printer.Print( api )
+411
View File
@@ -0,0 +1,411 @@
#!/bin/env python
# (C) Copyright IBM Corporation 2005, 2006
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML, glX_proto_common, license
import sys, getopt
def log2(value):
for i in range(0, 30):
p = 1 << i
if p >= value:
return i
return -1
def round_down_to_power_of_two(n):
"""Returns the nearest power-of-two less than or equal to n."""
for i in range(30, 0, -1):
p = 1 << i
if p <= n:
return p
return -1
class function_table:
def __init__(self, name, do_size_check):
self.name_base = name
self.do_size_check = do_size_check
self.max_bits = 1
self.next_opcode_threshold = (1 << self.max_bits)
self.max_opcode = 0
self.functions = {}
self.lookup_table = []
# Minimum number of opcodes in a leaf node.
self.min_op_bits = 3
self.min_op_count = (1 << self.min_op_bits)
return
def append(self, opcode, func):
self.functions[opcode] = func
if opcode > self.max_opcode:
self.max_opcode = opcode
if opcode > self.next_opcode_threshold:
bits = log2(opcode)
if (1 << bits) <= opcode:
bits += 1
self.max_bits = bits
self.next_opcode_threshold = 1 << bits
return
def divide_group(self, min_opcode, total):
"""Divide the group starting min_opcode into subgroups.
Returns a tuple containing the number of bits consumed by
the node, the list of the children's tuple, and the number
of entries in the final array used by this node and its
children, and the depth of the subtree rooted at the node."""
remaining_bits = self.max_bits - total
next_opcode = min_opcode + (1 << remaining_bits)
empty_children = 0
for M in range(0, remaining_bits):
op_count = 1 << (remaining_bits - M);
child_count = 1 << M;
empty_children = 0
full_children = 0
for i in range(min_opcode, next_opcode, op_count):
used = 0
empty = 0
for j in range(i, i + op_count):
if self.functions.has_key(j):
used += 1;
else:
empty += 1;
if empty == op_count:
empty_children += 1
if used == op_count:
full_children += 1
if (empty_children > 0) or (full_children == child_count) or (op_count <= self.min_op_count):
break
# If all the remaining bits are used by this node, as is the
# case when M is 0 or remaining_bits, the node is a leaf.
if (M == 0) or (M == remaining_bits):
return [remaining_bits, [], 0, 0]
else:
children = []
count = 1
depth = 1
all_children_are_nonempty_leaf_nodes = 1
for i in range(min_opcode, next_opcode, op_count):
n = self.divide_group(i, total + M)
if not (n[1] == [] and not self.is_empty_leaf(i, n[0])):
all_children_are_nonempty_leaf_nodes = 0
children.append(n)
count += n[2] + 1
if n[3] >= depth:
depth = n[3] + 1
# If all of the child nodes are non-empty leaf nodes, pull
# them up and make this node a leaf.
if all_children_are_nonempty_leaf_nodes:
return [remaining_bits, [], 0, 0]
else:
return [M, children, count, depth]
def is_empty_leaf(self, base_opcode, M):
for op in range(base_opcode, base_opcode + (1 << M)):
if self.functions.has_key(op):
return 0
break
return 1
def dump_tree(self, node, base_opcode, remaining_bits, base_entry, depth):
M = node[0]
children = node[1]
child_M = remaining_bits - M
# This actually an error condition.
if children == []:
return
print ' /* [%u] -> opcode range [%u, %u], node depth %u */' % (base_entry, base_opcode, base_opcode + (1 << remaining_bits), depth)
print ' %u,' % (M)
base_entry += (1 << M) + 1
child_index = base_entry
child_base_opcode = base_opcode
for child in children:
if child[1] == []:
if self.is_empty_leaf(child_base_opcode, child_M):
print ' EMPTY_LEAF,'
else:
# Emit the index of the next dispatch
# function. Then add all the
# dispatch functions for this leaf
# node to the dispatch function
# lookup table.
print ' LEAF(%u),' % (len(self.lookup_table))
for op in range(child_base_opcode, child_base_opcode + (1 << child_M)):
if self.functions.has_key(op):
func = self.functions[op]
size = func.command_fixed_length()
if func.glx_rop != 0:
size += 4
size = ((size + 3) & ~3)
if func.has_variable_size_request():
size_name = "__glX%sReqSize" % (func.name)
else:
size_name = ""
if func.glx_vendorpriv == op:
func_name = func.glx_vendorpriv_names[0]
else:
func_name = func.name
temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name]
else:
temp = [op, "NULL", "NULL", 0, ""]
self.lookup_table.append(temp)
else:
print ' %u,' % (child_index)
child_index += child[2]
child_base_opcode += 1 << child_M
print ''
child_index = base_entry
for child in children:
if child[1] != []:
self.dump_tree(child, base_opcode, remaining_bits - M, child_index, depth + 1)
child_index += child[2]
base_opcode += 1 << (remaining_bits - M)
def Print(self):
# Each dispatch table consists of two data structures.
#
# The first structure is an N-way tree where the opcode for
# the function is the key. Each node switches on a range of
# bits from the opcode. M bits are extracted from the opcde
# and are used as an index to select one of the N, where
# N = 2^M, children.
#
# The tree is stored as a flat array. The first value is the
# number of bits, M, used by the node. For inner nodes, the
# following 2^M values are indexes into the array for the
# child nodes. For leaf nodes, the followign 2^M values are
# indexes into the second data structure.
#
# If an inner node's child index is 0, the child is an empty
# leaf node. That is, none of the opcodes selectable from
# that child exist. Since most of the possible opcode space
# is unused, this allows compact data storage.
#
# The second data structure is an array of pairs of function
# pointers. Each function contains a pointer to a protocol
# decode function and a pointer to a byte-swapped protocol
# decode function. Elements in this array are selected by the
# leaf nodes of the first data structure.
#
# As the tree is traversed, an accumulator is kept. This
# accumulator counts the bits of the opcode consumed by the
# traversal. When accumulator + M = B, where B is the
# maximum number of bits in an opcode, the traversal has
# reached a leaf node. The traversal starts with the most
# significant bits and works down to the least significant
# bits.
#
# Creation of the tree is the most complicated part. At
# each node the elements are divided into groups of 2^M
# elements. The value of M selected is the smallest possible
# value where all of the groups are either empty or full, or
# the groups are a preset minimum size. If all the children
# of a node are non-empty leaf nodes, the children are merged
# to create a single leaf node that replaces the parent.
tree = self.divide_group(0, 0)
print '/*****************************************************************/'
print '/* tree depth = %u */' % (tree[3])
print 'static const int_fast16_t %s_dispatch_tree[%u] = {' % (self.name_base, tree[2])
self.dump_tree(tree, 0, self.max_bits, 0, 1)
print '};\n'
# After dumping the tree, dump the function lookup table.
print 'static const void *%s_function_table[%u][2] = {' % (self.name_base, len(self.lookup_table))
index = 0
for func in self.lookup_table:
opcode = func[0]
name = func[1]
name_swap = func[2]
print ' /* [% 3u] = %5u */ {%s, %s},' % (index, opcode, name, name_swap)
index += 1
print '};\n'
if self.do_size_check:
var_table = []
print 'static const int_fast16_t %s_size_table[%u][2] = {' % (self.name_base, len(self.lookup_table))
index = 0
var_table = []
for func in self.lookup_table:
opcode = func[0]
fixed = func[3]
var = func[4]
if var != "":
var_offset = "%2u" % (len(var_table))
var_table.append(var)
else:
var_offset = "~0"
print ' /* [%3u] = %5u */ {%3u, %s},' % (index, opcode, fixed, var_offset)
index += 1
print '};\n'
print 'static const gl_proto_size_func %s_size_func_table[%u] = {' % (self.name_base, len(var_table))
for func in var_table:
print ' %s,' % (func)
print '};\n'
print 'const struct __glXDispatchInfo %s_dispatch_info = {' % (self.name_base)
print ' %u,' % (self.max_bits)
print ' %s_dispatch_tree,' % (self.name_base)
print ' %s_function_table,' % (self.name_base)
if self.do_size_check:
print ' %s_size_table,' % (self.name_base)
print ' %s_size_func_table' % (self.name_base)
else:
print ' NULL,'
print ' NULL'
print '};\n'
return
class PrintGlxDispatchTables(glX_proto_common.glx_print_proto):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "glX_server_table.py (from Mesa)"
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005, 2006", "IBM")
self.rop_functions = function_table("Render", 1)
self.sop_functions = function_table("Single", 0)
self.vop_functions = function_table("VendorPriv", 0)
return
def printRealHeader(self):
print '#include <inttypes.h>'
print '#include "glxserver.h"'
print '#include "glxext.h"'
print '#include "indirect_dispatch.h"'
print '#include "indirect_reqsize.h"'
print '#include "g_disptab.h"'
print '#include "indirect_table.h"'
print ''
return
def printBody(self, api):
for f in api.functionIterateAll():
if not f.ignore and f.vectorequiv == None:
if f.glx_rop != 0:
self.rop_functions.append(f.glx_rop, f)
if f.glx_sop != 0:
self.sop_functions.append(f.glx_sop, f)
if f.glx_vendorpriv != 0:
self.vop_functions.append(f.glx_vendorpriv, f)
self.sop_functions.Print()
self.rop_functions.Print()
self.vop_functions.Print()
return
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m")
except Exception,e:
show_usage()
mode = "table_c"
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
if mode == "table_c":
printer = PrintGlxDispatchTables()
else:
show_usage()
api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() )
printer.Print( api )
+140
View File
@@ -0,0 +1,140 @@
<!ELEMENT OpenGLAPI (category?, xi:include?, OpenGLAPI?)+>
<!ELEMENT category (type*, enum*, function*)*>
<!ELEMENT type EMPTY>
<!ELEMENT enum (size*)>
<!ELEMENT size EMPTY>
<!ELEMENT function (param*, return?, glx?)*>
<!ELEMENT param EMPTY>
<!ELEMENT return EMPTY>
<!ELEMENT glx EMPTY>
<!ELEMENT xi:include (xi:fallback)?>
<!ATTLIST xi:include
xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude"
href CDATA #REQUIRED
parse (xml|text) "xml"
encoding CDATA #IMPLIED>
<!ELEMENT xi:fallback ANY>
<!ATTLIST xi:fallback
xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
<!ATTLIST category name NMTOKEN #REQUIRED
number NMTOKEN #IMPLIED
window_system NMTOKEN #IMPLIED>
<!ATTLIST type name NMTOKEN #REQUIRED
size NMTOKEN #REQUIRED
float (true | false) "false"
unsigned (true | false) "false"
glx_name NMTOKEN #IMPLIED>
<!ATTLIST enum name NMTOKEN #REQUIRED
count CDATA #IMPLIED
value NMTOKEN #REQUIRED>
<!ATTLIST function name NMTOKEN #REQUIRED
alias NMTOKEN #IMPLIED
offset CDATA #IMPLIED
static_dispatch (true | false) "true"
vectorequiv NMTOKEN #IMPLIED>
<!ATTLIST size name NMTOKEN #REQUIRED
count NMTOKEN #IMPLIED
mode (get | set) "set">
<!ATTLIST param name NMTOKEN #REQUIRED
type CDATA #REQUIRED
client_only (true | false) "false"
count NMTOKEN #IMPLIED
counter (true | false) "false"
count_scale NMTOKEN "1"
output (true | false) "false"
padding (true | false) "false"
img_width NMTOKEN #IMPLIED
img_height NMTOKEN #IMPLIED
img_depth NMTOKEN #IMPLIED
img_extent NMTOKEN #IMPLIED
img_xoff NMTOKEN #IMPLIED
img_yoff NMTOKEN #IMPLIED
img_zoff NMTOKEN #IMPLIED
img_woff NMTOKEN #IMPLIED
img_format NMTOKEN #IMPLIED
img_type NMTOKEN #IMPLIED
img_target NMTOKEN #IMPLIED
img_send_null (true | false) "false"
img_null_flag (true | false) "false"
img_pad_dimensions (true | false) "false"
variable_param NMTOKENS #IMPLIED>
<!ATTLIST return type CDATA "void">
<!ATTLIST glx rop NMTOKEN #IMPLIED
sop NMTOKEN #IMPLIED
vendorpriv NMTOKEN #IMPLIED
large (true | false) "false"
doubles_in_order (true | false) "false"
always_array (true | false) "false"
handcode (true | false | client | server) "false"
img_reset NMTOKEN #IMPLIED
dimensions_in_reply (true | false) "false"
ignore (true | false) "false">
<!--
The various attributes for param and glx have the meanings listed below.
When adding new functions, please annote them correctly. In most cases this
will just mean adding a '<glx ignore="true"/>' tag.
param:
name - name of the parameter
type - fully qualified type (e.g., with "const", etc.)
client_only - boolean flag set on parameters which are interpreted only
by the client and are not present in the protocol encoding (e.g.,
the stride parameters to Map1f, etc.)
count - for counted arrays (e.g., the 'lists' parameter to glCallLists),
the parameter or literal that represents the count. For functions
like glVertex3fv it will be a litteral, for others it will be one of
the parameters.
counter - this parameter is a counter that will be referenced by the
'count' attribute in another parameter.
count_scale - literal value scale factor for the 'count' attribute.
See ProgramParameters4dvNV for an example.
output - this parameter is used to store the output of the function.
variable_param - name of parameter used to determine the number of
elements referenced by this parameter. This should be the name of a
single enum parameter. Most of the gl*Parameter[if]v functions use
this. Additionally, the enums that can be passed should be properly
annotated.
img_width / img_height / img_depth / img_extent - name of parameters
(or hardcoded integer) used for the dimensions of pixel data.
img_xoff / img_yoff / img_zoff / img_woff - name of parameters used
for x, y, z, and w offsets of pixel data.
img_format - name of parameter used as the pixel data format.
img_type - name of parameter used as the pixel data type.
img_target - name of parameter used as a texture target. Non-texture
pixel data should hardcode 0.
img_send_null - boolean flag to determine if blank pixel data should
be sent when a NULL pointer is passed. This is only used by
TexImage1D and TexImage2D.
img_null_flag - boolean flag to determine if an extra flag is used to
determine if a NULL pixel pointer was passed. This is used by
TexSubImage1D, TexSubImage2D, TexImage3D and others.
img_pad_dimensions - boolean flag to determine if dimension data and
offset data should be padded to the next even number of dimensions.
For example, this will insert an empty "height" field after the
"width" field in the protocol for TexImage1D.
glx:
rop - Opcode value for "render" commands
sop - Opcode value for "single" commands
vendorpriv - Opcode value for vendor private (or vendor private with
reply) commands
large - set to "true" of the render command can use RenderLarge protocol.
doubles_in_order - older commands always put GLdouble data at the
start of the render packet. Newer commands (e.g.,
ProgramEnvParameter4dvARB) put the in the order that they appear
in the parameter list.
always_array - some single commands take reply data as an array or as
return value data (e.g., glGetLightfv). Other single commands take
reply data only as an array (e.g., glGetClipPlane).
handcode - some functions are just too complicated to generate
(e.g., glSeperableFilter2D) or operate only on client-side data
(e.g., glVertexPointer) and must be handcoded.
ignore - some functions have an entry in the dispatch table, but aren't
suitable for protocol implementation (e.g., glLockArraysEXT). This
also applies to functions that don't have any GLX protocol specified
(e.g., glGetFogFuncSGIS).
-->
File diff suppressed because it is too large Load Diff
+275
View File
@@ -0,0 +1,275 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import license
import gl_XML, glX_XML
import sys, getopt
class PrintGenericStubs(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_SPARC_asm.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
def printRealHeader(self):
print '#include "glapi/glapioffsets.h"'
print ''
print '#ifdef __arch64__'
print '#define GL_OFF(N)\t((N) * 8)'
print '#define GL_LL\t\tldx'
print '#define GL_TIE_LD(SYM)\t%tie_ldx(SYM)'
print '#define GL_STACK_SIZE\t128'
print '#else'
print '#define GL_OFF(N)\t((N) * 4)'
print '#define GL_LL\t\tld'
print '#define GL_TIE_LD(SYM)\t%tie_ld(SYM)'
print '#define GL_STACK_SIZE\t64'
print '#endif'
print ''
print '#define GLOBL_FN(x) .globl x ; .type x, @function'
print '#define HIDDEN(x) .hidden x'
print ''
print '\t.register %g2, #scratch'
print '\t.register %g3, #scratch'
print ''
print '\t.text'
print ''
print '\tGLOBL_FN(__glapi_sparc_icache_flush)'
print '\tHIDDEN(__glapi_sparc_icache_flush)'
print '\t.type\t__glapi_sparc_icache_flush, @function'
print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */'
print '\tflush\t%o0'
print '\tretl'
print '\t nop'
print ''
print '\t.align\t32'
print ''
print '\t.type\t__glapi_sparc_get_pc, @function'
print '__glapi_sparc_get_pc:'
print '\tretl'
print '\t add\t%o7, %g2, %g2'
print '\t.size\t__glapi_sparc_get_pc, .-__glapi_sparc_get_pc'
print ''
print '#ifdef GLX_USE_TLS'
print ''
print '\tGLOBL_FN(__glapi_sparc_get_dispatch)'
print '\tHIDDEN(__glapi_sparc_get_dispatch)'
print '__glapi_sparc_get_dispatch:'
print '\tmov\t%o7, %g1'
print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2'
print '\tcall\t__glapi_sparc_get_pc'
print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2'
print '\tmov\t%g1, %o7'
print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1'
print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1'
print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)'
print '\tretl'
print '\t mov\t%g2, %o0'
print ''
print '\t.data'
print '\t.align\t32'
print ''
print '\t/* --> sethi %hi(_glapi_tls_Dispatch), %g1 */'
print '\t/* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */'
print '\tGLOBL_FN(__glapi_sparc_tls_stub)'
print '\tHIDDEN(__glapi_sparc_tls_stub)'
print '__glapi_sparc_tls_stub: /* Call offset in %g3 */'
print '\tmov\t%o7, %g1'
print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2'
print '\tcall\t__glapi_sparc_get_pc'
print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2'
print '\tmov\t%g1, %o7'
print '\tsrl\t%g3, 10, %g3'
print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1'
print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1'
print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)'
print '\tGL_LL\t[%g7+%g2], %g1'
print '\tGL_LL\t[%g1 + %g3], %g1'
print '\tjmp\t%g1'
print '\t nop'
print '\t.size\t__glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub'
print ''
print '#define GL_STUB(fn, off)\t\t\t\t\\'
print '\tGLOBL_FN(fn);\t\t\t\t\t\\'
print 'fn:\tba\t__glapi_sparc_tls_stub;\t\t\t\\'
print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\'
print '\t.size\tfn,.-fn;'
print ''
print '#elif defined(PTHREADS)'
print ''
print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */'
print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */'
print '\t/* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */'
print '\t/* 64-bit 0x0c --> sllx %g1, 32, %g1 */'
print '\t/* 64-bit 0x10 --> add %g1, %g2, %g1 */'
print '\t/* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */'
print ''
print '\t/* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */'
print '\t/* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */'
print ''
print '\t.data'
print '\t.align\t32'
print ''
print '\tGLOBL_FN(__glapi_sparc_pthread_stub)'
print '\tHIDDEN(__glapi_sparc_pthread_stub)'
print '__glapi_sparc_pthread_stub: /* Call offset in %g3 */'
print '\tmov\t%o7, %g1'
print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2'
print '\tcall\t__glapi_sparc_get_pc'
print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2'
print '\tmov\t%g1, %o7'
print '\tsethi\t%hi(_glapi_Dispatch), %g1'
print '\tor\t%g1, %lo(_glapi_Dispatch), %g1'
print '\tsrl\t%g3, 10, %g3'
print '\tGL_LL\t[%g2+%g1], %g2'
print '\tGL_LL\t[%g2], %g1'
print '\tcmp\t%g1, 0'
print '\tbe\t2f'
print '\t nop'
print '1:\tGL_LL\t[%g1 + %g3], %g1'
print '\tjmp\t%g1'
print '\t nop'
print '2:\tsave\t%sp, GL_STACK_SIZE, %sp'
print '\tmov\t%g3, %l0'
print '\tcall\t_glapi_get_dispatch'
print '\t nop'
print '\tmov\t%o0, %g1'
print '\tmov\t%l0, %g3'
print '\tba\t1b'
print '\t restore %g0, %g0, %g0'
print '\t.size\t__glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub'
print ''
print '#define GL_STUB(fn, off)\t\t\t\\'
print '\tGLOBL_FN(fn);\t\t\t\t\\'
print 'fn:\tba\t__glapi_sparc_pthread_stub;\t\\'
print '\t sethi\tGL_OFF(off), %g3;\t\t\\'
print '\t.size\tfn,.-fn;'
print ''
print '#else /* Non-threaded version. */'
print ''
print '\t.type __glapi_sparc_nothread_stub, @function'
print '__glapi_sparc_nothread_stub: /* Call offset in %g3 */'
print '\tmov\t%o7, %g1'
print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2'
print '\tcall\t__glapi_sparc_get_pc'
print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2'
print '\tmov\t%g1, %o7'
print '\tsrl\t%g3, 10, %g3'
print '\tsethi\t%hi(_glapi_Dispatch), %g1'
print '\tor\t%g1, %lo(_glapi_Dispatch), %g1'
print '\tGL_LL\t[%g2+%g1], %g2'
print '\tGL_LL\t[%g2], %g1'
print '\tGL_LL\t[%g1 + %g3], %g1'
print '\tjmp\t%g1'
print '\t nop'
print '\t.size\t__glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub'
print ''
print '#define GL_STUB(fn, off)\t\t\t\\'
print '\tGLOBL_FN(fn);\t\t\t\t\\'
print 'fn:\tba\t__glapi_sparc_nothread_stub;\t\\'
print '\t sethi\tGL_OFF(off), %g3;\t\t\\'
print '\t.size\tfn,.-fn;'
print ''
print '#endif'
print ''
print '#define GL_STUB_ALIAS(fn, alias) \\'
print ' .globl fn; \\'
print ' .set fn, alias'
print ''
print '\t.text'
print '\t.align\t32'
print ''
print '\t.globl\tgl_dispatch_functions_start'
print '\tHIDDEN(gl_dispatch_functions_start)'
print 'gl_dispatch_functions_start:'
print ''
return
def printRealFooter(self):
print ''
print '\t.globl\tgl_dispatch_functions_end'
print '\tHIDDEN(gl_dispatch_functions_end)'
print 'gl_dispatch_functions_end:'
return
def printBody(self, api):
for f in api.functionIterateByOffset():
name = f.dispatch_name()
print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name)
if not f.is_static_entry_point(f.name):
print '\tHIDDEN(gl%s)' % (name)
for f in api.functionIterateByOffset():
name = f.dispatch_name()
if f.is_static_entry_point(f.name):
for n in f.entry_points:
if n != f.name:
text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name)
if f.has_different_protocol(n):
print '#ifndef GLX_INDIRECT_RENDERING'
print text
print '#endif'
else:
print text
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
mode = "generic"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == '-m':
mode = val
elif arg == "-f":
file_name = val
if mode == "generic":
printer = PrintGenericStubs()
else:
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer.Print(api)
+967
View File
@@ -0,0 +1,967 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import libxml2
import re, sys, string
import typeexpr
def parse_GL_API( file_name, factory = None ):
doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT )
ret = doc.xincludeProcess()
if not factory:
factory = gl_item_factory()
api = factory.create_item( "api", None, None )
api.process_element( doc )
# After the XML has been processed, we need to go back and assign
# dispatch offsets to the functions that request that their offsets
# be assigned by the scripts. Typically this means all functions
# that are not part of the ABI.
for func in api.functionIterateByCategory():
if func.assign_offset:
func.offset = api.next_offset;
api.next_offset += 1
doc.freeDoc()
return api
def is_attr_true( element, name ):
"""Read a name value from an element's attributes.
The value read from the attribute list must be either 'true' or
'false'. If the value is 'false', zero will be returned. If the
value is 'true', non-zero will be returned. An exception will be
raised for any other value."""
value = element.nsProp( name, None )
if value == "true":
return 1
elif value == "false":
return 0
else:
raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name))
class gl_print_base:
"""Base class of all API pretty-printers.
In the model-view-controller pattern, this is the view. Any derived
class will want to over-ride the printBody, printRealHader, and
printRealFooter methods. Some derived classes may want to over-ride
printHeader and printFooter, or even Print (though this is unlikely).
"""
def __init__(self):
# Name of the script that is generating the output file.
# Every derived class should set this to the name of its
# source file.
self.name = "a"
# License on the *generated* source file. This may differ
# from the license on the script that is generating the file.
# Every derived class should set this to some reasonable
# value.
#
# See license.py for an example of a reasonable value.
self.license = "The license for this file is unspecified."
# The header_tag is the name of the C preprocessor define
# used to prevent multiple inclusion. Typically only
# generated C header files need this to be set. Setting it
# causes code to be generated automatically in printHeader
# and printFooter.
self.header_tag = None
# List of file-private defines that must be undefined at the
# end of the file. This can be used in header files to define
# names for use in the file, then undefine them at the end of
# the header file.
self.undef_list = []
return
def Print(self, api):
self.printHeader()
self.printBody(api)
self.printFooter()
return
def printHeader(self):
"""Print the header associated with all files and call the printRealHeader method."""
print '/* DO NOT EDIT - This file generated automatically by %s script */' \
% (self.name)
print ''
print '/*'
print ' * ' + self.license.replace('\n', '\n * ')
print ' */'
print ''
if self.header_tag:
print '#if !defined( %s )' % (self.header_tag)
print '# define %s' % (self.header_tag)
print ''
self.printRealHeader();
return
def printFooter(self):
"""Print the header associated with all files and call the printRealFooter method."""
self.printRealFooter()
if self.undef_list:
print ''
for u in self.undef_list:
print "# undef %s" % (u)
if self.header_tag:
print ''
print '#endif /* !defined( %s ) */' % (self.header_tag)
def printRealHeader(self):
"""Print the "real" header for the created file.
In the base class, this function is empty. All derived
classes should over-ride this function."""
return
def printRealFooter(self):
"""Print the "real" footer for the created file.
In the base class, this function is empty. All derived
classes should over-ride this function."""
return
def printPure(self):
"""Conditionally define `PURE' function attribute.
Conditionally defines a preprocessor macro `PURE' that wraps
GCC's `pure' function attribute. The conditional code can be
easilly adapted to other compilers that support a similar
feature.
The name is also added to the file's undef_list.
"""
self.undef_list.append("PURE")
print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define PURE __attribute__((pure))
# else
# define PURE
# endif"""
return
def printFastcall(self):
"""Conditionally define `FASTCALL' function attribute.
Conditionally defines a preprocessor macro `FASTCALL' that
wraps GCC's `fastcall' function attribute. The conditional
code can be easilly adapted to other compilers that support a
similar feature.
The name is also added to the file's undef_list.
"""
self.undef_list.append("FASTCALL")
print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define FASTCALL __attribute__((fastcall))
# else
# define FASTCALL
# endif"""
return
def printVisibility(self, S, s):
"""Conditionally define visibility function attribute.
Conditionally defines a preprocessor macro name S that wraps
GCC's visibility function attribute. The visibility used is
the parameter s. The conditional code can be easilly adapted
to other compilers that support a similar feature.
The name is also added to the file's undef_list.
"""
self.undef_list.append(S)
print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__)
# define %s __attribute__((visibility("%s")))
# else
# define %s
# endif""" % (S, s, S)
return
def printNoinline(self):
"""Conditionally define `NOINLINE' function attribute.
Conditionally defines a preprocessor macro `NOINLINE' that
wraps GCC's `noinline' function attribute. The conditional
code can be easilly adapted to other compilers that support a
similar feature.
The name is also added to the file's undef_list.
"""
self.undef_list.append("NOINLINE")
print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define NOINLINE __attribute__((noinline))
# else
# define NOINLINE
# endif"""
return
def real_function_name(element):
name = element.nsProp( "name", None )
alias = element.nsProp( "alias", None )
if alias:
return alias
else:
return name
def real_category_name(c):
if re.compile("[1-9][0-9]*[.][0-9]+").match(c):
return "GL_VERSION_" + c.replace(".", "_")
else:
return c
def classify_category(name, number):
"""Based on the category name and number, select a numerical class for it.
Categories are divided into four classes numbered 0 through 3. The
classes are:
0. Core GL versions, sorted by version number.
1. ARB extensions, sorted by extension number.
2. Non-ARB extensions, sorted by extension number.
3. Un-numbered extensions, sorted by extension name.
"""
try:
core_version = float(name)
except Exception,e:
core_version = 0.0
if core_version > 0.0:
cat_type = 0
key = name
elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"):
cat_type = 1
key = int(number)
else:
if number != None:
cat_type = 2
key = int(number)
else:
cat_type = 3
key = name
return [cat_type, key]
def create_parameter_string(parameters, include_names):
"""Create a parameter string from a list of gl_parameters."""
list = []
for p in parameters:
if p.is_padding:
continue
if include_names:
list.append( p.string() )
else:
list.append( p.type_string() )
if len(list) == 0: list = ["void"]
return string.join(list, ", ")
class gl_item:
def __init__(self, element, context):
self.context = context
self.name = element.nsProp( "name", None )
self.category = real_category_name( element.parent.nsProp( "name", None ) )
return
class gl_type( gl_item ):
def __init__(self, element, context):
gl_item.__init__(self, element, context)
self.size = int( element.nsProp( "size", None ), 0 )
te = typeexpr.type_expression( None )
tn = typeexpr.type_node()
tn.size = int( element.nsProp( "size", None ), 0 )
tn.integer = not is_attr_true( element, "float" )
tn.unsigned = is_attr_true( element, "unsigned" )
tn.name = "GL" + self.name
te.set_base_type_node( tn )
self.type_expr = te
return
def get_type_expression(self):
return self.type_expr
class gl_enum( gl_item ):
def __init__(self, element, context):
gl_item.__init__(self, element, context)
self.value = int( element.nsProp( "value", None ), 0 )
temp = element.nsProp( "count", None )
if not temp or temp == "?":
self.default_count = -1
else:
try:
c = int(temp)
except Exception,e:
raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
self.default_count = c
return
def priority(self):
"""Calculate a 'priority' for this enum name.
When an enum is looked up by number, there may be many
possible names, but only one is the 'prefered' name. The
priority is used to select which name is the 'best'.
Highest precedence is given to core GL name. ARB extension
names have the next highest, followed by EXT extension names.
Vendor extension names are the lowest.
"""
if self.name.endswith( "_BIT" ):
bias = 1
else:
bias = 0
if self.category.startswith( "GL_VERSION_" ):
priority = 0
elif self.category.startswith( "GL_ARB_" ):
priority = 2
elif self.category.startswith( "GL_EXT_" ):
priority = 4
else:
priority = 6
return priority + bias
class gl_parameter:
def __init__(self, element, context):
self.name = element.nsProp( "name", None )
ts = element.nsProp( "type", None )
self.type_expr = typeexpr.type_expression( ts, context )
temp = element.nsProp( "variable_param", None )
if temp:
self.count_parameter_list = temp.split( ' ' )
else:
self.count_parameter_list = []
# The count tag can be either a numeric string or the name of
# a variable. If it is the name of a variable, the int(c)
# statement will throw an exception, and the except block will
# take over.
c = element.nsProp( "count", None )
try:
count = int(c)
self.count = count
self.counter = None
except Exception,e:
count = 1
self.count = 0
self.counter = c
self.count_scale = int(element.nsProp( "count_scale", None ))
elements = (count * self.count_scale)
if elements == 1:
elements = 0
#if ts == "GLdouble":
# print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
# print '/* # elements = %u */' % (elements)
self.type_expr.set_elements( elements )
#if ts == "GLdouble":
# print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())
self.is_client_only = is_attr_true( element, 'client_only' )
self.is_counter = is_attr_true( element, 'counter' )
self.is_output = is_attr_true( element, 'output' )
# Pixel data has special parameters.
self.width = element.nsProp('img_width', None)
self.height = element.nsProp('img_height', None)
self.depth = element.nsProp('img_depth', None)
self.extent = element.nsProp('img_extent', None)
self.img_xoff = element.nsProp('img_xoff', None)
self.img_yoff = element.nsProp('img_yoff', None)
self.img_zoff = element.nsProp('img_zoff', None)
self.img_woff = element.nsProp('img_woff', None)
self.img_format = element.nsProp('img_format', None)
self.img_type = element.nsProp('img_type', None)
self.img_target = element.nsProp('img_target', None)
self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' )
self.img_null_flag = is_attr_true( element, 'img_null_flag' )
self.img_send_null = is_attr_true( element, 'img_send_null' )
self.is_padding = is_attr_true( element, 'padding' )
return
def compatible(self, other):
return 1
def is_array(self):
return self.is_pointer()
def is_pointer(self):
return self.type_expr.is_pointer()
def is_image(self):
if self.width:
return 1
else:
return 0
def is_variable_length(self):
return len(self.count_parameter_list) or self.counter
def is_64_bit(self):
count = self.type_expr.get_element_count()
if count:
if (self.size() / count) == 8:
return 1
else:
if self.size() == 8:
return 1
return 0
def string(self):
return self.type_expr.original_string + " " + self.name
def type_string(self):
return self.type_expr.original_string
def get_base_type_string(self):
return self.type_expr.get_base_name()
def get_dimensions(self):
if not self.width:
return [ 0, "0", "0", "0", "0" ]
dim = 1
w = self.width
h = "1"
d = "1"
e = "1"
if self.height:
dim = 2
h = self.height
if self.depth:
dim = 3
d = self.depth
if self.extent:
dim = 4
e = self.extent
return [ dim, w, h, d, e ]
def get_stack_size(self):
return self.type_expr.get_stack_size()
def size(self):
if self.is_image():
return 0
else:
return self.type_expr.get_element_size()
def get_element_count(self):
c = self.type_expr.get_element_count()
if c == 0:
return 1
return c
def size_string(self, use_parens = 1):
s = self.size()
if self.counter or self.count_parameter_list:
list = [ "compsize" ]
if self.counter and self.count_parameter_list:
list.append( self.counter )
elif self.counter:
list = [ self.counter ]
if s > 1:
list.append( str(s) )
if len(list) > 1 and use_parens :
return "(%s)" % (string.join(list, " * "))
else:
return string.join(list, " * ")
elif self.is_image():
return "compsize"
else:
return str(s)
def format_string(self):
if self.type_expr.original_string == "GLenum":
return "0x%x"
else:
return self.type_expr.format_string()
class gl_function( gl_item ):
def __init__(self, element, context):
self.context = context
self.name = None
self.entry_points = []
self.return_type = "void"
self.parameters = []
self.offset = -1
self.initialized = 0
self.images = []
self.assign_offset = 0
self.static_entry_points = []
# Track the parameter string (for the function prototype)
# for each entry-point. This is done because some functions
# change their prototype slightly when promoted from extension
# to ARB extension to core. glTexImage3DEXT and glTexImage3D
# are good examples of this. Scripts that need to generate
# code for these differing aliases need to real prototype
# for each entry-point. Otherwise, they may generate code
# that won't compile.
self.parameter_strings = {}
self.process_element( element )
return
def process_element(self, element):
name = element.nsProp( "name", None )
alias = element.nsProp( "alias", None )
if is_attr_true(element, "static_dispatch"):
self.static_entry_points.append(name)
self.entry_points.append( name )
if alias:
true_name = alias
else:
true_name = name
# Only try to set the offset when a non-alias
# entry-point is being processes.
offset = element.nsProp( "offset", None )
if offset:
try:
o = int( offset )
self.offset = o
except Exception, e:
self.offset = -1
if offset == "assign":
self.assign_offset = 1
if not self.name:
self.name = true_name
elif self.name != true_name:
raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name))
# There are two possible cases. The first time an entry-point
# with data is seen, self.initialized will be 0. On that
# pass, we just fill in the data. The next time an
# entry-point with data is seen, self.initialized will be 1.
# On that pass we have to make that the new values match the
# valuse from the previous entry-point.
parameters = []
return_type = "void"
child = element.children
while child:
if child.type == "element":
if child.name == "return":
return_type = child.nsProp( "type", None )
elif child.name == "param":
param = self.context.factory.create_item( "parameter", child, self.context)
parameters.append( param )
child = child.next
if self.initialized:
if self.return_type != return_type:
raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type))
if len(parameters) != len(self.parameters):
raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters)))
for j in range(0, len(parameters)):
p1 = parameters[j]
p2 = self.parameters[j]
if not p1.compatible( p2 ):
raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string))
if true_name == name or not self.initialized:
self.return_type = return_type
self.parameters = parameters
for param in self.parameters:
if param.is_image():
self.images.append( param )
if element.children:
self.initialized = 1
self.parameter_strings[name] = create_parameter_string(parameters, 1)
else:
self.parameter_strings[name] = None
return
def get_images(self):
"""Return potentially empty list of input images."""
return self.images
def parameterIterator(self):
return self.parameters.__iter__();
def get_parameter_string(self, entrypoint = None):
if entrypoint:
s = self.parameter_strings[ entrypoint ]
if s:
return s
return create_parameter_string( self.parameters, 1 )
def get_called_parameter_string(self):
p_string = ""
comma = ""
for p in self.parameterIterator():
p_string = p_string + comma + p.name
comma = ", "
return p_string
def is_abi(self):
return (self.offset >= 0 and not self.assign_offset)
def is_static_entry_point(self, name):
return name in self.static_entry_points
def dispatch_name(self):
if self.name in self.static_entry_points:
return self.name
else:
return "_dispatch_stub_%u" % (self.offset)
def static_name(self, name):
if name in self.static_entry_points:
return name
else:
return "_dispatch_stub_%u" % (self.offset)
class gl_item_factory:
"""Factory to create objects derived from gl_item."""
def create_item(self, item_name, element, context):
if item_name == "function":
return gl_function(element, context)
if item_name == "type":
return gl_type(element, context)
elif item_name == "enum":
return gl_enum(element, context)
elif item_name == "parameter":
return gl_parameter(element, context)
elif item_name == "api":
return gl_api(self)
else:
return None
class gl_api:
def __init__(self, factory):
self.functions_by_name = {}
self.enums_by_name = {}
self.types_by_name = {}
self.category_dict = {}
self.categories = [{}, {}, {}, {}]
self.factory = factory
self.next_offset = 0
typeexpr.create_initial_types()
return
def process_element(self, doc):
element = doc.children
while element.type != "element" or element.name != "OpenGLAPI":
element = element.next
if element:
self.process_OpenGLAPI(element)
return
def process_OpenGLAPI(self, element):
child = element.children
while child:
if child.type == "element":
if child.name == "category":
self.process_category( child )
elif child.name == "OpenGLAPI":
self.process_OpenGLAPI( child )
child = child.next
return
def process_category(self, cat):
cat_name = cat.nsProp( "name", None )
cat_number = cat.nsProp( "number", None )
[cat_type, key] = classify_category(cat_name, cat_number)
self.categories[cat_type][key] = [cat_name, cat_number]
child = cat.children
while child:
if child.type == "element":
if child.name == "function":
func_name = real_function_name( child )
temp_name = child.nsProp( "name", None )
self.category_dict[ temp_name ] = [cat_name, cat_number]
if self.functions_by_name.has_key( func_name ):
func = self.functions_by_name[ func_name ]
func.process_element( child )
else:
func = self.factory.create_item( "function", child, self )
self.functions_by_name[ func_name ] = func
if func.offset >= self.next_offset:
self.next_offset = func.offset + 1
elif child.name == "enum":
enum = self.factory.create_item( "enum", child, self )
self.enums_by_name[ enum.name ] = enum
elif child.name == "type":
t = self.factory.create_item( "type", child, self )
self.types_by_name[ "GL" + t.name ] = t
child = child.next
return
def functionIterateByCategory(self, cat = None):
"""Iterate over functions by category.
If cat is None, all known functions are iterated in category
order. See classify_category for details of the ordering.
Within a category, functions are sorted by name. If cat is
not None, then only functions in that category are iterated.
"""
lists = [{}, {}, {}, {}]
for func in self.functionIterateAll():
[cat_name, cat_number] = self.category_dict[func.name]
if (cat == None) or (cat == cat_name):
[func_cat_type, key] = classify_category(cat_name, cat_number)
if not lists[func_cat_type].has_key(key):
lists[func_cat_type][key] = {}
lists[func_cat_type][key][func.name] = func
functions = []
for func_cat_type in range(0,4):
keys = lists[func_cat_type].keys()
keys.sort()
for key in keys:
names = lists[func_cat_type][key].keys()
names.sort()
for name in names:
functions.append(lists[func_cat_type][key][name])
return functions.__iter__()
def functionIterateByOffset(self):
max_offset = -1
for func in self.functions_by_name.itervalues():
if func.offset > max_offset:
max_offset = func.offset
temp = [None for i in range(0, max_offset + 1)]
for func in self.functions_by_name.itervalues():
if func.offset != -1:
temp[ func.offset ] = func
list = []
for i in range(0, max_offset + 1):
if temp[i]:
list.append(temp[i])
return list.__iter__();
def functionIterateAll(self):
return self.functions_by_name.itervalues()
def enumIterateByName(self):
keys = self.enums_by_name.keys()
keys.sort()
list = []
for enum in keys:
list.append( self.enums_by_name[ enum ] )
return list.__iter__()
def categoryIterate(self):
"""Iterate over categories.
Iterate over all known categories in the order specified by
classify_category. Each iterated value is a tuple of the
name and number (which may be None) of the category.
"""
list = []
for cat_type in range(0,4):
keys = self.categories[cat_type].keys()
keys.sort()
for key in keys:
list.append(self.categories[cat_type][key])
return list.__iter__()
def get_category_for_name( self, name ):
if self.category_dict.has_key(name):
return self.category_dict[name]
else:
return ["<unknown category>", None]
def typeIterate(self):
return self.types_by_name.itervalues()
def find_type( self, type_name ):
if type_name in self.types_by_name:
return self.types_by_name[ type_name ].type_expr
else:
print "Unable to find base type matching \"%s\"." % (type_name)
return None
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
<OpenGLAPI>
<xi:include href="glX_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="gl_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</OpenGLAPI>
+320
View File
@@ -0,0 +1,320 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML, glX_XML
import license
import sys, getopt
class PrintGlOffsets(gl_XML.gl_print_base):
def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_apitemp.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
self.es = es
self.undef_list.append( "KEYWORD1" )
self.undef_list.append( "KEYWORD1_ALT" )
self.undef_list.append( "KEYWORD2" )
self.undef_list.append( "NAME" )
self.undef_list.append( "DISPATCH" )
self.undef_list.append( "RETURN_DISPATCH" )
self.undef_list.append( "DISPATCH_TABLE_NAME" )
self.undef_list.append( "UNUSED_TABLE_NAME" )
self.undef_list.append( "TABLE_ENTRY" )
def printFunction(self, f, name):
p_string = ""
o_string = ""
t_string = ""
comma = ""
if f.is_static_entry_point(name):
keyword = "KEYWORD1"
else:
keyword = "KEYWORD1_ALT"
n = f.static_name(name)
for p in f.parameterIterator():
if p.is_padding:
continue
if p.is_pointer():
cast = "(const void *) "
else:
cast = ""
t_string = t_string + comma + p.format_string()
p_string = p_string + comma + p.name
o_string = o_string + comma + cast + p.name
comma = ", "
if f.return_type != 'void':
dispatch = "RETURN_DISPATCH"
else:
dispatch = "DISPATCH"
need_proto = False
if not f.is_static_entry_point(name):
need_proto = True
elif self.es:
cat, num = api.get_category_for_name(name)
if (cat.startswith("es") or cat.startswith("GL_OES")):
need_proto = True
if need_proto:
print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name))
print ''
print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name))
print '{'
if p_string == "":
print ' %s(%s, (), (F, "gl%s();\\n"));' \
% (dispatch, f.name, name)
else:
print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \
% (dispatch, f.name, p_string, name, t_string, o_string)
print '}'
print ''
return
def printRealHeader(self):
print ''
self.printVisibility( "HIDDEN", "hidden" )
print """
/*
* This file is a template which generates the OpenGL API entry point
* functions. It should be included by a .c file which first defines
* the following macros:
* KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
* KEYWORD2 - usually nothing, but might be __stdcall on Win32
* NAME(n) - builds the final function name (usually add "gl" prefix)
* DISPATCH(func, args, msg) - code to do dispatch of named function.
* msg is a printf-style debug message.
* RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
*
* Here is an example which generates the usual OpenGL functions:
* #define KEYWORD1
* #define KEYWORD2
* #define NAME(func) gl##func
* #define DISPATCH(func, args, msg) \\
* struct _glapi_table *dispatch = CurrentDispatch; \\
* (*dispatch->func) args
* #define RETURN DISPATCH(func, args, msg) \\
* struct _glapi_table *dispatch = CurrentDispatch; \\
* return (*dispatch->func) args
*
*/
#if defined( NAME )
#ifndef KEYWORD1
#define KEYWORD1
#endif
#ifndef KEYWORD1_ALT
#define KEYWORD1_ALT HIDDEN
#endif
#ifndef KEYWORD2
#define KEYWORD2
#endif
#ifndef DISPATCH
#error DISPATCH must be defined
#endif
#ifndef RETURN_DISPATCH
#error RETURN_DISPATCH must be defined
#endif
"""
return
def printInitDispatch(self, api):
print """
#endif /* defined( NAME ) */
/*
* This is how a dispatch table can be initialized with all the functions
* we generated above.
*/
#ifdef DISPATCH_TABLE_NAME
#ifndef TABLE_ENTRY
#error TABLE_ENTRY must be defined
#endif
#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined
#endif
_glapi_proc DISPATCH_TABLE_NAME[] = {"""
for f in api.functionIterateByOffset():
print ' TABLE_ENTRY(%s),' % (f.dispatch_name())
print ' /* A whole bunch of no-op functions. These might be called'
print ' * when someone tries to call a dynamically-registered'
print ' * extension function without a current rendering context.'
print ' */'
for i in range(1, 100):
print ' TABLE_ENTRY(Unused),'
print '};'
print '#endif /* DISPATCH_TABLE_NAME */'
print ''
return
def printAliasedTable(self, api):
print """
/*
* This is just used to silence compiler warnings.
* We list the functions which are not otherwise used.
*/
#ifdef UNUSED_TABLE_NAME
_glapi_proc UNUSED_TABLE_NAME[] = {"""
normal_entries = []
proto_entries = []
for f in api.functionIterateByOffset():
normal_ents, proto_ents = self.classifyEntryPoints(f)
# exclude f.name
if f.name in normal_ents:
normal_ents.remove(f.name)
elif f.name in proto_ents:
proto_ents.remove(f.name)
normal_ents = [f.static_name(ent) for ent in normal_ents]
proto_ents = [f.static_name(ent) for ent in proto_ents]
normal_entries.extend(normal_ents)
proto_entries.extend(proto_ents)
print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS'
for ent in normal_entries:
print ' TABLE_ENTRY(%s),' % (ent)
print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */'
print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS'
for ent in proto_entries:
print ' TABLE_ENTRY(%s),' % (ent)
print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */'
print '};'
print '#endif /*UNUSED_TABLE_NAME*/'
print ''
return
def classifyEntryPoints(self, func):
normal_names = []
normal_stubs = []
proto_names = []
proto_stubs = []
# classify the entry points
for name in func.entry_points:
if func.has_different_protocol(name):
if func.is_static_entry_point(name):
proto_names.append(name)
else:
proto_stubs.append(name)
else:
if func.is_static_entry_point(name):
normal_names.append(name)
else:
normal_stubs.append(name)
# there can be at most one stub for a function
if normal_stubs:
normal_names.append(normal_stubs[0])
elif proto_stubs:
proto_names.append(proto_stubs[0])
return (normal_names, proto_names)
def printBody(self, api):
normal_entry_points = []
proto_entry_points = []
for func in api.functionIterateByOffset():
normal_ents, proto_ents = self.classifyEntryPoints(func)
normal_entry_points.append((func, normal_ents))
proto_entry_points.append((func, proto_ents))
print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS'
print ''
for func, ents in normal_entry_points:
for ent in ents:
self.printFunction(func, ent)
print ''
print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */'
print ''
print '/* these entry points might require different protocols */'
print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS'
print ''
for func, ents in proto_entry_points:
for ent in ents:
self.printFunction(func, ent)
print ''
print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */'
print ''
self.printInitDispatch(api)
self.printAliasedTable(api)
return
def show_usage():
print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
print "-c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:c")
except Exception,e:
show_usage()
es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-c":
es = True
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer = PrintGlOffsets(es)
printer.Print(api)
+247
View File
@@ -0,0 +1,247 @@
#!/usr/bin/python2
# -*- Mode: Python; py-indent-offset: 8 -*-
# (C) Copyright Zack Rusin 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Zack Rusin <zack@kde.org>
import license
import gl_XML
import sys, getopt
class PrintGlEnums(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_enums.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL")
self.enum_table = {}
def printRealHeader(self):
print '#include "main/glheader.h"'
print '#include "main/mfeatures.h"'
print '#include "main/enums.h"'
print '#include "main/imports.h"'
print ''
print 'typedef struct {'
print ' size_t offset;'
print ' int n;'
print '} enum_elt;'
print ''
return
def print_code(self):
print """
typedef int (*cfunc)(const void *, const void *);
/**
* Compare a key name to an element in the \c all_enums array.
*
* \c bsearch always passes the key as the first parameter and the pointer
* to the array element as the second parameter. We can elimiate some
* extra work by taking advantage of that fact.
*
* \param a Pointer to the desired enum name.
* \param b Pointer to an element of the \c all_enums array.
*/
static int compar_name( const char *a, const enum_elt *b )
{
return strcmp( a, & enum_string_table[ b->offset ] );
}
/**
* Compare a key enum value to an element in the \c all_enums array.
*
* \c bsearch always passes the key as the first parameter and the pointer
* to the array element as the second parameter. We can elimiate some
* extra work by taking advantage of that fact.
*
* \param a Pointer to the desired enum name.
* \param b Pointer to an index into the \c all_enums array.
*/
static int compar_nr( const int *a, const unsigned *b )
{
return a[0] - all_enums[*b].n;
}
static char token_tmp[20];
const char *_mesa_lookup_enum_by_nr( int nr )
{
unsigned * i;
i = (unsigned *) _mesa_bsearch(& nr, reduced_enums,
Elements(reduced_enums),
sizeof(reduced_enums[0]),
(cfunc) compar_nr);
if ( i != NULL ) {
return & enum_string_table[ all_enums[ *i ].offset ];
}
else {
/* this is not re-entrant safe, no big deal here */
sprintf(token_tmp, "0x%x", nr);
return token_tmp;
}
}
/* Get the name of an enum given that it is a primitive type. Avoids
* GL_FALSE/GL_POINTS ambiguity and others.
*/
const char *_mesa_lookup_prim_by_nr( int nr )
{
switch (nr) {
case GL_POINTS: return "GL_POINTS";
case GL_LINES: return "GL_LINES";
case GL_LINE_STRIP: return "GL_LINE_STRIP";
case GL_LINE_LOOP: return "GL_LINE_LOOP";
case GL_TRIANGLES: return "GL_TRIANGLES";
case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP";
case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN";
case GL_QUADS: return "GL_QUADS";
case GL_QUAD_STRIP: return "GL_QUAD_STRIP";
case GL_POLYGON: return "GL_POLYGON";
case GL_POLYGON+1: return "OUTSIDE_BEGIN_END";
default: return "<invalid>";
}
}
int _mesa_lookup_enum_by_name( const char *symbol )
{
enum_elt * f = NULL;
if ( symbol != NULL ) {
f = (enum_elt *) _mesa_bsearch(symbol, all_enums,
Elements(all_enums),
sizeof( enum_elt ),
(cfunc) compar_name);
}
return (f != NULL) ? f->n : -1;
}
"""
return
def printBody(self, api_list):
self.enum_table = {}
for api in api_list:
self.process_enums( api )
keys = self.enum_table.keys()
keys.sort()
name_table = []
enum_table = {}
for enum in keys:
low_pri = 9
for [name, pri] in self.enum_table[ enum ]:
name_table.append( [name, enum] )
if pri < low_pri:
low_pri = pri
enum_table[enum] = name
name_table.sort()
string_offsets = {}
i = 0;
print 'LONGSTRING static const char enum_string_table[] = '
for [name, enum] in name_table:
print ' "%s\\0"' % (name)
string_offsets[ name ] = i
i += len(name) + 1
print ' ;'
print ''
print 'static const enum_elt all_enums[%u] =' % (len(name_table))
print '{'
for [name, enum] in name_table:
print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name)
print '};'
print ''
print 'static const unsigned reduced_enums[%u] =' % (len(keys))
print '{'
for enum in keys:
name = enum_table[ enum ]
if [name, enum] not in name_table:
print ' /* Error! %s, 0x%04x */ 0,' % (name, enum)
else:
i = name_table.index( [name, enum] )
print ' %4u, /* %s */' % (i, name)
print '};'
self.print_code()
return
def process_enums(self, api):
for obj in api.enumIterateByName():
if obj.value not in self.enum_table:
self.enum_table[ obj.value ] = []
enum = self.enum_table[ obj.value ]
name = "GL_" + obj.name
priority = obj.priority()
already_in = False;
for n, p in enum:
if n == name:
already_in = True
if not already_in:
enum.append( [name, priority] )
def show_usage():
print "Usage: %s [-f input_file_name]" % sys.argv[0]
sys.exit(1)
if __name__ == '__main__':
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
api_list = []
for (arg,val) in args:
if arg == "-f":
api = gl_XML.parse_GL_API( val )
api_list.append(api);
printer = PrintGlEnums()
printer.Print( api_list )
+120
View File
@@ -0,0 +1,120 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML
import license
import sys, getopt
class PrintGlOffsets(gl_XML.gl_print_base):
def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
self.es = es
self.name = "gl_offsets.py (from Mesa)"
self.header_tag = '_GLAPI_OFFSETS_H_'
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
return
def printBody(self, api):
print '/* this file should not be included directly in mesa */'
print ''
functions = []
abi_functions = []
alias_functions = []
count = 0
for f in api.functionIterateByOffset():
if not f.is_abi():
functions.append( [f, count] )
count += 1
else:
abi_functions.append( f )
if self.es:
# remember functions with aliases
if len(f.entry_points) > 1:
alias_functions.append(f)
for f in abi_functions:
print '#define _gloffset_%s %d' % (f.name, f.offset)
last_static = f.offset
print ''
print '#if !defined(_GLAPI_USE_REMAP_TABLE)'
print ''
for [f, index] in functions:
print '#define _gloffset_%s %d' % (f.name, f.offset)
print '#define _gloffset_FIRST_DYNAMIC %d' % (api.next_offset)
print ''
print '#else'
print ''
for [f, index] in functions:
print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name)
print ''
print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
if alias_functions:
print ''
print '/* define aliases for compatibility */'
for f in alias_functions:
for name in f.entry_points:
if name != f.name:
print '#define _gloffset_%s _gloffset_%s' % (name, f.name)
return
def show_usage():
print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
print " -c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:c")
except Exception,e:
show_usage()
es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-c":
es = True
api = gl_XML.parse_GL_API( file_name )
printer = PrintGlOffsets(es)
printer.Print( api )
+215
View File
@@ -0,0 +1,215 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import license
import gl_XML, glX_XML
import sys, getopt
class PrintGlProcs(gl_XML.gl_print_base):
def __init__(self, long_strings, es=False):
gl_XML.gl_print_base.__init__(self)
self.es = es
self.long_strings = long_strings
self.name = "gl_procs.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM")
def printRealHeader(self):
print """
/* This file is only included by glapi.c and is used for
* the GetProcAddress() function
*/
typedef struct {
GLint Name_offset;
#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
_glapi_proc Address;
#endif
GLuint Offset;
} glprocs_table_t;
#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o }
#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o }
#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o }
#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o }
#endif
"""
return
def printRealFooter(self):
print ''
print '#undef NAME_FUNC_OFFSET'
return
def printFunctionString(self, name):
if self.long_strings:
print ' "gl%s\\0"' % (name)
else:
print " 'g','l',",
for c in name:
print "'%s'," % (c),
print "'\\0',"
def printBody(self, api):
print ''
if self.long_strings:
print 'static const char gl_string_table[] ='
else:
print 'static const char gl_string_table[] = {'
base_offset = 0
table = []
for func in api.functionIterateByOffset():
name = func.dispatch_name()
self.printFunctionString(func.name)
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
# The length of the function's name, plus 2 for "gl",
# plus 1 for the NUL.
base_offset += len(func.name) + 3
for func in api.functionIterateByOffset():
for n in func.entry_points:
if n != func.name:
name = func.dispatch_name()
self.printFunctionString( n )
if func.has_different_protocol(n):
alt_name = "gl" + func.static_glx_name(n)
table.append((base_offset, "gl" + name, alt_name, alt_name, func.name))
else:
table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name))
base_offset += len(n) + 3
if self.long_strings:
print ' ;'
else:
print '};'
print ''
print ''
print "#ifdef USE_MGL_NAMESPACE"
for func in api.functionIterateByOffset():
for n in func.entry_points:
if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset)
break
print "#endif /* USE_MGL_NAMESPACE */"
print ''
print ''
print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)'
for func in api.functionIterateByOffset():
for n in func.entry_points:
if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string())
break
if self.es:
categories = {}
for func in api.functionIterateByOffset():
for n in func.entry_points:
cat, num = api.get_category_for_name(n)
if (cat.startswith("es") or cat.startswith("GL_OES")):
if not categories.has_key(cat):
categories[cat] = []
proto = 'GLAPI %s GLAPIENTRY %s(%s);' \
% (func.return_type, "gl" + n, func.get_parameter_string(n))
categories[cat].append(proto)
if categories:
print ''
print '/* OpenGL ES specific prototypes */'
print ''
keys = categories.keys()
keys.sort()
for key in keys:
print '/* category %s */' % key
print "\n".join(categories[key])
print ''
print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */'
print ''
print 'static const glprocs_table_t static_functions[] = {'
for info in table:
print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info
print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)'
print '};'
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0]
print "-c Enable compatibility with OpenGL ES."
print "-m mode mode can be one of:"
print " long - Create code for compilers that can handle very"
print " long string constants. (default)"
print " short - Create code for compilers that can only handle"
print " ANSI C89 string constants."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:c")
except Exception,e:
show_usage()
long_string = 1
es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
if val == "short":
long_string = 0
elif val == "long":
long_string = 1
else:
show_usage()
elif arg == "-c":
es = True
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer = PrintGlProcs(long_string, es)
printer.Print(api)
+229
View File
@@ -0,0 +1,229 @@
#!/usr/bin/python2
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML
import license
import sys, getopt
class PrintGlTable(gl_XML.gl_print_base):
def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
self.es = es
self.header_tag = '_GLAPI_TABLE_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
return
def printBody(self, api):
for f in api.functionIterateByOffset():
arg_string = f.get_parameter_string()
print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset)
def printRealHeader(self):
print '#ifndef GLAPIENTRYP'
print '# ifndef GLAPIENTRY'
print '# define GLAPIENTRY'
print '# endif'
print ''
print '# define GLAPIENTRYP GLAPIENTRY *'
print '#endif'
print ''
print ''
print 'struct _glapi_table'
print '{'
return
def printRealFooter(self):
print '};'
return
class PrintRemapTable(gl_XML.gl_print_base):
def __init__(self, es=False):
gl_XML.gl_print_base.__init__(self)
self.es = es
self.header_tag = '_GLAPI_DISPATCH_H_'
self.name = "gl_table.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def printRealHeader(self):
print """
/* this file should not be included directly in mesa */
/**
* \\file glapidispatch.h
* Macros for handling GL dispatch tables.
*
* For each known GL function, there are 3 macros in this file. The first
* macro is named CALL_FuncName and is used to call that GL function using
* the specified dispatch table. The other 2 macros, called GET_FuncName
* can SET_FuncName, are used to get and set the dispatch pointer for the
* named function in the specified dispatch table.
*/
"""
return
def printBody(self, api):
print '#define CALL_by_offset(disp, cast, offset, parameters) \\'
print ' (*(cast (GET_by_offset(disp, offset)))) parameters'
print '#define GET_by_offset(disp, offset) \\'
print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL'
print '#define SET_by_offset(disp, offset, fn) \\'
print ' do { \\'
print ' if ( (offset) < 0 ) { \\'
print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\'
print ' /* __func__, __LINE__, disp, offset, # fn); */ \\'
print ' /* abort(); */ \\'
print ' } \\'
print ' else { \\'
print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\'
print ' } \\'
print ' } while(0)'
print ''
functions = []
abi_functions = []
alias_functions = []
count = 0
for f in api.functionIterateByOffset():
if not f.is_abi():
functions.append( [f, count] )
count += 1
else:
abi_functions.append( f )
if self.es:
# remember functions with aliases
if len(f.entry_points) > 1:
alias_functions.append(f)
for f in abi_functions:
print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name)
print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name)
print ''
print '#if !defined(_GLAPI_USE_REMAP_TABLE)'
print ''
for [f, index] in functions:
print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name)
print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name)
print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name)
print ''
print '#else'
print ''
print '#define driDispatchRemapTable_size %u' % (count)
print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];'
print ''
for [f, index] in functions:
print '#define %s_remap_index %u' % (f.name, index)
print ''
for [f, index] in functions:
arg_string = gl_XML.create_parameter_string( f.parameters, 0 )
cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string)
print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name)
print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name)
print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name)
print ''
print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
if alias_functions:
print ''
print '/* define aliases for compatibility */'
for f in alias_functions:
for name in f.entry_points:
if name != f.name:
print '#define CALL_%s(disp, parameters) CALL_%s(disp, parameters)' % (name, f.name)
print '#define GET_%s(disp) GET_%s(disp)' % (name, f.name)
print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name)
print ''
print '#if defined(_GLAPI_USE_REMAP_TABLE)'
for f in alias_functions:
for name in f.entry_points:
if name != f.name:
print '#define %s_remap_index %s_remap_index' % (name, f.name)
print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */'
print ''
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0]
print " -m mode Mode can be 'table' or 'remap_table'."
print " -c Enable compatibility with OpenGL ES."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:c")
except Exception,e:
show_usage()
mode = "table"
es = False
for (arg,val) in args:
if arg == "-f":
file_name = val
elif arg == "-m":
mode = val
elif arg == "-c":
es = True
if mode == "table":
printer = PrintGlTable(es)
elif mode == "remap_table":
printer = PrintRemapTable(es)
else:
show_usage()
api = gl_XML.parse_GL_API( file_name )
printer.Print( api )
+334
View File
@@ -0,0 +1,334 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import license
import gl_XML, glX_XML
import sys, getopt, copy
def should_use_push(registers):
for [reg, offset] in registers:
if reg[1:4] == "xmm":
return 0
N = len(registers)
return (N & 1) != 0
def local_size(registers):
# The x86-64 ABI says "the value (%rsp - 8) is always a multiple of
# 16 when control is transfered to the function entry point." This
# means that the local stack usage must be (16*N)+8 for some value
# of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we
# meet this requirement.
N = (len(registers) | 1)
return 8*N
def save_all_regs(registers):
adjust_stack = 0
if not should_use_push(registers):
adjust_stack = local_size(registers)
print '\tsubq\t$%u, %%rsp' % (adjust_stack)
for [reg, stack_offset] in registers:
save_reg( reg, stack_offset, adjust_stack )
return
def restore_all_regs(registers):
adjust_stack = 0
if not should_use_push(registers):
adjust_stack = local_size(registers)
temp = copy.deepcopy(registers)
while len(temp):
[reg, stack_offset] = temp.pop()
restore_reg(reg, stack_offset, adjust_stack)
if adjust_stack:
print '\taddq\t$%u, %%rsp' % (adjust_stack)
return
def save_reg(reg, offset, use_move):
if use_move:
if offset == 0:
print '\tmovq\t%s, (%%rsp)' % (reg)
else:
print '\tmovq\t%s, %u(%%rsp)' % (reg, offset)
else:
print '\tpushq\t%s' % (reg)
return
def restore_reg(reg, offset, use_move):
if use_move:
if offset == 0:
print '\tmovq\t(%%rsp), %s' % (reg)
else:
print '\tmovq\t%u(%%rsp), %s' % (offset, reg)
else:
print '\tpopq\t%s' % (reg)
return
class PrintGenericStubs(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_x86-64_asm.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def get_stack_size(self, f):
size = 0
for p in f.parameterIterator():
size += p.get_stack_size()
return size
def printRealHeader(self):
print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change"
print " * the symbol visibility mode to 'default'."
print ' */'
print ''
print '#include "x86/assyntax.h"'
print ''
print '#ifdef __GNUC__'
print '# pragma GCC visibility push(default)'
print '# define HIDDEN(x) .hidden x'
print '#else'
print '# define HIDDEN(x)'
print '#endif'
print ''
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
print '# endif'
print ''
print '#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
print '# define THREADS'
print '#endif'
print ''
print '\t.text'
print ''
print '#ifdef GLX_USE_TLS'
print ''
print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)'
print '_x86_64_get_get_dispatch:'
print '\tlea\t_x86_64_get_dispatch(%rip), %rax'
print '\tret'
print ''
print '\t.p2align\t4,,15'
print '_x86_64_get_dispatch:'
print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax'
print '\tmovq\t%fs:(%rax), %rax'
print '\tret'
print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch'
print ''
print '#elif defined(PTHREADS)'
print ''
print '\t.extern\t_glapi_Dispatch'
print '\t.extern\t_gl_DispatchTSD'
print '\t.extern\tpthread_getspecific'
print ''
print '\t.p2align\t4,,15'
print '_x86_64_get_dispatch:'
print '\tmovq\t_gl_DispatchTSD(%rip), %rdi'
print '\tjmp\tpthread_getspecific@PLT'
print ''
print '#elif defined(THREADS)'
print ''
print '\t.extern\t_glapi_get_dispatch'
print ''
print '#endif'
print ''
return
def printRealFooter(self):
print ''
print '#if defined(GLX_USE_TLS) && defined(__linux__)'
print ' .section ".note.ABI-tag", "a"'
print ' .p2align 2'
print ' .long 1f - 0f /* name length */'
print ' .long 3f - 2f /* data length */'
print ' .long 1 /* note length */'
print '0: .asciz "GNU" /* vendor name */'
print '1: .p2align 2'
print '2: .long 0 /* note data: the ABI tag */'
print ' .long 2,4,20 /* Minimum kernel version w/TLS */'
print '3: .p2align 2 /* pad out section */'
print '#endif /* GLX_USE_TLS */'
print ''
print '#if defined (__ELF__) && defined (__linux__)'
print ' .section .note.GNU-stack,"",%progbits'
print '#endif'
return
def printFunction(self, f):
# The x86-64 ABI divides function parameters into a couple
# classes. For the OpenGL interface, the only ones that are
# relevent are INTEGER and SSE. Basically, the first 8
# GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7,
# the first 6 non-GLfloat / non-GLdouble parameters are placed
# in registers listed in int_parameters.
#
# If more parameters than that are required, they are passed
# on the stack. Therefore, we just have to make sure that
# %esp hasn't changed when we jump to the actual function.
# Since we're jumping to the function (and not calling it), we
# have to make sure of that anyway!
int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"]
int_class = 0
sse_class = 0
stack_offset = 0
registers = []
for p in f.parameterIterator():
type_name = p.get_base_type_string()
if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"):
if int_class < 6:
registers.append( [int_parameters[int_class], stack_offset] )
int_class += 1
stack_offset += 8
else:
if sse_class < 8:
registers.append( ["%%xmm%u" % (sse_class), stack_offset] )
sse_class += 1
stack_offset += 8
if ((int_class & 1) == 0) and (sse_class == 0):
registers.append( ["%rbp", 0] )
name = f.dispatch_name()
print '\t.p2align\t4,,15'
print '\t.globl\tGL_PREFIX(%s)' % (name)
print '\t.type\tGL_PREFIX(%s), @function' % (name)
if not f.is_static_entry_point(f.name):
print '\tHIDDEN(GL_PREFIX(%s))' % (name)
print 'GL_PREFIX(%s):' % (name)
print '#if defined(GLX_USE_TLS)'
print '\tcall\t_x86_64_get_dispatch@PLT'
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
print '\tjmp\t*%r11'
print '#elif defined(PTHREADS)'
save_all_regs(registers)
print '\tcall\t_x86_64_get_dispatch@PLT'
restore_all_regs(registers)
if f.offset == 0:
print '\tmovq\t(%rax), %r11'
else:
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
print '\tjmp\t*%r11'
print '#else'
print '\tmovq\t_glapi_Dispatch(%rip), %rax'
print '\ttestq\t%rax, %rax'
print '\tje\t1f'
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
print '\tjmp\t*%r11'
print '1:'
save_all_regs(registers)
print '\tcall\t_glapi_get_dispatch'
restore_all_regs(registers)
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
print '\tjmp\t*%r11'
print '#endif /* defined(GLX_USE_TLS) */'
print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name)
print ''
return
def printBody(self, api):
for f in api.functionIterateByOffset():
self.printFunction(f)
for f in api.functionIterateByOffset():
dispatch = f.dispatch_name()
for n in f.entry_points:
if n != f.name:
if f.is_static_entry_point(n):
text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
if f.has_different_protocol(n):
print '#ifndef GLX_INDIRECT_RENDERING'
print text
print '#endif'
else:
print text
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
mode = "generic"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == '-m':
mode = val
elif arg == "-f":
file_name = val
if mode == "generic":
printer = PrintGenericStubs()
else:
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer.Print(api)
+270
View File
@@ -0,0 +1,270 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import license
import gl_XML, glX_XML
import sys, getopt
class PrintGenericStubs(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "gl_x86_asm.py (from Mesa)"
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM")
return
def get_stack_size(self, f):
size = 0
for p in f.parameterIterator():
if p.is_padding:
continue
size += p.get_stack_size()
return size
def printRealHeader(self):
print '#include "x86/assyntax.h"'
print '#include "glapi/glapioffsets.h"'
print ''
print '#if defined(STDCALL_API)'
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))'
print '# else'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))'
print '# endif'
print '#else'
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
print '# endif'
print '#endif'
print ''
print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
print ''
print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)'
print '#define GLOBL_FN(x) GLOBL x ; .type x, function'
print '#else'
print '#define GLOBL_FN(x) GLOBL x'
print '#endif'
print ''
print '#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
print '# define THREADS'
print '#endif'
print ''
print '#ifdef GLX_USE_TLS'
print ''
print '#ifdef GLX_X86_READONLY_TEXT'
print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)'
print '#else'
print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */'
print '#endif'
print ''
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
print '\tCALL(_x86_get_dispatch) ;\t\t\t\\'
print '\tCTX_INSNS ; \\'
print '\tJMP(GL_OFFSET(off))'
print ''
print '#elif defined(PTHREADS)'
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
print '\tJE(1f) ;\t\t\t\t\t\\'
print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\'
print '\tJMP(GL_OFFSET(off))'
print '#elif defined(THREADS)'
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
print '\tJE(1f) ;\t\t\t\t\t\\'
print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\'
print '\tJMP(GL_OFFSET(off))'
print '#else /* Non-threaded version. */'
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
print '\tJMP(GL_OFFSET(off))'
print '#endif'
print ''
print '#ifdef HAVE_ALIAS'
print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\'
print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)'
print '#else'
print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
print ' GL_STUB(fn, off, fn_alt)'
print '#endif'
print ''
print 'SEG_TEXT'
print ''
print '#ifdef GLX_USE_TLS'
print ''
print '\tGLOBL\tGLNAME(_x86_get_dispatch)'
print '\tHIDDEN(GLNAME(_x86_get_dispatch))'
print 'ALIGNTEXT16'
print 'GLNAME(_x86_get_dispatch):'
print '\tcall 1f'
print '1:\tpopl %eax'
print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax'
print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax'
print '\tret'
print ''
print '#elif defined(PTHREADS)'
print 'EXTERN GLNAME(_glapi_Dispatch)'
print 'EXTERN GLNAME(_gl_DispatchTSD)'
print 'EXTERN GLNAME(pthread_getspecific)'
print ''
print 'ALIGNTEXT16'
print 'GLNAME(_x86_get_dispatch):'
print '\tSUB_L(CONST(24), ESP)'
print '\tPUSH_L(GLNAME(_gl_DispatchTSD))'
print '\tCALL(GLNAME(pthread_getspecific))'
print '\tADD_L(CONST(28), ESP)'
print '\tRET'
print '#elif defined(THREADS)'
print 'EXTERN GLNAME(_glapi_get_dispatch)'
print '#endif'
print ''
print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )'
print '\t\t.section\twtext, "awx", @progbits'
print '#endif /* defined( GLX_USE_TLS ) */'
print ''
print '\t\tALIGNTEXT16'
print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)'
print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))'
print 'GLNAME(gl_dispatch_functions_start):'
print ''
return
def printRealFooter(self):
print ''
print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)'
print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))'
print '\t\tALIGNTEXT16'
print 'GLNAME(gl_dispatch_functions_end):'
print ''
print '#if defined(GLX_USE_TLS) && defined(__linux__)'
print ' .section ".note.ABI-tag", "a"'
print ' .p2align 2'
print ' .long 1f - 0f /* name length */'
print ' .long 3f - 2f /* data length */'
print ' .long 1 /* note length */'
print '0: .asciz "GNU" /* vendor name */'
print '1: .p2align 2'
print '2: .long 0 /* note data: the ABI tag */'
print ' .long 2,4,20 /* Minimum kernel version w/TLS */'
print '3: .p2align 2 /* pad out section */'
print '#endif /* GLX_USE_TLS */'
print ''
print '#if defined (__ELF__) && defined (__linux__)'
print ' .section .note.GNU-stack,"",%progbits'
print '#endif'
return
def printBody(self, api):
for f in api.functionIterateByOffset():
name = f.dispatch_name()
stack = self.get_stack_size(f)
alt = "%s@%u" % (name, stack)
print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt)
if not f.is_static_entry_point(f.name):
print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt)
for f in api.functionIterateByOffset():
name = f.dispatch_name()
stack = self.get_stack_size(f)
alt = "%s@%u" % (name, stack)
for n in f.entry_points:
if f.is_static_entry_point(n):
if n != f.name:
alt2 = "%s@%u" % (n, stack)
text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, name, alt)
if f.has_different_protocol(n):
print '#ifndef GLX_INDIRECT_RENDERING'
print text
print '#endif'
else:
print text
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
mode = "generic"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == '-m':
mode = val
elif arg == "-f":
file_name = val
if mode == "generic":
printer = PrintGenericStubs()
else:
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
printer.Print(api)
+47
View File
@@ -0,0 +1,47 @@
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
bsd_license_template = """%s
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sub license,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
%s,
AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."""
+216
View File
@@ -0,0 +1,216 @@
#!/usr/bin/env python
# Mesa 3-D graphics library
# Version: 4.1
#
# Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is 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 Software.
#
# THE SOFTWARE IS 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
# BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Generate the mesa.def file for Windows.
#
# Usage:
# mesadef.py >mesa.def
# Then copy to src/mesa/drivers/windows/gdi
#
# Dependencies:
# The apispec file must be in the current directory.
import apiparser
import string
def PrintHead():
print '; DO NOT EDIT - This file generated automatically by mesadef.py script'
print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\''
print 'VERSION 6.0'
print ';'
print '; Module definition file for Mesa (OPENGL32.DLL)'
print ';'
print '; Note: The OpenGL functions use the STDCALL'
print '; function calling convention. Microsoft\'s'
print '; OPENGL32 uses this convention and so must the'
print '; Mesa OPENGL32 so that the Mesa DLL can be used'
print '; as a drop-in replacement.'
print ';'
print '; The linker exports STDCALL entry points with'
print '; \'decorated\' names; e.g., _glBegin@0, where the'
print '; trailing number is the number of bytes of '
print '; parameter data pushed onto the stack. The'
print '; callee is responsible for popping this data'
print '; off the stack, usually via a RETF n instruction.'
print ';'
print '; However, the Microsoft OPENGL32.DLL does not export'
print '; the decorated names, even though the calling convention'
print '; is STDCALL. So, this module definition file is'
print '; needed to force the Mesa OPENGL32.DLL to export the'
print '; symbols in the same manner as the Microsoft DLL.'
print '; Were it not for this problem, this file would not'
print '; be needed (for the gl* functions) since the entry'
print '; points are compiled with dllexport declspec.'
print ';'
print '; However, this file is still needed to export "internal"'
print '; Mesa symbols for the benefit of the OSMESA32.DLL.'
print ';'
print 'EXPORTS'
return
#enddef
def PrintTail():
print ';'
print '; WGL API'
print '\twglChoosePixelFormat'
print '\twglCopyContext'
print '\twglCreateContext'
print '\twglCreateLayerContext'
print '\twglDeleteContext'
print '\twglDescribeLayerPlane'
print '\twglDescribePixelFormat'
print '\twglGetCurrentContext'
print '\twglGetCurrentDC'
print '\twglGetExtensionsStringARB'
print '\twglGetLayerPaletteEntries'
print '\twglGetPixelFormat'
print '\twglGetProcAddress'
print '\twglMakeCurrent'
print '\twglRealizeLayerPalette'
print '\twglSetLayerPaletteEntries'
print '\twglSetPixelFormat'
print '\twglShareLists'
print '\twglSwapBuffers'
print '\twglSwapLayerBuffers'
print '\twglUseFontBitmapsA'
print '\twglUseFontBitmapsW'
print '\twglUseFontOutlinesA'
print '\twglUseFontOutlinesW'
print ';'
print '; Mesa internals - mostly for OSMESA'
print '\t_ac_CreateContext'
print '\t_ac_DestroyContext'
print '\t_ac_InvalidateState'
print '\t_glapi_get_context'
print '\t_glapi_get_proc_address'
print '\t_mesa_buffer_data'
print '\t_mesa_buffer_map'
print '\t_mesa_buffer_subdata'
print '\t_mesa_choose_tex_format'
print '\t_mesa_compressed_texture_size'
print '\t_mesa_create_framebuffer'
print '\t_mesa_create_visual'
print '\t_mesa_delete_buffer_object'
print '\t_mesa_delete_texture_object'
print '\t_mesa_destroy_framebuffer'
print '\t_mesa_destroy_visual'
print '\t_mesa_enable_1_3_extensions'
print '\t_mesa_enable_1_4_extensions'
print '\t_mesa_enable_1_5_extensions'
print '\t_mesa_enable_sw_extensions'
print '\t_mesa_error'
print '\t_mesa_free_context_data'
print '\t_mesa_get_current_context'
print '\t_mesa_init_default_imports'
print '\t_mesa_initialize_context'
print '\t_mesa_make_current'
print '\t_mesa_new_buffer_object'
print '\t_mesa_new_texture_object'
print '\t_mesa_problem'
print '\t_mesa_ResizeBuffersMESA'
print '\t_mesa_store_compressed_teximage1d'
print '\t_mesa_store_compressed_teximage2d'
print '\t_mesa_store_compressed_teximage3d'
print '\t_mesa_store_compressed_texsubimage1d'
print '\t_mesa_store_compressed_texsubimage2d'
print '\t_mesa_store_compressed_texsubimage3d'
print '\t_mesa_store_teximage1d'
print '\t_mesa_store_teximage2d'
print '\t_mesa_store_teximage3d'
print '\t_mesa_store_texsubimage1d'
print '\t_mesa_store_texsubimage2d'
print '\t_mesa_store_texsubimage3d'
print '\t_mesa_test_proxy_teximage'
print '\t_mesa_Viewport'
print '\t_mesa_meta_CopyColorSubTable'
print '\t_mesa_meta_CopyColorTable'
print '\t_mesa_meta_CopyConvolutionFilter1D'
print '\t_mesa_meta_CopyConvolutionFilter2D'
print '\t_mesa_meta_CopyTexImage1D'
print '\t_mesa_meta_CopyTexImage2D'
print '\t_mesa_meta_CopyTexSubImage1D'
print '\t_mesa_meta_CopyTexSubImage2D'
print '\t_mesa_meta_CopyTexSubImage3D'
print '\t_swrast_Accum'
print '\t_swrast_alloc_buffers'
print '\t_swrast_Bitmap'
print '\t_swrast_CopyPixels'
print '\t_swrast_DrawPixels'
print '\t_swrast_GetDeviceDriverReference'
print '\t_swrast_Clear'
print '\t_swrast_choose_line'
print '\t_swrast_choose_triangle'
print '\t_swrast_CreateContext'
print '\t_swrast_DestroyContext'
print '\t_swrast_InvalidateState'
print '\t_swrast_ReadPixels'
print '\t_swrast_zbuffer_address'
print '\t_swsetup_Wakeup'
print '\t_swsetup_CreateContext'
print '\t_swsetup_DestroyContext'
print '\t_swsetup_InvalidateState'
print '\t_tnl_CreateContext'
print '\t_tnl_DestroyContext'
print '\t_tnl_InvalidateState'
print '\t_tnl_MakeCurrent'
print '\t_tnl_run_pipeline'
#enddef
records = []
def FindOffset(funcName):
for (name, alias, offset) in records:
if name == funcName:
return offset
#endif
#endfor
return -1
#enddef
def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset):
if alias == '':
dispatchName = name
else:
dispatchName = alias
if offset < 0:
offset = FindOffset(dispatchName)
if offset >= 0 and string.find(name, "unused") == -1:
print '\tgl%s' % (name)
# save this info in case we need to look up an alias later
records.append((name, dispatchName, offset))
#enddef
PrintHead()
apiparser.ProcessSpecFile("APIspec", EmitEntry)
PrintTail()
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
# Trivial shell script to search the API definition file and print out the
# next numerically available API entry-point offset. This could probably
# be made smarter, but it would be better to use the existin Python
# framework to do that. This is just a quick-and-dirty hack.
num=$(grep 'offset="' gl_API.xml |\
sed 's/.\+ offset="//g;s/".*$//g' |\
grep -v '?' |\
sort -rn |\
head -1)
echo $((num + 1))
+218
View File
@@ -0,0 +1,218 @@
#!/usr/bin/env python
# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
# All Rights Reserved.
#
# This is based on extension_helper.py by Ian Romanick.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import gl_XML
import license
import sys, getopt, string
def get_function_spec(func):
sig = ""
# derive parameter signature
for p in func.parameterIterator():
if p.is_padding:
continue
# FIXME: This is a *really* ugly hack. :(
tn = p.type_expr.get_base_type_node()
if p.is_pointer():
sig += 'p'
elif tn.integer:
sig += 'i'
elif tn.size == 4:
sig += 'f'
else:
sig += 'd'
spec = [sig]
for ent in func.entry_points:
spec.append("gl" + ent)
# spec is terminated by an empty string
spec.append('')
return spec
class PrintGlRemap(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "remap_helper.py (from Mesa)"
self.license = license.bsd_license_template % ("Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>", "Chia-I Wu")
return
def printRealHeader(self):
print '#include "main/dispatch.h"'
print '#include "main/remap.h"'
print ''
return
def printBody(self, api):
pool_indices = {}
print '/* this is internal to remap.c */'
print '#ifdef need_MESA_remap_table'
print ''
print 'static const char _mesa_function_pool[] ='
# output string pool
index = 0;
for f in api.functionIterateAll():
pool_indices[f] = index
spec = get_function_spec(f)
# a function has either assigned offset, fixed offset,
# or no offset
if f.assign_offset:
comments = "will be remapped"
elif f.offset > 0:
comments = "offset %d" % f.offset
else:
comments = "dynamic"
print ' /* _mesa_function_pool[%d]: %s (%s) */' \
% (index, f.name, comments)
for line in spec:
print ' "%s\\0"' % line
index += len(line) + 1
print ' ;'
print ''
print '/* these functions need to be remapped */'
print 'static const struct gl_function_pool_remap MESA_remap_table_functions[] = {'
# output all functions that need to be remapped
# iterate by offsets so that they are sorted by remap indices
for f in api.functionIterateByOffset():
if not f.assign_offset:
continue
print ' { %5d, %s_remap_index },' \
% (pool_indices[f], f.name)
print ' { -1, -1 }'
print '};'
print ''
# collect functions by versions/extensions
extension_functions = {}
abi_extensions = []
for f in api.functionIterateAll():
for n in f.entry_points:
category, num = api.get_category_for_name(n)
# consider only GL_VERSION_X_Y or extensions
c = gl_XML.real_category_name(category)
if c.startswith("GL_"):
if not extension_functions.has_key(c):
extension_functions[c] = []
extension_functions[c].append(f)
# remember the ext names of the ABI
if (f.is_abi() and n == f.name and
c not in abi_extensions):
abi_extensions.append(c)
# ignore the ABI itself
for ext in abi_extensions:
extension_functions.pop(ext)
extensions = extension_functions.keys()
extensions.sort()
# output ABI functions that have alternative names (with ext suffix)
print '/* these functions are in the ABI, but have alternative names */'
print 'static const struct gl_function_remap MESA_alt_functions[] = {'
for ext in extensions:
funcs = []
for f in extension_functions[ext]:
# test if the function is in the ABI and has alt names
if f.is_abi() and len(f.entry_points) > 1:
funcs.append(f)
if not funcs:
continue
print ' /* from %s */' % ext
for f in funcs:
print ' { %5d, _gloffset_%s },' \
% (pool_indices[f], f.name)
print ' { -1, -1 }'
print '};'
print ''
print '#endif /* need_MESA_remap_table */'
print ''
# output remap helpers for DRI drivers
for ext in extensions:
funcs = []
remapped = []
for f in extension_functions[ext]:
if f.assign_offset:
# these are handled above
remapped.append(f)
else:
# these functions are either in the
# abi, or have offset -1
funcs.append(f)
print '#if defined(need_%s)' % (ext)
if remapped:
print '/* functions defined in MESA_remap_table_functions are excluded */'
# output extension functions that need to be mapped
print 'static const struct gl_function_remap %s_functions[] = {' % (ext)
for f in funcs:
if f.offset >= 0:
print ' { %5d, _gloffset_%s },' \
% (pool_indices[f], f.name)
else:
print ' { %5d, -1 }, /* %s */' % \
(pool_indices[f], f.name)
print ' { -1, -1 }'
print '};'
print '#endif'
print ''
return
def show_usage():
print "Usage: %s [-f input_file_name]" % sys.argv[0]
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
for (arg,val) in args:
if arg == "-f":
file_name = val
api = gl_XML.parse_GL_API( file_name )
printer = PrintGlRemap()
printer.Print( api )
+292
View File
@@ -0,0 +1,292 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import string, copy
class type_node:
def __init__(self):
self.pointer = 0 # bool
self.const = 0 # bool
self.signed = 1 # bool
self.integer = 1 # bool
# If elements is set to non-zero, then field is an array.
self.elements = 0
self.name = None
self.size = 0 # type's size in bytes
return
def string(self):
"""Return string representation of this type_node."""
s = ""
if self.pointer:
s = "* "
if self.const:
s += "const "
if not self.pointer:
if self.integer:
if self.signed:
s += "signed "
else:
s += "unsigned "
if self.name:
s += "%s " % (self.name)
return s
class type_table:
def __init__(self):
self.types_by_name = {}
return
def add_type(self, type_expr):
self.types_by_name[ type_expr.get_base_name() ] = type_expr
return
def find_type(self, name):
if name in self.types_by_name:
return self.types_by_name[ name ]
else:
return None
def create_initial_types():
tt = type_table()
basic_types = [
("char", 1, 1),
("short", 2, 1),
("int", 4, 1),
("long", 4, 1),
("float", 4, 0),
("double", 8, 0),
("enum", 4, 1)
]
for (type_name, type_size, integer) in basic_types:
te = type_expression(None)
tn = type_node()
tn.name = type_name
tn.size = type_size
tn.integer = integer
te.expr.append(tn)
tt.add_type( te )
type_expression.built_in_types = tt
return
class type_expression:
built_in_types = None
def __init__(self, type_string, extra_types = None):
self.expr = []
if not type_string:
return
self.original_string = type_string
if not type_expression.built_in_types:
raise RuntimeError("create_initial_types must be called before creating type_expression objects.")
# Replace '*' with ' * ' in type_string. Then, split the string
# into tokens, separated by spaces.
tokens = string.split( string.replace( type_string, "*", " * " ) )
const = 0
t = None
signed = 0
unsigned = 0
for i in tokens:
if i == "const":
if t and t.pointer:
t.const = 1
else:
const = 1
elif i == "signed":
signed = 1
elif i == "unsigned":
unsigned = 1
elif i == "*":
# This is a quirky special-case because of the
# way the C works for types. If 'unsigned' is
# specified all by itself, it is treated the
# same as "unsigned int".
if unsigned:
self.set_base_type( "int", signed, unsigned, const, extra_types )
const = 0
signed = 0
unsigned = 0
if not self.expr:
raise RuntimeError("Invalid type expression (dangling pointer)")
if signed:
raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)")
t = type_node()
t.pointer = 1
self.expr.append( t )
else:
if self.expr:
raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string))
self.set_base_type( i, signed, unsigned, const, extra_types )
const = 0
signed = 0
unsigned = 0
if signed and unsigned:
raise RuntimeError("Invalid type expression (both signed and unsigned specified)")
if const:
raise RuntimeError("Invalid type expression (dangling const)")
if unsigned:
raise RuntimeError("Invalid type expression (dangling signed)")
if signed:
raise RuntimeError("Invalid type expression (dangling unsigned)")
return
def set_base_type(self, type_name, signed, unsigned, const, extra_types):
te = type_expression.built_in_types.find_type( type_name )
if not te:
te = extra_types.find_type( type_name )
if not te:
raise RuntimeError('Unknown base type "%s".' % (type_name))
self.expr = copy.deepcopy(te.expr)
t = self.expr[ len(self.expr) - 1 ]
t.const = const
if signed:
t.signed = 1
elif unsigned:
t.signed = 0
def set_base_type_node(self, tn):
self.expr = [tn]
return
def set_elements(self, count):
tn = self.expr[0]
tn.elements = count
return
def string(self):
s = ""
for t in self.expr:
s += t.string()
return s
def get_base_type_node(self):
return self.expr[0]
def get_base_name(self):
if len(self.expr):
return self.expr[0].name
else:
return None
def get_element_size(self):
tn = self.expr[0]
if tn.elements:
return tn.elements * tn.size
else:
return tn.size
def get_element_count(self):
tn = self.expr[0]
return tn.elements
def get_stack_size(self):
tn = self.expr[ len(self.expr) - 1 ]
if tn.elements or tn.pointer:
return 4
elif not tn.integer:
return tn.size
else:
return 4
def is_pointer(self):
tn = self.expr[ len(self.expr) - 1 ]
return tn.pointer
def format_string(self):
tn = self.expr[ len(self.expr) - 1 ]
if tn.pointer:
return "%p"
elif not tn.integer:
return "%f"
else:
return "%d"
if __name__ == '__main__':
types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \
"unsigned * const *", \
"float", "const double", "double * const"]
create_initial_types()
for t in types_to_try:
print 'Trying "%s"...' % (t)
te = type_expression( t )
print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size())
+293
View File
@@ -0,0 +1,293 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* This file manages the OpenGL API dispatch layer.
* The dispatch table (struct _glapi_table) is basically just a list
* of function pointers.
* There are functions to set/get the current dispatch table for the
* current thread and to manage registration/dispatch of dynamically
* added extension functions.
*
* It's intended that this file and the other glapi*.[ch] files are
* flexible enough to be reused in several places: XFree86, DRI-
* based libGL.so, and perhaps the SGI SI.
*
* NOTE: There are no dependencies on Mesa in this code.
*
* Versions (API changes):
* 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
* 2001/01/16 - added dispatch override feature for Mesa 3.5
* 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
* 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints
* itself (using offset ~0). _glapi_add_entrypoint() can be
* called afterward and it'll fill in the correct dispatch
* offset. This allows DRI libGL to avoid probing for DRI
* drivers! No changes to the public glapi interface.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/glheader.h"
#include "main/compiler.h"
#endif
#include "glapi/glapi.h"
#include "glapi/glapi_priv.h"
extern _glapi_proc __glapi_noop_table[];
/**
* \name Current dispatch and current context control variables
*
* Depending on whether or not multithreading is support, and the type of
* support available, several variables are used to store the current context
* pointer and the current dispatch table pointer. In the non-threaded case,
* the variables \c _glapi_Dispatch and \c _glapi_Context are used for this
* purpose.
*
* In the "normal" threaded case, the variables \c _glapi_Dispatch and
* \c _glapi_Context will be \c NULL if an application is detected as being
* multithreaded. Single-threaded applications will use \c _glapi_Dispatch
* and \c _glapi_Context just like the case without any threading support.
* When \c _glapi_Dispatch and \c _glapi_Context are \c NULL, the thread state
* data \c _gl_DispatchTSD and \c ContextTSD are used. Drivers and the
* static dispatch functions access these variables via \c _glapi_get_dispatch
* and \c _glapi_get_context.
*
* There is a race condition in setting \c _glapi_Dispatch to \c NULL. It is
* possible for the original thread to be setting it at the same instant a new
* thread, perhaps running on a different processor, is clearing it. Because
* of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
* used to determine whether or not the application is multithreaded.
*
* In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
* hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and
* \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and
* \c _glapi_Context be hardcoded to \c NULL maintains binary compatability
* between TLS enabled loaders and non-TLS DRI drivers.
*/
/*@{*/
#if defined(GLX_USE_TLS)
PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")))
= (struct _glapi_table *) __glapi_noop_table;
PUBLIC __thread void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL;
PUBLIC const void *_glapi_Context = NULL;
#else
#if defined(THREADS)
static GLboolean ThreadSafe = GL_FALSE; /**< In thread-safe mode? */
_glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */
static _glthread_TSD ContextTSD; /**< Per-thread context pointer */
#endif /* defined(THREADS) */
PUBLIC struct _glapi_table *_glapi_Dispatch = (struct _glapi_table *) __glapi_noop_table;
PUBLIC void *_glapi_Context = NULL;
#endif /* defined(GLX_USE_TLS) */
/*@}*/
#if defined(THREADS) && !defined(GLX_USE_TLS)
void
_glapi_init_multithread(void)
{
_glthread_InitTSD(&_gl_DispatchTSD);
_glthread_InitTSD(&ContextTSD);
}
void
_glapi_destroy_multithread(void)
{
#ifdef WIN32_THREADS
_glthread_DestroyTSD(&_gl_DispatchTSD);
_glthread_DestroyTSD(&ContextTSD);
#endif
}
/**
* Mutex for multithread check.
*/
#ifdef WIN32_THREADS
/* _glthread_DECLARE_STATIC_MUTEX is broken on windows. There will be race! */
#define CHECK_MULTITHREAD_LOCK()
#define CHECK_MULTITHREAD_UNLOCK()
#else
_glthread_DECLARE_STATIC_MUTEX(ThreadCheckMutex);
#define CHECK_MULTITHREAD_LOCK() _glthread_LOCK_MUTEX(ThreadCheckMutex)
#define CHECK_MULTITHREAD_UNLOCK() _glthread_UNLOCK_MUTEX(ThreadCheckMutex)
#endif
/**
* We should call this periodically from a function such as glXMakeCurrent
* in order to test if multiple threads are being used.
*/
PUBLIC void
_glapi_check_multithread(void)
{
static unsigned long knownID;
static GLboolean firstCall = GL_TRUE;
if (ThreadSafe)
return;
CHECK_MULTITHREAD_LOCK();
if (firstCall) {
_glapi_init_multithread();
knownID = _glthread_GetID();
firstCall = GL_FALSE;
}
else if (knownID != _glthread_GetID()) {
ThreadSafe = GL_TRUE;
_glapi_set_dispatch(NULL);
_glapi_set_context(NULL);
}
CHECK_MULTITHREAD_UNLOCK();
}
#else
void
_glapi_init_multithread(void) { }
void
_glapi_destroy_multithread(void) { }
PUBLIC void
_glapi_check_multithread(void) { }
#endif
/**
* Set the current context pointer for this thread.
* The context pointer is an opaque type which should be cast to
* void from the real context pointer type.
*/
PUBLIC void
_glapi_set_context(void *context)
{
#if defined(GLX_USE_TLS)
_glapi_tls_Context = context;
#elif defined(THREADS)
_glthread_SetTSD(&ContextTSD, context);
_glapi_Context = (ThreadSafe) ? NULL : context;
#else
_glapi_Context = context;
#endif
}
/**
* Get the current context pointer for this thread.
* The context pointer is an opaque type which should be cast from
* void to the real context pointer type.
*/
PUBLIC void *
_glapi_get_context(void)
{
#if defined(GLX_USE_TLS)
return _glapi_tls_Context;
#elif defined(THREADS)
return (ThreadSafe) ? _glthread_GetTSD(&ContextTSD) : _glapi_Context;
#else
return _glapi_Context;
#endif
}
/**
* Set the global or per-thread dispatch table pointer.
* If the dispatch parameter is NULL we'll plug in the no-op dispatch
* table (__glapi_noop_table).
*/
PUBLIC void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
init_glapi_relocs_once();
if (dispatch == NULL) {
/* use the no-op functions */
dispatch = (struct _glapi_table *) __glapi_noop_table;
}
#ifdef DEBUG
else {
_glapi_check_table_not_null(dispatch);
_glapi_check_table(dispatch);
}
#endif
#if defined(GLX_USE_TLS)
_glapi_tls_Dispatch = dispatch;
#elif defined(THREADS)
_glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch);
_glapi_Dispatch = (ThreadSafe) ? NULL : dispatch;
#else
_glapi_Dispatch = dispatch;
#endif
}
/**
* Return pointer to current dispatch table for calling thread.
*/
PUBLIC struct _glapi_table *
_glapi_get_dispatch(void)
{
#if defined(GLX_USE_TLS)
return _glapi_tls_Dispatch;
#elif defined(THREADS)
return (ThreadSafe)
? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD)
: _glapi_Dispatch;
#else
return _glapi_Dispatch;
#endif
}
+172
View File
@@ -0,0 +1,172 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \mainpage Mesa GL API Module
*
* \section GLAPIIntroduction Introduction
*
* The Mesa GL API module is responsible for dispatching all the
* gl*() functions. All GL functions are dispatched by jumping through
* the current dispatch table (basically a struct full of function
* pointers.)
*
* A per-thread current dispatch table and per-thread current context
* pointer are managed by this module too.
*
* This module is intended to be non-Mesa-specific so it can be used
* with the X/DRI libGL also.
*/
#ifndef _GLAPI_H
#define _GLAPI_H
#include "glthread.h"
struct _glapi_table;
typedef void (*_glapi_proc)(void); /* generic function pointer */
#if defined(USE_MGL_NAMESPACE)
#define _glapi_set_dispatch _mglapi_set_dispatch
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
#define _glapi_Dispatch _mglapi_Dispatch
#define _glapi_Context _mglapi_Context
#endif
#if defined(__GNUC__)
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else
# define likely(x) (x)
# define unlikely(x) (x)
#endif
/**
** Define the GET_DISPATCH() and GET_CURRENT_CONTEXT() macros.
**
** \param C local variable which will hold the current context.
**/
#if defined (GLX_USE_TLS)
extern const struct _glapi_table *_glapi_Dispatch;
extern const void *_glapi_Context;
extern __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
extern __thread void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
# define GET_DISPATCH() _glapi_tls_Dispatch
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
#else
extern struct _glapi_table *_glapi_Dispatch;
extern void *_glapi_Context;
# ifdef THREADS
# define GET_DISPATCH() \
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) \
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
# else
# define GET_DISPATCH() _glapi_Dispatch
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
# endif
#endif /* defined (GLX_USE_TLS) */
/**
** GL API public functions
**/
extern void
_glapi_init_multithread(void);
extern void
_glapi_destroy_multithread(void);
extern void
_glapi_check_multithread(void);
extern void
_glapi_set_context(void *context);
extern void *
_glapi_get_context(void);
extern void
_glapi_set_dispatch(struct _glapi_table *dispatch);
extern struct _glapi_table *
_glapi_get_dispatch(void);
extern unsigned int
_glapi_get_dispatch_table_size(void);
extern int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature );
extern int
_glapi_get_proc_offset(const char *funcName);
extern _glapi_proc
_glapi_get_proc_address(const char *funcName);
extern const char *
_glapi_get_proc_name(unsigned int offset);
#endif
+102
View File
@@ -0,0 +1,102 @@
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glapi_dispatch.c
*
* This file generates all the gl* function entrypoints. This code is not
* used if optimized assembly stubs are available (e.g., using
* glapi/glapi_x86.S on IA32 or glapi/glapi_sparc.S on SPARC).
*
* \note
* This file is also used to build the client-side libGL that loads DRI-based
* device drivers. At build-time it is symlinked to src/glx.
*
* \author Brian Paul <brian@precisioninsight.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/glheader.h"
#include "main/compiler.h"
#endif
#include "glapi/glapi.h"
#include "glapi/glapitable.h"
#include "glapi/glapidispatch.h"
#include "glapi/glthread.h"
#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
#if defined(WIN32)
#define KEYWORD1 GLAPI
#else
#define KEYWORD1 PUBLIC
#endif
#define KEYWORD2 GLAPIENTRY
#if defined(USE_MGL_NAMESPACE)
#define NAME(func) mgl##func
#else
#define NAME(func) gl##func
#endif
#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */
#define F stdout
#define DISPATCH(FUNC, ARGS, MESSAGE) \
fprintf MESSAGE; \
CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
fprintf MESSAGE; \
return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#else
#define DISPATCH(FUNC, ARGS, MESSAGE) \
CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
#endif /* logging */
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifdef GLX_INDIRECT_RENDERING
/* those link to libglapi.a should provide the entry points */
#define _GLAPI_SKIP_PROTO_ENTRY_POINTS
#endif
#include "glapi/glapitemp.h"
#endif /* USE_X86_ASM */
+352
View File
@@ -0,0 +1,352 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glapi_entrypoint.c
*
* Arch-specific code for manipulating GL API entrypoints (dispatch stubs).
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/glheader.h"
#include "main/compiler.h"
#endif
#include "glapi/glapi.h"
#include "glapi/glapi_priv.h"
#ifdef USE_X86_ASM
#if defined( GLX_USE_TLS )
extern GLubyte gl_dispatch_functions_start[];
extern GLubyte gl_dispatch_functions_end[];
#else
extern const GLubyte gl_dispatch_functions_start[];
#endif
#endif /* USE_X86_ASM */
#if defined(DISPATCH_FUNCTION_SIZE)
_glapi_proc
get_entrypoint_address(unsigned int functionOffset)
{
return (_glapi_proc) (gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * functionOffset));
}
#endif
#if defined(USE_X86_ASM)
/**
* Perform platform-specific GL API entry-point fixups.
*/
static void
init_glapi_relocs( void )
{
#if defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT)
extern unsigned long _x86_get_dispatch(void);
char run_time_patch[] = {
0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */
};
GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */
const GLubyte * const get_disp = (const GLubyte *) run_time_patch;
GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start;
*offset = _x86_get_dispatch();
while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) {
(void) memcpy( curr_func, get_disp, sizeof(run_time_patch));
curr_func += DISPATCH_FUNCTION_SIZE;
}
#endif
}
/**
* Generate a dispatch function (entrypoint) which jumps through
* the given slot number (offset) in the current dispatch table.
* We need assembly language in order to accomplish this.
*/
_glapi_proc
generate_entrypoint(unsigned int functionOffset)
{
/* 32 is chosen as something of a magic offset. For x86, the dispatch
* at offset 32 is the first one where the offset in the
* "jmp OFFSET*4(%eax)" can't be encoded in a single byte.
*/
const GLubyte * const template_func = gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * 32);
GLubyte * const code = (GLubyte *) _glapi_exec_malloc(DISPATCH_FUNCTION_SIZE);
if ( code != NULL ) {
(void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE);
fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset );
}
return (_glapi_proc) code;
}
/**
* This function inserts a new dispatch offset into the assembly language
* stub that was generated with the preceeding function.
*/
void
fill_in_entrypoint_offset(_glapi_proc entrypoint, unsigned int offset)
{
GLubyte * const code = (GLubyte *) entrypoint;
#if defined(GLX_USE_TLS)
*((unsigned int *)(code + 8)) = 4 * offset;
#elif defined(THREADS)
*((unsigned int *)(code + 11)) = 4 * offset;
*((unsigned int *)(code + 22)) = 4 * offset;
#else
*((unsigned int *)(code + 7)) = 4 * offset;
#endif
}
#elif defined(USE_SPARC_ASM)
extern void __glapi_sparc_icache_flush(unsigned int *);
static void
init_glapi_relocs( void )
{
#if defined(PTHREADS) || defined(GLX_USE_TLS)
static const unsigned int template[] = {
#ifdef GLX_USE_TLS
0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */
0x8730e00a, /* srl %g3, 10, %g3 */
0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */
#ifdef __arch64__
0xc259c002, /* ldx [%g7 + %g2], %g1 */
0xc2584003, /* ldx [%g1 + %g3], %g1 */
#else
0xc201c002, /* ld [%g7 + %g2], %g1 */
0xc2004003, /* ld [%g1 + %g3], %g1 */
#endif
0x81c04000, /* jmp %g1 */
0x01000000, /* nop */
#else
#ifdef __arch64__
0x03000000, /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */
0x05000000, /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */
0x82106000, /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */
0x8730e00a, /* 64-bit 0x0c --> srl %g3, 10, %g3 */
0x83287020, /* 64-bit 0x10 --> sllx %g1, 32, %g1 */
0x82004002, /* 64-bit 0x14 --> add %g1, %g2, %g1 */
0xc2586000, /* 64-bit 0x18 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */
#else
0x03000000, /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */
0x8730e00a, /* 32-bit 0x04 --> srl %g3, 10, %g3 */
0xc2006000, /* 32-bit 0x08 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */
#endif
0x80a06000, /* --> cmp %g1, 0 */
0x02800005, /* --> be +4*5 */
0x01000000, /* --> nop */
#ifdef __arch64__
0xc2584003, /* 64-bit --> ldx [%g1 + %g3], %g1 */
#else
0xc2004003, /* 32-bit --> ld [%g1 + %g3], %g1 */
#endif
0x81c04000, /* --> jmp %g1 */
0x01000000, /* --> nop */
#ifdef __arch64__
0x9de3bf80, /* 64-bit --> save %sp, -128, %sp */
#else
0x9de3bfc0, /* 32-bit --> save %sp, -64, %sp */
#endif
0xa0100003, /* --> mov %g3, %l0 */
0x40000000, /* --> call _glapi_get_dispatch */
0x01000000, /* --> nop */
0x82100008, /* --> mov %o0, %g1 */
0x86100010, /* --> mov %l0, %g3 */
0x10bffff7, /* --> ba -4*9 */
0x81e80000, /* --> restore */
#endif
};
#ifdef GLX_USE_TLS
extern unsigned int __glapi_sparc_tls_stub;
extern unsigned long __glapi_sparc_get_dispatch(void);
unsigned int *code = &__glapi_sparc_tls_stub;
unsigned long dispatch = __glapi_sparc_get_dispatch();
#else
extern unsigned int __glapi_sparc_pthread_stub;
unsigned int *code = &__glapi_sparc_pthread_stub;
unsigned long dispatch = (unsigned long) &_glapi_Dispatch;
unsigned long call_dest = (unsigned long ) &_glapi_get_dispatch;
int idx;
#endif
#ifdef GLX_USE_TLS
code[0] = template[0] | (dispatch >> 10);
code[1] = template[1];
__glapi_sparc_icache_flush(&code[0]);
code[2] = template[2] | (dispatch & 0x3ff);
code[3] = template[3];
__glapi_sparc_icache_flush(&code[2]);
code[4] = template[4];
code[5] = template[5];
__glapi_sparc_icache_flush(&code[4]);
code[6] = template[6];
__glapi_sparc_icache_flush(&code[6]);
#else
#if defined(__arch64__)
code[0] = template[0] | (dispatch >> (32 + 10));
code[1] = template[1] | ((dispatch & 0xffffffff) >> 10);
__glapi_sparc_icache_flush(&code[0]);
code[2] = template[2] | ((dispatch >> 32) & 0x3ff);
code[3] = template[3];
__glapi_sparc_icache_flush(&code[2]);
code[4] = template[4];
code[5] = template[5];
__glapi_sparc_icache_flush(&code[4]);
code[6] = template[6] | (dispatch & 0x3ff);
idx = 7;
#else
code[0] = template[0] | (dispatch >> 10);
code[1] = template[1];
__glapi_sparc_icache_flush(&code[0]);
code[2] = template[2] | (dispatch & 0x3ff);
idx = 3;
#endif
code[idx + 0] = template[idx + 0];
__glapi_sparc_icache_flush(&code[idx - 1]);
code[idx + 1] = template[idx + 1];
code[idx + 2] = template[idx + 2];
__glapi_sparc_icache_flush(&code[idx + 1]);
code[idx + 3] = template[idx + 3];
code[idx + 4] = template[idx + 4];
__glapi_sparc_icache_flush(&code[idx + 3]);
code[idx + 5] = template[idx + 5];
code[idx + 6] = template[idx + 6];
__glapi_sparc_icache_flush(&code[idx + 5]);
code[idx + 7] = template[idx + 7];
code[idx + 8] = template[idx + 8] |
(((call_dest - ((unsigned long) &code[idx + 8]))
>> 2) & 0x3fffffff);
__glapi_sparc_icache_flush(&code[idx + 7]);
code[idx + 9] = template[idx + 9];
code[idx + 10] = template[idx + 10];
__glapi_sparc_icache_flush(&code[idx + 9]);
code[idx + 11] = template[idx + 11];
code[idx + 12] = template[idx + 12];
__glapi_sparc_icache_flush(&code[idx + 11]);
code[idx + 13] = template[idx + 13];
__glapi_sparc_icache_flush(&code[idx + 13]);
#endif
#endif
}
_glapi_proc
generate_entrypoint(GLuint functionOffset)
{
#if defined(PTHREADS) || defined(GLX_USE_TLS)
static const unsigned int template[] = {
0x07000000, /* sethi %hi(0), %g3 */
0x8210000f, /* mov %o7, %g1 */
0x40000000, /* call */
0x9e100001, /* mov %g1, %o7 */
};
#ifdef GLX_USE_TLS
extern unsigned int __glapi_sparc_tls_stub;
unsigned long call_dest = (unsigned long ) &__glapi_sparc_tls_stub;
#else
extern unsigned int __glapi_sparc_pthread_stub;
unsigned long call_dest = (unsigned long ) &__glapi_sparc_pthread_stub;
#endif
unsigned int *code = (unsigned int *) _glapi_exec_malloc(sizeof(template));
if (code) {
code[0] = template[0] | (functionOffset & 0x3fffff);
code[1] = template[1];
__glapi_sparc_icache_flush(&code[0]);
code[2] = template[2] |
(((call_dest - ((unsigned long) &code[2]))
>> 2) & 0x3fffffff);
code[3] = template[3];
__glapi_sparc_icache_flush(&code[2]);
}
return (_glapi_proc) code;
#endif
}
void
fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
{
unsigned int *code = (unsigned int *) entrypoint;
code[0] &= ~0x3fffff;
code[0] |= (offset * sizeof(void *)) & 0x3fffff;
__glapi_sparc_icache_flush(&code[0]);
}
#else /* USE_*_ASM */
static void
init_glapi_relocs( void )
{
}
_glapi_proc
generate_entrypoint(GLuint functionOffset)
{
(void) functionOffset;
return NULL;
}
void
fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
{
/* an unimplemented architecture */
(void) entrypoint;
(void) offset;
}
#endif /* USE_*_ASM */
void
init_glapi_relocs_once( void )
{
#if defined(PTHREADS) || defined(GLX_USE_TLS)
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
pthread_once( & once_control, init_glapi_relocs );
#endif
}
+128
View File
@@ -0,0 +1,128 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glapi_execmem.c
*
* Function for allocating executable memory for dispatch stubs.
*
* Copied from main/execmem.c and simplified for dispatch stubs.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/compiler.h"
#endif
#include "glapi/glthread.h"
#include "glapi/glapi_priv.h"
#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun)
#include <unistd.h>
#include <sys/mman.h>
#ifdef MESA_SELINUX
#include <selinux/selinux.h>
#endif
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
#define EXEC_MAP_SIZE (4*1024)
_glthread_DECLARE_STATIC_MUTEX(exec_mutex);
static unsigned int head = 0;
static unsigned char *exec_mem = NULL;
/*
* Dispatch stubs are of fixed size and never freed. Thus, we do not need to
* overlay a heap, we just mmap a page and manage through an index.
*/
static int
init_map(void)
{
#ifdef MESA_SELINUX
if (is_selinux_enabled()) {
if (!security_get_boolean_active("allow_execmem") ||
!security_get_boolean_pending("allow_execmem"))
return 0;
}
#endif
if (!exec_mem)
exec_mem = mmap(NULL, EXEC_MAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
return (exec_mem != MAP_FAILED);
}
void *
_glapi_exec_malloc(unsigned int size)
{
void *addr = NULL;
_glthread_LOCK_MUTEX(exec_mutex);
if (!init_map())
goto bail;
/* free space check, assumes no integer overflow */
if (head + size > EXEC_MAP_SIZE)
goto bail;
/* allocation, assumes proper addr and size alignement */
addr = exec_mem + head;
head += size;
bail:
_glthread_UNLOCK_MUTEX(exec_mutex);
return addr;
}
#else
void *
_glapi_exec_malloc(unsigned int size)
{
return malloc(size);
}
#endif
+695
View File
@@ -0,0 +1,695 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glapi_getproc.c
*
* Code for implementing glXGetProcAddress(), etc.
* This was originally in glapi.c but refactored out.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/glheader.h"
#include "main/compiler.h"
#endif
#include "glapi/glapi.h"
#include "glapi/glapi_priv.h"
#include "glapi/glapitable.h"
#include "glapi/glapioffsets.h"
/**********************************************************************
* Static function management.
*/
#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server)
# define NEED_FUNCTION_POINTER
#endif
#include "glapi/glprocs.h"
/**
* Search the table of static entrypoint functions for the named function
* and return the corresponding glprocs_table_t entry.
*/
static const glprocs_table_t *
get_static_proc( const char * n )
{
GLuint i;
for (i = 0; static_functions[i].Name_offset >= 0; i++) {
const char *testName = gl_string_table + static_functions[i].Name_offset;
#ifdef MANGLE
/* skip the prefix on the name */
if (strcmp(testName, n + 1) == 0)
#else
if (strcmp(testName, n) == 0)
#endif
{
return &static_functions[i];
}
}
return NULL;
}
/**
* Return dispatch table offset of the named static (built-in) function.
* Return -1 if function not found.
*/
static GLint
get_static_proc_offset(const char *funcName)
{
const glprocs_table_t * const f = get_static_proc( funcName );
if (f == NULL) {
return -1;
}
return f->Offset;
}
#if !defined(XFree86Server)
/**
* Return dispatch function address for the named static (built-in) function.
* Return NULL if function not found.
*/
static _glapi_proc
get_static_proc_address(const char *funcName)
{
const glprocs_table_t * const f = get_static_proc( funcName );
if (f == NULL) {
return NULL;
}
#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING)
return (f->Address == NULL)
? get_entrypoint_address(f->Offset)
: f->Address;
#elif defined(DISPATCH_FUNCTION_SIZE)
return get_entrypoint_address(f->Offset);
#else
return f->Address;
#endif
}
#else
static _glapi_proc
get_static_proc_address(const char *funcName)
{
(void) funcName;
return NULL;
}
#endif /* !defined(XFree86Server) */
/**
* Return the name of the function at the given offset in the dispatch
* table. For debugging only.
*/
static const char *
get_static_proc_name( GLuint offset )
{
GLuint i;
for (i = 0; static_functions[i].Name_offset >= 0; i++) {
if (static_functions[i].Offset == offset) {
return gl_string_table + static_functions[i].Name_offset;
}
}
return NULL;
}
/**********************************************************************
* Extension function management.
*/
/**
* Track information about a function added to the GL API.
*/
struct _glapi_function {
/**
* Name of the function.
*/
const char * name;
/**
* Text string that describes the types of the parameters passed to the
* named function. Parameter types are converted to characters using the
* following rules:
* - 'i' for \c GLint, \c GLuint, and \c GLenum
* - 'p' for any pointer type
* - 'f' for \c GLfloat and \c GLclampf
* - 'd' for \c GLdouble and \c GLclampd
*/
const char * parameter_signature;
/**
* Offset in the dispatch table where the pointer to the real function is
* located. If the driver has not requested that the named function be
* added to the dispatch table, this will have the value ~0.
*/
unsigned dispatch_offset;
/**
* Pointer to the dispatch stub for the named function.
*
* \todo
* The semantic of this field should be changed slightly. Currently, it
* is always expected to be non-\c NULL. However, it would be better to
* only allocate the entry-point stub when the application requests the
* function via \c glXGetProcAddress. This would save memory for all the
* functions that the driver exports but that the application never wants
* to call.
*/
_glapi_proc dispatch_stub;
};
static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS];
static GLuint NumExtEntryPoints = 0;
static struct _glapi_function *
get_extension_proc(const char *funcName)
{
GLuint i;
for (i = 0; i < NumExtEntryPoints; i++) {
if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
return & ExtEntryTable[i];
}
}
return NULL;
}
static GLint
get_extension_proc_offset(const char *funcName)
{
const struct _glapi_function * const f = get_extension_proc( funcName );
if (f == NULL) {
return -1;
}
return f->dispatch_offset;
}
static _glapi_proc
get_extension_proc_address(const char *funcName)
{
const struct _glapi_function * const f = get_extension_proc( funcName );
if (f == NULL) {
return NULL;
}
return f->dispatch_stub;
}
static const char *
get_extension_proc_name(GLuint offset)
{
GLuint i;
for (i = 0; i < NumExtEntryPoints; i++) {
if (ExtEntryTable[i].dispatch_offset == offset) {
return ExtEntryTable[i].name;
}
}
return NULL;
}
/**
* strdup() is actually not a standard ANSI C or POSIX routine.
* Irix will not define it if ANSI mode is in effect.
*/
static char *
str_dup(const char *str)
{
char *copy;
copy = (char*) malloc(strlen(str) + 1);
if (!copy)
return NULL;
strcpy(copy, str);
return copy;
}
/**
* Generate new entrypoint
*
* Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver
* calls \c _glapi_add_dispatch we'll put in the proper offset. If that
* never happens, and the user calls this function, he'll segfault. That's
* what you get when you try calling a GL function that doesn't really exist.
*
* \param funcName Name of the function to create an entry-point for.
*
* \sa _glapi_add_entrypoint
*/
static struct _glapi_function *
add_function_name( const char * funcName )
{
struct _glapi_function * entry = NULL;
_glapi_proc entrypoint = NULL;
char * name_dup = NULL;
if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS)
return NULL;
if (funcName == NULL)
return NULL;
name_dup = str_dup(funcName);
if (name_dup == NULL)
return NULL;
entrypoint = generate_entrypoint(~0);
if (entrypoint == NULL) {
free(name_dup);
return NULL;
}
entry = & ExtEntryTable[NumExtEntryPoints];
NumExtEntryPoints++;
entry->name = name_dup;
entry->parameter_signature = NULL;
entry->dispatch_offset = ~0;
entry->dispatch_stub = entrypoint;
return entry;
}
static struct _glapi_function *
set_entry_info( struct _glapi_function * entry, const char * signature, unsigned offset )
{
char * sig_dup = NULL;
if (signature == NULL)
return NULL;
sig_dup = str_dup(signature);
if (sig_dup == NULL)
return NULL;
fill_in_entrypoint_offset(entry->dispatch_stub, offset);
entry->parameter_signature = sig_dup;
entry->dispatch_offset = offset;
return entry;
}
/**
* Fill-in the dispatch stub for the named function.
*
* This function is intended to be called by a hardware driver. When called,
* a dispatch stub may be created created for the function. A pointer to this
* dispatch function will be returned by glXGetProcAddress.
*
* \param function_names Array of pointers to function names that should
* share a common dispatch offset.
* \param parameter_signature String representing the types of the parameters
* passed to the named function. Parameter types
* are converted to characters using the following
* rules:
* - 'i' for \c GLint, \c GLuint, and \c GLenum
* - 'p' for any pointer type
* - 'f' for \c GLfloat and \c GLclampf
* - 'd' for \c GLdouble and \c GLclampd
*
* \returns
* The offset in the dispatch table of the named function. A pointer to the
* driver's implementation of the named function should be stored at
* \c dispatch_table[\c offset]. Return -1 if error/problem.
*
* \sa glXGetProcAddress
*
* \warning
* This function can only handle up to 8 names at a time. As far as I know,
* the maximum number of names ever associated with an existing GL function is
* 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT,
* \c glPointParameterfARB, and \c glPointParameterf), so this should not be
* too painful of a limitation.
*
* \todo
* Determine whether or not \c parameter_signature should be allowed to be
* \c NULL. It doesn't seem like much of a hardship for drivers to have to
* pass in an empty string.
*
* \todo
* Determine if code should be added to reject function names that start with
* 'glX'.
*
* \bug
* Add code to compare \c parameter_signature with the parameter signature of
* a static function. In order to do that, we need to find a way to \b get
* the parameter signature of a static function.
*/
PUBLIC int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature )
{
static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC;
const char * const real_sig = (parameter_signature != NULL)
? parameter_signature : "";
struct _glapi_function * entry[8];
GLboolean is_static[8];
unsigned i;
int offset = ~0;
init_glapi_relocs_once();
(void) memset( is_static, 0, sizeof( is_static ) );
(void) memset( entry, 0, sizeof( entry ) );
/* Find the _single_ dispatch offset for all function names that already
* exist (and have a dispatch offset).
*/
for ( i = 0 ; function_names[i] != NULL ; i++ ) {
const char * funcName = function_names[i];
int static_offset;
int extension_offset;
if (funcName[0] != 'g' || funcName[1] != 'l')
return -1;
/* search built-in functions */
static_offset = get_static_proc_offset(funcName);
if (static_offset >= 0) {
is_static[i] = GL_TRUE;
/* FIXME: Make sure the parameter signatures match! How do we get
* FIXME: the parameter signature for static functions?
*/
if ( (offset != ~0) && (static_offset != offset) ) {
return -1;
}
offset = static_offset;
continue;
}
/* search added extension functions */
entry[i] = get_extension_proc(funcName);
if (entry[i] != NULL) {
extension_offset = entry[i]->dispatch_offset;
/* The offset may be ~0 if the function name was added by
* glXGetProcAddress but never filled in by the driver.
*/
if (extension_offset == ~0) {
continue;
}
if (strcmp(real_sig, entry[i]->parameter_signature) != 0) {
return -1;
}
if ( (offset != ~0) && (extension_offset != offset) ) {
return -1;
}
offset = extension_offset;
}
}
/* If all function names are either new (or with no dispatch offset),
* allocate a new dispatch offset.
*/
if (offset == ~0) {
offset = next_dynamic_offset;
next_dynamic_offset++;
}
/* Fill in the dispatch offset for the new function names (and those with
* no dispatch offset).
*/
for ( i = 0 ; function_names[i] != NULL ; i++ ) {
if (is_static[i]) {
continue;
}
/* generate entrypoints for new function names */
if (entry[i] == NULL) {
entry[i] = add_function_name( function_names[i] );
if (entry[i] == NULL) {
/* FIXME: Possible memory leak here. */
return -1;
}
}
if (entry[i]->dispatch_offset == ~0) {
set_entry_info( entry[i], real_sig, offset );
}
}
return offset;
}
/**
* Return offset of entrypoint for named function within dispatch table.
*/
PUBLIC GLint
_glapi_get_proc_offset(const char *funcName)
{
GLint offset;
/* search extension functions first */
offset = get_extension_proc_offset(funcName);
if (offset >= 0)
return offset;
/* search static functions */
return get_static_proc_offset(funcName);
}
/**
* Return pointer to the named function. If the function name isn't found
* in the name of static functions, try generating a new API entrypoint on
* the fly with assembly language.
*/
PUBLIC _glapi_proc
_glapi_get_proc_address(const char *funcName)
{
_glapi_proc func;
struct _glapi_function * entry;
init_glapi_relocs_once();
#ifdef MANGLE
/* skip the prefix on the name */
if (funcName[1] != 'g' || funcName[2] != 'l')
return NULL;
#else
if (funcName[0] != 'g' || funcName[1] != 'l')
return NULL;
#endif
/* search extension functions first */
func = get_extension_proc_address(funcName);
if (func)
return func;
/* search static functions */
func = get_static_proc_address(funcName);
if (func)
return func;
/* generate entrypoint, dispatch offset must be filled in by the driver */
entry = add_function_name(funcName);
if (entry == NULL)
return NULL;
return entry->dispatch_stub;
}
/**
* Return the name of the function at the given dispatch offset.
* This is only intended for debugging.
*/
const char *
_glapi_get_proc_name(GLuint offset)
{
const char * n;
/* search built-in functions */
n = get_static_proc_name(offset);
if ( n != NULL ) {
return n;
}
/* search added extension functions */
return get_extension_proc_name(offset);
}
/**********************************************************************
* GL API table functions.
*/
/*
* The dispatch table size (number of entries) is the size of the
* _glapi_table struct plus the number of dynamic entries we can add.
* The extra slots can be filled in by DRI drivers that register new extension
* functions.
*/
#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS)
/**
* Return size of dispatch table struct as number of functions (or
* slots).
*/
PUBLIC GLuint
_glapi_get_dispatch_table_size(void)
{
return DISPATCH_TABLE_SIZE;
}
/**
* Make sure there are no NULL pointers in the given dispatch table.
* Intended for debugging purposes.
*/
void
_glapi_check_table_not_null(const struct _glapi_table *table)
{
#ifdef EXTRA_DEBUG /* set to DEBUG for extra DEBUG */
const GLuint entries = _glapi_get_dispatch_table_size();
const void **tab = (const void **) table;
GLuint i;
for (i = 1; i < entries; i++) {
assert(tab[i]);
}
#else
(void) table;
#endif
}
/**
* Do some spot checks to be sure that the dispatch table
* slots are assigned correctly. For debugging only.
*/
void
_glapi_check_table(const struct _glapi_table *table)
{
#ifdef EXTRA_DEBUG /* set to DEBUG for extra DEBUG */
{
GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
char *BeginFunc = (char*) &table->Begin;
GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
assert(BeginOffset == _gloffset_Begin);
assert(BeginOffset == offset);
}
{
GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
char *viewportFunc = (char*) &table->Viewport;
GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
assert(viewportOffset == _gloffset_Viewport);
assert(viewportOffset == offset);
}
{
GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
char *VertexPointerFunc = (char*) &table->VertexPointer;
GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
assert(VertexPointerOffset == _gloffset_VertexPointer);
assert(VertexPointerOffset == offset);
}
{
GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
assert(ResetMinMaxOffset == offset);
}
{
GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor");
char *blendColorFunc = (char*) &table->BlendColor;
GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
assert(blendColorOffset == _gloffset_BlendColor);
assert(blendColorOffset == offset);
}
{
GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT");
char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT;
GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *);
assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT);
assert(secondaryColor3fOffset == offset);
}
{
GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV");
char *pointParameterivFunc = (char*) &table->PointParameterivNV;
GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
assert(pointParameterivOffset == _gloffset_PointParameterivNV);
assert(pointParameterivOffset == offset);
}
{
GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
char *setFenceFunc = (char*) &table->SetFenceNV;
GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
assert(setFenceOffset == _gloffset_SetFenceNV);
assert(setFenceOffset == offset);
}
#else
(void) table;
#endif
}
+134
View File
@@ -0,0 +1,134 @@
/*
* Mesa 3-D graphics library
* Version: 7.8
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
* Copyright (C) 2010 VMWare, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* No-op dispatch table.
*
* This file defines a special dispatch table which is loaded with no-op
* functions.
*
* When there's no current rendering context, calling a GL function like
* glBegin() is a no-op. Apps should never normally do this. So as a
* debugging aid, each of the no-op functions will emit a warning to
* stderr if the MESA_DEBUG or LIBGL_DEBUG env var is set.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/compiler.h"
#include "main/glheader.h"
#endif
#include "glapi/glapi.h"
/*
* These stubs are kept so that the old DRI drivers still load.
*/
PUBLIC void
_glapi_noop_enable_warnings(GLboolean enable);
PUBLIC void
_glapi_set_warning_func(_glapi_proc func);
void
_glapi_noop_enable_warnings(GLboolean enable)
{
}
void
_glapi_set_warning_func(_glapi_proc func)
{
}
#ifdef DEBUG
/**
* Called by each of the no-op GL entrypoints.
*/
static int
Warn(const char *func)
{
#if !defined(_WIN32_WCE)
if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) {
fprintf(stderr, "GL User Error: gl%s called without a rendering context\n",
func);
}
#endif
return 0;
}
/**
* This is called if the user somehow calls an unassigned GL dispatch function.
*/
static GLint
NoOpUnused(void)
{
return Warn(" function");
}
/*
* Defines for the glapitemp.h functions.
*/
#define KEYWORD1 static
#define KEYWORD1_ALT static
#define KEYWORD2 GLAPIENTRY
#define NAME(func) NoOp##func
#define DISPATCH(func, args, msg) Warn(#func);
#define RETURN_DISPATCH(func, args, msg) Warn(#func); return 0
/*
* Defines for the table of no-op entry points.
*/
#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name
#else
static int
NoOpGeneric(void)
{
#if !defined(_WIN32_WCE)
if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) {
fprintf(stderr, "GL User Error: calling GL function without a rendering context\n");
}
#endif
return 0;
}
#define TABLE_ENTRY(name) (_glapi_proc) NoOpGeneric
#endif
#define DISPATCH_TABLE_NAME __glapi_noop_table
#define UNUSED_TABLE_NAME __unused_noop_functions
#include "glapi/glapitemp.h"
+99
View File
@@ -0,0 +1,99 @@
/*
* Mesa 3-D graphics library
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _GLAPI_PRIV_H
#define _GLAPI_PRIV_H
#include "glthread.h"
#include "glapi.h"
/* getproc */
extern void
_glapi_check_table_not_null(const struct _glapi_table *table);
extern void
_glapi_check_table(const struct _glapi_table *table);
/* execmem */
extern void *
_glapi_exec_malloc(unsigned int size);
/* entrypoint */
extern void
init_glapi_relocs_once(void);
extern _glapi_proc
generate_entrypoint(unsigned int functionOffset);
extern void
fill_in_entrypoint_offset(_glapi_proc entrypoint, unsigned int offset);
extern _glapi_proc
get_entrypoint_address(unsigned int functionOffset);
/**
* Size (in bytes) of dispatch function (entrypoint).
*/
#if defined(USE_X86_ASM)
# if defined(GLX_USE_TLS)
# define DISPATCH_FUNCTION_SIZE 16
# elif defined(THREADS)
# define DISPATCH_FUNCTION_SIZE 32
# else
# define DISPATCH_FUNCTION_SIZE 16
# endif
#endif
#if defined(USE_X64_64_ASM)
# if defined(GLX_USE_TLS)
# define DISPATCH_FUNCTION_SIZE 16
# endif
#endif
/**
* Number of extension functions which we can dynamically add at runtime.
*
* Number of extension functions is also subject to the size of backing exec
* mem we allocate. For the common case of dispatch stubs with size 16 bytes,
* the two limits will be hit simultaneously. For larger dispatch function
* sizes, MAX_EXTENSION_FUNCS is effectively reduced.
*/
#define MAX_EXTENSION_FUNCS 256
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+862
View File
@@ -0,0 +1,862 @@
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
/*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL, IBM,
* AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _GLAPI_TABLE_H_ )
# define _GLAPI_TABLE_H_
#ifndef GLAPIENTRYP
# ifndef GLAPIENTRY
# define GLAPIENTRY
# endif
# define GLAPIENTRYP GLAPIENTRY *
#endif
struct _glapi_table
{
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
void (GLAPIENTRYP EndList)(void); /* 1 */
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
void (GLAPIENTRYP End)(void); /* 43 */
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
void (GLAPIENTRYP InitNames)(void); /* 197 */
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
void (GLAPIENTRYP PopName)(void); /* 200 */
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
void (GLAPIENTRYP Finish)(void); /* 216 */
void (GLAPIENTRYP Flush)(void); /* 217 */
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */
void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */
void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); /* 430 */
void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); /* 431 */
void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 432 */
void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 433 */
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 434 */
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 435 */
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 436 */
void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 438 */
void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 439 */
void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 441 */
void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 442 */
void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 443 */
void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 444 */
void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 445 */
void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 448 */
void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 449 */
void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 450 */
void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 451 */
void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 452 */
void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 453 */
void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 454 */
void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 455 */
void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 456 */
void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 457 */
void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 458 */
void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 459 */
void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 460 */
void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 461 */
void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 462 */
void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 463 */
void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 464 */
void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 465 */
void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 466 */
void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 467 */
void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 468 */
void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 469 */
void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 470 */
void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 471 */
void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 472 */
void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 473 */
void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 474 */
void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 475 */
void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 476 */
void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 477 */
void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 478 */
void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 479 */
void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 480 */
void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 481 */
void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 482 */
void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 483 */
void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 484 */
void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 485 */
void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 486 */
void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 487 */
void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 488 */
void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 489 */
void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 490 */
void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 491 */
void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 492 */
void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 493 */
void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 494 */
void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 495 */
void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 496 */
void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 497 */
void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 498 */
void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 499 */
void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 500 */
void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 501 */
void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 502 */
void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 503 */
void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 504 */
void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 505 */
void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 506 */
void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 507 */
void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 508 */
GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 509 */
GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 510 */
GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 511 */
void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 512 */
void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 513 */
void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 514 */
void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 515 */
void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 516 */
void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 517 */
void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 518 */
GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 519 */
void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 520 */
void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 521 */
GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 522 */
GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 523 */
void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 524 */
void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 525 */
void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 526 */
void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 527 */
GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 528 */
void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 529 */
void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 530 */
void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 531 */
void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 532 */
GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 533 */
void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 534 */
void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 535 */
void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 536 */
void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 537 */
void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 538 */
void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 539 */
void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 540 */
void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 541 */
void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 542 */
void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 543 */
void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 544 */
void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 545 */
void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 546 */
void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 547 */
void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 548 */
void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 549 */
void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 550 */
void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 551 */
void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 552 */
void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 553 */
void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 555 */
void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 556 */
void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 557 */
void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 558 */
void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 559 */
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 560 */
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 561 */
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 562 */
void (GLAPIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); /* 563 */
void (GLAPIENTRYP FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); /* 564 */
GLvoid * (GLAPIENTRYP MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); /* 565 */
void (GLAPIENTRYP BindVertexArray)(GLuint array); /* 566 */
void (GLAPIENTRYP GenVertexArrays)(GLsizei n, GLuint * arrays); /* 567 */
void (GLAPIENTRYP CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); /* 568 */
GLenum (GLAPIENTRYP ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 569 */
void (GLAPIENTRYP DeleteSync)(GLsync sync); /* 570 */
GLsync (GLAPIENTRYP FenceSync)(GLenum condition, GLbitfield flags); /* 571 */
void (GLAPIENTRYP GetInteger64v)(GLenum pname, GLint64 * params); /* 572 */
void (GLAPIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); /* 573 */
GLboolean (GLAPIENTRYP IsSync)(GLsync sync); /* 574 */
void (GLAPIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 575 */
void (GLAPIENTRYP DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 576 */
void (GLAPIENTRYP DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 577 */
void (GLAPIENTRYP MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex); /* 578 */
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 579 */
void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 580 */
void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 581 */
void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 582 */
void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 583 */
void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 584 */
void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 585 */
void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 586 */
void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 587 */
void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 588 */
void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 589 */
void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 590 */
void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 591 */
void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 592 */
void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 593 */
void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 594 */
void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 595 */
void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 596 */
void (GLAPIENTRYP UnlockArraysEXT)(void); /* 597 */
void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 598 */
void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 599 */
void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 600 */
void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 601 */
void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 602 */
void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 603 */
void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 604 */
void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 605 */
void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 606 */
void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 607 */
void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 608 */
void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 609 */
void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 610 */
void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 611 */
void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 612 */
void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 613 */
void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 614 */
void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 615 */
void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 616 */
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 617 */
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 618 */
void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 619 */
void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 620 */
void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 621 */
void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 622 */
void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 623 */
void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 624 */
void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 625 */
void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 626 */
void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 627 */
void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 628 */
void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 629 */
void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 630 */
void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 631 */
void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 632 */
void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 633 */
void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 634 */
void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 635 */
void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 636 */
void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 637 */
void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 638 */
void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 639 */
void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 640 */
void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 641 */
void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 642 */
void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 643 */
void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 644 */
void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 645 */
void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 646 */
void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 647 */
void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 648 */
void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 649 */
void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 650 */
void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 651 */
void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 652 */
void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 653 */
void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 654 */
void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 655 */
void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 656 */
void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 657 */
void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 658 */
void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 659 */
void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 660 */
void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 661 */
void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 662 */
void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 663 */
void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 664 */
void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 665 */
void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 666 */
void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 667 */
void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 668 */
void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 669 */
void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 670 */
void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 671 */
GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 672 */
void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 673 */
GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 674 */
GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 675 */
void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 676 */
void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 677 */
void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 678 */
void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 679 */
void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 680 */
void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 681 */
void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 682 */
void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 683 */
void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 684 */
void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 685 */
void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 686 */
void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 687 */
void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 688 */
GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 689 */
void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 690 */
void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 691 */
void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 692 */
void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 693 */
void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 694 */
void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 695 */
void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 696 */
void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 697 */
void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 698 */
void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 699 */
void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 700 */
void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 701 */
void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 702 */
void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 703 */
void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 704 */
void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 705 */
void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 706 */
void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 707 */
void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 708 */
void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 709 */
void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 710 */
void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 711 */
void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 712 */
void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 713 */
void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 714 */
void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 715 */
void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 716 */
void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 717 */
void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 718 */
void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 719 */
void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 720 */
void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 721 */
void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 722 */
void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 723 */
void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 724 */
void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 725 */
void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 726 */
void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 727 */
void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 728 */
void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 729 */
void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 730 */
void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 731 */
void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 732 */
void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 733 */
void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 734 */
void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 735 */
void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 736 */
void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 737 */
void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 738 */
void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 739 */
void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 740 */
void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 741 */
void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 742 */
void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 743 */
void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 744 */
void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 745 */
void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 746 */
void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 747 */
void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 748 */
GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 749 */
void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 750 */
void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 751 */
void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 752 */
void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 753 */
void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 754 */
void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 755 */
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 756 */
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 757 */
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 758 */
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 759 */
void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 760 */
void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 761 */
void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 762 */
void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 763 */
void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 764 */
void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 765 */
void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 766 */
void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 767 */
void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 768 */
void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 769 */
GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 770 */
void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 771 */
void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 772 */
void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 773 */
void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 774 */
void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 775 */
void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 776 */
void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 777 */
void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 778 */
void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 779 */
void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 780 */
void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 781 */
GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 782 */
GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 783 */
void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 784 */
void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 785 */
void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 786 */
void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 787 */
void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 788 */
void (GLAPIENTRYP ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); /* 789 */
void (GLAPIENTRYP DisableIndexedEXT)(GLenum target, GLuint index); /* 790 */
void (GLAPIENTRYP EnableIndexedEXT)(GLenum target, GLuint index); /* 791 */
void (GLAPIENTRYP GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean * data); /* 792 */
void (GLAPIENTRYP GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint * data); /* 793 */
GLboolean (GLAPIENTRYP IsEnabledIndexedEXT)(GLenum target, GLuint index); /* 794 */
void (GLAPIENTRYP BeginConditionalRenderNV)(GLuint query, GLenum mode); /* 795 */
void (GLAPIENTRYP EndConditionalRenderNV)(void); /* 796 */
void (GLAPIENTRYP BeginTransformFeedbackEXT)(GLenum mode); /* 797 */
void (GLAPIENTRYP BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer); /* 798 */
void (GLAPIENTRYP BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); /* 799 */
void (GLAPIENTRYP BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); /* 800 */
void (GLAPIENTRYP EndTransformFeedbackEXT)(void); /* 801 */
void (GLAPIENTRYP GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); /* 802 */
void (GLAPIENTRYP TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode); /* 803 */
void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 804 */
void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 805 */
void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 806 */
void (GLAPIENTRYP GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value); /* 807 */
GLenum (GLAPIENTRYP ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 808 */
GLenum (GLAPIENTRYP ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 809 */
void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 810 */
void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 811 */
void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 812 */
void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 813 */
void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 814 */
void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 815 */
void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 816 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+263
View File
@@ -0,0 +1,263 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* XXX There's probably some work to do in order to make this file
* truly reusable outside of Mesa. First, the glheader.h include must go.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#include "glapi/mesa.h"
#else
#include "main/compiler.h"
#endif
#include "glapi/glthread.h"
/*
* This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene..
*/
#ifdef THREADS
#include <errno.h>
/*
* Error messages
*/
#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
/*
* Magic number to determine if a TSD object has been initialized.
* Kind of a hack but there doesn't appear to be a better cross-platform
* solution.
*/
#define INIT_MAGIC 0xff8adc98
/*
* POSIX Threads -- The best way to go if your platform supports them.
* Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
* has them, and many of the free Unixes now have them.
* Be sure to use appropriate -mt or -D_REENTRANT type
* compile flags when building.
*/
#ifdef PTHREADS
PUBLIC unsigned long
_glthread_GetID(void)
{
return (unsigned long) pthread_self();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return pthread_getspecific(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (pthread_setspecific(tsd->key, ptr) != 0) {
perror(SET_TSD_ERROR);
exit(-1);
}
}
#endif /* PTHREADS */
/*
* Win32 Threads. The only available option for Windows 95/NT.
* Be sure that you compile using the Multithreaded runtime, otherwise
* bad things will happen.
*/
#ifdef WIN32_THREADS
static void InsteadOf_exit(int nCode)
{
DWORD dwErr = GetLastError();
}
PUBLIC unsigned long
_glthread_GetID(void)
{
return GetCurrentThreadId();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = TlsAlloc();
if (tsd->key == TLS_OUT_OF_INDEXES) {
perror(INIT_TSD_ERROR);
InsteadOf_exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void
_glthread_DestroyTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != INIT_MAGIC) {
return;
}
TlsFree(tsd->key);
tsd->initMagic = 0x0;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return TlsGetValue(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
/* the following code assumes that the _glthread_TSD has been initialized
to zero at creation */
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (TlsSetValue(tsd->key, ptr) == 0) {
perror(SET_TSD_ERROR);
InsteadOf_exit(-1);
}
}
#endif /* WIN32_THREADS */
/*
* BeOS threads
*/
#ifdef BEOS_THREADS
PUBLIC unsigned long
_glthread_GetID(void)
{
return (unsigned long) find_thread(NULL);
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = tls_allocate();
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return tls_get(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
tls_set(tsd->key, ptr);
}
#endif /* BEOS_THREADS */
#else /* THREADS */
/*
* no-op functions
*/
PUBLIC unsigned long
_glthread_GetID(void)
{
return 0;
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
(void) tsd;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
(void) tsd;
return NULL;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
(void) tsd;
(void) ptr;
}
#endif /* THREADS */
+255
View File
@@ -0,0 +1,255 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is 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 Software.
*
* THE SOFTWARE IS 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
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Thread support for gl dispatch.
*
* Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
* and Christoph Poliwoda (poliwoda@volumegraphics.com)
* Revised by Keith Whitwell
* Adapted for new gl dispatcher by Brian Paul
*
*
*
* DOCUMENTATION
*
* This thread module exports the following types:
* _glthread_TSD Thread-specific data area
* _glthread_Thread Thread datatype
* _glthread_Mutex Mutual exclusion lock
*
* Macros:
* _glthread_DECLARE_STATIC_MUTEX(name) Declare a non-local mutex
* _glthread_INIT_MUTEX(name) Initialize a mutex
* _glthread_LOCK_MUTEX(name) Lock a mutex
* _glthread_UNLOCK_MUTEX(name) Unlock a mutex
*
* Functions:
* _glthread_GetID(v) Get integer thread ID
* _glthread_InitTSD() Initialize thread-specific data
* _glthread_GetTSD() Get thread-specific data
* _glthread_SetTSD() Set thread-specific data
*
*/
/*
* If this file is accidentally included by a non-threaded build,
* it should not cause the build to fail, or otherwise cause problems.
* In general, it should only be included when needed however.
*/
#ifndef GLTHREAD_H
#define GLTHREAD_H
#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
#ifndef THREADS
#define THREADS
#endif
#endif
/*
* POSIX threads. This should be your choice in the Unix world
* whenever possible. When building with POSIX threads, be sure
* to enable any compiler flags which will cause the MT-safe
* libc (if one exists) to be used when linking, as well as any
* header macros for MT-safe errno, etc. For Solaris, this is the -mt
* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc.
*/
#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */
typedef struct {
pthread_key_t key;
int initMagic;
} _glthread_TSD;
typedef pthread_t _glthread_Thread;
typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = PTHREAD_MUTEX_INITIALIZER
#define _glthread_INIT_MUTEX(name) \
pthread_mutex_init(&(name), NULL)
#define _glthread_DESTROY_MUTEX(name) \
pthread_mutex_destroy(&(name))
#define _glthread_LOCK_MUTEX(name) \
(void) pthread_mutex_lock(&(name))
#define _glthread_UNLOCK_MUTEX(name) \
(void) pthread_mutex_unlock(&(name))
#endif /* PTHREADS */
/*
* Windows threads. Should work with Windows NT and 95.
* IMPORTANT: Link with multithreaded runtime library when THREADS are
* used!
*/
#ifdef WIN32_THREADS
#include <windows.h>
typedef struct {
DWORD key;
int initMagic;
} _glthread_TSD;
typedef HANDLE _glthread_Thread;
typedef CRITICAL_SECTION _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) \
/* static */ _glthread_Mutex name = { 0, 0, 0, 0, 0, 0 }
#define _glthread_INIT_MUTEX(name) \
InitializeCriticalSection(&name)
#define _glthread_DESTROY_MUTEX(name) \
DeleteCriticalSection(&name)
#define _glthread_LOCK_MUTEX(name) \
EnterCriticalSection(&name)
#define _glthread_UNLOCK_MUTEX(name) \
LeaveCriticalSection(&name)
#endif /* WIN32_THREADS */
/*
* BeOS threads. R5.x required.
*/
#ifdef BEOS_THREADS
/* Problem with OS.h and this file on haiku */
#ifndef __HAIKU__
#include <kernel/OS.h>
#endif
#include <support/TLS.h>
/* The only two typedefs required here
* this is cause of the OS.h problem
*/
#ifdef __HAIKU__
typedef int32 thread_id;
typedef int32 sem_id;
#endif
typedef struct {
int32 key;
int initMagic;
} _glthread_TSD;
typedef thread_id _glthread_Thread;
/* Use Benaphore, aka speeder semaphore */
typedef struct {
int32 lock;
sem_id sem;
} benaphore;
typedef benaphore _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = { 0, 0 }
#define _glthread_INIT_MUTEX(name) \
name.sem = create_sem(0, #name"_benaphore"), \
name.lock = 0
#define _glthread_DESTROY_MUTEX(name) \
delete_sem(name.sem), \
name.lock = 0
#define _glthread_LOCK_MUTEX(name) \
if (name.sem == 0) \
_glthread_INIT_MUTEX(name); \
if (atomic_add(&(name.lock), 1) >= 1) \
acquire_sem(name.sem)
#define _glthread_UNLOCK_MUTEX(name) \
if (atomic_add(&(name.lock), -1) > 1) \
release_sem(name.sem)
#endif /* BEOS_THREADS */
/*
* THREADS not defined
*/
#ifndef THREADS
typedef unsigned _glthread_TSD;
typedef unsigned _glthread_Thread;
typedef unsigned _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
#endif /* THREADS */
/*
* Platform independent thread specific data API.
*/
extern unsigned long
_glthread_GetID(void);
extern void
_glthread_InitTSD(_glthread_TSD *);
extern void
_glthread_DestroyTSD(_glthread_TSD *); /* WIN32 only */
extern void *
_glthread_GetTSD(_glthread_TSD *);
extern void
_glthread_SetTSD(_glthread_TSD *, void *);
#endif /* THREADS_H */
+19
View File
@@ -0,0 +1,19 @@
# src/mapi/glapi/sources.mak
GLAPI_SOURCES = \
glapi.c \
glapi_dispatch.c \
glapi_entrypoint.c \
glapi_execmem.c \
glapi_getproc.c \
glapi_nop.c \
glthread.c
X86_API = \
glapi_x86.S
X86-64_API = \
glapi_x86-64.S
SPARC_API = \
glapi_sparc.S