aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf.c120
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf.h6
-rw-r--r--mesalib/src/glsl/.gitignore1
-rw-r--r--mesalib/src/glsl/Android.mk2
-rw-r--r--mesalib/src/glsl/Makefile.am48
-rw-r--r--mesalib/src/glsl/SConscript7
-rw-r--r--mesalib/src/glsl/builtin_compiler/.gitignore6
-rw-r--r--mesalib/src/glsl/builtin_compiler/Makefile.am68
-rw-r--r--mesalib/src/glsl/builtin_compiler/builtin_stubs.cpp (renamed from mesalib/src/glsl/builtin_stubs.cpp)0
-rw-r--r--mesalib/src/mapi/glapi/SConscript6
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml4
-rw-r--r--mesalib/src/mapi/glapi/gen/Makefile.am31
-rw-r--r--mesalib/src/mapi/glapi/gen/SConscript10
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_API.xml3
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_XML.py7
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_and_es_API.xml1
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_apitemp.py2
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_gentable.py2
-rw-r--r--mesalib/src/mesa/Android.gen.mk33
-rw-r--r--mesalib/src/mesa/Makefile.am15
-rw-r--r--mesalib/src/mesa/SConscript18
-rw-r--r--mesalib/src/mesa/main/.gitignore3
-rw-r--r--mesalib/src/mesa/main/APIspec.py617
-rw-r--r--mesalib/src/mesa/main/APIspec.xml2383
-rw-r--r--mesalib/src/mesa/main/APIspecutil.py272
-rw-r--r--mesalib/src/mesa/main/api_exec.c260
-rw-r--r--mesalib/src/mesa/main/api_exec.h6
-rw-r--r--mesalib/src/mesa/main/api_loopback.c9
-rw-r--r--mesalib/src/mesa/main/arrayobj.c2
-rw-r--r--mesalib/src/mesa/main/bufferobj.c24
-rw-r--r--mesalib/src/mesa/main/context.c27
-rw-r--r--mesalib/src/mesa/main/dlist.c12
-rw-r--r--mesalib/src/mesa/main/es1_conversion.c4
-rw-r--r--mesalib/src/mesa/main/es1_conversion.h31
-rw-r--r--mesalib/src/mesa/main/es_generator.py765
-rw-r--r--mesalib/src/mesa/main/fbobject.c21
-rw-r--r--mesalib/src/mesa/main/fbobject.h9
-rw-r--r--mesalib/src/mesa/main/querymatrix.c13
-rw-r--r--mesalib/src/mesa/main/querymatrix.h39
-rw-r--r--mesalib/src/mesa/main/queryobj.c16
-rw-r--r--mesalib/src/mesa/main/shaderapi.c76
-rw-r--r--mesalib/src/mesa/main/texgen.c10
-rw-r--r--mesalib/src/mesa/main/texgen.h2
-rw-r--r--mesalib/src/mesa/main/texobj.c2
-rw-r--r--mesalib/src/mesa/main/uniforms.c52
-rw-r--r--mesalib/src/mesa/main/vtxfmt.c51
-rw-r--r--mesalib/src/mesa/sources.mak1
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch.c2
48 files changed, 634 insertions, 4465 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf.c b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
index 7fb492882..b712b52de 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf.c
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf.c
@@ -25,6 +25,66 @@
*
**************************************************************************/
+/**
+ * This module uploads user buffers and translates the vertex buffers which
+ * contain incompatible vertices (i.e. not supported by the driver/hardware)
+ * into compatible ones, based on the Gallium CAPs.
+ *
+ * It does not upload index buffers.
+ *
+ * The module heavily uses bitmasks to represent per-buffer and
+ * per-vertex-element flags to avoid looping over the list of buffers just
+ * to see if there's a non-zero stride, or user buffer, or unsupported format,
+ * etc.
+ *
+ * There are 3 categories of vertex elements, which are processed separately:
+ * - per-vertex attribs (stride != 0, instance_divisor == 0)
+ * - instanced attribs (stride != 0, instance_divisor > 0)
+ * - constant attribs (stride == 0)
+ *
+ * All needed uploads and translations are performed every draw command, but
+ * only the subset of vertices needed for that draw command is uploaded or
+ * translated. (the module never translates whole buffers)
+ *
+ *
+ * The module consists of two main parts:
+ *
+ *
+ * 1) Translate (u_vbuf_translate_begin/end)
+ *
+ * This is pretty much a vertex fetch fallback. It translates vertices from
+ * one vertex buffer to another in an unused vertex buffer slot. It does
+ * whatever is needed to make the vertices readable by the hardware (changes
+ * vertex formats and aligns offsets and strides). The translate module is
+ * used here.
+ *
+ * Each of the 3 categories is translated to a separate buffer.
+ * Only the [min_index, max_index] range is translated. For instanced attribs,
+ * the range is [start_instance, start_instance+instance_count]. For constant
+ * attribs, the range is [0, 1].
+ *
+ *
+ * 2) User buffer uploading (u_vbuf_upload_buffers)
+ *
+ * Only the [min_index, max_index] range is uploaded (just like Translate)
+ * with a single memcpy.
+ *
+ * This method works best for non-indexed draw operations or indexed draw
+ * operations where the [min_index, max_index] range is not being way bigger
+ * than the vertex count.
+ *
+ * If the range is too big (e.g. one triangle with indices {0, 1, 10000}),
+ * the per-vertex attribs are uploaded via the translate module, all packed
+ * into one vertex buffer, and the indexed draw call is turned into
+ * a non-indexed one in the process. This adds additional complexity
+ * to the translate part, but it prevents bad apps from bringing your frame
+ * rate down.
+ *
+ *
+ * If there is nothing to do, it forwards every command to the driver.
+ * The module also has its own CSO cache of vertex element states.
+ */
+
#include "util/u_vbuf.h"
#include "util/u_dump.h"
@@ -49,6 +109,8 @@ struct u_vbuf_elements {
enum pipe_format native_format[PIPE_MAX_ATTRIBS];
unsigned native_format_size[PIPE_MAX_ATTRIBS];
+ /* Which buffers are used by the vertex element state. */
+ uint32_t used_vb_mask;
/* This might mean two things:
* - src_format != native_format, as discussed above.
* - src_offset % 4 != 0 (if the caps don't allow such an offset). */
@@ -430,6 +492,8 @@ u_vbuf_translate_begin(struct u_vbuf *mgr,
struct translate_key key[VB_NUM];
unsigned elem_index[VB_NUM][PIPE_MAX_ATTRIBS]; /* ... into key.elements */
unsigned i, type;
+ unsigned incompatible_vb_mask = mgr->incompatible_vb_mask &
+ mgr->ve->used_vb_mask;
int start[VB_NUM] = {
start_vertex, /* VERTEX */
@@ -453,20 +517,20 @@ u_vbuf_translate_begin(struct u_vbuf *mgr,
if (!mgr->vertex_buffer[vb_index].stride) {
if (!(mgr->ve->incompatible_elem_mask & (1 << i)) &&
- !(mgr->incompatible_vb_mask & (1 << vb_index))) {
+ !(incompatible_vb_mask & (1 << vb_index))) {
continue;
}
mask[VB_CONST] |= 1 << vb_index;
} else if (mgr->ve->ve[i].instance_divisor) {
if (!(mgr->ve->incompatible_elem_mask & (1 << i)) &&
- !(mgr->incompatible_vb_mask & (1 << vb_index))) {
+ !(incompatible_vb_mask & (1 << vb_index))) {
continue;
}
mask[VB_INSTANCE] |= 1 << vb_index;
} else {
if (!unroll_indices &&
!(mgr->ve->incompatible_elem_mask & (1 << i)) &&
- !(mgr->incompatible_vb_mask & (1 << vb_index))) {
+ !(incompatible_vb_mask & (1 << vb_index))) {
continue;
}
mask[VB_VERTEX] |= 1 << vb_index;
@@ -488,7 +552,7 @@ u_vbuf_translate_begin(struct u_vbuf *mgr,
bit = 1 << vb_index;
if (!(mgr->ve->incompatible_elem_mask & (1 << i)) &&
- !(mgr->incompatible_vb_mask & (1 << vb_index)) &&
+ !(incompatible_vb_mask & (1 << vb_index)) &&
(!unroll_indices || !(mask[VB_VERTEX] & bit))) {
continue;
}
@@ -690,6 +754,7 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
}
}
+ ve->used_vb_mask = used_buffers;
ve->compatible_vb_mask_all = ~ve->incompatible_vb_mask_any & used_buffers;
ve->incompatible_vb_mask_all = ~ve->compatible_vb_mask_any & used_buffers;
@@ -826,18 +891,18 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
{
unsigned i;
unsigned nr_velems = mgr->ve->count;
- unsigned nr_vbufs = util_last_bit(mgr->enabled_vb_mask);
struct pipe_vertex_element *velems =
mgr->using_translate ? mgr->fallback_velems : mgr->ve->ve;
unsigned start_offset[PIPE_MAX_ATTRIBS];
- unsigned end_offset[PIPE_MAX_ATTRIBS] = {0};
+ unsigned end_offset[PIPE_MAX_ATTRIBS];
+ uint32_t buffer_mask = 0;
/* Determine how much data needs to be uploaded. */
for (i = 0; i < nr_velems; i++) {
struct pipe_vertex_element *velem = &velems[i];
unsigned index = velem->vertex_buffer_index;
struct pipe_vertex_buffer *vb = &mgr->vertex_buffer[index];
- unsigned instance_div, first, size;
+ unsigned instance_div, first, size, index_bit;
/* Skip the buffers generated by translate. */
if (index == mgr->fallback_vbs[VB_VERTEX] ||
@@ -867,8 +932,10 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
size = vb->stride * (num_vertices - 1) + mgr->ve->src_format_size[i];
}
+ index_bit = 1 << index;
+
/* Update offsets. */
- if (!end_offset[index]) {
+ if (!(buffer_mask & index_bit)) {
start_offset[index] = first;
end_offset[index] = first + size;
} else {
@@ -877,19 +944,20 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
if (first + size > end_offset[index])
end_offset[index] = first + size;
}
+
+ buffer_mask |= index_bit;
}
/* Upload buffers. */
- for (i = 0; i < nr_vbufs; i++) {
- unsigned start, end = end_offset[i];
+ while (buffer_mask) {
+ unsigned start, end;
struct pipe_vertex_buffer *real_vb;
const uint8_t *ptr;
- if (!end) {
- continue;
- }
+ i = u_bit_scan(&buffer_mask);
start = start_offset[i];
+ end = end_offset[i];
assert(start < end);
real_vb = &mgr->real_vertex_buffer[i];
@@ -907,9 +975,10 @@ static boolean u_vbuf_need_minmax_index(struct u_vbuf *mgr)
/* See if there are any per-vertex attribs which will be uploaded or
* translated. Use bitmasks to get the info instead of looping over vertex
* elements. */
- return ((mgr->user_vb_mask | mgr->incompatible_vb_mask |
- mgr->ve->incompatible_vb_mask_any) &
- mgr->ve->noninstance_vb_mask_any & mgr->nonzero_stride_vb_mask) != 0;
+ return (mgr->ve->used_vb_mask &
+ ((mgr->user_vb_mask | mgr->incompatible_vb_mask |
+ mgr->ve->incompatible_vb_mask_any) &
+ mgr->ve->noninstance_vb_mask_any & mgr->nonzero_stride_vb_mask)) != 0;
}
static boolean u_vbuf_mapping_vertex_buffer_blocks(struct u_vbuf *mgr)
@@ -918,9 +987,10 @@ static boolean u_vbuf_mapping_vertex_buffer_blocks(struct u_vbuf *mgr)
*
* We could query whether each buffer is busy, but that would
* be way more costly than this. */
- return (~mgr->user_vb_mask & ~mgr->incompatible_vb_mask &
- mgr->ve->compatible_vb_mask_all & mgr->ve->noninstance_vb_mask_any &
- mgr->nonzero_stride_vb_mask) != 0;
+ return (mgr->ve->used_vb_mask &
+ (~mgr->user_vb_mask & ~mgr->incompatible_vb_mask &
+ mgr->ve->compatible_vb_mask_all & mgr->ve->noninstance_vb_mask_any &
+ mgr->nonzero_stride_vb_mask)) != 0;
}
static void u_vbuf_get_minmax_index(struct pipe_context *pipe,
@@ -1041,15 +1111,17 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
int start_vertex, min_index;
unsigned num_vertices;
boolean unroll_indices = FALSE;
- uint32_t user_vb_mask = mgr->user_vb_mask;
+ uint32_t used_vb_mask = mgr->ve->used_vb_mask;
+ uint32_t user_vb_mask = mgr->user_vb_mask & used_vb_mask;
+ uint32_t incompatible_vb_mask = mgr->incompatible_vb_mask & used_vb_mask;
/* Normal draw. No fallback and no user buffers. */
- if (!mgr->incompatible_vb_mask &&
+ if (!incompatible_vb_mask &&
!mgr->ve->incompatible_elem_mask &&
!user_vb_mask) {
/* Set vertex buffers if needed. */
- if (mgr->dirty_real_vb_mask) {
+ if (mgr->dirty_real_vb_mask & used_vb_mask) {
u_vbuf_set_driver_vertex_buffers(mgr);
}
@@ -1102,7 +1174,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
/* Translate vertices with non-native layouts or formats. */
if (unroll_indices ||
- mgr->incompatible_vb_mask ||
+ incompatible_vb_mask ||
mgr->ve->incompatible_elem_mask) {
/* XXX check the return value */
u_vbuf_translate_begin(mgr, start_vertex, num_vertices,
@@ -1110,7 +1182,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
info->start, info->count, min_index,
unroll_indices);
- user_vb_mask &= ~(mgr->incompatible_vb_mask |
+ user_vb_mask &= ~(incompatible_vb_mask |
mgr->ve->incompatible_vb_mask_all);
}
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf.h b/mesalib/src/gallium/auxiliary/util/u_vbuf.h
index 0f8227164..a608184e5 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf.h
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf.h
@@ -28,9 +28,9 @@
#ifndef U_VBUF_H
#define U_VBUF_H
-/* This module builds upon u_upload_mgr and translate_cache and takes care of
- * user buffer uploads and vertex format fallbacks. It's designed
- * for the drivers which don't always use the Draw module. (e.g. for HWTCL)
+/* This module takes care of user buffer uploads and vertex format fallbacks.
+ * It's designed for the drivers which don't want to use the Draw module.
+ * There is a more detailed description at the beginning of the .c file.
*/
#include "pipe/p_context.h"
diff --git a/mesalib/src/glsl/.gitignore b/mesalib/src/glsl/.gitignore
index 5b4fc6c9c..9f6fbd69e 100644
--- a/mesalib/src/glsl/.gitignore
+++ b/mesalib/src/glsl/.gitignore
@@ -4,6 +4,5 @@ glsl_parser.cc
glsl_parser.h
glsl_parser.output
builtin_function.cpp
-builtin_compiler
glsl_test
/Makefile
diff --git a/mesalib/src/glsl/Android.mk b/mesalib/src/glsl/Android.mk
index 87a02f51b..f975d03d1 100644
--- a/mesalib/src/glsl/Android.mk
+++ b/mesalib/src/glsl/Android.mk
@@ -60,7 +60,7 @@ LOCAL_SRC_FILES := \
$(LIBGLCPP_FILES) \
$(LIBGLSL_FILES) \
$(LIBGLSL_CXX_FILES) \
- $(BUILTIN_COMPILER_CXX_FILES) \
+ $(GLSL_SRCDIR)/builtin_compiler/builtin_stubs.cpp \
$(GLSL_COMPILER_CXX_FILES)
LOCAL_C_INCLUDES := \
diff --git a/mesalib/src/glsl/Makefile.am b/mesalib/src/glsl/Makefile.am
index 1ecc0036c..6fb3d2d9d 100644
--- a/mesalib/src/glsl/Makefile.am
+++ b/mesalib/src/glsl/Makefile.am
@@ -19,9 +19,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-
-# builtin_compiler is built before libglsl to generate builtin_function.cpp for libglsl.
-# For this to work, a dummy version of builtin_function.cpp, builtin_stubs.cpp, is used.
+SUBDIRS = builtin_compiler glcpp
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
@@ -38,32 +36,23 @@ AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
include Makefile.sources
-noinst_LTLIBRARIES = libglslcommon.la libglsl.la
-noinst_PROGRAMS = glsl_compiler glsl_test builtin_compiler
+noinst_LTLIBRARIES = libglsl.la
+noinst_PROGRAMS = glsl_compiler glsl_test
-# common sources for builtin_compiler and libglsl
-libglslcommon_la_SOURCES = \
+libglsl_la_SOURCES = \
glsl_lexer.ll \
glsl_parser.cc \
$(LIBGLSL_FILES) \
- $(LIBGLSL_CXX_FILES)
-
-libglslcommon_la_LIBADD = glcpp/libglcpp.la
-
-# common sources for builtin_compiler and glsl_compiler
-GLSL2_SOURCES = \
- $(top_srcdir)/src/mesa/program/hash_table.c \
- $(top_srcdir)/src/mesa/program/symbol_table.c \
- $(GLSL_COMPILER_CXX_FILES)
-
-libglsl_la_SOURCES = \
+ $(LIBGLSL_CXX_FILES) \
builtin_function.cpp
-libglsl_la_LIBADD = libglslcommon.la
+libglsl_la_LIBADD = glcpp/libglcpp.la
libglsl_la_LDFLAGS =
glsl_compiler_SOURCES = \
- $(GLSL2_SOURCES)
+ $(top_srcdir)/src/mesa/program/hash_table.c \
+ $(top_srcdir)/src/mesa/program/symbol_table.c \
+ $(GLSL_COMPILER_CXX_FILES)
glsl_compiler_LDADD = libglsl.la
@@ -76,12 +65,6 @@ glsl_test_SOURCES = \
glsl_test_LDADD = libglsl.la
-builtin_compiler_SOURCES = \
- $(GLSL2_SOURCES) \
- builtin_stubs.cpp
-
-builtin_compiler_LDADD = libglslcommon.la
-
# automake <=1.11 and automake >=1.12 have different conventions for naming C++ header files
# made by yacc. To work with both, we write our own rule rather than using automake's.
# When (if) we require automake >=1.12 in configure.ac, this can be removed, and we can use
@@ -89,16 +72,11 @@ builtin_compiler_LDADD = libglslcommon.la
glsl_parser.cc glsl_parser.h: glsl_parser.yy
$(AM_V_GEN) $(YACC) -v -o glsl_parser.cc -p "_mesa_glsl_" --defines=glsl_parser.h $<
-BUILT_SOURCES = glsl_parser.h builtin_function.cpp
-CLEANFILES = glsl_lexer.cc glsl_parser.cc $(BUILT_SOURCES)
-
-builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler$(EXEEXT)
- $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp
-
-glcpp/libglcpp.la:
- cd glcpp ; $(MAKE) $(AM_MAKEFLAGS)
+BUILT_SOURCES = glsl_parser.h
+CLEANFILES = glsl_lexer.cc glsl_parser.cc $(BUILT_SOURCES) builtin_function.cpp
-SUBDIRS = glcpp
+builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler/builtin_compiler$(BUILD_EXEEXT)
+ $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py builtin_compiler/builtin_compiler$(BUILD_EXEEXT) > builtin_function.cpp || rm -f builtin_function.cpp
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the library in the current directory.
diff --git a/mesalib/src/glsl/SConscript b/mesalib/src/glsl/SConscript
index 6314c7551..89014ee3c 100644
--- a/mesalib/src/glsl/SConscript
+++ b/mesalib/src/glsl/SConscript
@@ -71,9 +71,10 @@ else:
compiler_objs += mesa_objs
builtin_compiler = env.Program(
- target = 'builtin_compiler',
- source = compiler_objs + glsl_sources + \
- source_lists['BUILTIN_COMPILER_CXX_FILES'],
+ target = 'builtin_compiler/builtin_compiler',
+ source = compiler_objs + glsl_sources + [
+ 'builtin_compiler/builtin_stubs.cpp',
+ ]
)
# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll
diff --git a/mesalib/src/glsl/builtin_compiler/.gitignore b/mesalib/src/glsl/builtin_compiler/.gitignore
new file mode 100644
index 000000000..40c551baa
--- /dev/null
+++ b/mesalib/src/glsl/builtin_compiler/.gitignore
@@ -0,0 +1,6 @@
+builtin_compiler
+glcpp-lex.c
+glcpp-parse.c
+glcpp-parse.h
+glcpp-parse.output
+/Makefile
diff --git a/mesalib/src/glsl/builtin_compiler/Makefile.am b/mesalib/src/glsl/builtin_compiler/Makefile.am
new file mode 100644
index 000000000..72032b524
--- /dev/null
+++ b/mesalib/src/glsl/builtin_compiler/Makefile.am
@@ -0,0 +1,68 @@
+# Copyright © 2012 Jon TURNEY
+# Copyright © 2012 Thierry Reding
+#
+# 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 (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 NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+CC = @CC_FOR_BUILD@
+CFLAGS = @CFLAGS_FOR_BUILD@
+CPP = @CPP_FOR_BUILD@
+CPPFLAGS = @CPPFLAGS_FOR_BUILD@
+CXX = @CXX_FOR_BUILD@
+CXXFLAGS = @CXXFLAGS_FOR_BUILD@
+LD = @LD_FOR_BUILD@
+LDFLAGS = @LDFLAGS_FOR_BUILD@
+
+AM_CFLAGS = \
+ -I $(top_srcdir)/include \
+ -I $(top_srcdir)/src/mapi \
+ -I $(top_srcdir)/src/mesa \
+ -I $(GLSL_SRCDIR) \
+ -I $(GLSL_SRCDIR)/glcpp \
+ $(DEFINES_FOR_BUILD)
+
+AM_CXXFLAGS = $(AM_CFLAGS)
+
+AM_YFLAGS = -v -d -p "glcpp_parser_"
+AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
+
+include ../Makefile.sources
+
+noinst_PROGRAMS = builtin_compiler
+
+builtin_compiler_SOURCES = \
+ $(GLSL_SRCDIR)/glcpp/glcpp-lex.l \
+ $(GLSL_SRCDIR)/glcpp/glcpp-parse.y \
+ $(LIBGLCPP_FILES) \
+ $(GLSL_SRCDIR)/glsl_lexer.ll \
+ $(GLSL_SRCDIR)/glsl_parser.cc \
+ $(LIBGLSL_FILES) \
+ $(LIBGLSL_CXX_FILES) \
+ $(top_srcdir)/src/mesa/program/hash_table.c \
+ $(top_srcdir)/src/mesa/program/symbol_table.c \
+ $(GLSL_COMPILER_CXX_FILES) \
+ builtin_stubs.cpp
+
+BUILT_SOURCES = \
+ glcpp-lex.c \
+ glcpp-parse.c \
+ glcpp-parse.h \
+ glsl_lexer.cc
+
+CLEANFILES = $(BUILT_SOURCES)
diff --git a/mesalib/src/glsl/builtin_stubs.cpp b/mesalib/src/glsl/builtin_compiler/builtin_stubs.cpp
index dfa5d324e..dfa5d324e 100644
--- a/mesalib/src/glsl/builtin_stubs.cpp
+++ b/mesalib/src/glsl/builtin_compiler/builtin_stubs.cpp
diff --git a/mesalib/src/mapi/glapi/SConscript b/mesalib/src/mapi/glapi/SConscript
index c336c2510..153374cc5 100644
--- a/mesalib/src/mapi/glapi/SConscript
+++ b/mesalib/src/mapi/glapi/SConscript
@@ -61,7 +61,7 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
env.CodeGenerate(
target = 'glapi_x86.S',
script = GLAPI + 'gen/gl_x86_asm.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
elif env['machine'] == 'x86_64':
@@ -74,7 +74,7 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
env.CodeGenerate(
target = 'glapi_x86-64.S',
script = GLAPI + 'gen/gl_x86-64_asm.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
elif env['machine'] == 'sparc':
@@ -87,7 +87,7 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
env.CodeGenerate(
target = 'glapi_sparc.S',
script = GLAPI + 'gen/gl_SPARC_asm.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
else:
diff --git a/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
index d9e540fc9..97a4e2e8f 100644
--- a/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
+++ b/mesalib/src/mapi/glapi/gen/ARB_geometry_shader4.xml
@@ -27,12 +27,12 @@
<enum name="FRAMEBUFFER_ATTACHMENT_LAYERED_ARB" value="0x8DA7"/>
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" value="0x8CD4"/>
<enum name="PROGRAM_POINT_SIZE_ARB" value="0x8642"/>
- <function name="ProgramParameteriARB" offset="assign">
+ <function name="ProgramParameteriARB" alias="ProgramParameteri">
<param name="program" type="GLuint"/>
<param name="pname" type="GLenum"/>
<param name="value" type="GLint"/>
</function>
- <function name="FramebufferTextureARB" offset="assign">
+ <function name="FramebufferTextureARB" alias="FramebufferTexture">
<param name="target" type="GLenum"/>
<param name="attachment" type="GLenum"/>
<param name="texture" type="GLuint"/>
diff --git a/mesalib/src/mapi/glapi/gen/Makefile.am b/mesalib/src/mapi/glapi/gen/Makefile.am
index 40aaf51cd..14bb2dfe6 100644
--- a/mesalib/src/mapi/glapi/gen/Makefile.am
+++ b/mesalib/src/mapi/glapi/gen/Makefile.am
@@ -135,10 +135,11 @@ API_XML = \
GL3x.xml
-COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py
-
-COMMON_ES = \
- $(COMMON) \
+COMMON = $(API_XML) \
+ gl_XML.py \
+ glX_XML.py \
+ license.py \
+ typeexpr.py \
gl_and_es_API.xml \
es_EXT.xml \
ARB_ES2_compatibility.xml \
@@ -182,43 +183,43 @@ $(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h
######################################################################
-$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON_ES)
+$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON)
$(PYTHON_GEN) $< \
--printer glapi --mode lib $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glapi_gentable.c: gl_gentable.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
######################################################################
$(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
######################################################################
-$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON_ES)
+$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON)
$(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
$(MESA_DIR)/main/dispatch.h: gl_table.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml -m remap_table > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml -m remap_table > $@
$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
- $(PYTHON_GEN) $< -f $(srcdir)/gl_API.xml > $@
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
######################################################################
diff --git a/mesalib/src/mapi/glapi/gen/SConscript b/mesalib/src/mapi/glapi/gen/SConscript
index e8bb22731..353d02175 100644
--- a/mesalib/src/mapi/glapi/gen/SConscript
+++ b/mesalib/src/mapi/glapi/gen/SConscript
@@ -14,35 +14,35 @@ glapi_headers = []
glapi_headers += env.CodeGenerate(
target = '#src/mesa/main/dispatch.h',
script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET',
)
glapi_headers += env.CodeGenerate(
target = '#src/mapi/glapi/glapitable.h',
script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
glapi_headers += env.CodeGenerate(
target = '#src/mapi/glapi/glapitemp.h',
script = GLAPI + 'gen/gl_apitemp.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
glapi_headers += env.CodeGenerate(
target = '#src/mapi/glapi/glprocs.h',
script = GLAPI + 'gen/gl_procs.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
glapi_headers += env.CodeGenerate(
target = '#src/mesa/main/remap_helper.h',
script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen/gl_API.xml',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
index 2f6cf195f..af564726a 100644
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -12731,4 +12731,7 @@
<xi:include href="NV_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="EXT_transform_feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_get_program_binary.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
</OpenGLAPI>
diff --git a/mesalib/src/mapi/glapi/gen/gl_XML.py b/mesalib/src/mapi/glapi/gen/gl_XML.py
index ef7ed519b..019687912 100644
--- a/mesalib/src/mapi/glapi/gen/gl_XML.py
+++ b/mesalib/src/mapi/glapi/gen/gl_XML.py
@@ -757,8 +757,11 @@ class gl_function( gl_item ):
return self.images
- def parameterIterator(self):
- return self.parameters.__iter__();
+ def parameterIterator(self, name = None):
+ if name is not None:
+ return self.entry_point_parameters[name].__iter__();
+ else:
+ return self.parameters.__iter__();
def get_parameter_string(self, entrypoint = None):
diff --git a/mesalib/src/mapi/glapi/gen/gl_and_es_API.xml b/mesalib/src/mapi/glapi/gen/gl_and_es_API.xml
index 8e000a8bc..7495a2e56 100644
--- a/mesalib/src/mapi/glapi/gen/gl_and_es_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_and_es_API.xml
@@ -8,7 +8,6 @@
<xi:include href="gl_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- these can be moved to gl_API.xml -->
-<xi:include href="ARB_get_program_binary.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="OES_fixed_point.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="OES_single_precision.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
diff --git a/mesalib/src/mapi/glapi/gen/gl_apitemp.py b/mesalib/src/mapi/glapi/gen/gl_apitemp.py
index c9a6e2937..4157032c5 100644
--- a/mesalib/src/mapi/glapi/gen/gl_apitemp.py
+++ b/mesalib/src/mapi/glapi/gen/gl_apitemp.py
@@ -66,7 +66,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
silence = ''
space = ''
- for p in f.parameterIterator():
+ for p in f.parameterIterator(name):
if p.is_padding:
continue
diff --git a/mesalib/src/mapi/glapi/gen/gl_gentable.py b/mesalib/src/mapi/glapi/gen/gl_gentable.py
index 74611a76b..c0495c09a 100644
--- a/mesalib/src/mapi/glapi/gen/gl_gentable.py
+++ b/mesalib/src/mapi/glapi/gen/gl_gentable.py
@@ -54,7 +54,7 @@ header = """/* GLXEXT is the define used in the xserver when the GLX extension i
#include <stdlib.h>
#include <stdio.h>
-#include <GL/gl.h>
+#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
diff --git a/mesalib/src/mesa/Android.gen.mk b/mesalib/src/mesa/Android.gen.mk
index 893fa4199..ffa36db4d 100644
--- a/mesalib/src/mesa/Android.gen.mk
+++ b/mesalib/src/mesa/Android.gen.mk
@@ -32,9 +32,6 @@ intermediates := $(call local-intermediates-dir)
# This is the list of auto-generated files: sources and headers
sources := \
main/enums.c \
- main/api_exec_es1.c \
- main/api_exec_es1_dispatch.h \
- main/api_exec_es1_remap_helper.h \
program/program_parse.tab.c \
program/lex.yy.c \
main/dispatch.h \
@@ -60,13 +57,7 @@ LOCAL_GENERATED_SOURCES += $(sources)
glapi := $(MESA_TOP)/src/mapi/glapi/gen
-es_src_deps := \
- $(LOCAL_PATH)/main/APIspec.xml \
- $(LOCAL_PATH)/main/es_generator.py \
- $(LOCAL_PATH)/main/APIspecutil.py \
- $(LOCAL_PATH)/main/APIspec.py
-
-es_hdr_deps := \
+dispatch_deps := \
$(wildcard $(glapi)/*.py) \
$(wildcard $(glapi)/*.xml)
@@ -88,22 +79,6 @@ define es-gen
$(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
endef
-$(intermediates)/main/api_exec_%.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/main/es_generator.py
-$(intermediates)/main/api_exec_%.c: PRIVATE_XML := -S $(LOCAL_PATH)/main/APIspec.xml
-$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
-$(intermediates)/main/api_exec_%_dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
-$(intermediates)/main/api_exec_%_remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-
-$(intermediates)/main/api_exec_es1.c: $(es_src_deps)
- $(call es-gen, -V GLES1.1)
-
-$(intermediates)/main/api_exec_%_dispatch.h: $(es_hdr_deps)
- $(call es-gen, -c $* -m remap_table)
-
-$(intermediates)/main/api_exec_%_remap_helper.h: $(es_hdr_deps)
- $(call es-gen, -c $*)
-
$(intermediates)/program/program_parse.tab.c: $(LOCAL_PATH)/program/program_parse.y
$(mesa_local-y-to-c-and-h)
@@ -133,19 +108,19 @@ $(intermediates)/x86/matypes.h: $(matypes_deps)
$(intermediates)/main/dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
$(intermediates)/main/dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-$(intermediates)/main/dispatch.h: $(es_hdr_deps)
+$(intermediates)/main/dispatch.h: $(dispatch_deps)
$(call es-gen, $* -m remap_table)
$(intermediates)/main/remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
$(intermediates)/main/remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-$(intermediates)/main/remap_helper.h: $(es_hdr_deps)
+$(intermediates)/main/remap_helper.h: $(dispatch_deps)
$(call es-gen, $*)
$(intermediates)/main/enums.c: PRIVATE_SCRIPT :=$(MESA_PYTHON2) $(glapi)/gl_enums.py
$(intermediates)/main/enums.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
-$(intermediates)/main/enums.c: $(es_src_deps)
+$(intermediates)/main/enums.c: $(dispatch_deps)
$(call es-gen)
GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py
diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am
index 1dc3132c7..1f897257e 100644
--- a/mesalib/src/mesa/Makefile.am
+++ b/mesalib/src/mesa/Makefile.am
@@ -53,9 +53,6 @@ include $(GLAPI)/glapi_gen.mk
BUILT_SOURCES = \
main/git_sha1.h \
- main/api_exec_es1_dispatch.h \
- main/api_exec_es1_remap_helper.h \
- main/api_exec_es1.c \
main/get_hash.h \
program/program_parse.tab.c \
program/program_parse.tab.h \
@@ -64,18 +61,6 @@ CLEANFILES = \
$(BUILT_SOURCES) \
git_sha1.h.tmp
-main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_dispatch_deps)
- $(call glapi_gen_dispatch,$<,es1)
-
-main/api_exec_es1_remap_helper.h: $(GLAPI)/gl_and_es_API.xml $(glapi_gen_remap_deps)
- $(call glapi_gen_remap,$<,es1)
-
-main/api_exec_es1.o: main/api_exec_es1_dispatch.h main/api_exec_es1_remap_helper.h
-
-main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
- $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/es_generator.py \
- -S $(srcdir)/main/APIspec.xml -V GLES1.1 > $@
-
program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
$(MKDIR_P) program
$(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $<
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript
index 12bb70aec..53e5ee8c2 100644
--- a/mesalib/src/mesa/SConscript
+++ b/mesalib/src/mesa/SConscript
@@ -339,27 +339,9 @@ if env['gles']:
# generate GLES sources
gles_sources = ['main/es1_conversion.c',]
- gles_sources += env.CodeGenerate(
- target = 'main/api_exec_es1.c',
- script = 'main/es_generator.py',
- source = 'main/APIspec.xml',
- command = python_cmd + ' $SCRIPT -S $SOURCE -V GLES1.1 > $TARGET'
- )
# generate GLES headers
gles_headers = []
- gles_headers += env.CodeGenerate(
- target = 'main/api_exec_es1_dispatch.h',
- script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen/gl_and_es_API.xml',
- command = python_cmd + ' $SCRIPT -c es1 -m remap_table -f $SOURCE > $TARGET',
- )
- gles_headers += env.CodeGenerate(
- target = 'main/api_exec_es1_remap_helper.h',
- script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen/gl_and_es_API.xml',
- command = python_cmd + ' $SCRIPT -c es1 -f $SOURCE > $TARGET',
- )
env.Depends(gles_sources, gles_headers)
diff --git a/mesalib/src/mesa/main/.gitignore b/mesalib/src/mesa/main/.gitignore
index edbdfb598..12c88372a 100644
--- a/mesalib/src/mesa/main/.gitignore
+++ b/mesalib/src/mesa/main/.gitignore
@@ -1,12 +1,9 @@
-api_exec_es1.c
dispatch.h
enums.c
get_es1.c
get_es2.c
git_sha1.h
git_sha1.h.tmp
-api_exec_es1_dispatch.h
-api_exec_es1_remap_helper.h
remap_helper.h
get_hash.h
get_hash.h.tmp
diff --git a/mesalib/src/mesa/main/APIspec.py b/mesalib/src/mesa/main/APIspec.py
deleted file mode 100644
index 6947f7301..000000000
--- a/mesalib/src/mesa/main/APIspec.py
+++ /dev/null
@@ -1,617 +0,0 @@
-#!/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.
-"""
-A parser for APIspec.
-"""
-
-class SpecError(Exception):
- """Error in the spec file."""
-
-
-class Spec(object):
- """A Spec is an abstraction of the API spec."""
-
- def __init__(self, doc):
- self.doc = doc
-
- self.spec_node = doc.getRootElement()
- self.tmpl_nodes = {}
- self.api_nodes = {}
- self.impl_node = None
-
- # parse <apispec>
- node = self.spec_node.children
- while node:
- if node.type == "element":
- if node.name == "template":
- self.tmpl_nodes[node.prop("name")] = node
- elif node.name == "api":
- self.api_nodes[node.prop("name")] = node
- else:
- raise SpecError("unexpected node %s in apispec" %
- node.name)
- node = node.next
-
- # find an implementation
- for name, node in self.api_nodes.iteritems():
- if node.prop("implementation") == "true":
- self.impl_node = node
- break
- if not self.impl_node:
- raise SpecError("unable to find an implementation")
-
- def get_impl(self):
- """Return the implementation."""
- return API(self, self.impl_node)
-
- def get_api(self, name):
- """Return an API."""
- return API(self, self.api_nodes[name])
-
-
-class API(object):
- """An API consists of categories and functions."""
-
- def __init__(self, spec, api_node):
- self.name = api_node.prop("name")
- self.is_impl = (api_node.prop("implementation") == "true")
-
- self.categories = []
- self.functions = []
-
- # parse <api>
- func_nodes = []
- node = api_node.children
- while node:
- if node.type == "element":
- if node.name == "category":
- cat = node.prop("name")
- self.categories.append(cat)
- elif node.name == "function":
- func_nodes.append(node)
- else:
- raise SpecError("unexpected node %s in api" % node.name)
- node = node.next
-
- # realize functions
- for func_node in func_nodes:
- tmpl_node = spec.tmpl_nodes[func_node.prop("template")]
- try:
- func = Function(tmpl_node, func_node, self.is_impl,
- self.categories)
- except SpecError, e:
- func_name = func_node.prop("name")
- raise SpecError("failed to parse %s: %s" % (func_name, e))
- self.functions.append(func)
-
- def match(self, func, conversions={}):
- """Find a matching function in the API."""
- match = None
- need_conv = False
- for f in self.functions:
- matched, conv = f.match(func, conversions)
- if matched:
- match = f
- need_conv = conv
- # exact match
- if not need_conv:
- break
- return (match, need_conv)
-
-
-class Function(object):
- """Parse and realize a <template> node."""
-
- def __init__(self, tmpl_node, func_node, force_skip_desc=False, categories=[]):
- self.tmpl_name = tmpl_node.prop("name")
- self.direction = tmpl_node.prop("direction")
-
- self.name = func_node.prop("name")
- self.prefix = func_node.prop("default_prefix")
- self.is_external = (func_node.prop("external") == "true")
-
- if force_skip_desc:
- self._skip_desc = True
- else:
- self._skip_desc = (func_node.prop("skip_desc") == "true")
-
- self._categories = categories
-
- # these attributes decide how the template is realized
- self._gltype = func_node.prop("gltype")
- if func_node.hasProp("vector_size"):
- self._vector_size = int(func_node.prop("vector_size"))
- else:
- self._vector_size = 0
- self._expand_vector = (func_node.prop("expand_vector") == "true")
-
- self.return_type = "void"
- param_nodes = []
-
- # find <proto>
- proto_node = tmpl_node.children
- while proto_node:
- if proto_node.type == "element" and proto_node.name == "proto":
- break
- proto_node = proto_node.next
- if not proto_node:
- raise SpecError("no proto")
- # and parse it
- node = proto_node.children
- while node:
- if node.type == "element":
- if node.name == "return":
- self.return_type = node.prop("type")
- elif node.name == "param" or node.name == "vector":
- if self.support_node(node):
- # make sure the node is not hidden
- if not (self._expand_vector and
- (node.prop("hide_if_expanded") == "true")):
- param_nodes.append(node)
- else:
- raise SpecError("unexpected node %s in proto" % node.name)
- node = node.next
-
- self._init_params(param_nodes)
- self._init_descs(tmpl_node, param_nodes)
-
- def __str__(self):
- return "%s %s%s(%s)" % (self.return_type, self.prefix, self.name,
- self.param_string(True))
-
- def _init_params(self, param_nodes):
- """Parse and initialize parameters."""
- self.params = []
-
- for param_node in param_nodes:
- size = self.param_node_size(param_node)
- # when no expansion, vector is just like param
- if param_node.name == "param" or not self._expand_vector:
- param = Parameter(param_node, self._gltype, size)
- self.params.append(param)
- continue
-
- if not size or size > param_node.lsCountNode():
- raise SpecError("could not expand %s with unknown or "
- "mismatch sizes" % param.name)
-
- # expand the vector
- expanded_params = []
- child = param_node.children
- while child:
- if (child.type == "element" and child.name == "param" and
- self.support_node(child)):
- expanded_params.append(Parameter(child, self._gltype))
- if len(expanded_params) == size:
- break
- child = child.next
- # just in case that lsCountNode counts unknown nodes
- if len(expanded_params) < size:
- raise SpecError("not enough named parameters")
-
- self.params.extend(expanded_params)
-
- def _init_descs(self, tmpl_node, param_nodes):
- """Parse and initialize parameter descriptions."""
- self.checker = Checker()
- if self._skip_desc:
- return
-
- node = tmpl_node.children
- while node:
- if node.type == "element" and node.name == "desc":
- if self.support_node(node):
- # parse <desc>
- desc = Description(node, self._categories)
- self.checker.add_desc(desc)
- node = node.next
-
- self.checker.validate(self, param_nodes)
-
- def support_node(self, node):
- """Return true if a node is in the supported category."""
- return (not node.hasProp("category") or
- node.prop("category") in self._categories)
-
- def get_param(self, name):
- """Return the named parameter."""
- for param in self.params:
- if param.name == name:
- return param
- return None
-
- def param_node_size(self, param):
- """Return the size of a vector."""
- if param.name != "vector":
- return 0
-
- size = param.prop("size")
- if size.isdigit():
- size = int(size)
- else:
- size = 0
- if not size:
- size = self._vector_size
- if not size and self._expand_vector:
- # return the number of named parameters
- size = param.lsCountNode()
- return size
-
- def param_string(self, declaration):
- """Return the C code of the parameters."""
- args = []
- if declaration:
- for param in self.params:
- sep = "" if param.type.endswith("*") else " "
- args.append("%s%s%s" % (param.type, sep, param.name))
- if not args:
- args.append("void")
- else:
- for param in self.params:
- args.append(param.name)
- return ", ".join(args)
-
- def match(self, other, conversions={}):
- """Return true if the functions match, probably with a conversion."""
- if (self.tmpl_name != other.tmpl_name or
- self.return_type != other.return_type or
- len(self.params) != len(other.params)):
- return (False, False)
-
- need_conv = False
- for i in xrange(len(self.params)):
- src = other.params[i]
- dst = self.params[i]
- if (src.is_vector != dst.is_vector or src.size != dst.size):
- return (False, False)
- if src.type != dst.type:
- if dst.base_type() in conversions.get(src.base_type(), []):
- need_conv = True
- else:
- # unable to convert
- return (False, False)
-
- return (True, need_conv)
-
-
-class Parameter(object):
- """A parameter of a function."""
-
- def __init__(self, param_node, gltype=None, size=0):
- self.is_vector = (param_node.name == "vector")
-
- self.name = param_node.prop("name")
- self.size = size
-
- type = param_node.prop("type")
- if gltype:
- type = type.replace("GLtype", gltype)
- elif type.find("GLtype") != -1:
- raise SpecError("parameter %s has unresolved type" % self.name)
-
- self.type = type
-
- def base_type(self):
- """Return the base GL type by stripping qualifiers."""
- return [t for t in self.type.split(" ") if t.startswith("GL")][0]
-
-
-class Checker(object):
- """A checker is the collection of all descriptions on the same level.
- Descriptions of the same parameter are concatenated.
- """
-
- def __init__(self):
- self.switches = {}
- self.switch_constants = {}
-
- def add_desc(self, desc):
- """Add a description."""
- # TODO allow index to vary
- const_attrs = ["index", "error", "convert", "size_str"]
- if desc.name not in self.switches:
- self.switches[desc.name] = []
- self.switch_constants[desc.name] = {}
- for attr in const_attrs:
- self.switch_constants[desc.name][attr] = None
-
- # some attributes, like error code, should be the same for all descs
- consts = self.switch_constants[desc.name]
- for attr in const_attrs:
- if getattr(desc, attr) is not None:
- if (consts[attr] is not None and
- consts[attr] != getattr(desc, attr)):
- raise SpecError("mismatch %s for %s" % (attr, desc.name))
- consts[attr] = getattr(desc, attr)
-
- self.switches[desc.name].append(desc)
-
- def validate(self, func, param_nodes):
- """Validate the checker against a function."""
- tmp = Checker()
-
- for switch in self.switches.itervalues():
- valid_descs = []
- for desc in switch:
- if desc.validate(func, param_nodes):
- valid_descs.append(desc)
- # no possible values
- if not valid_descs:
- return False
- for desc in valid_descs:
- if not desc._is_noop:
- tmp.add_desc(desc)
-
- self.switches = tmp.switches
- self.switch_constants = tmp.switch_constants
- return True
-
- def flatten(self, name=None):
- """Return a flat list of all descriptions of the named parameter."""
- flat_list = []
- for switch in self.switches.itervalues():
- for desc in switch:
- if not name or desc.name == name:
- flat_list.append(desc)
- flat_list.extend(desc.checker.flatten(name))
- return flat_list
-
- def always_check(self, name):
- """Return true if the parameter is checked in all possible pathes."""
- if name in self.switches:
- return True
-
- # a param is always checked if any of the switch always checks it
- for switch in self.switches.itervalues():
- # a switch always checks it if all of the descs always check it
- always = True
- for desc in switch:
- if not desc.checker.always_check(name):
- always = False
- break
- if always:
- return True
- return False
-
- def _c_switch(self, name, indent="\t"):
- """Output C switch-statement for the named parameter, for debug."""
- switch = self.switches.get(name, [])
- # make sure there are valid values
- need_switch = False
- for desc in switch:
- if desc.values:
- need_switch = True
- if not need_switch:
- return []
-
- stmts = []
- var = switch[0].name
- if switch[0].index >= 0:
- var += "[%d]" % switch[0].index
- stmts.append("switch (%s) { /* assume GLenum */" % var)
-
- for desc in switch:
- if desc.values:
- for val in desc.values:
- stmts.append("case %s:" % val)
- for dep_name in desc.checker.switches.iterkeys():
- dep_stmts = [indent + s for s in desc.checker._c_switch(dep_name, indent)]
- stmts.extend(dep_stmts)
- stmts.append(indent + "break;")
-
- stmts.append("default:")
- stmts.append(indent + "ON_ERROR(%s);" % switch[0].error);
- stmts.append(indent + "break;")
- stmts.append("}")
-
- return stmts
-
- def dump(self, indent="\t"):
- """Dump the descriptions in C code."""
- stmts = []
- for name in self.switches.iterkeys():
- c_switch = self._c_switch(name)
- print "\n".join(c_switch)
-
-
-class Description(object):
- """A description desribes a parameter and its relationship with other
- parameters.
- """
-
- def __init__(self, desc_node, categories=[]):
- self._categories = categories
- self._is_noop = False
-
- self.name = desc_node.prop("name")
- self.index = -1
-
- self.error = desc_node.prop("error") or "GL_INVALID_ENUM"
- # vector_size may be C code
- self.size_str = desc_node.prop("vector_size")
-
- self._has_enum = False
- self.values = []
- dep_nodes = []
-
- # parse <desc>
- valid_names = ["value", "range", "desc"]
- node = desc_node.children
- while node:
- if node.type == "element":
- if node.name in valid_names:
- # ignore nodes that require unsupported categories
- if (node.prop("category") and
- node.prop("category") not in self._categories):
- node = node.next
- continue
- else:
- raise SpecError("unexpected node %s in desc" % node.name)
-
- if node.name == "value":
- val = node.prop("name")
- if not self._has_enum and val.startswith("GL_"):
- self._has_enum = True
- self.values.append(val)
- elif node.name == "range":
- first = int(node.prop("from"))
- last = int(node.prop("to"))
- base = node.prop("base") or ""
- if not self._has_enum and base.startswith("GL_"):
- self._has_enum = True
- # expand range
- for i in xrange(first, last + 1):
- self.values.append("%s%d" % (base, i))
- else: # dependent desc
- dep_nodes.append(node)
- node = node.next
-
- # default to convert if there is no enum
- self.convert = not self._has_enum
- if desc_node.hasProp("convert"):
- self.convert = (desc_node.prop("convert") == "true")
-
- self._init_deps(dep_nodes)
-
- def _init_deps(self, dep_nodes):
- """Parse and initialize dependents."""
- self.checker = Checker()
-
- for dep_node in dep_nodes:
- # recursion!
- dep = Description(dep_node, self._categories)
- self.checker.add_desc(dep)
-
- def _search_param_node(self, param_nodes, name=None):
- """Search the template parameters for the named node."""
- param_node = None
- param_index = -1
-
- if not name:
- name = self.name
- for node in param_nodes:
- if name == node.prop("name"):
- param_node = node
- elif node.name == "vector":
- child = node.children
- idx = 0
- while child:
- if child.type == "element" and child.name == "param":
- if name == child.prop("name"):
- param_node = node
- param_index = idx
- break
- idx += 1
- child = child.next
- if param_node:
- break
- return (param_node, param_index)
-
- def _find_final(self, func, param_nodes):
- """Find the final parameter."""
- param = func.get_param(self.name)
- param_index = -1
-
- # the described param is not in the final function
- if not param:
- # search the template parameters
- node, index = self._search_param_node(param_nodes)
- if not node:
- raise SpecError("invalid desc %s in %s" %
- (self.name, func.name))
-
- # a named parameter of a vector
- if index >= 0:
- param = func.get_param(node.prop("name"))
- param_index = index
- elif node.name == "vector":
- # must be an expanded vector, check its size
- if self.size_str and self.size_str.isdigit():
- size = int(self.size_str)
- expanded_size = func.param_node_size(node)
- if size != expanded_size:
- return (False, None, -1)
- # otherwise, it is a valid, but no-op, description
-
- return (True, param, param_index)
-
- def validate(self, func, param_nodes):
- """Validate a description against certain function."""
- if self.checker.switches and not self.values:
- raise SpecError("no valid values for %s" % self.name)
-
- valid, param, param_index = self._find_final(func, param_nodes)
- if not valid:
- return False
-
- # the description is valid, but the param is gone
- # mark it no-op so that it will be skipped
- if not param:
- self._is_noop = True
- return True
-
- if param.is_vector:
- # if param was known, this should have been done in __init__
- if self._has_enum:
- self.size_str = "1"
- # size mismatch
- if (param.size and self.size_str and self.size_str.isdigit() and
- param.size != int(self.size_str)):
- return False
- elif self.size_str:
- # only vector accepts vector_size
- raise SpecError("vector_size is invalid for %s" % param.name)
-
- if not self.checker.validate(func, param_nodes):
- return False
-
- # update the description
- self.name = param.name
- self.index = param_index
-
- return True
-
-
-def main():
- import libxml2
-
- filename = "APIspec.xml"
- apinames = ["GLES1.1", "GLES2.0"]
-
- doc = libxml2.readFile(filename, None,
- libxml2.XML_PARSE_DTDLOAD +
- libxml2.XML_PARSE_DTDVALID +
- libxml2.XML_PARSE_NOBLANKS)
-
- spec = Spec(doc)
- impl = spec.get_impl()
- for apiname in apinames:
- spec.get_api(apiname)
-
- doc.freeDoc()
-
- print "%s is successfully parsed" % filename
-
-
-if __name__ == "__main__":
- main()
diff --git a/mesalib/src/mesa/main/APIspec.xml b/mesalib/src/mesa/main/APIspec.xml
deleted file mode 100644
index c3969526f..000000000
--- a/mesalib/src/mesa/main/APIspec.xml
+++ /dev/null
@@ -1,2383 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE apispec SYSTEM "APIspec.dtd">
-
-<!-- A function is generated from a template. Multiple functions can be
- generated from a single template with different arguments. For example,
- glColor3f can be generated from
-
- <function name="Color3f" template="Color" gltype="GLfloat" vector_size="3" expand_vector="true"/>
-
- and glColor4iv can be generated from
-
- <function name="Color4iv" template="Color" gltype="GLint" vector_size="4"/>
-
- In a template, there are <desc>s that describe the properties of
- parameters. A <desc> can enumerate the valid values of a parameter. It
- can also specify the error code when an invalid value is given, and etc.
- By nesting <desc>s, they can create dependency between parameters.
-
- A function can be marked as external. It means that the function cannot
- be dispatched to the corresponding mesa function, if one exists, directly,
- and requires an external implementation.
--->
-
-<apispec>
-
-<template name="Color">
- <proto>
- <return type="void"/>
- <vector name="v" type="const GLtype *" size="dynamic">
- <param name="red" type="GLtype"/>
- <param name="green" type="GLtype"/>
- <param name="blue" type="GLtype"/>
- <param name="alpha" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="ClipPlane">
- <proto>
- <return type="void"/>
- <param name="plane" type="GLenum"/>
- <vector name="equation" type="const GLtype *" size="4"/>
- </proto>
-</template>
-
-<template name="CullFace">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="Fog">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="FrontFace">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="Hint">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="Light">
- <proto>
- <return type="void"/>
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="LightModel">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="LineWidth">
- <proto>
- <return type="void"/>
- <param name="width" type="GLtype"/>
- </proto>
-</template>
-
-<template name="Material">
- <proto>
- <return type="void"/>
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="PointSize">
- <proto>
- <return type="void"/>
- <param name="size" type="GLtype"/>
- </proto>
-</template>
-
-<template name="PointSizePointer">
- <proto>
- <return type="void"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="Scissor">
- <proto>
- <return type="void"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </proto>
-</template>
-
-<template name="ShadeModel">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="TexParameter">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="TexImage2D">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalFormat" type="GLint"/> <!-- should be 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 *"/>
- </proto>
-</template>
-
-<template name="TexEnv">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="TexGen">
- <proto>
- <return type="void"/>
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="Clear">
- <proto>
- <return type="void"/>
- <param name="mask" type="GLbitfield"/>
- </proto>
-</template>
-
-<template name="ClearColor">
- <proto>
- <return type="void"/>
- <param name="red" type="GLtype"/>
- <param name="green" type="GLtype"/>
- <param name="blue" type="GLtype"/>
- <param name="alpha" type="GLtype"/>
- </proto>
-</template>
-
-<template name="ClearStencil">
- <proto>
- <return type="void"/>
- <param name="s" type="GLint"/>
- </proto>
-</template>
-
-<template name="ClearDepth">
- <proto>
- <return type="void"/>
- <param name="depth" type="GLtype"/>
- </proto>
-</template>
-
-<template name="StencilMask">
- <proto>
- <return type="void"/>
- <param name="mask" type="GLuint"/>
- </proto>
-</template>
-
-<template name="StencilMaskSeparate">
- <proto>
- <return type="void"/>
- <param name="face" type="GLenum"/>
- <param name="mask" type="GLuint"/>
- </proto>
-</template>
-
-<template name="ColorMask">
- <proto>
- <return type="void"/>
- <param name="red" type="GLboolean"/>
- <param name="green" type="GLboolean"/>
- <param name="blue" type="GLboolean"/>
- <param name="alpha" type="GLboolean"/>
- </proto>
-</template>
-
-<template name="DepthMask">
- <proto>
- <return type="void"/>
- <param name="flag" type="GLboolean"/>
- </proto>
-</template>
-
-<template name="Disable">
- <proto>
- <return type="void"/>
- <param name="cap" type="GLenum"/>
- </proto>
-</template>
-
-<!-- it is exactly the same as Disable -->
-<template name="Enable">
- <proto>
- <return type="void"/>
- <param name="cap" type="GLenum"/>
- </proto>
-</template>
-
-<template name="Finish">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="Flush">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="AlphaFunc">
- <proto>
- <return type="void"/>
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLtype"/>
- </proto>
-</template>
-
-<template name="BlendFunc">
- <proto>
- <return type="void"/>
- <param name="sfactor" type="GLenum"/>
- <param name="dfactor" type="GLenum"/>
- </proto>
-</template>
-
-<template name="LogicOp">
- <proto>
- <return type="void"/>
- <param name="opcode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="StencilFunc">
- <proto>
- <return type="void"/>
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- </proto>
-</template>
-
-<template name="StencilFuncSeparate">
- <proto>
- <return type="void"/>
- <param name="face" type="GLenum"/>
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- </proto>
-</template>
-
-<template name="StencilOp">
- <proto>
- <return type="void"/>
- <param name="fail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- </proto>
-</template>
-
-<template name="StencilOpSeparate">
- <proto>
- <return type="void"/>
- <param name="face" type="GLenum"/>
- <param name="fail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- </proto>
-</template>
-
-<template name="DepthFunc">
- <proto>
- <return type="void"/>
- <param name="func" type="GLenum"/>
- </proto>
-</template>
-
-<template name="PixelStore">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLtype"/>
- </proto>
-</template>
-
-<template name="ReadPixels" direction="get">
- <proto>
- <return type="void"/>
- <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 *"/>
- </proto>
-</template>
-
-<template name="GetClipPlane" direction="get">
- <proto>
- <return type="void"/>
- <param name="plane" type="GLenum"/>
- <vector name="equation" type="GLtype *" size="4"/>
- </proto>
-</template>
-
-<template name="GetError" direction="get">
- <proto>
- <return type="GLenum"/>
- </proto>
-</template>
-
-<!-- template for GetFloatv, GetIntegerv, GetBoolean, and GetFixedv -->
-<template name="GetState" direction="get">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
- <!-- param checking is done in mesa -->
-</template>
-
-<template name="GetLight" direction="get">
- <proto>
- <return type="void"/>
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetMaterial" direction="get">
- <proto>
- <return type="void"/>
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="GetString" direction="get">
- <proto>
- <return type="const GLubyte *"/>
- <param name="name" type="GLenum"/>
- </proto>
-</template>
-
-<template name="GetTexEnv" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetTexGen" direction="get">
- <proto>
- <return type="void"/>
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetTexParameter" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="IsEnabled" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="cap" type="GLenum"/>
- </proto>
-</template>
-
-<template name="DepthRange">
- <proto>
- <return type="void"/>
- <param name="zNear" type="GLtype"/>
- <param name="zFar" type="GLtype"/>
- </proto>
-</template>
-
-<template name="Frustum">
- <proto>
- <return type="void"/>
- <param name="left" type="GLtype"/>
- <param name="right" type="GLtype"/>
- <param name="bottom" type="GLtype"/>
- <param name="top" type="GLtype"/>
- <param name="zNear" type="GLtype"/>
- <param name="zFar" type="GLtype"/>
- </proto>
-</template>
-
-<template name="LoadIdentity">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="LoadMatrix">
- <proto>
- <return type="void"/>
- <vector name="m" type="const GLtype *" size="16"/>
- </proto>
-</template>
-
-<template name="MatrixMode">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="MultMatrix">
- <proto>
- <return type="void"/>
- <vector name="m" type="const GLtype *" size="16"/>
- </proto>
-</template>
-
-<template name="Ortho">
- <proto>
- <return type="void"/>
- <param name="left" type="GLtype"/>
- <param name="right" type="GLtype"/>
- <param name="bottom" type="GLtype"/>
- <param name="top" type="GLtype"/>
- <param name="zNear" type="GLtype"/>
- <param name="zFar" type="GLtype"/>
- </proto>
-</template>
-
-<template name="PopMatrix">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="PushMatrix">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="Rotate">
- <proto>
- <return type="void"/>
- <param name="angle" type="GLtype"/>
- <param name="x" type="GLtype"/>
- <param name="y" type="GLtype"/>
- <param name="z" type="GLtype"/>
- </proto>
-</template>
-
-<template name="Scale">
- <proto>
- <return type="void"/>
- <param name="x" type="GLtype"/>
- <param name="y" type="GLtype"/>
- <param name="z" type="GLtype"/>
- </proto>
-</template>
-
-<template name="Translate">
- <proto>
- <return type="void"/>
- <param name="x" type="GLtype"/>
- <param name="y" type="GLtype"/>
- <param name="z" type="GLtype"/>
- </proto>
-</template>
-
-<template name="Viewport">
- <proto>
- <return type="void"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </proto>
-</template>
-
-<template name="ColorPointer">
- <proto>
- <return type="void"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="DisableClientState">
- <proto>
- <return type="void"/>
- <param name="array" type="GLenum"/>
- </proto>
-</template>
-
-<template name="DrawArrays">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- </proto>
-</template>
-
-<template name="DrawElements">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="EnableClientState">
- <proto>
- <return type="void"/>
- <param name="array" type="GLenum"/>
- </proto>
-</template>
-
-<template name="GetPointer" direction="get">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLvoid **" size="dynamic"/>
- </proto>
-</template>
-
-<template name="Normal">
- <proto>
- <return type="void"/>
- <vector name="v" type="const GLtype *" size="3">
- <param name="nx" type="GLtype"/>
- <param name="ny" type="GLtype"/>
- <param name="nz" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="NormalPointer">
- <proto>
- <return type="void"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="TexCoordPointer">
- <proto>
- <return type="void"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="VertexPointer">
- <proto>
- <return type="void"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="PolygonOffset">
- <proto>
- <return type="void"/>
- <param name="factor" type="GLtype"/>
- <param name="units" type="GLtype"/>
- </proto>
-</template>
-
-<template name="CopyTexImage2D">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="CopyTexSubImage2D">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="TexSubImage2D">
- <proto>
- <return type="void"/>
- <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="pixels" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="BindTexture">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DeleteTextures">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="textures" type="const GLuint *"/>
- </proto>
-</template>
-
-<template name="GenTextures" direction="get">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="textures" type="GLuint *"/>
- </proto>
-</template>
-
-<template name="IsTexture" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="texture" type="GLuint"/>
- </proto>
-</template>
-
-<template name="BlendColor">
- <proto>
- <return type="void"/>
- <param name="red" type="GLtype"/>
- <param name="green" type="GLtype"/>
- <param name="blue" type="GLtype"/>
- <param name="alpha" type="GLtype"/>
- </proto>
-</template>
-
-<template name="BlendEquation">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<template name="BlendEquationSeparate">
- <proto>
- <return type="void"/>
- <param name="modeRGB" type="GLenum"/>
- <param name="modeAlpha" type="GLenum"/>
- </proto>
-</template>
-
-<template name="TexImage3D">
- <proto>
- <return type="void"/>
- <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 *"/>
- </proto>
-
-</template>
-
-<template name="TexSubImage3D">
- <proto>
- <return type="void"/>
- <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="pixels" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="CopyTexSubImage3D">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="MultiTexCoord">
- <proto>
- <return type="void"/>
- <param name="texture" type="GLenum"/>
- <vector name="v" type="const GLtype *" size="dynamic">
- <param name="s" type="GLtype"/>
- <param name="t" type="GLtype"/>
- <param name="r" type="GLtype"/>
- <param name="q" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="CompressedTexImage3D">
- <proto>
- <return type="void"/>
- <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"/>
- <param name="data" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="CompressedTexSubImage3D">
- <proto>
- <return type="void"/>
- <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"/>
- <param name="data" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="ActiveTexture">
- <proto>
- <return type="void"/>
- <param name="texture" type="GLenum"/>
- </proto>
-</template>
-
-<template name="ClientActiveTexture">
- <proto>
- <return type="void"/>
- <param name="texture" type="GLenum"/>
- </proto>
-</template>
-
-<template name="SampleCoverage">
- <proto>
- <return type="void"/>
- <param name="value" type="GLtype"/>
- <param name="invert" type="GLboolean"/>
- </proto>
-</template>
-
-<template name="CompressedTexImage2D">
- <proto>
- <return type="void"/>
- <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"/>
- <param name="data" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="CompressedTexSubImage2D">
- <proto>
- <return type="void"/>
- <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"/>
- <param name="data" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="BlendFuncSeparate">
- <proto>
- <return type="void"/>
- <param name="srcRGB" type="GLenum"/>
- <param name="dstRGB" type="GLenum"/>
- <param name="srcAlpha" type="GLenum"/>
- <param name="dstAlpha" type="GLenum"/>
- </proto>
-</template>
-
-<template name="PointParameter">
- <proto>
- <return type="void"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="const GLtype *" size="dynamic">
- <param name="param" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="VertexAttrib">
- <proto>
- <return type="void"/>
- <param name="index" type="GLuint"/>
- <vector name="v" type="const GLtype *" size="dynamic">
- <param name="x" type="GLtype"/>
- <param name="y" type="GLtype"/>
- <param name="z" type="GLtype"/>
- <param name="w" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="VertexAttribPointer">
- <proto>
- <return type="void"/>
- <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 *"/>
- </proto>
-</template>
-
-<template name="EnableVertexAttribArray">
- <proto>
- <return type="void"/>
- <param name="index" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DisableVertexAttribArray">
- <proto>
- <return type="void"/>
- <param name="index" type="GLuint"/>
- </proto>
-</template>
-
-<template name="IsProgram" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="program" type="GLuint"/>
- </proto>
-</template>
-
-<template name="GetProgram" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetVertexAttrib" direction="get">
- <proto>
- <return type="void"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetVertexAttribPointer" direction="get">
- <proto>
- <return type="void"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <vector name="pointer" type="GLvoid **" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetBufferPointer" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLvoid **" size="dynamic"/>
- </proto>
-</template>
-
-<template name="MapBuffer" direction="get">
- <proto>
- <return type="void *"/>
- <param name="target" type="GLenum"/>
- <param name="access" type="GLenum"/>
- </proto>
-</template>
-
-<template name="UnmapBuffer" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="target" type="GLenum"/>
- </proto>
-</template>
-
-<template name="BindBuffer">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="BufferData">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- <param name="usage" type="GLenum"/>
- </proto>
-</template>
-
-<template name="BufferSubData">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- </proto>
-</template>
-
-<template name="DeleteBuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="buffer" type="const GLuint *"/>
- </proto>
-</template>
-
-<template name="GenBuffers" direction="get">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="buffer" type="GLuint *"/>
- </proto>
-</template>
-
-<template name="GetBufferParameter" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="IsBuffer" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="buffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="CreateShader">
- <proto>
- <return type="GLuint"/>
- <param name="type" type="GLenum"/>
- </proto>
-</template>
-
-<template name="ShaderSource">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="string" type="const GLchar * const *"/>
- <param name="length" type="const int *"/>
- </proto>
-</template>
-
-<template name="CompileShader">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- </proto>
-</template>
-
-<template name="ReleaseShaderCompiler">
- <proto>
- <return type="void"/>
- </proto>
-</template>
-
-<template name="DeleteShader">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- </proto>
-</template>
-
-<template name="ShaderBinary">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="CreateProgram">
- <proto>
- <return type="GLuint"/>
- </proto>
-</template>
-
-<template name="AttachShader">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="shader" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DetachShader">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="shader" type="GLuint"/>
- </proto>
-</template>
-
-<template name="LinkProgram">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- </proto>
-</template>
-
-<template name="UseProgram">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DeleteProgram">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- </proto>
-</template>
-
-<template name="GetActiveAttrib" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="size" type="GLint *"/>
- <param name="type" type="GLenum *"/>
- <param name="name" type="GLchar *"/>
- </proto>
-</template>
-
-<template name="GetAttribLocation" direction="get">
- <proto>
- <return type="GLint"/>
- <param name="program" type="GLuint"/>
- <param name="name" type="const char *"/>
- </proto>
-</template>
-
-<template name="BindAttribLocation">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="name" type="const char *"/>
- </proto>
-</template>
-
-<template name="GetUniformLocation" direction="get">
- <proto>
- <return type="GLint"/>
- <param name="program" type="GLuint"/>
- <param name="name" type="const char *"/>
- </proto>
-</template>
-
-<template name="GetActiveUniform" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="size" type="GLint *"/>
- <param name="type" type="GLenum *"/>
- <param name="name" type="GLchar *"/>
- </proto>
-</template>
-
-<template name="Uniform">
- <proto>
- <return type="void"/>
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei" hide_if_expanded="true"/>
- <vector name="values" type="const GLtype *" size="dynamic">
- <param name="v0" type="GLtype"/>
- <param name="v1" type="GLtype"/>
- <param name="v2" type="GLtype"/>
- <param name="v3" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="UniformMatrix">
- <proto>
- <return type="void"/>
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <vector name="value" type="const GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="ValidateProgram">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- </proto>
-</template>
-
-<template name="GenerateMipmap">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- </proto>
-</template>
-
-<template name="BindFramebuffer">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="framebuffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DeleteFramebuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="framebuffers" type="const GLuint *"/>
- </proto>
-</template>
-
-<template name="GenFramebuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="ids" type="GLuint *"/>
- </proto>
-</template>
-
-<template name="BindRenderbuffer">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="renderbuffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="DeleteRenderbuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="renderbuffers" type="const GLuint *"/>
- </proto>
-</template>
-
-<template name="GenRenderbuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="renderbuffers" type="GLuint *"/>
- </proto>
-</template>
-
-<template name="RenderbufferStorage">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="internalFormat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </proto>
-</template>
-
-<template name="FramebufferRenderbuffer">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="renderbuffertarget" type="GLenum"/>
- <param name="renderbuffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="FramebufferTexture2D">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
- <!-- According to the base specification, "level" must be 0. But
- extension GL_OES_fbo_render_mipmap lifts that restriction,
- so no restriction is placed here. -->
-</template>
-
-<template name="FramebufferTexture3D">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="CheckFramebufferStatus" direction="get">
- <proto>
- <return type="GLenum"/>
- <param name="target" type="GLenum"/>
- </proto>
-</template>
-
-<template name="GetFramebufferAttachmentParameter" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetRenderbufferParameter" direction="get">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="IsRenderbuffer" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="renderbuffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="IsFramebuffer" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="framebuffer" type="GLuint"/>
- </proto>
-</template>
-
-<template name="IsShader" direction="get">
- <proto>
- <return type="GLboolean"/>
- <param name="shader" type="GLuint"/>
- </proto>
-</template>
-
-<template name="GetShader" direction="get">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="GetAttachedShaders" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="maxCount" type="GLsizei"/>
- <param name="count" type="GLsizei *"/>
- <param name="shaders" type="GLuint *"/>
- </proto>
-</template>
-
-<template name="GetShaderInfoLog" direction="get">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="infoLog" type="GLchar *"/>
- </proto>
-</template>
-
-<template name="GetProgramInfoLog" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="infoLog" type="GLchar *"/>
- </proto>
-</template>
-
-<template name="GetShaderSource" direction="get">
- <proto>
- <return type="void"/>
- <param name="shader" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="source" type="GLchar *"/>
- </proto>
-</template>
-
-<template name="GetShaderPrecisionFormat" direction="get">
- <proto>
- <return type="void"/>
- <param name="shadertype" type="GLenum"/>
- <param name="precisiontype" type="GLenum"/>
- <param name="range" type="GLint *"/>
- <param name="precision" type="GLint *"/>
- </proto>
-</template>
-
-<template name="GetUniform" direction="get">
- <proto>
- <return type="void"/>
- <param name="program" type="GLuint"/>
- <param name="location" type="GLint"/>
- <vector name="params" type="GLtype *" size="dynamic"/>
- </proto>
-</template>
-
-<template name="QueryMatrix" direction="get">
- <proto>
- <return type="GLbitfield"/>
- <vector name="mantissa" type="GLtype *" size="16"/>
- <vector name="exponent" type="GLint *" size="16"/>
- </proto>
-</template>
-
-<template name="DrawTex">
- <proto>
- <return type="void"/>
- <vector name="coords" type="const GLtype *" size="5">
- <param name="x" type="GLtype"/>
- <param name="y" type="GLtype"/>
- <param name="z" type="GLtype"/>
- <param name="w" type="GLtype"/>
- <param name="h" type="GLtype"/>
- </vector>
- </proto>
-</template>
-
-<template name="MultiDrawArrays">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- <param name="first" type="const GLint *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="primcount" type="GLsizei"/>
- </proto>
-</template>
-
-<template name="MultiDrawElements">
- <proto>
- <return type="void"/>
- <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"/>
- </proto>
-</template>
-
-<template name="EGLImageTargetTexture2D">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="image" type="GLeglImageOES"/>
- </proto>
-</template>
-
-<template name="EGLImageTargetRenderbufferStorage">
- <proto>
- <return type="void"/>
- <param name="target" type="GLenum"/>
- <param name="image" type="GLeglImageOES"/>
- </proto>
-</template>
-
-<template name="DrawBuffers">
- <proto>
- <return type="void"/>
- <param name="n" type="GLsizei"/>
- <param name="bufs" type="const GLenum *"/>
- </proto>
-</template>
-
-<template name="ReadBuffer">
- <proto>
- <return type="void"/>
- <param name="mode" type="GLenum"/>
- </proto>
-</template>
-
-<api name="mesa" implementation="true">
- <category name="MESA"/>
-
- <function name="Color4f" default_prefix="_es_" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="ClipPlane" template="ClipPlane" gltype="GLdouble"/>
- <function name="CullFace" template="CullFace"/>
-
- <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/>
- <function name="Fogfv" template="Fog" gltype="GLfloat"/>
-
- <function name="FrontFace" template="FrontFace"/>
- <function name="Hint" template="Hint"/>
-
- <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/>
- <function name="Lightfv" template="Light" gltype="GLfloat"/>
-
- <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/>
- <function name="LightModelfv" template="LightModel" gltype="GLfloat"/>
-
- <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
-
- <function name="Materialf" default_prefix="_es_" template="Material" gltype="GLfloat" expand_vector="true"/>
- <function name="Materialfv" default_prefix="_es_" template="Material" gltype="GLfloat"/>
-
- <function name="PointSize" template="PointSize" gltype="GLfloat"/>
- <function name="PointSizePointer" template="PointSizePointer"/>
-
- <function name="Scissor" template="Scissor"/>
- <function name="ShadeModel" template="ShadeModel"/>
-
- <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
- <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
- <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
- <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
-
- <function name="TexImage2D" template="TexImage2D"/>
-
- <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/>
- <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/>
- <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/>
- <function name="TexEnviv" template="TexEnv" gltype="GLint"/>
-
- <function name="TexGenf" template="TexGen" gltype="GLfloat" expand_vector="true"/>
- <function name="TexGenfv" template="TexGen" gltype="GLfloat"/>
-
- <function name="Clear" template="Clear"/>
- <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
- <function name="ClearStencil" template="ClearStencil"/>
- <function name="ClearDepth" template="ClearDepth" gltype="GLclampd"/>
- <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/>
-
- <function name="StencilMask" template="StencilMask"/>
- <function name="StencilMaskSeparate" template="StencilMaskSeparate"/>
- <function name="ColorMask" template="ColorMask"/>
- <function name="DepthMask" template="DepthMask"/>
- <function name="Disable" template="Disable"/>
- <function name="Enable" template="Enable"/>
- <function name="Finish" template="Finish"/>
- <function name="Flush" template="Flush"/>
-
- <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/>
-
- <function name="BlendFunc" template="BlendFunc"/>
- <function name="LogicOp" template="LogicOp"/>
- <function name="StencilFunc" template="StencilFunc"/>
- <function name="StencilFuncSeparate" template="StencilFuncSeparate"/>
- <function name="StencilOp" template="StencilOp"/>
- <function name="StencilOpSeparate" template="StencilOpSeparate"/>
- <function name="DepthFunc" template="DepthFunc"/>
- <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
-
- <function name="ReadPixels" template="ReadPixels"/>
- <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
- <function name="GetClipPlane" template="GetClipPlane" gltype="GLdouble"/>
- <function name="GetError" template="GetError"/>
- <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
- <function name="GetFixedv" template="GetState" gltype="GLfixed"/>
- <function name="GetIntegerv" template="GetState" gltype="GLint"/>
-
- <function name="GetLightfv" template="GetLight" gltype="GLfloat"/>
- <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/>
- <function name="GetMaterialiv" template="GetMaterial" gltype="GLint"/>
-
- <function name="GetString" template="GetString"/>
-
- <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/>
- <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/>
- <function name="GetTexGenfv" template="GetTexGen" gltype="GLfloat"/>
- <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
- <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
-
- <function name="IsEnabled" template="IsEnabled"/>
-
- <function name="DepthRange" template="DepthRange" gltype="GLclampd"/>
- <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/>
- <function name="Frustum" template="Frustum" gltype="GLdouble"/>
-
- <function name="LoadIdentity" template="LoadIdentity"/>
- <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/>
- <function name="MatrixMode" template="MatrixMode"/>
-
- <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/>
- <function name="Ortho" template="Ortho" gltype="GLdouble"/>
- <function name="PopMatrix" template="PopMatrix"/>
- <function name="PushMatrix" template="PushMatrix"/>
-
- <function name="Rotatef" template="Rotate" gltype="GLfloat"/>
- <function name="Scalef" template="Scale" gltype="GLfloat"/>
- <function name="Translatef" template="Translate" gltype="GLfloat"/>
-
- <function name="Viewport" template="Viewport"/>
-
- <function name="ColorPointer" template="ColorPointer"/>
- <function name="DisableClientState" template="DisableClientState"/>
- <function name="DrawArrays" template="DrawArrays"/>
- <function name="DrawElements" template="DrawElements"/>
- <function name="EnableClientState" template="EnableClientState"/>
-
- <function name="GetPointerv" template="GetPointer"/>
- <function name="Normal3f" default_prefix="_es_" template="Normal" gltype="GLfloat" expand_vector="true"/>
- <function name="NormalPointer" template="NormalPointer"/>
- <function name="TexCoordPointer" template="TexCoordPointer"/>
- <function name="VertexPointer" template="VertexPointer"/>
-
- <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
- <function name="CopyTexImage2D" template="CopyTexImage2D"/>
- <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
- <function name="TexSubImage2D" template="TexSubImage2D"/>
-
- <function name="BindTexture" template="BindTexture"/>
- <function name="DeleteTextures" template="DeleteTextures"/>
- <function name="GenTextures" template="GenTextures"/>
- <function name="IsTexture" template="IsTexture"/>
-
- <function name="BlendColor" template="BlendColor" gltype="GLclampf"/>
- <function name="BlendEquation" template="BlendEquation"/>
- <function name="BlendEquationSeparateEXT" template="BlendEquationSeparate"/>
-
- <function name="TexImage3D" template="TexImage3D"/>
- <function name="TexSubImage3D" template="TexSubImage3D"/>
- <function name="CopyTexSubImage3D" template="CopyTexSubImage3D"/>
-
- <function name="CompressedTexImage3DARB" template="CompressedTexImage3D"/>
- <function name="CompressedTexSubImage3DARB" template="CompressedTexSubImage3D"/>
-
- <function name="ActiveTextureARB" template="ActiveTexture"/>
- <function name="ClientActiveTextureARB" template="ClientActiveTexture"/>
-
- <function name="MultiTexCoord4f" default_prefix="_es_" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/>
-
- <function name="SampleCoverageARB" template="SampleCoverage" gltype="GLclampf"/>
-
- <function name="CompressedTexImage2DARB" template="CompressedTexImage2D"/>
- <function name="CompressedTexSubImage2DARB" template="CompressedTexSubImage2D"/>
-
- <function name="BlendFuncSeparateEXT" template="BlendFuncSeparate"/>
-
- <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/>
- <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/>
-
- <function name="VertexAttrib1f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/>
- <function name="VertexAttrib2f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/>
- <function name="VertexAttrib3f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/>
- <function name="VertexAttrib4f" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="VertexAttrib1fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="1"/>
- <function name="VertexAttrib2fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="2"/>
- <function name="VertexAttrib3fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="3"/>
- <function name="VertexAttrib4fv" default_prefix="_es_" template="VertexAttrib" gltype="GLfloat" vector_size="4"/>
-
- <function name="VertexAttribPointerARB" template="VertexAttribPointer"/>
- <function name="EnableVertexAttribArrayARB" template="EnableVertexAttribArray"/>
- <function name="DisableVertexAttribArrayARB" template="DisableVertexAttribArray"/>
-
- <function name="IsProgram" template="IsProgram"/>
- <function name="GetProgramiv" template="GetProgram" gltype="GLint"/>
-
- <function name="GetVertexAttribfvARB" template="GetVertexAttrib" gltype="GLfloat"/>
- <function name="GetVertexAttribivARB" template="GetVertexAttrib" gltype="GLint"/>
- <function name="GetVertexAttribPointervARB" template="GetVertexAttribPointer"/>
-
- <function name="GetBufferPointervARB" template="GetBufferPointer"/>
- <function name="MapBufferARB" template="MapBuffer"/>
- <function name="UnmapBufferARB" template="UnmapBuffer"/>
- <function name="BindBufferARB" template="BindBuffer"/>
- <function name="BufferDataARB" template="BufferData"/>
- <function name="BufferSubDataARB" template="BufferSubData"/>
- <function name="DeleteBuffersARB" template="DeleteBuffers"/>
- <function name="GenBuffersARB" template="GenBuffers"/>
- <function name="GetBufferParameterivARB" template="GetBufferParameter" gltype="GLint"/>
- <function name="IsBufferARB" template="IsBuffer"/>
-
- <function name="CreateShader" template="CreateShader"/>
- <function name="ShaderSourceARB" template="ShaderSource"/>
- <function name="CompileShaderARB" template="CompileShader"/>
- <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/>
- <function name="DeleteShader" template="DeleteShader"/>
- <function name="ShaderBinary" template="ShaderBinary"/>
- <function name="CreateProgram" template="CreateProgram"/>
- <function name="AttachShader" template="AttachShader"/>
- <function name="DetachShader" template="DetachShader"/>
- <function name="LinkProgramARB" template="LinkProgram"/>
- <function name="UseProgramObjectARB" template="UseProgram"/>
- <function name="DeleteProgram" template="DeleteProgram"/>
-
- <function name="GetActiveAttribARB" template="GetActiveAttrib"/>
- <function name="GetAttribLocationARB" template="GetAttribLocation"/>
- <function name="BindAttribLocationARB" template="BindAttribLocation"/>
- <function name="GetUniformLocationARB" template="GetUniformLocation"/>
- <function name="GetActiveUniformARB" template="GetActiveUniform"/>
-
- <function name="Uniform1fARB" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/>
- <function name="Uniform2fARB" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/>
- <function name="Uniform3fARB" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/>
- <function name="Uniform4fARB" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="Uniform1iARB" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/>
- <function name="Uniform2iARB" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/>
- <function name="Uniform3iARB" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/>
- <function name="Uniform4iARB" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/>
- <function name="Uniform1fvARB" template="Uniform" gltype="GLfloat" vector_size="1"/>
- <function name="Uniform2fvARB" template="Uniform" gltype="GLfloat" vector_size="2"/>
- <function name="Uniform3fvARB" template="Uniform" gltype="GLfloat" vector_size="3"/>
- <function name="Uniform4fvARB" template="Uniform" gltype="GLfloat" vector_size="4"/>
- <function name="Uniform1ivARB" template="Uniform" gltype="GLint" vector_size="1"/>
- <function name="Uniform2ivARB" template="Uniform" gltype="GLint" vector_size="2"/>
- <function name="Uniform3ivARB" template="Uniform" gltype="GLint" vector_size="3"/>
- <function name="Uniform4ivARB" template="Uniform" gltype="GLint" vector_size="4"/>
-
- <function name="UniformMatrix2fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="2"/>
- <function name="UniformMatrix3fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="3"/>
- <function name="UniformMatrix4fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="4"/>
-
- <function name="ValidateProgramARB" template="ValidateProgram"/>
-
- <function name="GenerateMipmapEXT" template="GenerateMipmap"/>
- <function name="BindFramebufferEXT" template="BindFramebuffer"/>
- <function name="DeleteFramebuffersEXT" template="DeleteFramebuffers"/>
- <function name="GenFramebuffersEXT" template="GenFramebuffers"/>
- <function name="BindRenderbufferEXT" template="BindRenderbuffer"/>
- <function name="DeleteRenderbuffersEXT" template="DeleteRenderbuffers"/>
- <function name="GenRenderbuffersEXT" template="GenRenderbuffers"/>
- <function name="RenderbufferStorageEXT" template="RenderbufferStorage"/>
- <function name="FramebufferRenderbufferEXT" template="FramebufferRenderbuffer"/>
- <function name="FramebufferTexture2DEXT" template="FramebufferTexture2D"/>
- <function name="FramebufferTexture3DEXT" template="FramebufferTexture3D"/>
- <function name="CheckFramebufferStatusEXT" template="CheckFramebufferStatus"/>
- <function name="GetFramebufferAttachmentParameterivEXT" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
- <function name="GetRenderbufferParameterivEXT" template="GetRenderbufferParameter" gltype="GLint"/>
- <function name="IsRenderbufferEXT" template="IsRenderbuffer"/>
- <function name="IsFramebufferEXT" template="IsFramebuffer"/>
-
- <function name="IsShader" template="IsShader"/>
- <function name="GetShaderiv" template="GetShader" gltype="GLint"/>
- <function name="GetAttachedShaders" template="GetAttachedShaders"/>
- <function name="GetShaderInfoLog" template="GetShaderInfoLog"/>
- <function name="GetProgramInfoLog" template="GetProgramInfoLog"/>
- <function name="GetShaderSourceARB" template="GetShaderSource"/>
- <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/>
- <function name="GetUniformfvARB" template="GetUniform" gltype="GLfloat"/>
- <function name="GetUniformivARB" template="GetUniform" gltype="GLint"/>
-
- <function name="DrawTexf" template="DrawTex" gltype="GLfloat" expand_vector="true"/>
- <function name="DrawTexfv" template="DrawTex" gltype="GLfloat"/>
- <function name="DrawTexi" template="DrawTex" gltype="GLint" expand_vector="true"/>
- <function name="DrawTexiv" template="DrawTex" gltype="GLint"/>
- <function name="DrawTexs" template="DrawTex" gltype="GLshort" expand_vector="true"/>
- <function name="DrawTexsv" template="DrawTex" gltype="GLshort"/>
-
- <!-- EXT_multi_draw_arrays -->
- <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
- <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
-
- <!-- OES_EGL_image -->
- <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/>
- <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/>
-
- <function name="DrawBuffersARB" template="DrawBuffers"/>
-
- <function name="ReadBuffer" template="ReadBuffer"/>
-
-</api>
-
-<api name="GLES1.1">
- <category name="GLES1.1"/>
-
- <category name="OES_byte_coordinates"/>
- <category name="OES_fixed_point"/>
- <category name="OES_single_precision"/>
- <category name="OES_matrix_get"/>
- <category name="OES_read_format"/>
- <category name="OES_compressed_paletted_texture"/>
- <category name="OES_compressed_ETC1_RGB8_texture"/>
- <category name="OES_point_size_array"/>
- <category name="OES_point_sprite"/>
- <category name="OES_query_matrix"/>
- <category name="OES_draw_texture"/>
- <category name="OES_blend_equation_separate"/>
- <category name="OES_blend_func_separate"/>
- <category name="OES_blend_subtract"/>
- <category name="OES_stencil_wrap"/>
- <category name="OES_texture_cube_map"/>
- <category name="OES_texture_env_crossbar"/>
- <category name="OES_texture_mirrored_repeat"/>
- <category name="OES_framebuffer_object"/>
- <category name="OES_depth24"/>
- <category name="OES_depth32"/>
- <category name="OES_fbo_render_mipmap"/>
- <category name="OES_rgb8_rgba8"/>
- <category name="OES_stencil1"/>
- <category name="OES_stencil4"/>
- <category name="OES_stencil8"/>
- <category name="OES_element_index_uint"/>
- <category name="OES_mapbuffer"/>
- <category name="EXT_texture_filter_anisotropic"/>
- <category name="EXT_texture_format_BGRA8888"/>
- <category name="EXT_read_format_bgra"/>
-
- <category name="ARB_texture_non_power_of_two"/>
- <!-- disabled due to missing enums
- <category name="EXT_texture_compression_dxt1"/>
- -->
- <category name="EXT_texture_lod_bias"/>
- <category name="EXT_blend_minmax"/>
- <category name="EXT_multi_draw_arrays"/>
- <category name="OES_EGL_image"/>
- <category name="OES_EGL_image_external"/>
-
- <category name="OES_matrix_palette"/>
-
- <function name="Color4f" external="true" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="Color4ub" template="Color" gltype="GLubyte" vector_size="4" expand_vector="true"/>
- <function name="Color4x" template="Color" gltype="GLfixed" vector_size="4" expand_vector="true"/>
-
- <function name="ClipPlanef" template="ClipPlane" gltype="GLfloat"/>
- <function name="ClipPlanex" template="ClipPlane" gltype="GLfixed"/>
-
- <function name="CullFace" template="CullFace"/>
-
- <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/>
- <function name="Fogx" template="Fog" gltype="GLfixed" expand_vector="true"/>
- <function name="Fogfv" template="Fog" gltype="GLfloat"/>
- <function name="Fogxv" template="Fog" gltype="GLfixed"/>
-
- <function name="FrontFace" template="FrontFace"/>
- <function name="Hint" template="Hint"/>
-
- <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/>
- <function name="Lightx" template="Light" gltype="GLfixed" expand_vector="true"/>
- <function name="Lightfv" template="Light" gltype="GLfloat"/>
- <function name="Lightxv" template="Light" gltype="GLfixed"/>
-
- <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/>
- <function name="LightModelx" template="LightModel" gltype="GLfixed" expand_vector="true"/>
- <function name="LightModelfv" template="LightModel" gltype="GLfloat"/>
- <function name="LightModelxv" template="LightModel" gltype="GLfixed"/>
-
- <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
- <function name="LineWidthx" template="LineWidth" gltype="GLfixed"/>
-
- <function name="Materialf" external="true" template="Material" gltype="GLfloat" expand_vector="true"/>
- <function name="Materialfv" external="true" template="Material" gltype="GLfloat"/>
- <function name="Materialx" template="Material" gltype="GLfixed" expand_vector="true"/>
- <function name="Materialxv" template="Material" gltype="GLfixed"/>
-
- <function name="PointSize" template="PointSize" gltype="GLfloat"/>
- <function name="PointSizex" template="PointSize" gltype="GLfixed"/>
- <function name="PointSizePointerOES" template="PointSizePointer"/>
-
- <function name="Scissor" template="Scissor"/>
- <function name="ShadeModel" template="ShadeModel"/>
-
- <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
- <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
- <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
- <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
- <function name="TexParameterx" template="TexParameter" gltype="GLfixed" expand_vector="true"/>
- <function name="TexParameterxv" template="TexParameter" gltype="GLfixed"/>
-
- <function name="TexImage2D" template="TexImage2D"/>
-
- <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/>
- <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/>
- <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/>
- <function name="TexEnviv" template="TexEnv" gltype="GLint"/>
- <function name="TexEnvx" template="TexEnv" gltype="GLfixed" expand_vector="true"/>
- <function name="TexEnvxv" template="TexEnv" gltype="GLfixed"/>
-
- <function name="TexGenfOES" external="true" template="TexGen" gltype="GLfloat" expand_vector="true"/>
- <function name="TexGenfvOES" external="true" template="TexGen" gltype="GLfloat"/>
- <function name="TexGeniOES" external="true" template="TexGen" gltype="GLint" expand_vector="true"/>
- <function name="TexGenivOES" external="true" template="TexGen" gltype="GLint"/>
- <function name="TexGenxOES" external="true" template="TexGen" gltype="GLfixed" expand_vector="true"/>
- <function name="TexGenxvOES" external="true" template="TexGen" gltype="GLfixed"/>
-
- <function name="Clear" template="Clear"/>
- <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
- <function name="ClearColorx" template="ClearColor" gltype="GLclampx"/>
-
- <function name="ClearStencil" template="ClearStencil"/>
- <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/>
- <function name="ClearDepthx" template="ClearDepth" gltype="GLclampx"/>
-
- <function name="StencilMask" template="StencilMask"/>
- <function name="ColorMask" template="ColorMask"/>
- <function name="DepthMask" template="DepthMask"/>
-
- <function name="Disable" template="Disable"/>
- <function name="Enable" template="Enable"/>
- <function name="Finish" template="Finish"/>
- <function name="Flush" template="Flush"/>
-
- <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/>
- <function name="AlphaFuncx" template="AlphaFunc" gltype="GLclampx"/>
-
- <function name="BlendFunc" template="BlendFunc"/>
- <function name="LogicOp" template="LogicOp"/>
- <function name="StencilFunc" template="StencilFunc"/>
-
- <function name="StencilOp" template="StencilOp"/>
- <function name="DepthFunc" template="DepthFunc"/>
-
- <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
- <function name="ReadPixels" template="ReadPixels"/>
-
- <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
-
- <function name="GetClipPlanef" template="GetClipPlane" gltype="GLfloat"/>
- <function name="GetClipPlanex" template="GetClipPlane" gltype="GLfixed"/>
-
- <function name="GetError" template="GetError"/>
- <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
- <function name="GetFixedv" template="GetState" gltype="GLfixed"/>
- <function name="GetIntegerv" template="GetState" gltype="GLint"/>
-
- <function name="GetLightfv" template="GetLight" gltype="GLfloat"/>
- <function name="GetLightxv" template="GetLight" gltype="GLfixed"/>
-
- <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/>
- <function name="GetMaterialxv" template="GetMaterial" gltype="GLfixed"/>
-
- <function name="GetString" template="GetString"/>
-
- <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/>
- <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/>
- <function name="GetTexEnvxv" template="GetTexEnv" gltype="GLfixed"/>
-
- <function name="GetTexGenfvOES" external="true" template="GetTexGen" gltype="GLfloat"/>
- <function name="GetTexGenivOES" external="true" template="GetTexGen" gltype="GLint"/>
- <function name="GetTexGenxvOES" external="true" template="GetTexGen" gltype="GLfixed"/>
-
- <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
- <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
- <function name="GetTexParameterxv" template="GetTexParameter" gltype="GLfixed"/>
-
- <function name="IsEnabled" template="IsEnabled"/>
-
- <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/>
- <function name="DepthRangex" template="DepthRange" gltype="GLclampx"/>
-
- <function name="Frustumf" template="Frustum" gltype="GLfloat"/>
- <function name="Frustumx" template="Frustum" gltype="GLfixed"/>
-
- <function name="LoadIdentity" template="LoadIdentity"/>
- <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/>
- <function name="LoadMatrixx" template="LoadMatrix" gltype="GLfixed"/>
- <function name="MatrixMode" template="MatrixMode"/>
-
- <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/>
- <function name="MultMatrixx" template="MultMatrix" gltype="GLfixed"/>
- <function name="Orthof" template="Ortho" gltype="GLfloat"/>
- <function name="Orthox" template="Ortho" gltype="GLfixed"/>
-
- <function name="PopMatrix" template="PopMatrix"/>
- <function name="PushMatrix" template="PushMatrix"/>
-
- <function name="Rotatef" template="Rotate" gltype="GLfloat"/>
- <function name="Rotatex" template="Rotate" gltype="GLfixed"/>
- <function name="Scalef" template="Scale" gltype="GLfloat"/>
- <function name="Scalex" template="Scale" gltype="GLfixed"/>
- <function name="Translatef" template="Translate" gltype="GLfloat"/>
- <function name="Translatex" template="Translate" gltype="GLfixed"/>
-
- <function name="Viewport" template="Viewport"/>
- <function name="ColorPointer" template="ColorPointer"/>
- <function name="DisableClientState" template="DisableClientState"/>
- <function name="DrawArrays" template="DrawArrays"/>
- <function name="DrawElements" template="DrawElements"/>
- <function name="EnableClientState" template="EnableClientState"/>
-
- <function name="GetPointerv" template="GetPointer"/>
-
- <function name="Normal3f" external="true" template="Normal" gltype="GLfloat" expand_vector="true"/>
- <function name="Normal3x" template="Normal" gltype="GLfixed" expand_vector="true"/>
- <function name="NormalPointer" template="NormalPointer"/>
- <function name="TexCoordPointer" template="TexCoordPointer"/>
- <function name="VertexPointer" template="VertexPointer"/>
-
- <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
- <function name="PolygonOffsetx" template="PolygonOffset" gltype="GLfixed"/>
-
- <function name="CopyTexImage2D" template="CopyTexImage2D"/>
- <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
-
- <function name="TexSubImage2D" template="TexSubImage2D"/>
-
- <function name="BindTexture" template="BindTexture"/>
- <function name="DeleteTextures" template="DeleteTextures"/>
- <function name="GenTextures" template="GenTextures"/>
- <function name="IsTexture" template="IsTexture"/>
-
- <function name="BlendEquationOES" template="BlendEquation"/>
- <function name="BlendEquationSeparateOES" template="BlendEquationSeparate"/>
-
- <function name="MultiTexCoord4x" template="MultiTexCoord" gltype="GLfixed" vector_size="4" expand_vector="true"/>
-
- <function name="ActiveTexture" template="ActiveTexture"/>
- <function name="ClientActiveTexture" template="ClientActiveTexture"/>
-
- <function name="MultiTexCoord4f" external="true" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/>
-
- <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/>
- <function name="SampleCoveragex" template="SampleCoverage" gltype="GLclampx"/>
-
- <!-- CompressedTexImage2D calls out to two different functions based on
- whether the image is a paletted image or not -->
- <function name="CompressedTexImage2D" template="CompressedTexImage2D"/>
- <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/>
-
- <function name="BlendFuncSeparateOES" template="BlendFuncSeparate"/>
-
- <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/>
- <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/>
- <function name="PointParameterx" template="PointParameter" gltype="GLfixed" expand_vector="true"/>
- <function name="PointParameterxv" template="PointParameter" gltype="GLfixed"/>
-
- <!-- OES_mapbuffer -->
- <function name="GetBufferPointervOES" template="GetBufferPointer"/>
- <function name="MapBufferOES" template="MapBuffer"/>
- <function name="UnmapBufferOES" template="UnmapBuffer"/>
-
- <function name="BindBuffer" template="BindBuffer"/>
- <function name="BufferData" template="BufferData"/>
- <function name="BufferSubData" template="BufferSubData"/>
- <function name="DeleteBuffers" template="DeleteBuffers"/>
- <function name="GenBuffers" template="GenBuffers"/>
- <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/>
- <function name="IsBuffer" template="IsBuffer"/>
-
- <!-- OES_framebuffer_object -->
- <function name="GenerateMipmapOES" template="GenerateMipmap"/>
- <function name="BindFramebufferOES" template="BindFramebuffer"/>
- <function name="DeleteFramebuffersOES" template="DeleteFramebuffers"/>
- <function name="GenFramebuffersOES" template="GenFramebuffers"/>
- <function name="BindRenderbufferOES" template="BindRenderbuffer"/>
- <function name="DeleteRenderbuffersOES" template="DeleteRenderbuffers"/>
- <function name="GenRenderbuffersOES" template="GenRenderbuffers"/>
- <function name="RenderbufferStorageOES" external="true" template="RenderbufferStorage"/>
- <function name="FramebufferRenderbufferOES" template="FramebufferRenderbuffer"/>
- <function name="FramebufferTexture2DOES" template="FramebufferTexture2D"/>
- <function name="CheckFramebufferStatusOES" template="CheckFramebufferStatus"/>
- <function name="GetFramebufferAttachmentParameterivOES" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
- <function name="GetRenderbufferParameterivOES" template="GetRenderbufferParameter" gltype="GLint"/>
- <function name="IsRenderbufferOES" template="IsRenderbuffer"/>
- <function name="IsFramebufferOES" template="IsFramebuffer"/>
-
- <!-- OES_query_matrix -->
- <!-- QueryMatrixx returns values in an unusual, decomposed, fixed-value
- form; it has its own code for this -->
- <function name="QueryMatrixxOES" external="true" template="QueryMatrix" gltype="GLfixed"/>
-
- <!-- OES_draw_texture -->
- <function name="DrawTexfOES" template="DrawTex" gltype="GLfloat" expand_vector="true"/>
- <function name="DrawTexiOES" template="DrawTex" gltype="GLint" expand_vector="true"/>
- <function name="DrawTexsOES" template="DrawTex" gltype="GLshort" expand_vector="true"/>
- <function name="DrawTexxOES" template="DrawTex" gltype="GLfixed" expand_vector="true"/>
- <function name="DrawTexfvOES" template="DrawTex" gltype="GLfloat"/>
- <function name="DrawTexivOES" template="DrawTex" gltype="GLint"/>
- <function name="DrawTexsvOES" template="DrawTex" gltype="GLshort"/>
- <function name="DrawTexxvOES" template="DrawTex" gltype="GLfixed"/>
-
- <!-- EXT_multi_draw_arrays -->
- <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
- <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
-
- <!-- OES_EGL_image -->
- <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/>
- <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/>
-</api>
-
-<api name="GLES2.0">
- <category name="GLES2.0"/>
-
- <category name="OES_compressed_paletted_texture"/>
- <category name="OES_compressed_ETC1_RGB8_texture"/>
- <category name="OES_depth24"/>
- <category name="OES_depth32"/>
- <category name="OES_fbo_render_mipmap"/>
- <category name="OES_rgb8_rgba8"/>
- <category name="OES_stencil1"/>
- <category name="OES_stencil4"/>
- <category name="OES_element_index_uint"/>
- <category name="OES_mapbuffer"/>
- <category name="OES_texture_3D"/>
- <category name="OES_texture_npot"/>
- <category name="EXT_texture_filter_anisotropic"/>
- <category name="EXT_texture_type_2_10_10_10_REV"/>
- <category name="OES_depth_texture"/>
- <category name="OES_packed_depth_stencil"/>
- <category name="OES_standard_derivatives"/>
- <category name="EXT_texture_format_BGRA8888"/>
- <category name="EXT_texture_rg"/>
- <category name="EXT_read_format_bgra"/>
-
- <category name="EXT_texture_compression_dxt1"/>
- <category name="EXT_blend_minmax"/>
- <category name="EXT_multi_draw_arrays"/>
- <category name="OES_EGL_image"/>
- <category name="OES_EGL_image_external"/>
- <category name="EXT_unpack_subimage"/>
-
- <category name="NV_draw_buffers"/>
- <category name="NV_read_buffer"/>
-
- <!-- GL_ANGLE_texture_compression_dxt -->
- <category name="ANGLE_texture_compression_dxt"/>
-
- <function name="DrawBuffersNV" template="DrawBuffers"/>
- <function name="ReadBufferNV" template="ReadBuffer"/>
-
- <function name="CullFace" template="CullFace"/>
-
- <function name="FrontFace" template="FrontFace"/>
- <function name="Hint" template="Hint"/>
-
- <function name="LineWidth" template="LineWidth" gltype="GLfloat"/>
-
- <function name="Scissor" template="Scissor"/>
-
- <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/>
- <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/>
- <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/>
- <function name="TexParameteriv" template="TexParameter" gltype="GLint"/>
-
- <function name="TexImage2D" template="TexImage2D"/>
-
- <function name="Clear" template="Clear"/>
- <function name="ClearColor" template="ClearColor" gltype="GLclampf"/>
- <function name="ClearStencil" template="ClearStencil"/>
- <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/>
-
- <function name="StencilMask" template="StencilMask"/>
- <function name="StencilMaskSeparate" template="StencilMaskSeparate"/>
- <function name="ColorMask" template="ColorMask"/>
- <function name="DepthMask" template="DepthMask"/>
- <function name="Disable" template="Disable"/>
- <function name="Enable" template="Enable"/>
- <function name="Finish" template="Finish"/>
- <function name="Flush" template="Flush"/>
-
- <function name="BlendFunc" template="BlendFunc"/>
-
- <function name="StencilFunc" template="StencilFunc"/>
- <function name="StencilFuncSeparate" template="StencilFuncSeparate"/>
- <function name="StencilOp" template="StencilOp"/>
- <function name="StencilOpSeparate" template="StencilOpSeparate"/>
-
- <function name="DepthFunc" template="DepthFunc"/>
-
- <function name="PixelStorei" template="PixelStore" gltype="GLint"/>
- <function name="ReadPixels" template="ReadPixels"/>
-
- <function name="GetBooleanv" template="GetState" gltype="GLboolean"/>
- <function name="GetError" template="GetError"/>
- <function name="GetFloatv" template="GetState" gltype="GLfloat"/>
- <function name="GetIntegerv" template="GetState" gltype="GLint"/>
-
- <function name="GetString" template="GetString"/>
-
- <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/>
- <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/>
-
- <function name="IsEnabled" template="IsEnabled"/>
-
- <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/>
-
- <function name="Viewport" template="Viewport"/>
-
- <function name="DrawArrays" template="DrawArrays"/>
- <function name="DrawElements" template="DrawElements"/>
-
- <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/>
- <function name="CopyTexImage2D" template="CopyTexImage2D"/>
- <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/>
- <function name="TexSubImage2D" template="TexSubImage2D"/>
-
- <function name="BindTexture" template="BindTexture"/>
- <function name="DeleteTextures" template="DeleteTextures"/>
- <function name="GenTextures" template="GenTextures"/>
- <function name="IsTexture" template="IsTexture"/>
-
- <function name="BlendColor" template="BlendColor" gltype="GLclampf"/>
- <function name="BlendEquation" template="BlendEquation"/>
- <function name="BlendEquationSeparate" template="BlendEquationSeparate"/>
-
- <function name="TexImage3DOES" template="TexImage3D"/>
- <function name="TexSubImage3DOES" template="TexSubImage3D"/>
- <function name="CopyTexSubImage3DOES" template="CopyTexSubImage3D"/>
-
- <function name="CompressedTexImage3DOES" template="CompressedTexImage3D"/>
- <function name="CompressedTexSubImage3DOES" template="CompressedTexSubImage3D"/>
-
- <function name="ActiveTexture" template="ActiveTexture"/>
-
- <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/>
-
- <function name="CompressedTexImage2D" template="CompressedTexImage2D"/>
- <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/>
-
- <function name="BlendFuncSeparate" template="BlendFuncSeparate"/>
-
- <function name="VertexAttrib1f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/>
- <function name="VertexAttrib2f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/>
- <function name="VertexAttrib3f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/>
- <function name="VertexAttrib4f" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="VertexAttrib1fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="1"/>
- <function name="VertexAttrib2fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="2"/>
- <function name="VertexAttrib3fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="3"/>
- <function name="VertexAttrib4fv" external="true" template="VertexAttrib" gltype="GLfloat" vector_size="4"/>
-
- <function name="VertexAttribPointer" template="VertexAttribPointer"/>
-
- <function name="EnableVertexAttribArray" template="EnableVertexAttribArray"/>
- <function name="DisableVertexAttribArray" template="DisableVertexAttribArray"/>
-
- <function name="IsProgram" template="IsProgram"/>
- <function name="GetProgramiv" template="GetProgram" gltype="GLint"/>
-
- <function name="GetVertexAttribfv" template="GetVertexAttrib" gltype="GLfloat"/>
- <function name="GetVertexAttribiv" template="GetVertexAttrib" gltype="GLint"/>
- <function name="GetVertexAttribPointerv" template="GetVertexAttribPointer"/>
-
- <function name="GetBufferPointervOES" template="GetBufferPointer"/>
- <function name="MapBufferOES" template="MapBuffer"/>
- <function name="UnmapBufferOES" template="UnmapBuffer"/>
- <function name="BindBuffer" template="BindBuffer"/>
- <function name="BufferData" template="BufferData"/>
- <function name="BufferSubData" template="BufferSubData"/>
- <function name="DeleteBuffers" template="DeleteBuffers"/>
- <function name="GenBuffers" template="GenBuffers"/>
- <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/>
- <function name="IsBuffer" template="IsBuffer"/>
-
- <function name="CreateShader" template="CreateShader"/>
- <function name="ShaderSource" template="ShaderSource"/>
- <function name="CompileShader" template="CompileShader"/>
- <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/>
- <function name="DeleteShader" template="DeleteShader"/>
- <function name="ShaderBinary" template="ShaderBinary"/>
- <function name="CreateProgram" template="CreateProgram"/>
- <function name="AttachShader" template="AttachShader"/>
- <function name="DetachShader" template="DetachShader"/>
- <function name="LinkProgram" template="LinkProgram"/>
- <function name="UseProgram" template="UseProgram"/>
- <function name="DeleteProgram" template="DeleteProgram"/>
-
- <function name="GetActiveAttrib" template="GetActiveAttrib"/>
- <function name="GetAttribLocation" template="GetAttribLocation"/>
- <function name="BindAttribLocation" template="BindAttribLocation"/>
- <function name="GetUniformLocation" template="GetUniformLocation"/>
- <function name="GetActiveUniform" template="GetActiveUniform"/>
-
- <function name="Uniform1f" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/>
- <function name="Uniform2f" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/>
- <function name="Uniform3f" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/>
- <function name="Uniform4f" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/>
- <function name="Uniform1i" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/>
- <function name="Uniform2i" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/>
- <function name="Uniform3i" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/>
- <function name="Uniform4i" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/>
-
- <function name="Uniform1fv" template="Uniform" gltype="GLfloat" vector_size="1"/>
- <function name="Uniform2fv" template="Uniform" gltype="GLfloat" vector_size="2"/>
- <function name="Uniform3fv" template="Uniform" gltype="GLfloat" vector_size="3"/>
- <function name="Uniform4fv" template="Uniform" gltype="GLfloat" vector_size="4"/>
- <function name="Uniform1iv" template="Uniform" gltype="GLint" vector_size="1"/>
- <function name="Uniform2iv" template="Uniform" gltype="GLint" vector_size="2"/>
- <function name="Uniform3iv" template="Uniform" gltype="GLint" vector_size="3"/>
- <function name="Uniform4iv" template="Uniform" gltype="GLint" vector_size="4"/>
-
- <function name="UniformMatrix2fv" template="UniformMatrix" gltype="GLfloat" vector_size="2"/>
- <function name="UniformMatrix3fv" template="UniformMatrix" gltype="GLfloat" vector_size="3"/>
- <function name="UniformMatrix4fv" template="UniformMatrix" gltype="GLfloat" vector_size="4"/>
-
- <function name="ValidateProgram" template="ValidateProgram"/>
-
- <function name="GenerateMipmap" template="GenerateMipmap"/>
- <function name="BindFramebuffer" template="BindFramebuffer"/>
- <function name="DeleteFramebuffers" template="DeleteFramebuffers"/>
- <function name="GenFramebuffers" template="GenFramebuffers"/>
- <function name="BindRenderbuffer" template="BindRenderbuffer"/>
- <function name="DeleteRenderbuffers" template="DeleteRenderbuffers"/>
- <function name="GenRenderbuffers" template="GenRenderbuffers"/>
- <function name="RenderbufferStorage" external="true" template="RenderbufferStorage"/>
- <function name="FramebufferRenderbuffer" template="FramebufferRenderbuffer"/>
- <function name="FramebufferTexture2D" template="FramebufferTexture2D"/>
- <function name="FramebufferTexture3DOES" template="FramebufferTexture3D"/>
- <function name="CheckFramebufferStatus" template="CheckFramebufferStatus"/>
- <function name="GetFramebufferAttachmentParameteriv" template="GetFramebufferAttachmentParameter" gltype="GLint"/>
- <function name="GetRenderbufferParameteriv" template="GetRenderbufferParameter" gltype="GLint"/>
- <function name="IsRenderbuffer" template="IsRenderbuffer"/>
- <function name="IsFramebuffer" template="IsFramebuffer"/>
-
- <function name="IsShader" template="IsShader"/>
- <function name="GetShaderiv" template="GetShader" gltype="GLint"/>
- <function name="GetAttachedShaders" template="GetAttachedShaders"/>
- <function name="GetShaderInfoLog" template="GetShaderInfoLog"/>
- <function name="GetProgramInfoLog" template="GetProgramInfoLog"/>
- <function name="GetShaderSource" template="GetShaderSource"/>
- <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/>
- <function name="GetUniformfv" template="GetUniform" gltype="GLfloat"/>
- <function name="GetUniformiv" template="GetUniform" gltype="GLint"/>
-
- <!-- EXT_multi_draw_arrays -->
- <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/>
- <function name="MultiDrawElementsEXT" template="MultiDrawElements"/>
-
- <!-- OES_EGL_image -->
- <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/>
- <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/>
-</api>
-
-</apispec>
diff --git a/mesalib/src/mesa/main/APIspecutil.py b/mesalib/src/mesa/main/APIspecutil.py
deleted file mode 100644
index 3c1552809..000000000
--- a/mesalib/src/mesa/main/APIspecutil.py
+++ /dev/null
@@ -1,272 +0,0 @@
-#!/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.
-"""
-Minimal apiutil.py interface for use by es_generator.py.
-"""
-
-import sys
-import libxml2
-
-import APIspec
-
-__spec = {}
-__functions = {}
-__aliases = {}
-
-def _ParseXML(filename, apiname):
- conversions = {
- # from to
- 'GLfloat': [ 'GLdouble' ],
- 'GLclampf': [ 'GLclampd' ],
- 'GLubyte': [ 'GLfloat', 'GLdouble' ],
- 'GLint': [ 'GLfloat', 'GLdouble' ],
- 'GLfixed': [ 'GLfloat', 'GLdouble' ],
- 'GLclampx': [ 'GLclampf', 'GLclampd' ],
- }
-
- doc = libxml2.readFile(filename, None,
- libxml2.XML_PARSE_DTDLOAD +
- libxml2.XML_PARSE_DTDVALID +
- libxml2.XML_PARSE_NOBLANKS)
- spec = APIspec.Spec(doc)
- impl = spec.get_impl()
- api = spec.get_api(apiname)
- doc.freeDoc()
-
- __spec["impl"] = impl
- __spec["api"] = api
-
- for func in api.functions:
- alias, need_conv = impl.match(func, conversions)
- if not alias:
- # external functions are manually dispatched
- if not func.is_external:
- print >>sys.stderr, "Error: unable to dispatch %s" % func.name
- alias = func
- need_conv = False
-
- __functions[func.name] = func
- __aliases[func.name] = (alias, need_conv)
-
-
-def AllSpecials(notused=None):
- """Return a list of all external functions in the API."""
- api = __spec["api"]
-
- specials = []
- for func in api.functions:
- if func.is_external:
- specials.append(func.name)
-
- return specials
-
-
-def GetAllFunctions(filename, api):
- """Return sorted list of all functions in the API."""
- if not __spec:
- _ParseXML(filename, api)
-
- api = __spec["api"]
- names = []
- for func in api.functions:
- names.append(func.name)
- names.sort()
- return names
-
-
-def ReturnType(funcname):
- """Return the C return type of named function."""
- func = __functions[funcname]
- return func.return_type
-
-
-def Properties(funcname):
- """Return list of properties of the named GL function."""
- func = __functions[funcname]
- return [func.direction]
-
-
-def _ValidValues(func, param):
- """Return the valid values of a parameter."""
- valid_values = []
- switch = func.checker.switches.get(param.name, [])
- for desc in switch:
- # no dependent vector
- if not desc.checker.switches:
- for val in desc.values:
- valid_values.append((val, None, None, [], desc.error, None))
- continue
-
- items = desc.checker.switches.items()
- if len(items) > 1:
- print >>sys.stderr, "%s: more than one parameter depend on %s" % \
- (func.name, desc.name)
- dep_name, dep_switch = items[0]
-
- for dep_desc in dep_switch:
- if dep_desc.index >= 0 and dep_desc.index != 0:
- print >>sys.stderr, "%s: not first element of a vector" % func.name
- if dep_desc.checker.switches:
- print >>sys.stderr, "%s: deep nested dependence" % func.name
-
- convert = None if dep_desc.convert else "noconvert"
- for val in desc.values:
- valid_values.append((val, dep_desc.size_str, dep_desc.name,
- dep_desc.values, dep_desc.error, convert))
- return valid_values
-
-
-def _Conversion(func, src_param):
- """Return the destination type of the conversion, or None."""
- alias, need_conv = __aliases[func.name]
- if need_conv:
- dst_param = alias.get_param(src_param.name)
- if src_param.type == dst_param.type:
- need_conv = False
- if not need_conv:
- return (None, "none")
-
- converts = { True: 0, False: 0 }
-
- # In Fogx, for example, pname may be GL_FOG_DENSITY/GL_FOG_START/GL_FOG_END
- # or GL_FOG_MODE. In the former three cases, param is not checked and the
- # default is to convert.
- if not func.checker.always_check(src_param.name):
- converts[True] += 1
-
- for desc in func.checker.flatten(src_param.name):
- converts[desc.convert] += 1
- if converts[True] and converts[False]:
- break
-
- # it should be "never", "sometimes", and "always"...
- if converts[False]:
- if converts[True]:
- conversion = "some"
- else:
- conversion = "none"
- else:
- conversion = "all"
-
- return (dst_param.base_type(), conversion)
-
-
-def _MaxVecSize(func, param):
- """Return the largest possible size of a vector."""
- if not param.is_vector:
- return 0
- if param.size:
- return param.size
-
- # need to look at all descriptions
- size = 0
- for desc in func.checker.flatten(param.name):
- if desc.size_str and desc.size_str.isdigit():
- s = int(desc.size_str)
- if s > size:
- size = s
- if not size:
- need_conv = __aliases[func.name][1]
- if need_conv:
- print >>sys.stderr, \
- "Error: unable to decide the max size of %s in %s" % \
- (param.name, func.name)
- return size
-
-
-def _ParameterTuple(func, param):
- """Return a parameter tuple.
-
- [0] -- parameter name
- [1] -- parameter type
- [2] -- max vector size or 0
- [3] -- dest type the parameter converts to, or None
- [4] -- valid values
- [5] -- how often does the conversion happen
-
- """
- vec_size = _MaxVecSize(func, param)
- dst_type, conversion = _Conversion(func, param)
- valid_values = _ValidValues(func, param)
-
- return (param.name, param.type, vec_size, dst_type, valid_values, conversion)
-
-
-def Parameters(funcname):
- """Return list of tuples of function parameters."""
- func = __functions[funcname]
- params = []
- for param in func.params:
- params.append(_ParameterTuple(func, param))
-
- return params
-
-
-def FunctionPrefix(funcname):
- """Return function specific prefix."""
- func = __functions[funcname]
-
- return func.prefix
-
-
-def FindParamIndex(params, paramname):
- """Find the index of a named parameter."""
- for i in xrange(len(params)):
- if params[i][0] == paramname:
- return i
- return None
-
-
-def MakeDeclarationString(params):
- """Return a C-style parameter declaration string."""
- string = []
- for p in params:
- sep = "" if p[1].endswith("*") else " "
- string.append("%s%s%s" % (p[1], sep, p[0]))
- if not string:
- return "void"
- return ", ".join(string)
-
-
-def AliasPrefix(funcname):
- """Return the prefix of the function the named function is an alias of."""
- alias = __aliases[funcname][0]
- return alias.prefix
-
-
-def Alias(funcname):
- """Return the name of the function the named function is an alias of."""
- alias, need_conv = __aliases[funcname]
- return alias.name if not need_conv else None
-
-
-def ConversionFunction(funcname):
- """Return the name of the function the named function converts to."""
- alias, need_conv = __aliases[funcname]
- return alias.name if need_conv else None
-
-
-def Categories(funcname):
- """Return all the categories of the named GL function."""
- api = __spec["api"]
- return [api.name]
diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c
index a670fba43..bc5f71f0d 100644
--- a/mesalib/src/mesa/main/api_exec.c
+++ b/mesalib/src/mesa/main/api_exec.c
@@ -49,9 +49,11 @@
#include "depth.h"
#include "dlist.h"
#include "drawpix.h"
+#include "drawtex.h"
#include "rastpos.h"
#include "enable.h"
#include "errors.h"
+#include "es1_conversion.h"
#include "eval.h"
#include "get.h"
#include "feedback.h"
@@ -69,6 +71,7 @@
#include "pixelstore.h"
#include "points.h"
#include "polygon.h"
+#include "querymatrix.h"
#include "queryobj.h"
#include "readpix.h"
#include "samplerobj.h"
@@ -128,12 +131,14 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_Disable(exec, _mesa_Disable);
if (ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE)
SET_DrawBuffer(exec, _mesa_DrawBuffer);
- SET_ReadBuffer(exec, _mesa_ReadBuffer);
+ if (ctx->API != API_OPENGLES) {
+ SET_ReadBuffer(exec, _mesa_ReadBuffer);
+ }
SET_Enable(exec, _mesa_Enable);
SET_Finish(exec, _mesa_Finish);
SET_Flush(exec, _mesa_Flush);
SET_FrontFace(exec, _mesa_FrontFace);
- if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ if (ctx->API == API_OPENGL) {
SET_Frustum(exec, _mesa_Frustum);
}
SET_GetError(exec, _mesa_GetError);
@@ -153,6 +158,8 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_MatrixMode(exec, _mesa_MatrixMode);
SET_MultMatrixf(exec, _mesa_MultMatrixf);
+ }
+ if (ctx->API == API_OPENGL) {
SET_Ortho(exec, _mesa_Ortho);
}
SET_PixelStorei(exec, _mesa_PixelStorei);
@@ -185,7 +192,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
_mesa_init_dlist_dispatch(exec);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ClearDepth(exec, _mesa_ClearDepth);
}
@@ -197,11 +204,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_DepthFunc(exec, _mesa_DepthFunc);
SET_DepthMask(exec, _mesa_DepthMask);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DepthRange(exec, _mesa_DepthRange);
}
- if (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) {
+ if (ctx->API == API_OPENGL) {
_mesa_init_drawpix_dispatch(exec);
}
if (ctx->API == API_OPENGL) {
@@ -210,33 +217,37 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (ctx->API == API_OPENGL) {
SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT);
- SET_Fogf(exec, _mesa_Fogf);
- SET_Fogfv(exec, _mesa_Fogfv);
SET_Fogi(exec, _mesa_Fogi);
SET_Fogiv(exec, _mesa_Fogiv);
SET_GetClipPlane(exec, _mesa_GetClipPlane);
}
+ if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
+ SET_Fogf(exec, _mesa_Fogf);
+ SET_Fogfv(exec, _mesa_Fogfv);
+ }
SET_GetBooleanv(exec, _mesa_GetBooleanv);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetDoublev(exec, _mesa_GetDoublev);
}
SET_GetIntegerv(exec, _mesa_GetIntegerv);
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_GetLightfv(exec, _mesa_GetLightfv);
- SET_GetLightiv(exec, _mesa_GetLightiv);
SET_GetMaterialfv(exec, _mesa_GetMaterialfv);
- SET_GetMaterialiv(exec, _mesa_GetMaterialiv);
- SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple);
SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv);
SET_GetTexEnviv(exec, _mesa_GetTexEnviv);
}
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API == API_OPENGL) {
+ SET_GetLightiv(exec, _mesa_GetLightiv);
+ SET_GetMaterialiv(exec, _mesa_GetMaterialiv);
+ SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple);
+ }
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv);
SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv);
}
SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv);
SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetTexImage(exec, _mesa_GetTexImage);
}
SET_Hint(exec, _mesa_Hint);
@@ -247,10 +258,12 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_LightModelf(exec, _mesa_LightModelf);
SET_LightModelfv(exec, _mesa_LightModelfv);
- SET_LightModeli(exec, _mesa_LightModeli);
- SET_LightModeliv(exec, _mesa_LightModeliv);
SET_Lightf(exec, _mesa_Lightf);
SET_Lightfv(exec, _mesa_Lightfv);
+ }
+ if (ctx->API == API_OPENGL) {
+ SET_LightModeli(exec, _mesa_LightModeli);
+ SET_LightModeliv(exec, _mesa_LightModeliv);
SET_Lighti(exec, _mesa_Lighti);
SET_Lightiv(exec, _mesa_Lightiv);
SET_LoadMatrixd(exec, _mesa_LoadMatrixd);
@@ -263,10 +276,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
if (ctx->API != API_OPENGLES2) {
- SET_PixelStoref(exec, _mesa_PixelStoref);
-
SET_PointSize(exec, _mesa_PointSize);
+ }
+ if (_mesa_is_desktop_gl(ctx)) {
+ SET_PixelStoref(exec, _mesa_PixelStoref);
SET_PolygonMode(exec, _mesa_PolygonMode);
}
@@ -278,19 +292,21 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
SET_ReadPixels(exec, _mesa_ReadPixels);
- if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ if (ctx->API == API_OPENGL) {
SET_Rotated(exec, _mesa_Rotated);
SET_Scaled(exec, _mesa_Scaled);
SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT);
+ }
+ if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_TexEnvf(exec, _mesa_TexEnvf);
SET_TexEnviv(exec, _mesa_TexEnviv);
}
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
- _mesa_init_texgen_dispatch(exec);
+ _mesa_init_texgen_dispatch(ctx, exec);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_TexImage1D(exec, _mesa_TexImage1D);
}
SET_TexParameterf(exec, _mesa_TexParameterf);
@@ -306,9 +322,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_GenTextures(exec, _mesa_GenTextures);
if (ctx->API == API_OPENGL) {
SET_AreTexturesResident(exec, _mesa_AreTexturesResident);
+ }
+ if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
SET_ColorPointer(exec, _mesa_ColorPointer);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D);
SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D);
SET_TexSubImage1D(exec, _mesa_TexSubImage1D);
@@ -320,29 +338,41 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_DisableClientState(exec, _mesa_DisableClientState);
- SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
SET_EnableClientState(exec, _mesa_EnableClientState);
+ }
+ if (ctx->API == API_OPENGL) {
+ SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
SET_IndexPointer(exec, _mesa_IndexPointer);
SET_InterleavedArrays(exec, _mesa_InterleavedArrays);
}
if (ctx->API != API_OPENGLES2) {
+ /* Note glGetPointerv is deprecated in GL CORE 3.1 through 4.2, but
+ * was re-added in GL CORE 4.3. We will just keep the function
+ * around in all GL CORE contexts.
+ */
SET_GetPointerv(exec, _mesa_GetPointerv);
}
SET_IsTexture(exec, _mesa_IsTexture);
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_NormalPointer(exec, _mesa_NormalPointer);
- SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
SET_TexCoordPointer(exec, _mesa_TexCoordPointer);
SET_VertexPointer(exec, _mesa_VertexPointer);
}
+ if (ctx->API == API_OPENGL) {
+ SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
+ }
/* 1.2 */
- SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D);
- SET_TexImage3D(exec, _mesa_TexImage3D);
- SET_TexSubImage3D(exec, _mesa_TexSubImage3D);
+ if (ctx->API != API_OPENGLES) {
+ SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D);
+ SET_TexImage3D(exec, _mesa_TexImage3D);
+ SET_TexSubImage3D(exec, _mesa_TexSubImage3D);
+ }
/* OpenGL 1.2 GL_ARB_imaging */
- SET_BlendColor(exec, _mesa_BlendColor);
+ if (ctx->API != API_OPENGLES) {
+ SET_BlendColor(exec, _mesa_BlendColor);
+ }
SET_BlendEquation(exec, _mesa_BlendEquation);
SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
@@ -353,9 +383,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* OpenGL 2.0 */
- SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
- SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
- SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
+ if (ctx->API != API_OPENGLES) {
+ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
+ SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
+ SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
+ }
_mesa_init_shader_dispatch(ctx, exec);
_mesa_init_shader_uniform_dispatch(ctx, exec);
@@ -446,7 +478,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* part of _mesa_init_rastpos_dispatch(exec); */
/* 200. GL_IBM_multimode_draw_arrays */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM);
SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM);
}
@@ -466,8 +498,10 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE);
}
/* Reused by ARB_vertex_array_object / OES_vertex_array_object */
- SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE);
- SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
+ if (ctx->API != API_OPENGLES) {
+ SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE);
+ SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
+ }
/* 262. GL_NV_point_sprite */
if (_mesa_is_desktop_gl(ctx)) {
@@ -481,23 +515,23 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* 285. GL_NV_primitive_restart */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_PrimitiveRestartIndexNV(exec, _mesa_PrimitiveRestartIndex);
}
/* ???. GL_EXT_depth_bounds_test */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT);
}
/* 352. GL_EXT_transform_feedback */
/* ARB 93. GL_ARB_transform_feedback2 */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
_mesa_init_transform_feedback_dispatch(ctx, exec);
}
/* 364. GL_EXT_provoking_vertex */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ProvokingVertexEXT(exec, _mesa_ProvokingVertexEXT);
}
@@ -519,19 +553,23 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB);
/* ARB 12. GL_ARB_texture_compression */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB);
SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB);
SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB);
}
- SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB);
+ }
SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB);
- SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB);
+ }
SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB);
/* ARB 104. GL_ARB_robustness */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetnCompressedTexImageARB(exec, _mesa_GetnCompressedTexImageARB);
}
@@ -576,10 +614,12 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* glVertexAttrib4NivARB handled in api_loopback.c */
/* glVertexAttrib4NusvARB handled in api_loopback.c */
/* glVertexAttrib4NuivARB handled in api_loopback.c */
- SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB);
- SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB);
- SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB);
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES) {
+ SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB);
+ SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB);
+ SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB);
+ }
+ if (_mesa_is_desktop_gl(ctx)) {
/* glBindProgramARB aliases glBindProgramNV */
/* glDeleteProgramsARB aliases glDeleteProgramsNV */
/* glGenProgramsARB aliases glGenProgramsNV */
@@ -590,9 +630,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_ProgramStringARB(exec, _mesa_ProgramStringARB);
}
- SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB);
- SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB);
- SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB);
+ SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB);
+ SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervARB);
+ }
if (ctx->API == API_OPENGL) {
SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB);
SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB);
@@ -614,25 +656,27 @@ _mesa_create_exec_table(struct gl_context *ctx)
_mesa_init_bufferobj_dispatch(ctx, exec);
/* ARB 29. GL_ARB_occlusion_query */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
_mesa_init_queryobj_dispatch(ctx, exec);
}
/* ARB 37. GL_ARB_draw_buffers */
- SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
+ }
/* ARB 66. GL_ARB_sync */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
_mesa_init_sync_dispatch(exec);
}
/* ARB 104. GL_ARB_debug_output */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
_mesa_init_errors_dispatch(exec);
}
/* ARB 105. GL_ARB_robustness */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetGraphicsResetStatusARB(exec, _mesa_GetGraphicsResetStatusARB);
SET_GetnPolygonStippleARB(exec, _mesa_GetnPolygonStippleARB);
SET_GetnTexImageARB(exec, _mesa_GetnTexImageARB);
@@ -663,16 +707,18 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT);
SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT);
SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT);
}
SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT);
- SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT);
+ if (ctx->API != API_OPENGLES) {
+ SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT);
+ }
SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT);
SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT);
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
}
@@ -683,7 +729,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_MESA_texture_array / GL_EXT_texture_array */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
}
@@ -695,7 +741,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* The ARB_fbo functions are the union of
* GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
*/
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
}
@@ -704,13 +750,15 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
/* GL_ARB_copy_buffer */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_CopyBufferSubData(exec, _mesa_CopyBufferSubData);
}
/* GL_ARB_vertex_array_object / GL_OES_vertex_array_object */
- SET_BindVertexArray(exec, _mesa_BindVertexArray);
- SET_GenVertexArrays(exec, _mesa_GenVertexArrays);
+ if (ctx->API != API_OPENGLES) {
+ SET_BindVertexArray(exec, _mesa_BindVertexArray);
+ SET_GenVertexArrays(exec, _mesa_GenVertexArrays);
+ }
/* GL_EXT_draw_buffers2 */
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
@@ -725,7 +773,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_NV_conditional_render */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BeginConditionalRenderNV(exec, _mesa_BeginConditionalRender);
SET_EndConditionalRenderNV(exec, _mesa_EndConditionalRender);
}
@@ -733,18 +781,13 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES);
SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE);
SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE);
SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE);
}
- if (ctx->API != API_OPENGLES2) {
- SET_FramebufferTextureARB(exec, _mesa_FramebufferTextureARB);
- SET_FramebufferTextureFaceARB(exec, _mesa_FramebufferTextureFaceARB);
- }
-
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ClampColorARB(exec, _mesa_ClampColorARB);
}
@@ -753,7 +796,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_ClearColorIiEXT(exec, _mesa_ClearColorIiEXT);
SET_ClearColorIuiEXT(exec, _mesa_ClearColorIuiEXT);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetTexParameterIivEXT(exec, _mesa_GetTexParameterIiv);
SET_GetTexParameterIuivEXT(exec, _mesa_GetTexParameterIuiv);
SET_TexParameterIivEXT(exec, _mesa_TexParameterIiv);
@@ -761,14 +804,14 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_EXT_gpu_shader4 / OpenGL 3.0 */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_GetVertexAttribIivEXT(exec, _mesa_GetVertexAttribIiv);
SET_GetVertexAttribIuivEXT(exec, _mesa_GetVertexAttribIuiv);
SET_VertexAttribIPointerEXT(exec, _mesa_VertexAttribIPointer);
}
/* GL 3.0 (functions not covered by other extensions) */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_ClearBufferiv(exec, _mesa_ClearBufferiv);
SET_ClearBufferuiv(exec, _mesa_ClearBufferuiv);
SET_ClearBufferfv(exec, _mesa_ClearBufferfv);
@@ -777,12 +820,12 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_ARB_instanced_arrays */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_VertexAttribDivisorARB(exec, _mesa_VertexAttribDivisor);
}
/* GL_ARB_draw_buffer_blend */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BlendFunciARB(exec, _mesa_BlendFunci);
SET_BlendFuncSeparateiARB(exec, _mesa_BlendFuncSeparatei);
SET_BlendEquationiARB(exec, _mesa_BlendEquationi);
@@ -790,17 +833,17 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_NV_texture_barrier */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_TextureBarrierNV(exec, _mesa_TextureBarrierNV);
}
/* GL_ARB_texture_buffer_object */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_TexBufferARB(exec, _mesa_TexBuffer);
}
/* GL_ARB_texture_storage */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_TexStorage1D(exec, _mesa_TexStorage1D);
SET_TextureStorage1DEXT(exec, _mesa_TextureStorage1DEXT);
}
@@ -813,7 +856,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
_mesa_init_sampler_object_dispatch(ctx, exec);
}
@@ -827,5 +870,66 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_InvalidateFramebuffer(exec, _mesa_InvalidateFramebuffer);
}
+#if FEATURE_ES1
+ if (ctx->API == API_OPENGLES) {
+ SET_AlphaFuncxOES(exec, _es_AlphaFuncx);
+ SET_ClearColorxOES(exec, _es_ClearColorx);
+ SET_ClearDepthxOES(exec, _es_ClearDepthx);
+ SET_ClipPlanefOES(exec, _es_ClipPlanef);
+ SET_ClipPlanexOES(exec, _es_ClipPlanex);
+ SET_Color4xOES(exec, _es_Color4x);
+ SET_DepthRangexOES(exec, _es_DepthRangex);
+ SET_DrawTexfOES(exec, _mesa_DrawTexf);
+ SET_DrawTexfvOES(exec, _mesa_DrawTexfv);
+ SET_DrawTexiOES(exec, _mesa_DrawTexi);
+ SET_DrawTexivOES(exec, _mesa_DrawTexiv);
+ SET_DrawTexsOES(exec, _mesa_DrawTexs);
+ SET_DrawTexsvOES(exec, _mesa_DrawTexsv);
+ SET_DrawTexxOES(exec, _es_DrawTexxOES);
+ SET_DrawTexxvOES(exec, _es_DrawTexxvOES);
+ SET_FogxOES(exec, _es_Fogx);
+ SET_FogxvOES(exec, _es_Fogxv);
+ SET_FrustumfOES(exec, _es_Frustumf);
+ SET_FrustumxOES(exec, _es_Frustumx);
+ SET_GetClipPlanefOES(exec, _es_GetClipPlanef);
+ SET_GetClipPlanexOES(exec, _es_GetClipPlanex);
+ SET_GetFixedvOES(exec, _mesa_GetFixedv);
+ SET_GetLightxvOES(exec, _es_GetLightxv);
+ SET_GetMaterialxvOES(exec, _es_GetMaterialxv);
+ SET_GetTexEnvxvOES(exec, _es_GetTexEnvxv);
+ SET_GetTexGenxvOES(exec, _check_GetTexGenxvOES);
+ SET_GetTexParameterxvOES(exec, _es_GetTexParameterxv);
+ SET_LightModelxOES(exec, _es_LightModelx);
+ SET_LightModelxvOES(exec, _es_LightModelxv);
+ SET_LightxOES(exec, _es_Lightx);
+ SET_LightxvOES(exec, _es_Lightxv);
+ SET_LineWidthxOES(exec, _es_LineWidthx);
+ SET_LoadMatrixxOES(exec, _es_LoadMatrixx);
+ SET_MaterialxOES(exec, _es_Materialx);
+ SET_MaterialxvOES(exec, _es_Materialxv);
+ SET_MultMatrixxOES(exec, _es_MultMatrixx);
+ SET_MultiTexCoord4xOES(exec, _es_MultiTexCoord4x);
+ SET_Normal3xOES(exec, _es_Normal3x);
+ SET_OrthofOES(exec, _es_Orthof);
+ SET_OrthoxOES(exec, _es_Orthox);
+ SET_PointParameterxOES(exec, _es_PointParameterx);
+ SET_PointParameterxvOES(exec, _es_PointParameterxv);
+ SET_PointSizePointerOES(exec, _mesa_PointSizePointer);
+ SET_PointSizexOES(exec, _es_PointSizex);
+ SET_PolygonOffsetxOES(exec, _es_PolygonOffsetx);
+ SET_QueryMatrixxOES(exec, _es_QueryMatrixxOES);
+ SET_RotatexOES(exec, _es_Rotatex);
+ SET_SampleCoveragexOES(exec, _es_SampleCoveragex);
+ SET_ScalexOES(exec, _es_Scalex);
+ SET_TexEnvxOES(exec, _es_TexEnvx);
+ SET_TexEnvxvOES(exec, _es_TexEnvxv);
+ SET_TexGenxOES(exec, _check_TexGenxOES);
+ SET_TexGenxvOES(exec, _check_TexGenxvOES);
+ SET_TexParameterxOES(exec, _es_TexParameterx);
+ SET_TexParameterxvOES(exec, _es_TexParameterxv);
+ SET_TranslatexOES(exec, _es_Translatex);
+ }
+#endif
+
return exec;
}
diff --git a/mesalib/src/mesa/main/api_exec.h b/mesalib/src/mesa/main/api_exec.h
index 100e97273..7d37ff754 100644
--- a/mesalib/src/mesa/main/api_exec.h
+++ b/mesalib/src/mesa/main/api_exec.h
@@ -36,11 +36,5 @@ _mesa_alloc_dispatch_table(int size);
extern struct _glapi_table *
_mesa_create_exec_table(struct gl_context *ctx);
-extern struct _glapi_table *
-_mesa_create_exec_table_es1(void);
-
-extern struct _glapi_table *
-_mesa_create_exec_table_es2(void);
-
#endif
diff --git a/mesalib/src/mesa/main/api_loopback.c b/mesalib/src/mesa/main/api_loopback.c
index 330eb22f7..2d35f17ad 100644
--- a/mesalib/src/mesa/main/api_loopback.c
+++ b/mesalib/src/mesa/main/api_loopback.c
@@ -37,6 +37,7 @@
#include "glapi/glthread.h"
#include "main/dispatch.h"
#include "mfeatures.h"
+#include "main/context.h"
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
* calls to a smaller set of driver-provided formats. Currently just
@@ -1503,6 +1504,10 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
struct _glapi_table *dest)
{
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ SET_Color4ub(dest, loopback_Color4ub_f);
+ SET_Materialf(dest, loopback_Materialf);
+ }
+ if (ctx->API == API_OPENGL) {
SET_Color3b(dest, loopback_Color3b_f);
SET_Color3d(dest, loopback_Color3d_f);
SET_Color3i(dest, loopback_Color3i_f);
@@ -1516,7 +1521,6 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_Color4s(dest, loopback_Color4s_f);
SET_Color4ui(dest, loopback_Color4ui_f);
SET_Color4us(dest, loopback_Color4us_f);
- SET_Color4ub(dest, loopback_Color4ub_f);
SET_Color3bv(dest, loopback_Color3bv_f);
SET_Color3dv(dest, loopback_Color3dv_f);
SET_Color3iv(dest, loopback_Color3iv_f);
@@ -1637,7 +1641,6 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_EvalCoord1dv(dest, loopback_EvalCoord1dv);
SET_EvalCoord1fv(dest, loopback_EvalCoord1fv);
SET_EvalCoord1d(dest, loopback_EvalCoord1d);
- SET_Materialf(dest, loopback_Materialf);
SET_Materiali(dest, loopback_Materiali);
SET_Materialiv(dest, loopback_Materialiv);
SET_Rectd(dest, loopback_Rectd);
@@ -1685,7 +1688,7 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB);
SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB);
SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB);
diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c
index 5959260c2..926c753dd 100644
--- a/mesalib/src/mesa/main/arrayobj.c
+++ b/mesalib/src/mesa/main/arrayobj.c
@@ -359,7 +359,7 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
newObj = lookup_arrayobj(ctx, id);
if (!newObj) {
if (genRequired) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindVertexArray(id)");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindVertexArray(non-gen name)");
return;
}
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index 9820693fa..9697919fa 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -660,7 +660,7 @@ _mesa_free_buffer_objects( struct gl_context *ctx )
ctx->UniformBufferBindings = NULL;
}
-static void
+static bool
handle_bind_buffer_gen(struct gl_context *ctx,
GLenum target,
GLuint buffer,
@@ -668,6 +668,11 @@ handle_bind_buffer_gen(struct gl_context *ctx,
{
struct gl_buffer_object *buf = *buf_handle;
+ if (!buf && ctx->API == API_OPENGL_CORE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBuffer(non-gen name)");
+ return false;
+ }
+
if (!buf || buf == &DummyBufferObject) {
/* If this is a new buffer object id, or one which was generated but
* never used before, allocate a buffer object now.
@@ -676,11 +681,13 @@ handle_bind_buffer_gen(struct gl_context *ctx,
buf = ctx->Driver.NewBufferObject(ctx, buffer, target);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB");
- return;
+ return false;
}
_mesa_HashInsert(ctx->Shared->BufferObjects, buffer, buf);
*buf_handle = buf;
}
+
+ return true;
}
/**
@@ -717,11 +724,8 @@ bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer)
else {
/* non-default buffer object */
newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (newBufObj == NULL && ctx->API == API_OPENGL_CORE) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBuffer(non-gen name)");
+ if (!handle_bind_buffer_gen(ctx, target, buffer, &newBufObj))
return;
- }
- handle_bind_buffer_gen(ctx, target, buffer, &newBufObj);
}
/* bind new buffer */
@@ -2147,7 +2151,8 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
} else {
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
}
- handle_bind_buffer_gen(ctx, target, buffer, &bufObj);
+ if (!handle_bind_buffer_gen(ctx, target, buffer, &bufObj))
+ return;
if (!bufObj) {
_mesa_error(ctx, GL_INVALID_OPERATION,
@@ -2193,7 +2198,8 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
} else {
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
}
- handle_bind_buffer_gen(ctx, target, buffer, &bufObj);
+ if (!handle_bind_buffer_gen(ctx, target, buffer, &bufObj))
+ return;
if (!bufObj) {
_mesa_error(ctx, GL_INVALID_OPERATION,
@@ -2345,7 +2351,7 @@ _mesa_init_bufferobj_dispatch(struct gl_context *ctx, struct _glapi_table *disp)
* exist for it.
*/
SET_GetBufferPointervARB(disp, _mesa_GetBufferPointervARB);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_GetBufferSubDataARB(disp, _mesa_GetBufferSubDataARB);
}
SET_IsBufferARB(disp, _mesa_IsBufferARB);
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index a51073843..a4dedeea2 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -422,14 +422,7 @@ one_time_init( struct gl_context *ctx )
if (!(api_init_mask & (1 << ctx->API))) {
_mesa_init_get_hash(ctx);
- /*
- * This is fine as ES does not use the remap table, but it may not be
- * future-proof. We cannot always initialize the remap table because
- * when an app is linked to libGLES*, there are not enough dynamic
- * entries.
- */
- if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2)
- _mesa_init_remap_table();
+ _mesa_init_remap_table();
}
api_init_mask |= 1 << ctx->API;
@@ -943,23 +936,7 @@ _mesa_initialize_context(struct gl_context *ctx,
}
/* setup the API dispatch tables */
- switch (ctx->API) {
-#if FEATURE_GL || FEATURE_ES2
- case API_OPENGL:
- case API_OPENGL_CORE:
- case API_OPENGLES2:
- ctx->Exec = _mesa_create_exec_table(ctx);
- break;
-#endif
-#if FEATURE_ES1
- case API_OPENGLES:
- ctx->Exec = _mesa_create_exec_table_es1();
- break;
-#endif
- default:
- _mesa_problem(ctx, "unknown or unsupported API");
- break;
- }
+ ctx->Exec = _mesa_create_exec_table(ctx);
if (!ctx->Exec) {
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index d53879efd..c15043694 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -7177,7 +7177,7 @@ save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
n[3].i = value;
}
if (ctx->ExecuteFlag) {
- CALL_ProgramParameteriARB(ctx->Exec, (program, pname, value));
+ CALL_ProgramParameteri(ctx->Exec, (program, pname, value));
}
}
@@ -7196,7 +7196,7 @@ save_FramebufferTexture(GLenum target, GLenum attachment,
n[4].i = level;
}
if (ctx->ExecuteFlag) {
- CALL_FramebufferTextureARB(ctx->Exec, (target, attachment, texture, level));
+ CALL_FramebufferTexture(ctx->Exec, (target, attachment, texture, level));
}
}
@@ -8509,10 +8509,10 @@ execute_list(struct gl_context *ctx, GLuint list)
/* GL_ARB_geometry_shader4 */
case OPCODE_PROGRAM_PARAMETERI:
- CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
+ CALL_ProgramParameteri(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
break;
case OPCODE_FRAMEBUFFER_TEXTURE:
- CALL_FramebufferTextureARB(ctx->Exec, (n[1].e, n[2].e,
+ CALL_FramebufferTexture(ctx->Exec, (n[1].e, n[2].e,
n[3].ui, n[4].i));
break;
case OPCODE_FRAMEBUFFER_TEXTURE_FACE:
@@ -10212,8 +10212,8 @@ _mesa_create_save_table(const struct gl_context *ctx)
SET_BlendEquationSeparateiARB(table, save_BlendEquationSeparatei);
/* GL_ARB_geometry_shader4 */
- SET_ProgramParameteriARB(table, save_ProgramParameteri);
- SET_FramebufferTextureARB(table, save_FramebufferTexture);
+ SET_ProgramParameteri(table, save_ProgramParameteri);
+ SET_FramebufferTexture(table, save_FramebufferTexture);
SET_FramebufferTextureFaceARB(table, save_FramebufferTextureFace);
/* GL_NV_conditional_render */
diff --git a/mesalib/src/mesa/main/es1_conversion.c b/mesalib/src/mesa/main/es1_conversion.c
index ae3c5badc..758fb1a66 100644
--- a/mesalib/src/mesa/main/es1_conversion.c
+++ b/mesalib/src/mesa/main/es1_conversion.c
@@ -29,10 +29,6 @@
#include "main/drawtex.h"
#include "vbo/vbo.h"
-#ifndef GL_APIENTRY
-#define GL_APIENTRY GLAPIENTRY
-#endif
-
#include "main/es1_conversion.h"
void GL_APIENTRY
diff --git a/mesalib/src/mesa/main/es1_conversion.h b/mesalib/src/mesa/main/es1_conversion.h
index ece3893a1..eb0734759 100644
--- a/mesalib/src/mesa/main/es1_conversion.h
+++ b/mesalib/src/mesa/main/es1_conversion.h
@@ -1,3 +1,33 @@
+/*
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * 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
+ * TUNGSTEN GRAPHICS 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 ES1_CONVERSION_H
+#define ES1_CONVERSION_H
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY GLAPIENTRY
+#endif
+
void GL_APIENTRY
_es_AlphaFuncx(GLenum func, GLclampx ref);
@@ -155,3 +185,4 @@ _es_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params);
void GL_APIENTRY
_es_Translatex(GLfixed x, GLfixed y, GLfixed z);
+#endif /* ES1_CONVERSION_H */
diff --git a/mesalib/src/mesa/main/es_generator.py b/mesalib/src/mesa/main/es_generator.py
deleted file mode 100644
index b074e9dcf..000000000
--- a/mesalib/src/mesa/main/es_generator.py
+++ /dev/null
@@ -1,765 +0,0 @@
-#*************************************************************************
-# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
-# 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
-# TUNGSTEN GRAPHICS 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, os
-import APIspecutil as apiutil
-
-# These dictionary entries are used for automatic conversion.
-# The string will be used as a format string with the conversion
-# variable.
-Converters = {
- 'GLfloat': {
- 'GLdouble': "(GLdouble) (%s)",
- 'GLfixed' : "(GLint) (%s * 65536)",
- },
- 'GLfixed': {
- 'GLfloat': "(GLfloat) (%s / 65536.0f)",
- 'GLdouble': "(GLdouble) (%s / 65536.0)",
- },
- 'GLdouble': {
- 'GLfloat': "(GLfloat) (%s)",
- 'GLfixed': "(GLfixed) (%s * 65536)",
- },
- 'GLclampf': {
- 'GLclampd': "(GLclampd) (%s)",
- 'GLclampx': "(GLclampx) (%s * 65536)",
- },
- 'GLclampx': {
- 'GLclampf': "(GLclampf) (%s / 65536.0f)",
- 'GLclampd': "(GLclampd) (%s / 65536.0)",
- },
- 'GLubyte': {
- 'GLfloat': "(GLfloat) (%s / 255.0f)",
- },
-}
-
-def GetBaseType(type):
- typeTokens = type.split(' ')
- baseType = None
- typeModifiers = []
- for t in typeTokens:
- if t in ['const', '*']:
- typeModifiers.append(t)
- else:
- baseType = t
- return (baseType, typeModifiers)
-
-def ConvertValue(value, fromType, toType):
- """Returns a string that represents the given parameter string,
- type-converted if necessary."""
-
- if not Converters.has_key(fromType):
- print >> sys.stderr, "No base converter for type '%s' found. Ignoring." % fromType
- return value
-
- if not Converters[fromType].has_key(toType):
- print >> sys.stderr, "No converter found for type '%s' to type '%s'. Ignoring." % (fromType, toType)
- return value
-
- # This part is simple. Return the proper conversion.
- conversionString = Converters[fromType][toType]
- return conversionString % value
-
-FormatStrings = {
- 'GLenum' : '0x%x',
- 'GLfloat' : '%f',
- 'GLint' : '%d',
- 'GLbitfield' : '0x%x',
-}
-def GetFormatString(type):
- if FormatStrings.has_key(type):
- return FormatStrings[type]
- else:
- return None
-
-
-######################################################################
-# Version-specific values to be used in the main script
-# header: which header file to include
-# api: what text specifies an API-level function
-VersionSpecificValues = {
- 'GLES1.1' : {
- 'description' : 'GLES1.1 functions',
- 'header' : 'GLES/gl.h',
- 'extheader' : 'GLES/glext.h',
- 'shortname' : 'es1'
- },
- 'GLES2.0': {
- 'description' : 'GLES2.0 functions',
- 'header' : 'GLES2/gl2.h',
- 'extheader' : 'GLES2/gl2ext.h',
- 'shortname' : 'es2'
- }
-}
-
-
-######################################################################
-# Main code for the script begins here.
-
-# Get the name of the program (without the directory part) for use in
-# error messages.
-program = os.path.basename(sys.argv[0])
-
-# Set default values
-verbose = 0
-functionList = "APIspec.xml"
-version = "GLES1.1"
-
-# Allow for command-line switches
-import getopt, time
-options = "hvV:S:"
-try:
- optlist, args = getopt.getopt(sys.argv[1:], options)
-except getopt.GetoptError, message:
- sys.stderr.write("%s: %s. Use -h for help.\n" % (program, message))
- sys.exit(1)
-
-for option, optarg in optlist:
- if option == "-h":
- sys.stderr.write("Usage: %s [-%s]\n" % (program, options))
- sys.stderr.write("Parse an API specification file and generate wrapper functions for a given GLES version\n")
- sys.stderr.write("-h gives help\n")
- sys.stderr.write("-v is verbose\n")
- sys.stderr.write("-V specifies GLES version to generate [%s]:\n" % version)
- for key in VersionSpecificValues.keys():
- sys.stderr.write(" %s - %s\n" % (key, VersionSpecificValues[key]['description']))
- sys.stderr.write("-S specifies API specification file to use [%s]\n" % functionList)
- sys.exit(1)
- elif option == "-v":
- verbose += 1
- elif option == "-V":
- version = optarg
- elif option == "-S":
- functionList = optarg
-
-# Beyond switches, we support no further command-line arguments
-if len(args) > 0:
- sys.stderr.write("%s: only switch arguments are supported - use -h for help\n" % program)
- sys.exit(1)
-
-# If we don't have a valid version, abort.
-if not VersionSpecificValues.has_key(version):
- sys.stderr.write("%s: version '%s' is not valid - use -h for help\n" % (program, version))
- sys.exit(1)
-
-# Grab the version-specific items we need to use
-versionHeader = VersionSpecificValues[version]['header']
-versionExtHeader = VersionSpecificValues[version]['extheader']
-shortname = VersionSpecificValues[version]['shortname']
-
-# If we get to here, we're good to go. The "version" parameter
-# directs GetDispatchedFunctions to only allow functions from
-# that "category" (version in our parlance). This allows
-# functions with different declarations in different categories
-# to exist (glTexImage2D, for example, is different between
-# GLES1 and GLES2).
-keys = apiutil.GetAllFunctions(functionList, version)
-
-allSpecials = apiutil.AllSpecials()
-
-print """/* DO NOT EDIT *************************************************
- * THIS FILE AUTOMATICALLY GENERATED BY THE %s SCRIPT
- * API specification file: %s
- * GLES version: %s
- * date: %s
- */
-""" % (program, functionList, version, time.strftime("%Y-%m-%d %H:%M:%S"))
-
-# The headers we choose are version-specific.
-print """
-#include "%s"
-#include "%s"
-#include "main/mfeatures.h"
-#include "main/compiler.h"
-#include "main/api_exec.h"
-
-#if FEATURE_%s
-
-#ifndef GLAPIENTRYP
-#define GLAPIENTRYP GL_APIENTRYP
-#endif
-""" % (versionHeader, versionExtHeader, shortname.upper())
-
-if version == "GLES1.1":
- print '#include "main/es1_conversion.h"'
- print
-
-# Everyone needs these types.
-print """
-/* These types are needed for the Mesa veneer, but are not defined in
- * the standard GLES headers.
- */
-typedef double GLdouble;
-typedef double GLclampd;
-
-/* Mesa error handling requires these */
-extern void *_mesa_get_current_context(void);
-extern void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... );
-"""
-
-# Finally we get to the all-important functions
-print """/*************************************************************
- * Generated functions begin here
- */
-"""
-for funcName in keys:
- if verbose > 0: sys.stderr.write("%s: processing function %s\n" % (program, funcName))
-
- # start figuring out what this function will look like.
- returnType = apiutil.ReturnType(funcName)
- props = apiutil.Properties(funcName)
- params = apiutil.Parameters(funcName)
- declarationString = apiutil.MakeDeclarationString(params)
-
- # In case of error, a function may have to return. Make
- # sure we have valid return values in this case.
- if returnType == "void":
- errorReturn = "return"
- elif returnType == "GLboolean":
- errorReturn = "return GL_FALSE"
- else:
- errorReturn = "return (%s) 0" % returnType
-
- # These are the output of this large calculation block.
- # passthroughDeclarationString: a typed set of parameters that
- # will be used to create the "extern" reference for the
- # underlying Mesa or support function. Note that as generated
- # these have an extra ", " at the beginning, which will be
- # removed before use.
- #
- # passthroughDeclarationString: an untyped list of parameters
- # that will be used to call the underlying Mesa or support
- # function (including references to converted parameters).
- # This will also be generated with an extra ", " at the
- # beginning, which will be removed before use.
- #
- # variables: C code to create any local variables determined to
- # be necessary.
- # conversionCodeOutgoing: C code to convert application parameters
- # to a necessary type before calling the underlying support code.
- # May be empty if no conversion is required.
- # conversionCodeIncoming: C code to do the converse: convert
- # values returned by underlying Mesa code to the types needed
- # by the application.
- # Note that *either* the conversionCodeIncoming will be used (for
- # generated query functions), *or* the conversionCodeOutgoing will
- # be used (for generated non-query functions), never both.
- passthroughFuncName = ""
- passthroughDeclarationString = ""
- passthroughCallString = ""
- prefixOverride = None
- variables = []
- conversionCodeOutgoing = []
- conversionCodeIncoming = []
- switchCode = []
-
- # Calculate the name of the underlying support function to call.
- # By default, the passthrough function is named _mesa_<funcName>.
- # We're allowed to override the prefix and/or the function name
- # for each function record, though. The "ConversionFunction"
- # utility is poorly named, BTW...
- if funcName in allSpecials:
- # perform checks and pass through
- funcPrefix = "_check_"
- aliasprefix = "_es_"
- else:
- funcPrefix = "_es_"
- aliasprefix = apiutil.AliasPrefix(funcName)
- alias = apiutil.ConversionFunction(funcName)
- prefixOverride = apiutil.FunctionPrefix(funcName)
- if prefixOverride != "_mesa_":
- aliasprefix = apiutil.FunctionPrefix(funcName)
- if not alias:
- # There may still be a Mesa alias for the function
- if apiutil.Alias(funcName):
- passthroughFuncName = "%s%s" % (aliasprefix, apiutil.Alias(funcName))
- else:
- passthroughFuncName = "%s%s" % (aliasprefix, funcName)
- else: # a specific alias is provided
- passthroughFuncName = "%s%s" % (aliasprefix, alias)
-
- # Look at every parameter: each one may have only specific
- # allowed values, or dependent parameters to check, or
- # variant-sized vector arrays to calculate
- for (paramName, paramType, paramMaxVecSize, paramConvertToType, paramValidValues, paramValueConversion) in params:
- # We'll need this below if we're doing conversions
- (paramBaseType, paramTypeModifiers) = GetBaseType(paramType)
-
- # Conversion management.
- # We'll handle three cases, easiest to hardest: a parameter
- # that doesn't require conversion, a scalar parameter that
- # requires conversion, and a vector parameter that requires
- # conversion.
- if paramConvertToType == None:
- # Unconverted parameters are easy, whether they're vector
- # or scalar - just add them to the call list. No conversions
- # or anything to worry about.
- passthroughDeclarationString += ", %s %s" % (paramType, paramName)
- passthroughCallString += ", %s" % paramName
-
- elif paramMaxVecSize == 0: # a scalar parameter that needs conversion
- # A scalar to hold a converted parameter
- variables.append(" %s converted_%s;" % (paramConvertToType, paramName))
-
- # Outgoing conversion depends on whether we have to conditionally
- # perform value conversion.
- if paramValueConversion == "none":
- conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName))
- elif paramValueConversion == "some":
- # We'll need a conditional variable to keep track of
- # whether we're converting values or not.
- if (" int convert_%s_value = 1;" % paramName) not in variables:
- variables.append(" int convert_%s_value = 1;" % paramName)
-
- # Write code based on that conditional.
- conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName)
- conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType)))
- conversionCodeOutgoing.append(" } else {")
- conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName))
- conversionCodeOutgoing.append(" }")
- else: # paramValueConversion == "all"
- conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType)))
-
- # Note that there can be no incoming conversion for a
- # scalar parameter; changing the scalar will only change
- # the local value, and won't ultimately change anything
- # that passes back to the application.
-
- # Call strings. The unusual " ".join() call will join the
- # array of parameter modifiers with spaces as separators.
- passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName)
- passthroughCallString += ", converted_%s" % paramName
-
- else: # a vector parameter that needs conversion
- # We'll need an index variable for conversions
- if " register unsigned int i;" not in variables:
- variables.append(" register unsigned int i;")
-
- # This variable will hold the (possibly variant) size of
- # this array needing conversion. By default, we'll set
- # it to the maximal size (which is correct for functions
- # with a constant-sized vector parameter); for true
- # variant arrays, we'll modify it with other code.
- variables.append(" unsigned int n_%s = %d;" % (paramName, paramMaxVecSize))
-
- # This array will hold the actual converted values.
- variables.append(" %s converted_%s[%d];" % (paramConvertToType, paramName, paramMaxVecSize))
-
- # Again, we choose the conversion code based on whether we
- # have to always convert values, never convert values, or
- # conditionally convert values.
- if paramValueConversion == "none":
- conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName))
- conversionCodeOutgoing.append(" }")
- elif paramValueConversion == "some":
- # We'll need a conditional variable to keep track of
- # whether we're converting values or not.
- if (" int convert_%s_value = 1;" % paramName) not in variables:
- variables.append(" int convert_%s_value = 1;" % paramName)
- # Write code based on that conditional.
- conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName)
- conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType)))
- conversionCodeOutgoing.append(" }")
- conversionCodeOutgoing.append(" } else {")
- conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName))
- conversionCodeOutgoing.append(" }")
- conversionCodeOutgoing.append(" }")
- else: # paramValueConversion == "all"
- conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType)))
-
- conversionCodeOutgoing.append(" }")
-
- # If instead we need an incoming conversion (i.e. results
- # from Mesa have to be converted before handing back
- # to the application), this is it. Fortunately, we don't
- # have to worry about conditional value conversion - the
- # functions that do (e.g. glGetFixedv()) are handled
- # specially, outside this code generation.
- #
- # Whether we use incoming conversion or outgoing conversion
- # is determined later - we only ever use one or the other.
-
- if paramValueConversion == "none":
- conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramConvertToType, paramName))
- conversionCodeIncoming.append(" }")
- elif paramValueConversion == "some":
- # We'll need a conditional variable to keep track of
- # whether we're converting values or not.
- if (" int convert_%s_value = 1;" % paramName) not in variables:
- variables.append(" int convert_%s_value = 1;" % paramName)
-
- # Write code based on that conditional.
- conversionCodeIncoming.append(" if (convert_%s_value) {" % paramName)
- conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType)))
- conversionCodeIncoming.append(" }")
- conversionCodeIncoming.append(" } else {")
- conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramBaseType, paramName))
- conversionCodeIncoming.append(" }")
- conversionCodeIncoming.append(" }")
- else: # paramValueConversion == "all"
- conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName)
- conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType)))
- conversionCodeIncoming.append(" }")
-
- # Call strings. The unusual " ".join() call will join the
- # array of parameter modifiers with spaces as separators.
- passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName)
- passthroughCallString += ", converted_%s" % paramName
-
- # endif conversion management
-
- # Parameter checking. If the parameter has a specific list of
- # valid values, we have to make sure that the passed-in values
- # match these, or we make an error.
- if len(paramValidValues) > 0:
- # We're about to make a big switch statement with an
- # error at the end. By default, the error is GL_INVALID_ENUM,
- # unless we find a "case" statement in the middle with a
- # non-GLenum value.
- errorDefaultCase = "GL_INVALID_ENUM"
-
- # This parameter has specific valid values. Make a big
- # switch statement to handle it. Note that the original
- # parameters are always what is checked, not the
- # converted parameters.
- switchCode.append(" switch(%s) {" % paramName)
-
- for valueIndex in range(len(paramValidValues)):
- (paramValue, dependentVecSize, dependentParamName, dependentValidValues, errorCode, valueConvert) = paramValidValues[valueIndex]
-
- # We're going to need information on the dependent param
- # as well.
- if dependentParamName:
- depParamIndex = apiutil.FindParamIndex(params, dependentParamName)
- if depParamIndex == None:
- sys.stderr.write("%s: can't find dependent param '%s' for function '%s'\n" % (program, dependentParamName, funcName))
-
- (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = params[depParamIndex]
- else:
- (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = (None, None, None, None, [], None)
-
- # This is a sneaky trick. It's valid syntax for a parameter
- # that is *not* going to be converted to be declared
- # with a dependent vector size; but in this case, the
- # dependent vector size is unused and unnecessary.
- # So check for this and ignore the dependent vector size
- # if the parameter is not going to be converted.
- if depParamConvertToType:
- usedDependentVecSize = dependentVecSize
- else:
- usedDependentVecSize = None
-
- # We'll peek ahead at the next parameter, to see whether
- # we can combine cases
- if valueIndex + 1 < len(paramValidValues) :
- (nextParamValue, nextDependentVecSize, nextDependentParamName, nextDependentValidValues, nextErrorCode, nextValueConvert) = paramValidValues[valueIndex + 1]
- if depParamConvertToType:
- usedNextDependentVecSize = nextDependentVecSize
- else:
- usedNextDependentVecSize = None
-
- # Create a case for this value. As a mnemonic,
- # if we have a dependent vector size that we're ignoring,
- # add it as a comment.
- if usedDependentVecSize == None and dependentVecSize != None:
- switchCode.append(" case %s: /* size %s */" % (paramValue, dependentVecSize))
- else:
- switchCode.append(" case %s:" % paramValue)
-
- # If this is not a GLenum case, then switch our error
- # if no value is matched to be GL_INVALID_VALUE instead
- # of GL_INVALID_ENUM. (Yes, this does get confused
- # if there are both values and GLenums in the same
- # switch statement, which shouldn't happen.)
- if paramValue[0:3] != "GL_":
- errorDefaultCase = "GL_INVALID_VALUE"
-
- # If all the remaining parameters are identical to the
- # next set, then we're done - we'll just create the
- # official code on the next pass through, and the two
- # cases will share the code.
- if valueIndex + 1 < len(paramValidValues) and usedDependentVecSize == usedNextDependentVecSize and dependentParamName == nextDependentParamName and dependentValidValues == nextDependentValidValues and errorCode == nextErrorCode and valueConvert == nextValueConvert:
- continue
-
- # Otherwise, we'll have to generate code for this case.
- # Start off with a check: if there is a dependent parameter,
- # and a list of valid values for that parameter, we need
- # to generate an error if something other than one
- # of those values is passed.
- if len(dependentValidValues) > 0:
- conditional=""
-
- # If the parameter being checked is actually an array,
- # check only its first element.
- if depParamMaxVecSize == 0:
- valueToCheck = dependentParamName
- else:
- valueToCheck = "%s[0]" % dependentParamName
-
- for v in dependentValidValues:
- conditional += " && %s != %s" % (valueToCheck, v)
- switchCode.append(" if (%s) {" % conditional[4:])
- if errorCode == None:
- errorCode = "GL_INVALID_ENUM"
- switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=0x%s)", %s);' % (errorCode, funcName, paramName, "%x", paramName))
- switchCode.append(" %s;" % errorReturn)
- switchCode.append(" }")
- # endif there are dependent valid values
-
- # The dependent parameter may require conditional
- # value conversion. If it does, and we don't want
- # to convert values, we'll have to generate code for that
- if depParamValueConversion == "some" and valueConvert == "noconvert":
- switchCode.append(" convert_%s_value = 0;" % dependentParamName)
-
- # If there's a dependent vector size for this parameter
- # that we're actually going to use (i.e. we need conversion),
- # mark it.
- if usedDependentVecSize:
- switchCode.append(" n_%s = %s;" % (dependentParamName, dependentVecSize))
-
- # In all cases, break out of the switch if any valid
- # value is found.
- switchCode.append(" break;")
-
-
- # Need a default case to catch all the other, invalid
- # parameter values. These will all generate errors.
- switchCode.append(" default:")
- if errorCode == None:
- errorCode = "GL_INVALID_ENUM"
- formatString = GetFormatString(paramType)
- if formatString == None:
- switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s)");' % (errorCode, funcName, paramName))
- else:
- switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=%s)", %s);' % (errorCode, funcName, paramName, formatString, paramName))
- switchCode.append(" %s;" % errorReturn)
-
- # End of our switch code.
- switchCode.append(" }")
-
- # endfor every recognized parameter value
-
- # endfor every param
-
- if conversionCodeOutgoing != [] or conversionCodeIncoming != []:
- continue
-
- # Here, the passthroughDeclarationString and passthroughCallString
- # are complete; remove the extra ", " at the front of each.
- passthroughDeclarationString = passthroughDeclarationString[2:]
- passthroughCallString = passthroughCallString[2:]
- if not passthroughDeclarationString:
- passthroughDeclarationString = "void"
-
- # The Mesa functions are scattered across all the Mesa
- # header files. The easiest way to manage declarations
- # is to create them ourselves.
- if funcName in allSpecials:
- print "/* this function is special and is defined elsewhere */"
- print "extern %s GL_APIENTRY %s(%s);" % (returnType, passthroughFuncName, passthroughDeclarationString)
-
- # A function may be a core function (i.e. it exists in
- # the core specification), a core addition (extension
- # functions added officially to the core), a required
- # extension (usually an extension for an earlier version
- # that has been officially adopted), or an optional extension.
- #
- # Core functions have a simple category (e.g. "GLES1.1");
- # we generate only a simple callback for them.
- #
- # Core additions have two category listings, one simple
- # and one compound (e.g. ["GLES1.1", "GLES1.1:OES_fixed_point"]).
- # We generate the core function, and also an extension function.
- #
- # Required extensions and implemented optional extensions
- # have a single compound category "GLES1.1:OES_point_size_array".
- # For these we generate just the extension function.
- for categorySpec in apiutil.Categories(funcName):
- compoundCategory = categorySpec.split(":")
-
- # This category isn't for us, if the base category doesn't match
- # our version
- if compoundCategory[0] != version:
- continue
-
- # Otherwise, determine if we're writing code for a core
- # function (no suffix) or an extension function.
- if len(compoundCategory) == 1:
- # This is a core function
- extensionName = None
- extensionSuffix = ""
- else:
- # This is an extension function. We'll need to append
- # the extension suffix.
- extensionName = compoundCategory[1]
- extensionSuffix = extensionName.split("_")[0]
- fullFuncName = funcPrefix + funcName + extensionSuffix
-
- # Now the generated function. The text used to mark an API-level
- # function, oddly, is version-specific.
- if extensionName:
- print "/* Extension %s */" % extensionName
-
- if (not variables and
- not switchCode and
- not conversionCodeOutgoing and
- not conversionCodeIncoming):
- # pass through directly
- print "#define %s %s" % (fullFuncName, passthroughFuncName)
- print
- continue
-
- print "static %s GL_APIENTRY %s(%s)" % (returnType, fullFuncName, declarationString)
- print "{"
-
- # Start printing our code pieces. Start with any local
- # variables we need. This unusual syntax joins the
- # lines in the variables[] array with the "\n" separator.
- if len(variables) > 0:
- print "\n".join(variables) + "\n"
-
- # If there's any sort of parameter checking or variable
- # array sizing, the switch code will contain it.
- if len(switchCode) > 0:
- print "\n".join(switchCode) + "\n"
-
- # In the case of an outgoing conversion (i.e. parameters must
- # be converted before calling the underlying Mesa function),
- # use the appropriate code.
- if "get" not in props and len(conversionCodeOutgoing) > 0:
- print "\n".join(conversionCodeOutgoing) + "\n"
-
- # Call the Mesa function. Note that there are very few functions
- # that return a value (i.e. returnType is not "void"), and that
- # none of them require incoming translation; so we're safe
- # to generate code that directly returns in those cases,
- # even though it's not completely independent.
-
- if returnType == "void":
- print " %s(%s);" % (passthroughFuncName, passthroughCallString)
- else:
- print " return %s(%s);" % (passthroughFuncName, passthroughCallString)
-
- # If the function is one that returns values (i.e. "get" in props),
- # it might return values of a different type than we need, that
- # require conversion before passing back to the application.
- if "get" in props and len(conversionCodeIncoming) > 0:
- print "\n".join(conversionCodeIncoming)
-
- # All done.
- print "}"
- print
- # end for each category provided for a function
-
-# end for each function
-
-print """
-#include "glapi/glapi.h"
-
-#if FEATURE_remap_table
-
-/* define esLocalRemapTable */
-#include "main/api_exec_%s_dispatch.h"
-
-#define need_MESA_remap_table
-#include "main/api_exec_%s_remap_helper.h"
-
-static void
-init_remap_table(void)
-{
- _glthread_DECLARE_STATIC_MUTEX(mutex);
- static GLboolean initialized = GL_FALSE;
- const struct gl_function_pool_remap *remap = MESA_remap_table_functions;
- int i;
-
- _glthread_LOCK_MUTEX(mutex);
- if (initialized) {
- _glthread_UNLOCK_MUTEX(mutex);
- return;
- }
-
- for (i = 0; i < esLocalRemapTable_size; i++) {
- GLint offset;
- const char *spec;
-
- /* sanity check */
- ASSERT(i == remap[i].remap_index);
- spec = _mesa_function_pool + remap[i].pool_index;
-
- offset = _mesa_map_function_spec(spec);
- esLocalRemapTable[i] = offset;
- }
- initialized = GL_TRUE;
- _glthread_UNLOCK_MUTEX(mutex);
-}
-
-#else /* FEATURE_remap_table */
-
-#include "%sapi/main/dispatch.h"
-
-static INLINE void
-init_remap_table(void)
-{
-}
-
-#endif /* FEATURE_remap_table */
-
-struct _glapi_table *
-_mesa_create_exec_table_%s(void)
-{
- struct _glapi_table *exec;
-
- exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
- if (exec == NULL)
- return NULL;
-
- init_remap_table();
-""" % (shortname, shortname, shortname, shortname)
-
-for func in keys:
- prefix = "_es_" if func not in allSpecials else "_check_"
- for spec in apiutil.Categories(func):
- ext = spec.split(":")
- # version does not match
- if ext.pop(0) != version:
- continue
- entry = func
- if ext:
- suffix = ext[0].split("_")[0]
- entry += suffix
- print " SET_%s(exec, %s%s);" % (entry, prefix, entry)
-print ""
-print " return exec;"
-print "}"
-
-print """
-#endif /* FEATURE_%s */""" % (shortname.upper())
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 9cde52ae6..fc5681ccc 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -3055,27 +3055,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
}
-void GLAPIENTRY
-_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTextureARB "
- "not implemented!");
-}
-
-
-void GLAPIENTRY
-_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLenum face)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTextureFaceARB "
- "not implemented!");
-}
-
static void
invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments,
const GLenum *attachments, GLint x, GLint y,
diff --git a/mesalib/src/mesa/main/fbobject.h b/mesalib/src/mesa/main/fbobject.h
index 9cded3cfa..44d92d421 100644
--- a/mesalib/src/mesa/main/fbobject.h
+++ b/mesalib/src/mesa/main/fbobject.h
@@ -206,15 +206,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLbitfield mask, GLenum filter);
extern void GLAPIENTRY
-_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLenum face);
-
-
-extern void GLAPIENTRY
_mesa_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments,
const GLenum *attachments, GLint x, GLint y,
GLsizei width, GLsizei height);
diff --git a/mesalib/src/mesa/main/querymatrix.c b/mesalib/src/mesa/main/querymatrix.c
index 2843d5589..63d1d8e26 100644
--- a/mesalib/src/mesa/main/querymatrix.c
+++ b/mesalib/src/mesa/main/querymatrix.c
@@ -14,8 +14,9 @@
#include <stdlib.h>
#include <math.h>
-#include "GLES/gl.h"
-#include "GLES/glext.h"
+#include "glheader.h"
+#include "querymatrix.h"
+#include "main/get.h"
/**
@@ -88,13 +89,7 @@ fpclassify(double x)
#endif
-extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
-
-/* The Mesa functions we'll need */
-extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params);
-extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params);
-
-GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
+GLbitfield GLAPIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16])
{
GLfloat matrix[16];
GLint tmp;
diff --git a/mesalib/src/mesa/main/querymatrix.h b/mesalib/src/mesa/main/querymatrix.h
new file mode 100644
index 000000000..37a22e961
--- /dev/null
+++ b/mesalib/src/mesa/main/querymatrix.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * 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 (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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef QUERYMATRIX_H
+#define QUERYMATRIX_H
+
+
+#include "mfeatures.h"
+#include "mtypes.h"
+
+
+/*
+ * API functions
+ */
+
+extern GLbitfield GLAPIENTRY
+_es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
+
+#endif
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index 9c38dd1bc..8bfd964ea 100644
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/src/mesa/main/queryobj.c
@@ -321,13 +321,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
q = _mesa_lookup_query_object(ctx, id);
if (!q) {
- /* create new object */
- q = ctx->Driver.NewQueryObject(ctx, id);
- if (!q) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
+ if (ctx->API == API_OPENGL_CORE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(non-gen name)");
return;
+ } else {
+ /* create new object */
+ q = ctx->Driver.NewQueryObject(ctx, id);
+ if (!q) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
+ return;
+ }
+ _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
}
- _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
}
else {
/* pre-existing object */
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index d40a35376..9376b0f42 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -1692,7 +1692,7 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx,
{
#if FEATURE_GL
/* GL_ARB_vertex/fragment_shader */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB);
SET_GetHandleARB(exec, _mesa_GetHandleARB);
SET_DetachObjectARB(exec, _mesa_DetachObjectARB);
@@ -1705,56 +1705,58 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx,
SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB);
}
- SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
- SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
- SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
- SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
- SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
- SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
-
- /* OpenGL 2.0 */
- SET_AttachShader(exec, _mesa_AttachShader);
- SET_CreateProgram(exec, _mesa_CreateProgram);
- SET_CreateShader(exec, _mesa_CreateShader);
- SET_DeleteProgram(exec, _mesa_DeleteProgram);
- SET_DeleteShader(exec, _mesa_DeleteShader);
- SET_DetachShader(exec, _mesa_DetachShader);
- SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
- SET_GetProgramiv(exec, _mesa_GetProgramiv);
- SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
- SET_GetShaderiv(exec, _mesa_GetShaderiv);
- SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
- SET_IsProgram(exec, _mesa_IsProgram);
- SET_IsShader(exec, _mesa_IsShader);
-
- /* GL_ARB_vertex_shader */
- SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
- SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
- SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
-
- if (ctx->API != API_OPENGLES2) {
- SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-
+ if (ctx->API != API_OPENGLES) {
+ SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
+ SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
+ SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
+ SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
+ SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
+ SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
+
+ /* OpenGL 2.0 */
+ SET_AttachShader(exec, _mesa_AttachShader);
+ SET_CreateProgram(exec, _mesa_CreateProgram);
+ SET_CreateShader(exec, _mesa_CreateShader);
+ SET_DeleteProgram(exec, _mesa_DeleteProgram);
+ SET_DeleteShader(exec, _mesa_DeleteShader);
+ SET_DetachShader(exec, _mesa_DetachShader);
+ SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
+ SET_GetProgramiv(exec, _mesa_GetProgramiv);
+ SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
+ SET_GetShaderiv(exec, _mesa_GetShaderiv);
+ SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
+ SET_IsProgram(exec, _mesa_IsProgram);
+ SET_IsShader(exec, _mesa_IsShader);
+
+ /* GL_ARB_vertex_shader */
+ SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
+ SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
+ SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
}
/* GL_EXT_gpu_shader4 / GL 3.0 */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation);
}
/* GL_ARB_ES2_compatibility */
- SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
- SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
- SET_ShaderBinary(exec, _mesa_ShaderBinary);
+ if (ctx->API != API_OPENGLES) {
+ SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
+ SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
+ SET_ShaderBinary(exec, _mesa_ShaderBinary);
+ }
/* GL_ARB_blend_func_extended */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BindFragDataLocationIndexed(exec, _mesa_BindFragDataLocationIndexed);
SET_GetFragDataIndex(exec, _mesa_GetFragDataIndex);
}
diff --git a/mesalib/src/mesa/main/texgen.c b/mesalib/src/mesa/main/texgen.c
index 0b0f67335..c5a878644 100644
--- a/mesalib/src/mesa/main/texgen.c
+++ b/mesalib/src/mesa/main/texgen.c
@@ -426,15 +426,17 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )
void
-_mesa_init_texgen_dispatch(struct _glapi_table *disp)
+_mesa_init_texgen_dispatch(struct gl_context *ctx, struct _glapi_table *disp)
{
- SET_GetTexGendv(disp, _mesa_GetTexGendv);
SET_GetTexGenfv(disp, _mesa_GetTexGenfv);
SET_GetTexGeniv(disp, _mesa_GetTexGeniv);
- SET_TexGend(disp, _mesa_TexGend);
- SET_TexGendv(disp, _mesa_TexGendv);
SET_TexGenf(disp, _mesa_TexGenf);
SET_TexGenfv(disp, _mesa_TexGenfv);
SET_TexGeni(disp, _mesa_TexGeni);
SET_TexGeniv(disp, _mesa_TexGeniv);
+ if (ctx->API == API_OPENGL) {
+ SET_GetTexGendv(disp, _mesa_GetTexGendv);
+ SET_TexGend(disp, _mesa_TexGend);
+ SET_TexGendv(disp, _mesa_TexGendv);
+ }
}
diff --git a/mesalib/src/mesa/main/texgen.h b/mesalib/src/mesa/main/texgen.h
index 35a799587..03dd49c61 100644
--- a/mesalib/src/mesa/main/texgen.h
+++ b/mesalib/src/mesa/main/texgen.h
@@ -50,7 +50,7 @@ extern void GLAPIENTRY
_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params );
extern void
-_mesa_init_texgen_dispatch(struct _glapi_table *disp);
+_mesa_init_texgen_dispatch(struct gl_context *ctx, struct _glapi_table *disp);
extern void GLAPIENTRY
diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c
index 224d8a825..8525ff9fd 100644
--- a/mesalib/src/mesa/main/texobj.c
+++ b/mesalib/src/mesa/main/texobj.c
@@ -1220,7 +1220,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
}
else {
if (ctx->API == API_OPENGL_CORE) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindTexture");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindTexture(non-gen name)");
return;
}
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index d89255aaa..861601efd 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -808,33 +808,35 @@ _mesa_init_shader_uniform_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec)
{
#if FEATURE_GL
- SET_Uniform1fARB(exec, _mesa_Uniform1fARB);
- SET_Uniform2fARB(exec, _mesa_Uniform2fARB);
- SET_Uniform3fARB(exec, _mesa_Uniform3fARB);
- SET_Uniform4fARB(exec, _mesa_Uniform4fARB);
- SET_Uniform1iARB(exec, _mesa_Uniform1iARB);
- SET_Uniform2iARB(exec, _mesa_Uniform2iARB);
- SET_Uniform3iARB(exec, _mesa_Uniform3iARB);
- SET_Uniform4iARB(exec, _mesa_Uniform4iARB);
- SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB);
- SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB);
- SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB);
- SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB);
- SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB);
- SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB);
- SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB);
- SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB);
- SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB);
- SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB);
- SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB);
-
- SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB);
- SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB);
- SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB);
- SET_GetUniformivARB(exec, _mesa_GetUniformivARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_Uniform1fARB(exec, _mesa_Uniform1fARB);
+ SET_Uniform2fARB(exec, _mesa_Uniform2fARB);
+ SET_Uniform3fARB(exec, _mesa_Uniform3fARB);
+ SET_Uniform4fARB(exec, _mesa_Uniform4fARB);
+ SET_Uniform1iARB(exec, _mesa_Uniform1iARB);
+ SET_Uniform2iARB(exec, _mesa_Uniform2iARB);
+ SET_Uniform3iARB(exec, _mesa_Uniform3iARB);
+ SET_Uniform4iARB(exec, _mesa_Uniform4iARB);
+ SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB);
+ SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB);
+ SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB);
+ SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB);
+ SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB);
+ SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB);
+ SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB);
+ SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB);
+ SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB);
+ SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB);
+ SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB);
+
+ SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB);
+ SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB);
+ SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB);
+ SET_GetUniformivARB(exec, _mesa_GetUniformivARB);
+ }
/* OpenGL 2.1 */
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv);
SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv);
SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv);
diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c
index 462cc8849..5891a5231 100644
--- a/mesalib/src/mesa/main/vtxfmt.c
+++ b/mesalib/src/mesa/main/vtxfmt.c
@@ -47,10 +47,13 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
const GLvertexformat *vfmt)
{
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ SET_Color4f(tab, vfmt->Color4f);
+ }
+
+ if (ctx->API == API_OPENGL) {
_mesa_install_arrayelt_vtxfmt(tab, vfmt);
SET_Color3f(tab, vfmt->Color3f);
SET_Color3fv(tab, vfmt->Color3fv);
- SET_Color4f(tab, vfmt->Color4f);
SET_Color4fv(tab, vfmt->Color4fv);
SET_EdgeFlag(tab, vfmt->EdgeFlag);
}
@@ -60,21 +63,27 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
}
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ SET_Materialfv(tab, vfmt->Materialfv);
+ SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB);
+ SET_Normal3f(tab, vfmt->Normal3f);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT);
SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT);
SET_Indexf(tab, vfmt->Indexf);
SET_Indexfv(tab, vfmt->Indexfv);
- SET_Materialfv(tab, vfmt->Materialfv);
SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB);
SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB);
SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB);
SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB);
SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB);
SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB);
- SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB);
SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB);
- SET_Normal3f(tab, vfmt->Normal3f);
SET_Normal3fv(tab, vfmt->Normal3fv);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT);
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT);
SET_TexCoord1f(tab, vfmt->TexCoord1f);
@@ -105,13 +114,13 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_DrawArrays(tab, vfmt->DrawArrays);
SET_DrawElements(tab, vfmt->DrawElements);
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
}
SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex);
SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex);
@@ -121,12 +130,12 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced);
SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback);
SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream);
SET_DrawTransformFeedbackInstanced(tab,
@@ -147,17 +156,19 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV);
}
- SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
- SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
- SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
- SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB);
- SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB);
- SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
- SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
- SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
+ SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
+ SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
+ SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB);
+ SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB);
+ SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
+ SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
+ SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
+ }
/* GL_EXT_gpu_shader4 / OpenGL 3.0 */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i);
SET_VertexAttribI2iEXT(tab, vfmt->VertexAttribI2i);
SET_VertexAttribI3iEXT(tab, vfmt->VertexAttribI3i);
@@ -171,14 +182,14 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttribI3uivEXT(tab, vfmt->VertexAttribI3uiv);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_VertexAttribI4iEXT(tab, vfmt->VertexAttribI4i);
SET_VertexAttribI4ivEXT(tab, vfmt->VertexAttribI4iv);
SET_VertexAttribI4uiEXT(tab, vfmt->VertexAttribI4ui);
SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv);
}
- if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ if (ctx->API == API_OPENGL) {
/* GL_ARB_vertex_type_10_10_10_2_rev / GL 3.3 */
SET_VertexP2ui(tab, vfmt->VertexP2ui);
SET_VertexP2uiv(tab, vfmt->VertexP2uiv);
@@ -217,7 +228,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_SecondaryColorP3uiv(tab, vfmt->SecondaryColorP3uiv);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_VertexAttribP1ui(tab, vfmt->VertexAttribP1ui);
SET_VertexAttribP2ui(tab, vfmt->VertexAttribP2ui);
SET_VertexAttribP3ui(tab, vfmt->VertexAttribP3ui);
diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
index b14ec13ed..b4b58db6d 100644
--- a/mesalib/src/mesa/sources.mak
+++ b/mesalib/src/mesa/sources.mak
@@ -5,7 +5,6 @@
# this is part of MAIN_FILES
MAIN_ES_FILES = \
- $(BUILDDIR)main/api_exec_es1.c \
$(SRCDIR)main/es1_conversion.c
MAIN_FILES = \
diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c
index 741dd876c..7bfe3b941 100644
--- a/mesalib/src/mesa/swrast/s_texfetch.c
+++ b/mesalib/src/mesa/swrast/s_texfetch.c
@@ -115,7 +115,7 @@ static struct {
FetchTexelFunc Fetch2D;
FetchTexelFunc Fetch3D;
}
-texfetch_funcs[MESA_FORMAT_COUNT] =
+texfetch_funcs[] =
{
{
MESA_FORMAT_NONE,