summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/common/driverfuncs.c4
-rw-r--r--src/mesa/glapi/Makefile25
-rw-r--r--src/mesa/glapi/dispatch.h9
-rw-r--r--src/mesa/glapi/glX_proto_common.py4
-rw-r--r--src/mesa/glapi/glX_proto_recv.py561
-rw-r--r--src/mesa/glapi/glX_proto_send.py2
-rw-r--r--src/mesa/glapi/gl_API.xml23
-rw-r--r--src/mesa/glapi/gl_enums.py4
-rw-r--r--src/mesa/glapi/gl_procs.py2
-rw-r--r--src/mesa/glapi/glapioffsets.h4
-rw-r--r--src/mesa/glapi/glapitable.h1
-rw-r--r--src/mesa/glapi/glapitemp.h6
-rw-r--r--src/mesa/glapi/glprocs.h358
-rw-r--r--src/mesa/glapi/mesadef.py3
-rw-r--r--src/mesa/glapi/typeexpr.py42
-rw-r--r--src/mesa/main/accum.c4
-rw-r--r--src/mesa/main/api_arrayelt.c54
-rw-r--r--src/mesa/main/attrib.c8
-rw-r--r--src/mesa/main/context.c71
-rw-r--r--src/mesa/main/dlist.c5367
-rw-r--r--src/mesa/main/dlist.h21
-rw-r--r--src/mesa/main/enable.c46
-rw-r--r--src/mesa/main/enums.c4079
-rw-r--r--src/mesa/main/execmem.c3
-rw-r--r--src/mesa/main/extensions.c18
-rw-r--r--src/mesa/main/fbobject.c19
-rw-r--r--src/mesa/main/fog.c35
-rw-r--r--src/mesa/main/glheader.h5
-rw-r--r--src/mesa/main/imports.c47
-rw-r--r--src/mesa/main/imports.h39
-rw-r--r--src/mesa/main/light.c19
-rw-r--r--src/mesa/main/mtypes.h28
-rw-r--r--src/mesa/main/renderbuffer.c4
-rw-r--r--src/mesa/main/state.c8
-rw-r--r--src/mesa/main/texenvprogram.c9
-rw-r--r--src/mesa/main/texrender.c2
-rw-r--r--src/mesa/main/texstate.c21
-rw-r--r--src/mesa/main/texstore.c42
-rw-r--r--src/mesa/shader/arbprogparse.c3
-rw-r--r--src/mesa/shader/nvfragparse.c1
-rw-r--r--src/mesa/shader/nvvertparse.c6
-rw-r--r--src/mesa/shader/program.c19
-rw-r--r--src/mesa/shader/shaderobjects.c1321
-rw-r--r--src/mesa/shader/shaderobjects.h11
-rwxr-xr-xsrc/mesa/shader/shaderobjects_3dlabs.c656
-rwxr-xr-xsrc/mesa/shader/shaderobjects_3dlabs.h24
-rw-r--r--src/mesa/shader/slang/descrip.mms19
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_common_builtin.gc2223
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin_gc.h1324
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_core.gc1164
-rw-r--r--src/mesa/shader/slang/library/slang_core_gc.h1037
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_fragment_builtin.gc422
-rw-r--r--src/mesa/shader/slang/library/slang_fragment_builtin_gc.h146
-rw-r--r--src/mesa/shader/slang/library/slang_shader.syn95
-rw-r--r--src/mesa/shader/slang/library/slang_shader_syn.h52
-rwxr-xr-xsrc/mesa/shader/slang/library/slang_vertex_builtin.gc292
-rw-r--r--src/mesa/shader/slang/library/slang_vertex_builtin_gc.h144
-rw-r--r--src/mesa/shader/slang/slang_analyse.c100
-rw-r--r--src/mesa/shader/slang/slang_analyse.h50
-rw-r--r--src/mesa/shader/slang/slang_assemble.c1624
-rw-r--r--src/mesa/shader/slang/slang_assemble.h138
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.c183
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.h13
-rw-r--r--src/mesa/shader/slang/slang_assemble_conditional.c581
-rw-r--r--src/mesa/shader/slang/slang_assemble_conditional.h34
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.c338
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.h58
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.c537
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.h89
-rw-r--r--src/mesa/shader/slang/slang_compile.c2067
-rw-r--r--src/mesa/shader/slang/slang_compile.h239
-rw-r--r--src/mesa/shader/slang/slang_compile_function.c190
-rw-r--r--src/mesa/shader/slang/slang_compile_function.h84
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c102
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.h117
-rw-r--r--src/mesa/shader/slang/slang_compile_struct.c178
-rw-r--r--src/mesa/shader/slang/slang_compile_struct.h61
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.c369
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.h93
-rw-r--r--src/mesa/shader/slang/slang_execute.c364
-rw-r--r--src/mesa/shader/slang/slang_execute.h31
-rw-r--r--src/mesa/shader/slang/slang_execute_x86.c546
-rw-r--r--src/mesa/shader/slang/slang_export.c341
-rw-r--r--src/mesa/shader/slang/slang_export.h141
-rw-r--r--src/mesa/shader/slang/slang_library_noise.c501
-rw-r--r--src/mesa/shader/slang/slang_library_noise.h42
-rw-r--r--src/mesa/shader/slang/slang_library_texsample.c142
-rw-r--r--src/mesa/shader/slang/slang_library_texsample.h44
-rw-r--r--src/mesa/shader/slang/slang_link.c437
-rw-r--r--src/mesa/shader/slang/slang_link.h195
-rw-r--r--src/mesa/shader/slang/slang_preprocess.c5
-rw-r--r--src/mesa/shader/slang/slang_preprocess.h6
-rw-r--r--src/mesa/shader/slang/slang_storage.c202
-rw-r--r--src/mesa/shader/slang/slang_storage.h106
-rw-r--r--src/mesa/shader/slang/slang_utility.c87
-rw-r--r--src/mesa/shader/slang/slang_utility.h43
-rw-r--r--src/mesa/sources15
-rw-r--r--src/mesa/swrast/descrip.mms18
-rw-r--r--src/mesa/swrast/s_arbshader.c99
-rw-r--r--src/mesa/swrast/s_arbshader.h34
-rw-r--r--src/mesa/swrast/s_atifragshader.c5
-rw-r--r--src/mesa/swrast/s_blit.c790
-rw-r--r--src/mesa/swrast/s_context.c16
-rw-r--r--src/mesa/swrast/s_context.h27
-rw-r--r--src/mesa/swrast/s_span.c31
-rw-r--r--src/mesa/swrast/s_texstore.c3
-rw-r--r--src/mesa/swrast/swrast.h6
-rw-r--r--src/mesa/tnl/descrip.mms11
-rw-r--r--src/mesa/tnl/t_pipeline.c7
-rw-r--r--src/mesa/tnl/t_pipeline.h5
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c40
-rw-r--r--src/mesa/tnl/t_vb_arbprogram_sse.c56
-rw-r--r--src/mesa/tnl/t_vb_arbshader.c262
-rw-r--r--src/mesa/tnl/t_vb_cull.c7
-rw-r--r--src/mesa/tnl/t_vb_fog.c5
-rw-r--r--src/mesa/tnl/t_vb_light.c10
-rw-r--r--src/mesa/tnl/t_vb_normals.c9
-rw-r--r--src/mesa/tnl/t_vb_points.c5
-rw-r--r--src/mesa/tnl/t_vb_program.c7
-rw-r--r--src/mesa/tnl/t_vb_texgen.c10
-rw-r--r--src/mesa/tnl/t_vb_texmat.c7
-rw-r--r--src/mesa/tnl/t_vb_vertex.c7
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S53
-rw-r--r--src/mesa/x86/glapi_x86.S1
-rw-r--r--src/mesa/x86/rtasm/x86sse.c83
-rw-r--r--src/mesa/x86/rtasm/x86sse.h32
126 files changed, 19664 insertions, 12431 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index c554be0743..9838e0b5ec 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -211,6 +211,10 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
#endif
+#if FEATURE_EXT_framebuffer_blit
+ driver->BlitFramebuffer = _swrast_BlitFramebuffer;
+#endif
+
/* query objects */
driver->NewQueryObject = _mesa_new_query_object;
driver->BeginQuery = NULL;
diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile
index fb5a228851..129e51fb1f 100644
--- a/src/mesa/glapi/Makefile
+++ b/src/mesa/glapi/Makefile
@@ -18,11 +18,21 @@ OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \
../../glx/x11/indirect_size.h \
../../glx/x11/indirect_size.c
+
+#XORG_BASE = /home/idr/devel/graphics/Xorg/xserver/xorg
+GLX_DIR = $(XORG_BASE)/GL/glx
+
+SERVER_OUTPUTS = $(GLX_DIR)/indirect_dispatch.c \
+ $(GLX_DIR)/indirect_dispatch_swap.c \
+ $(GLX_DIR)/indirect_dispatch.h
+
COMMON = gl_XML.py license.py gl_API.xml typeexpr.py
COMMON_GLX = $(COMMON) glX_XML.py glX_proto_common.py
all: $(OUTPUTS)
+server: $(SERVER_OUTPUTS)
+
glprocs.h: $(COMMON) gl_procs.py
$(PYTHON2) $(PYTHON_FLAGS) gl_procs.py > glprocs.h
@@ -65,6 +75,21 @@ dispatch.h: $(COMMON) gl_table.py
../../glx/x11/indirect_size.c: $(COMMON_GLX) glX_proto_size.py
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c --only-set > ../../glx/x11/indirect_size.c
+$(GLX_DIR)/indirect_dispatch.c: $(COMMON_GLX) glX_proto_recv.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_c > $@
+
+$(GLX_DIR)/indirect_dispatch_swap.c: $(COMMON_GLX) glX_proto_recv.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_c -s > $@
+
+$(GLX_DIR)/indirect_dispatch.h: $(COMMON_GLX) glX_proto_recv.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_recv.py -m dispatch_h -s > $@
+
+$(GLX_DIR)/indirect_size_get.h: $(COMMON_GLX) glX_proto_size.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' > $@
+
+$(GLX_DIR)/indirect_size_get.c: $(COMMON_GLX) glX_proto_size.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c > $@
+
clean:
rm -f *~ *.pyo
rm -f $(OUTPUTS)
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index b2b06a837e..d1d21beb45 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -2512,10 +2512,13 @@
#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters
#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT)
#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn)
+#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters
+#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT)
+#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn)
#else
-#define driDispatchRemapTable_size 410
+#define driDispatchRemapTable_size 411
extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define LoadTransposeMatrixfARB_remap_index 0
@@ -2928,6 +2931,7 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define StencilMaskSeparate_remap_index 407
#define GetQueryObjecti64vEXT_remap_index 408
#define GetQueryObjectui64vEXT_remap_index 409
+#define BlitFramebufferEXT_remap_index 410
#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters)
#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index])
@@ -4159,6 +4163,9 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters)
#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index])
#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn)
+#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters)
+#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index])
+#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn)
#endif /* !defined(IN_DRI_DRIVER) */
diff --git a/src/mesa/glapi/glX_proto_common.py b/src/mesa/glapi/glX_proto_common.py
index 7448963571..6f094e22b3 100644
--- a/src/mesa/glapi/glX_proto_common.py
+++ b/src/mesa/glapi/glX_proto_common.py
@@ -48,7 +48,7 @@ class glx_proto_type(gl_XML.gl_type):
class glx_print_proto(gl_XML.gl_print_base):
- def size_call(self, func):
+ def size_call(self, func, outputs_also = 0):
"""Create C code to calculate 'compsize'.
Creates code to calculate 'compsize'. If the function does
@@ -58,7 +58,7 @@ class glx_print_proto(gl_XML.gl_print_base):
compsize = None
for param in func.parameterIterator():
- if not param.is_output:
+ if outputs_also or not param.is_output:
if param.is_image():
[dim, w, h, d, junk] = param.get_dimensions()
diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py
new file mode 100644
index 0000000000..a0c4ea0541
--- /dev/null
+++ b/src/mesa/glapi/glX_proto_recv.py
@@ -0,0 +1,561 @@
+#!/usr/bin/env python
+
+# (C) Copyright IBM Corporation 2005
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# Authors:
+# Ian Romanick <idr@us.ibm.com>
+
+import gl_XML, glX_XML, glX_proto_common, license
+import sys, getopt, string
+
+
+class PrintGlxDispatch_h(gl_XML.gl_print_base):
+ def __init__(self):
+ gl_XML.gl_print_base.__init__(self)
+
+ self.name = "glX_proto_recv.py (from Mesa)"
+ self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
+
+ self.header_tag = "_INDIRECT_DISPATCH_H_"
+ return
+
+
+ def printRealHeader(self):
+ self.printVisibility( "HIDDEN", "hidden" )
+ print 'struct __GLXclientStateRec;'
+ print ''
+ return
+
+
+ def printBody(self, api):
+ for func in api.functionIterateAll():
+ if not func.ignore and not func.vectorequiv:
+ if func.glx_rop != 0:
+ print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name)
+ print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
+ elif func.glx_sop != 0 or func.glx_vendorpriv != 0:
+ print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
+ print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
+
+ return
+
+
+class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
+ def __init__(self, do_swap):
+ gl_XML.gl_print_base.__init__(self)
+ self.name = "glX_proto_recv.py (from Mesa)"
+ self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM")
+
+ self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ]
+ self.do_swap = do_swap
+ return
+
+
+ def printRealHeader(self):
+ print '#include <X11/Xmd.h>'
+ print '#include <GL/gl.h>'
+ print '#include <GL/glxproto.h>'
+
+
+ # FIXME: Since this block will require changes as other
+ # FIXME: platforms are added, it should probably be in a
+ # FIXME: header file that is not generated by a script.
+
+ if self.do_swap:
+ print '#ifdef __linux__'
+ print '#include <byteswap.h>'
+ print '#elif defined(__OpenBSD__)'
+ print '#include <sys/endian.h>'
+ print '#define bswap_16 __swap16'
+ print '#define bswap_32 __swap32'
+ print '#define bswap_64 __swap64'
+ print '#else'
+ print '#include <sys/endian.h>'
+ print '#define bswap_16 bswap16'
+ print '#define bswap_32 bswap32'
+ print '#define bswap_64 bswap64'
+ print '#endif'
+
+ print '#include <inttypes.h>'
+ print '#include "indirect_size.h"'
+ print '#include "indirect_size_get.h"'
+ print '#include "indirect_dispatch.h"'
+ print '#include "glxserver.h"'
+ print '#include "indirect_util.h"'
+ print '#include "singlesize.h"'
+ print '#include "glapitable.h"'
+ print '#include "glapi.h"'
+ print '#include "glthread.h"'
+ print '#include "dispatch.h"'
+ print ''
+ print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
+ print ''
+ print 'typedef struct {'
+ print ' __GLX_PIXEL_3D_HDR;'
+ print '} __GLXpixel3DHeader;'
+ print ''
+ print 'extern GLboolean __glXErrorOccured( void );'
+ print 'extern void __glXClearErrorOccured( void );'
+ print ''
+ print 'static const unsigned dummy_answer[2] = {0, 0};'
+ print ''
+ return
+
+
+ def printBody(self, api):
+ if self.do_swap:
+ self.emit_swap_wrappers(api)
+
+
+ for func in api.functionIterateByOffset():
+ if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv):
+ self.printFunction(func)
+
+ return
+
+
+ def printFunction(self, f):
+ if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0):
+ return
+
+ if not self.do_swap:
+ base = '__glXDisp'
+ else:
+ base = '__glXDispSwap'
+
+ if f.glx_rop:
+ print 'void %s_%s(GLbyte * pc)' % (base, f.name)
+ else:
+ print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, f.name)
+
+ print '{'
+
+ if f.glx_rop or f.vectorequiv:
+ self.printRenderFunction(f)
+ elif f.glx_sop or f.glx_vendorpriv:
+ if len(f.get_images()) == 0:
+ self.printSingleFunction(f)
+ else:
+ print "/* Missing GLX protocol for %s. */" % (f.name)
+
+ print '}'
+ print ''
+ return
+
+
+ def swap_name(self, bytes):
+ return 'bswap_%u_array' % (8 * bytes)
+
+
+ def emit_swap_wrappers(self, api):
+ self.type_map = {}
+ already_done = [ ]
+
+ for t in api.typeIterate():
+ te = t.get_type_expression()
+ t_size = te.get_element_size()
+
+ if t_size > 1 and t.glx_name:
+
+ t_name = "GL" + t.name
+ self.type_map[ t_name ] = t.glx_name
+
+ if t.glx_name not in already_done:
+ real_name = self.real_types[t_size]
+
+ print 'static %s' % (t_name)
+ print 'bswap_%s( const void * src )' % (t.glx_name)
+ print '{'
+ print ' union { %s dst; %s ret; } x;' % (real_name, t_name)
+ print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name)
+ print ' return x.ret;'
+ print '}'
+ print ''
+ already_done.append( t.glx_name )
+
+ for bits in [16, 32, 64]:
+ print 'static void *'
+ print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits)
+ print '{'
+ print ' unsigned i;'
+ print ''
+ print ' for ( i = 0 ; i < count ; i++ ) {'
+ print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits)
+ print ' src[i] = temp;'
+ print ' }'
+ print ''
+ print ' return src;'
+ print '}'
+ print ''
+
+
+ def fetch_param(self, param):
+ t = param.type_string()
+ o = param.offset
+ element_size = param.size() / param.get_element_count()
+
+ if self.do_swap and (element_size != 1):
+ if param.is_array():
+ real_name = self.real_types[ element_size ]
+
+ swap_func = self.swap_name( element_size )
+ return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count)
+ else:
+ t_name = param.get_base_type_string()
+ return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o)
+ else:
+ if param.is_array():
+ return ' (%-8s)(pc + %2u)' % (t, o)
+ else:
+ return '*(%-8s *)(pc + %2u)' % (t, o)
+
+ return None
+
+
+ def emit_function_call(self, f, retval_assign, indent):
+ list = []
+
+ for param in f.parameterIterator():
+
+ if param.is_counter or param.is_image() or param.is_output or len(param.count_parameter_list):
+ location = param.name
+ else:
+ location = self.fetch_param(param)
+
+ list.append( '%s %s' % (indent, location) )
+
+
+ if len( list ):
+ print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name)
+ print string.join( list, ",\n" )
+ print '%s ) );' % (indent)
+ else:
+ print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name)
+ return
+
+
+ def common_func_print_just_start(self, f, indent):
+ align64 = 0
+ need_blank = 0
+
+
+ f.calculate_offsets()
+ for param in f.parameterIterateGlxSend():
+ # If any parameter has a 64-bit base type, then we
+ # have to do alignment magic for the while thing.
+
+ if param.is_64_bit():
+ align64 = 1
+
+
+ # FIXME img_null_flag is over-loaded. In addition to
+ # FIXME being used for images, it is used to signify
+ # FIXME NULL data pointers for vertex buffer object
+ # FIXME related functions. Re-name it to null_data
+ # FIXME or something similar.
+
+ if param.img_null_flag:
+ print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4)
+ cond = '(ptr_is_null != 0) ? NULL : '
+ else:
+ cond = ""
+
+
+ type_string = param.type_string()
+
+ if param.is_image():
+ offset = f.offset_of( param.name )
+
+ print '%s %s const %s = (%s) %s(pc + %s);' % (indent, type_string, param.name, type_string, cond, offset)
+
+ if param.depth:
+ print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent)
+ else:
+ print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent)
+
+ need_blank = 1
+ elif param.is_counter or param.name in f.count_parameter_list:
+ location = self.fetch_param(param)
+ print '%s const %s %s = %s;' % (indent, type_string, param.name, location)
+ need_blank = 1
+ elif len(param.count_parameter_list):
+ if param.size() == 1 and not self.do_swap:
+ location = self.fetch_param(param)
+ print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location)
+ else:
+ print '%s %s %s;' % (indent, type_string, param.name)
+ need_blank = 1
+
+
+
+ if need_blank:
+ print ''
+
+ if align64:
+ print '#ifdef __GLX_ALIGN64'
+
+ if f.has_variable_size_request():
+ self.emit_packet_size_calculation(f, 4)
+ s = "cmdlen"
+ else:
+ s = str((f.command_fixed_length() + 3) & ~3)
+
+ print ' if ((unsigned long)(pc) & 7) {'
+ print ' (void) memmove(pc-4, pc, %s);' % (s)
+ print ' pc -= 4;'
+ print ' }'
+ print '#endif'
+ print ''
+
+
+ need_blank = 0
+ if self.do_swap:
+ for param in f.parameterIterateGlxSend():
+ if param.count_parameter_list:
+ o = param.offset
+ count = param.get_element_count()
+ type_size = param.size() / count
+
+ if param.counter:
+ count_name = param.counter
+ else:
+ count_name = str(count)
+
+ # This is basically an ugly special-
+ # case for glCallLists.
+
+ if type_size == 1:
+ x = []
+ x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] )
+ x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] )
+ x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] )
+
+ print ' switch(%s) {' % (param.count_parameter_list[0])
+ for sub in x:
+ for t_name in sub[1]:
+ print ' case GL_%s:' % (t_name)
+
+ if sub[0] == 1:
+ print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o)
+ else:
+ swap_func = self.swap_name(sub[0])
+ print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name)
+ print ' }'
+ else:
+ swap_func = self.swap_name(type_size)
+ compsize = self.size_call(f, 1)
+ print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize)
+
+ need_blank = 1
+
+ else:
+ for param in f.parameterIterateGlxSend():
+ if param.count_parameter_list:
+ print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset)
+ need_blank = 1
+
+
+ if need_blank:
+ print ''
+
+
+ return
+
+
+ def printSingleFunction(self, f):
+ if f.glx_sop:
+ print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;'
+ else:
+ print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;'
+
+ print ' int error;'
+
+ if self.do_swap:
+ print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);'
+ else:
+ print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);'
+
+ print ''
+ if f.glx_sop:
+ print ' pc += __GLX_SINGLE_HDR_SIZE;'
+ else:
+ print ' pc += __GLX_VENDPRIV_HDR_SIZE;'
+
+ print ' if ( cx != NULL ) {'
+ self.common_func_print_just_start(f, " ")
+
+
+ if f.return_type != 'void':
+ print ' %s retval;' % (f.return_type)
+ retval_string = "retval"
+ retval_assign = "retval = "
+ else:
+ retval_string = "0"
+ retval_assign = ""
+
+
+ type_size = 0
+ answer_string = "dummy_answer"
+ answer_count = "0"
+ is_array_string = "GL_FALSE"
+
+ for param in f.parameterIterateOutputs():
+ answer_type = param.get_base_type_string()
+ if answer_type == "GLvoid":
+ answer_type = "GLubyte"
+
+
+ c = param.get_element_count()
+ type_size = (param.size() / c)
+ if type_size == 1:
+ size_scale = ""
+ else:
+ size_scale = " * %u" % (type_size)
+
+
+ if param.count_parameter_list:
+ print ' const GLuint compsize = %s;' % (self.size_call(f, 1))
+ print ' %s answerBuffer[200];' % (answer_type)
+ print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size )
+ answer_string = param.name
+ answer_count = "compsize"
+
+ print ''
+ print ' if (%s == NULL) return BadAlloc;' % (param.name)
+ print ' __glXClearErrorOccured();'
+ print ''
+ elif param.counter:
+ print ' %s answerBuffer[200];' % (answer_type)
+ print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size)
+ answer_string = param.name
+ answer_count = param.counter
+ elif c >= 1:
+ print ' %s %s[%u];' % (answer_type, param.name, c)
+ answer_string = param.name
+ answer_count = "%u" % (c)
+
+ if f.reply_always_array:
+ is_array_string = "GL_TRUE"
+
+
+ self.emit_function_call(f, retval_assign, " ")
+
+
+ if f.needs_reply():
+ if self.do_swap:
+ for param in f.parameterIterateOutputs():
+ c = param.get_element_count()
+ type_size = (param.size() / c)
+
+ if type_size > 1:
+ swap_name = self.swap_name( type_size )
+ print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count)
+
+
+ reply_func = '__glXSendReplySwap'
+ else:
+ reply_func = '__glXSendReply'
+
+ print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string)
+ #elif f.note_unflushed:
+ # print ' cx->hasUnflushedCommands = GL_TRUE;'
+
+ print ' error = Success;'
+ print ' }'
+ print ''
+ print ' return error;'
+ return
+
+
+ def printRenderFunction(self, f):
+ # There are 4 distinct phases in a rendering dispatch function.
+ # In the first phase we compute the sizes and offsets of each
+ # element in the command. In the second phase we (optionally)
+ # re-align 64-bit data elements. In the third phase we
+ # (optionally) byte-swap array data. Finally, in the fourth
+ # phase we actually dispatch the function.
+
+ self.common_func_print_just_start(f, "")
+
+ images = f.get_images()
+ if len(images):
+ if self.do_swap:
+ pre = "bswap_CARD32( & "
+ post = " )"
+ else:
+ pre = ""
+ post = ""
+
+ img = images[0]
+
+ # swapBytes and lsbFirst are single byte fields, so
+ # the must NEVER be byte-swapped.
+
+ if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"):
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );'
+
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );'
+
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post)
+ if img.depth:
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post)
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post)
+ if img.depth:
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post)
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post)
+ print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post)
+ print ''
+
+
+ self.emit_function_call(f, "", "")
+ return
+
+
+if __name__ == '__main__':
+ file_name = "gl_API.xml"
+
+ try:
+ (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s")
+ except Exception,e:
+ show_usage()
+
+ mode = "dispatch_c"
+ do_swap = 0
+ for (arg,val) in args:
+ if arg == "-f":
+ file_name = val
+ elif arg == "-m":
+ mode = val
+ elif arg == "-s":
+ do_swap = 1
+
+ if mode == "dispatch_c":
+ printer = PrintGlxDispatchFunctions(do_swap)
+ elif mode == "dispatch_h":
+ printer = PrintGlxDispatch_h()
+ else:
+ show_usage()
+
+ api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() )
+
+ printer.Print( api )
diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py
index 53a9795918..3fa665dbce 100644
--- a/src/mesa/glapi/glX_proto_send.py
+++ b/src/mesa/glapi/glX_proto_send.py
@@ -879,7 +879,7 @@ __GLapi * __glXNewIndirectAPI( void )
if first:
print ''
if show_num:
- print ' /* % 3u. %s */' % (cat_num, cat_name)
+ print ' /* %3u. %s */' % (cat_num, cat_name)
else:
print ' /* %s */' % (cat_name)
print ''
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index e473f1d5a4..9fb99e381a 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -10447,8 +10447,8 @@
<function name="GenProgramsNV" offset="582">
<param name="n" type="GLsizei" counter="true"/>
<param name="programs" type="GLuint *" output="true" count="n"/>
- <glx vendorpriv="1295"/>
- </function>
+ <glx vendorpriv="1295" always_array="true"/>
+ </function>
<!-- This isn't 100% correct. Currently, the only valid value of pname
is GL_PROGRAM_PARAMETER_NV, and the count for that pname is always
@@ -11498,4 +11498,23 @@
</function>
</category>
+<category name="GL_EXT_framebuffer_blit" number="316">
+ <enum name="GL_READ_FRAMEBUFFER_EXT" value="0x8CA8"/>
+ <enum name="GL_DRAW_FRAMEBUFFER_EXT" value="0x8CA9"/>
+ <enum name="GL_DRAW_FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
+ <enum name="GL_READ_FRAMEBUFFER_BINDING_EXT" value="0x8CAA"/>
+ <function name="BlitFramebufferEXT" offset="818">
+ <param name="srcX0" type="GLint"/>
+ <param name="srcY0" type="GLint"/>
+ <param name="srcX1" type="GLint"/>
+ <param name="srcY1" type="GLint"/>
+ <param name="dstX0" type="GLint"/>
+ <param name="dstY0" type="GLint"/>
+ <param name="dstX1" type="GLint"/>
+ <param name="dstY1" type="GLint"/>
+ <param name="mask" type="GLbitfield"/>
+ <param name="filter" type="GLenum"/>
+ </function>
+</category>
+
</OpenGLAPI>
diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index 33d621dcd6..e8c0576fd9 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -161,7 +161,7 @@ int _mesa_lookup_enum_by_name( const char *symbol )
print 'static const enum_elt all_enums[%u] =' % (len(name_table))
print '{'
for [name, enum] in name_table:
- print ' { % 5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name)
+ print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name)
print '};'
print ''
@@ -174,7 +174,7 @@ int _mesa_lookup_enum_by_name( const char *symbol )
else:
i = name_table.index( [name, enum] )
- print ' % 4u, /* %s */' % (i, name)
+ print ' %4u, /* %s */' % (i, name)
print '};'
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py
index 1ad683de5c..76131b83a0 100644
--- a/src/mesa/glapi/gl_procs.py
+++ b/src/mesa/glapi/gl_procs.py
@@ -113,7 +113,7 @@ class PrintGlProcs(gl_XML.gl_print_base):
print 'static const glprocs_table_t static_functions[] = {'
for (offset, disp_name, real_name) in table:
- print ' NAME_FUNC_OFFSET( % 5u, gl%s, _gloffset_%s ),' % (offset, disp_name, real_name)
+ print ' NAME_FUNC_OFFSET( %5u, gl%s, _gloffset_%s ),' % (offset, disp_name, real_name)
print ' NAME_FUNC_OFFSET( -1, NULL, 0 )'
print '};'
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index 40ccd3af02..dfa927f7b2 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -850,7 +850,8 @@
#define _gloffset_StencilMaskSeparate 815
#define _gloffset_GetQueryObjecti64vEXT 816
#define _gloffset_GetQueryObjectui64vEXT 817
-#define _gloffset_FIRST_DYNAMIC 818
+#define _gloffset_BlitFramebufferEXT 818
+#define _gloffset_FIRST_DYNAMIC 819
#else
@@ -1264,6 +1265,7 @@
#define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index]
#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]
#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]
+#define _gloffset_BlitFramebufferEXT driDispatchRemapTable[BlitFramebufferEXT_remap_index]
#endif /* !defined(IN_DRI_DRIVER) */
diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h
index 1524e2aa8a..c672e7e40d 100644
--- a/src/mesa/glapi/glapitable.h
+++ b/src/mesa/glapi/glapitable.h
@@ -855,6 +855,7 @@ struct _glapi_table
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 815 */
void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 816 */
void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 817 */
+ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 818 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index d473774703..a4494099e3 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -5050,6 +5050,11 @@ KEYWORD1 void KEYWORD2 NAME(GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLu
DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
+}
+
#endif /* defined( NAME ) */
@@ -5882,6 +5887,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(StencilMaskSeparate),
TABLE_ENTRY(GetQueryObjecti64vEXT),
TABLE_ENTRY(GetQueryObjectui64vEXT),
+ TABLE_ENTRY(BlitFramebufferEXT),
/* A whole bunch of no-op functions. These might be called
* when someone tries to call a dynamically-registered
* extension function without a current rendering context.
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index b8d175abf4..b41c418561 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -864,6 +864,7 @@ static const char gl_string_table[] =
"glStencilMaskSeparate\0"
"glGetQueryObjecti64vEXT\0"
"glGetQueryObjectui64vEXT\0"
+ "glBlitFramebufferEXT\0"
"glArrayElementEXT\0"
"glBindTextureEXT\0"
"glDrawArraysEXT\0"
@@ -1863,184 +1864,185 @@ static const glprocs_table_t static_functions[] = {
NAME_FUNC_OFFSET( 14649, glStencilMaskSeparate, _gloffset_StencilMaskSeparate ),
NAME_FUNC_OFFSET( 14671, glGetQueryObjecti64vEXT, _gloffset_GetQueryObjecti64vEXT ),
NAME_FUNC_OFFSET( 14695, glGetQueryObjectui64vEXT, _gloffset_GetQueryObjectui64vEXT ),
- NAME_FUNC_OFFSET( 14720, glArrayElementEXT, _gloffset_ArrayElement ),
- NAME_FUNC_OFFSET( 14738, glBindTextureEXT, _gloffset_BindTexture ),
- NAME_FUNC_OFFSET( 14755, glDrawArraysEXT, _gloffset_DrawArrays ),
- NAME_FUNC_OFFSET( 14771, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ),
- NAME_FUNC_OFFSET( 14791, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ),
- NAME_FUNC_OFFSET( 14811, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ),
- NAME_FUNC_OFFSET( 14834, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ),
- NAME_FUNC_OFFSET( 14857, glDeleteTexturesEXT, _gloffset_DeleteTextures ),
- NAME_FUNC_OFFSET( 14877, glGetPointervEXT, _gloffset_GetPointerv ),
- NAME_FUNC_OFFSET( 14894, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ),
- NAME_FUNC_OFFSET( 14918, glTexSubImage1DEXT, _gloffset_TexSubImage1D ),
- NAME_FUNC_OFFSET( 14937, glTexSubImage2DEXT, _gloffset_TexSubImage2D ),
- NAME_FUNC_OFFSET( 14956, glBlendColorEXT, _gloffset_BlendColor ),
- NAME_FUNC_OFFSET( 14972, glBlendEquationEXT, _gloffset_BlendEquation ),
- NAME_FUNC_OFFSET( 14991, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ),
- NAME_FUNC_OFFSET( 15014, glColorTableSGI, _gloffset_ColorTable ),
- NAME_FUNC_OFFSET( 15030, glColorTableEXT, _gloffset_ColorTable ),
- NAME_FUNC_OFFSET( 15046, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ),
- NAME_FUNC_OFFSET( 15073, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ),
- NAME_FUNC_OFFSET( 15100, glCopyColorTableSGI, _gloffset_CopyColorTable ),
- NAME_FUNC_OFFSET( 15120, glColorSubTableEXT, _gloffset_ColorSubTable ),
- NAME_FUNC_OFFSET( 15139, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ),
- NAME_FUNC_OFFSET( 15162, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 15187, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 15212, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ),
- NAME_FUNC_OFFSET( 15239, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ),
- NAME_FUNC_OFFSET( 15267, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ),
- NAME_FUNC_OFFSET( 15294, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ),
- NAME_FUNC_OFFSET( 15322, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ),
- NAME_FUNC_OFFSET( 15351, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ),
- NAME_FUNC_OFFSET( 15380, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ),
- NAME_FUNC_OFFSET( 15403, glHistogramEXT, _gloffset_Histogram ),
- NAME_FUNC_OFFSET( 15418, glMinmaxEXT, _gloffset_Minmax ),
- NAME_FUNC_OFFSET( 15430, glResetHistogramEXT, _gloffset_ResetHistogram ),
- NAME_FUNC_OFFSET( 15450, glResetMinmaxEXT, _gloffset_ResetMinmax ),
- NAME_FUNC_OFFSET( 15467, glTexImage3DEXT, _gloffset_TexImage3D ),
- NAME_FUNC_OFFSET( 15483, glTexSubImage3DEXT, _gloffset_TexSubImage3D ),
- NAME_FUNC_OFFSET( 15502, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ),
- NAME_FUNC_OFFSET( 15525, glActiveTexture, _gloffset_ActiveTextureARB ),
- NAME_FUNC_OFFSET( 15541, glClientActiveTexture, _gloffset_ClientActiveTextureARB ),
- NAME_FUNC_OFFSET( 15563, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ),
- NAME_FUNC_OFFSET( 15581, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ),
- NAME_FUNC_OFFSET( 15600, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ),
- NAME_FUNC_OFFSET( 15618, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ),
- NAME_FUNC_OFFSET( 15637, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ),
- NAME_FUNC_OFFSET( 15655, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ),
- NAME_FUNC_OFFSET( 15674, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ),
- NAME_FUNC_OFFSET( 15692, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ),
- NAME_FUNC_OFFSET( 15711, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ),
- NAME_FUNC_OFFSET( 15729, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ),
- NAME_FUNC_OFFSET( 15748, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ),
- NAME_FUNC_OFFSET( 15766, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ),
- NAME_FUNC_OFFSET( 15785, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ),
- NAME_FUNC_OFFSET( 15803, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ),
- NAME_FUNC_OFFSET( 15822, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ),
- NAME_FUNC_OFFSET( 15840, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ),
- NAME_FUNC_OFFSET( 15859, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ),
- NAME_FUNC_OFFSET( 15877, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ),
- NAME_FUNC_OFFSET( 15896, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ),
- NAME_FUNC_OFFSET( 15914, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ),
- NAME_FUNC_OFFSET( 15933, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ),
- NAME_FUNC_OFFSET( 15951, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ),
- NAME_FUNC_OFFSET( 15970, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ),
- NAME_FUNC_OFFSET( 15988, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ),
- NAME_FUNC_OFFSET( 16007, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ),
- NAME_FUNC_OFFSET( 16025, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ),
- NAME_FUNC_OFFSET( 16044, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ),
- NAME_FUNC_OFFSET( 16062, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ),
- NAME_FUNC_OFFSET( 16081, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ),
- NAME_FUNC_OFFSET( 16099, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ),
- NAME_FUNC_OFFSET( 16118, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ),
- NAME_FUNC_OFFSET( 16136, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ),
- NAME_FUNC_OFFSET( 16155, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 16178, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 16201, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ),
- NAME_FUNC_OFFSET( 16224, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ),
- NAME_FUNC_OFFSET( 16247, glSampleCoverage, _gloffset_SampleCoverageARB ),
- NAME_FUNC_OFFSET( 16264, glDrawBuffersATI, _gloffset_DrawBuffersARB ),
- NAME_FUNC_OFFSET( 16281, glSampleMaskEXT, _gloffset_SampleMaskSGIS ),
- NAME_FUNC_OFFSET( 16297, glSamplePatternEXT, _gloffset_SamplePatternSGIS ),
- NAME_FUNC_OFFSET( 16316, glPointParameterf, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 16334, glPointParameterfARB, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 16355, glPointParameterfSGIS, _gloffset_PointParameterfEXT ),
- NAME_FUNC_OFFSET( 16377, glPointParameterfv, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 16396, glPointParameterfvARB, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 16418, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( 16441, glWindowPos2d, _gloffset_WindowPos2dMESA ),
- NAME_FUNC_OFFSET( 16455, glWindowPos2dARB, _gloffset_WindowPos2dMESA ),
- NAME_FUNC_OFFSET( 16472, glWindowPos2dv, _gloffset_WindowPos2dvMESA ),
- NAME_FUNC_OFFSET( 16487, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ),
- NAME_FUNC_OFFSET( 16505, glWindowPos2f, _gloffset_WindowPos2fMESA ),
- NAME_FUNC_OFFSET( 16519, glWindowPos2fARB, _gloffset_WindowPos2fMESA ),
- NAME_FUNC_OFFSET( 16536, glWindowPos2fv, _gloffset_WindowPos2fvMESA ),
- NAME_FUNC_OFFSET( 16551, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ),
- NAME_FUNC_OFFSET( 16569, glWindowPos2i, _gloffset_WindowPos2iMESA ),
- NAME_FUNC_OFFSET( 16583, glWindowPos2iARB, _gloffset_WindowPos2iMESA ),
- NAME_FUNC_OFFSET( 16600, glWindowPos2iv, _gloffset_WindowPos2ivMESA ),
- NAME_FUNC_OFFSET( 16615, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ),
- NAME_FUNC_OFFSET( 16633, glWindowPos2s, _gloffset_WindowPos2sMESA ),
- NAME_FUNC_OFFSET( 16647, glWindowPos2sARB, _gloffset_WindowPos2sMESA ),
- NAME_FUNC_OFFSET( 16664, glWindowPos2sv, _gloffset_WindowPos2svMESA ),
- NAME_FUNC_OFFSET( 16679, glWindowPos2svARB, _gloffset_WindowPos2svMESA ),
- NAME_FUNC_OFFSET( 16697, glWindowPos3d, _gloffset_WindowPos3dMESA ),
- NAME_FUNC_OFFSET( 16711, glWindowPos3dARB, _gloffset_WindowPos3dMESA ),
- NAME_FUNC_OFFSET( 16728, glWindowPos3dv, _gloffset_WindowPos3dvMESA ),
- NAME_FUNC_OFFSET( 16743, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ),
- NAME_FUNC_OFFSET( 16761, glWindowPos3f, _gloffset_WindowPos3fMESA ),
- NAME_FUNC_OFFSET( 16775, glWindowPos3fARB, _gloffset_WindowPos3fMESA ),
- NAME_FUNC_OFFSET( 16792, glWindowPos3fv, _gloffset_WindowPos3fvMESA ),
- NAME_FUNC_OFFSET( 16807, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ),
- NAME_FUNC_OFFSET( 16825, glWindowPos3i, _gloffset_WindowPos3iMESA ),
- NAME_FUNC_OFFSET( 16839, glWindowPos3iARB, _gloffset_WindowPos3iMESA ),
- NAME_FUNC_OFFSET( 16856, glWindowPos3iv, _gloffset_WindowPos3ivMESA ),
- NAME_FUNC_OFFSET( 16871, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ),
- NAME_FUNC_OFFSET( 16889, glWindowPos3s, _gloffset_WindowPos3sMESA ),
- NAME_FUNC_OFFSET( 16903, glWindowPos3sARB, _gloffset_WindowPos3sMESA ),
- NAME_FUNC_OFFSET( 16920, glWindowPos3sv, _gloffset_WindowPos3svMESA ),
- NAME_FUNC_OFFSET( 16935, glWindowPos3svARB, _gloffset_WindowPos3svMESA ),
- NAME_FUNC_OFFSET( 16953, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ),
- NAME_FUNC_OFFSET( 16973, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ),
- NAME_FUNC_OFFSET( 16997, glFogCoordf, _gloffset_FogCoordfEXT ),
- NAME_FUNC_OFFSET( 17009, glFogCoordfv, _gloffset_FogCoordfvEXT ),
- NAME_FUNC_OFFSET( 17022, glFogCoordd, _gloffset_FogCoorddEXT ),
- NAME_FUNC_OFFSET( 17034, glFogCoorddv, _gloffset_FogCoorddvEXT ),
- NAME_FUNC_OFFSET( 17047, glFogCoordPointer, _gloffset_FogCoordPointerEXT ),
- NAME_FUNC_OFFSET( 17065, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ),
- NAME_FUNC_OFFSET( 17088, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ),
- NAME_FUNC_OFFSET( 17111, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ),
- NAME_FUNC_OFFSET( 17134, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ),
- NAME_FUNC_OFFSET( 17160, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ),
- NAME_FUNC_OFFSET( 17186, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ),
- NAME_FUNC_OFFSET( 17212, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ),
- NAME_FUNC_OFFSET( 17236, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ),
- NAME_FUNC_OFFSET( 17255, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ),
- NAME_FUNC_OFFSET( 17275, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ),
- NAME_FUNC_OFFSET( 17294, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ),
- NAME_FUNC_OFFSET( 17314, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ),
- NAME_FUNC_OFFSET( 17333, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ),
- NAME_FUNC_OFFSET( 17353, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ),
- NAME_FUNC_OFFSET( 17372, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ),
- NAME_FUNC_OFFSET( 17392, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ),
- NAME_FUNC_OFFSET( 17411, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ),
- NAME_FUNC_OFFSET( 17431, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ),
- NAME_FUNC_OFFSET( 17451, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ),
- NAME_FUNC_OFFSET( 17472, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ),
- NAME_FUNC_OFFSET( 17492, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ),
- NAME_FUNC_OFFSET( 17513, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ),
- NAME_FUNC_OFFSET( 17533, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ),
- NAME_FUNC_OFFSET( 17554, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ),
- NAME_FUNC_OFFSET( 17578, glBindProgramARB, _gloffset_BindProgramNV ),
- NAME_FUNC_OFFSET( 17595, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ),
- NAME_FUNC_OFFSET( 17615, glGenProgramsARB, _gloffset_GenProgramsNV ),
- NAME_FUNC_OFFSET( 17632, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ),
- NAME_FUNC_OFFSET( 17661, glIsProgramARB, _gloffset_IsProgramNV ),
- NAME_FUNC_OFFSET( 17676, glPointParameteri, _gloffset_PointParameteriNV ),
- NAME_FUNC_OFFSET( 17694, glPointParameteriv, _gloffset_PointParameterivNV ),
- NAME_FUNC_OFFSET( 17713, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ),
- NAME_FUNC_OFFSET( 17731, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ),
- NAME_FUNC_OFFSET( 17751, glBindBuffer, _gloffset_BindBufferARB ),
- NAME_FUNC_OFFSET( 17764, glBufferData, _gloffset_BufferDataARB ),
- NAME_FUNC_OFFSET( 17777, glBufferSubData, _gloffset_BufferSubDataARB ),
- NAME_FUNC_OFFSET( 17793, glDeleteBuffers, _gloffset_DeleteBuffersARB ),
- NAME_FUNC_OFFSET( 17809, glGenBuffers, _gloffset_GenBuffersARB ),
- NAME_FUNC_OFFSET( 17822, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ),
- NAME_FUNC_OFFSET( 17845, glGetBufferPointerv, _gloffset_GetBufferPointervARB ),
- NAME_FUNC_OFFSET( 17865, glGetBufferSubData, _gloffset_GetBufferSubDataARB ),
- NAME_FUNC_OFFSET( 17884, glIsBuffer, _gloffset_IsBufferARB ),
- NAME_FUNC_OFFSET( 17895, glMapBuffer, _gloffset_MapBufferARB ),
- NAME_FUNC_OFFSET( 17907, glUnmapBuffer, _gloffset_UnmapBufferARB ),
- NAME_FUNC_OFFSET( 17921, glGenQueries, _gloffset_GenQueriesARB ),
- NAME_FUNC_OFFSET( 17934, glDeleteQueries, _gloffset_DeleteQueriesARB ),
- NAME_FUNC_OFFSET( 17950, glIsQuery, _gloffset_IsQueryARB ),
- NAME_FUNC_OFFSET( 17960, glBeginQuery, _gloffset_BeginQueryARB ),
- NAME_FUNC_OFFSET( 17973, glEndQuery, _gloffset_EndQueryARB ),
- NAME_FUNC_OFFSET( 17984, glGetQueryiv, _gloffset_GetQueryivARB ),
- NAME_FUNC_OFFSET( 17997, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ),
- NAME_FUNC_OFFSET( 18016, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ),
- NAME_FUNC_OFFSET( 18036, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ),
+ NAME_FUNC_OFFSET( 14720, glBlitFramebufferEXT, _gloffset_BlitFramebufferEXT ),
+ NAME_FUNC_OFFSET( 14741, glArrayElementEXT, _gloffset_ArrayElement ),
+ NAME_FUNC_OFFSET( 14759, glBindTextureEXT, _gloffset_BindTexture ),
+ NAME_FUNC_OFFSET( 14776, glDrawArraysEXT, _gloffset_DrawArrays ),
+ NAME_FUNC_OFFSET( 14792, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ),
+ NAME_FUNC_OFFSET( 14812, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ),
+ NAME_FUNC_OFFSET( 14832, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ),
+ NAME_FUNC_OFFSET( 14855, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ),
+ NAME_FUNC_OFFSET( 14878, glDeleteTexturesEXT, _gloffset_DeleteTextures ),
+ NAME_FUNC_OFFSET( 14898, glGetPointervEXT, _gloffset_GetPointerv ),
+ NAME_FUNC_OFFSET( 14915, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ),
+ NAME_FUNC_OFFSET( 14939, glTexSubImage1DEXT, _gloffset_TexSubImage1D ),
+ NAME_FUNC_OFFSET( 14958, glTexSubImage2DEXT, _gloffset_TexSubImage2D ),
+ NAME_FUNC_OFFSET( 14977, glBlendColorEXT, _gloffset_BlendColor ),
+ NAME_FUNC_OFFSET( 14993, glBlendEquationEXT, _gloffset_BlendEquation ),
+ NAME_FUNC_OFFSET( 15012, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ),
+ NAME_FUNC_OFFSET( 15035, glColorTableSGI, _gloffset_ColorTable ),
+ NAME_FUNC_OFFSET( 15051, glColorTableEXT, _gloffset_ColorTable ),
+ NAME_FUNC_OFFSET( 15067, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ),
+ NAME_FUNC_OFFSET( 15094, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ),
+ NAME_FUNC_OFFSET( 15121, glCopyColorTableSGI, _gloffset_CopyColorTable ),
+ NAME_FUNC_OFFSET( 15141, glColorSubTableEXT, _gloffset_ColorSubTable ),
+ NAME_FUNC_OFFSET( 15160, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ),
+ NAME_FUNC_OFFSET( 15183, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ),
+ NAME_FUNC_OFFSET( 15208, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ),
+ NAME_FUNC_OFFSET( 15233, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ),
+ NAME_FUNC_OFFSET( 15260, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ),
+ NAME_FUNC_OFFSET( 15288, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ),
+ NAME_FUNC_OFFSET( 15315, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ),
+ NAME_FUNC_OFFSET( 15343, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ),
+ NAME_FUNC_OFFSET( 15372, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ),
+ NAME_FUNC_OFFSET( 15401, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ),
+ NAME_FUNC_OFFSET( 15424, glHistogramEXT, _gloffset_Histogram ),
+ NAME_FUNC_OFFSET( 15439, glMinmaxEXT, _gloffset_Minmax ),
+ NAME_FUNC_OFFSET( 15451, glResetHistogramEXT, _gloffset_ResetHistogram ),
+ NAME_FUNC_OFFSET( 15471, glResetMinmaxEXT, _gloffset_ResetMinmax ),
+ NAME_FUNC_OFFSET( 15488, glTexImage3DEXT, _gloffset_TexImage3D ),
+ NAME_FUNC_OFFSET( 15504, glTexSubImage3DEXT, _gloffset_TexSubImage3D ),
+ NAME_FUNC_OFFSET( 15523, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ),
+ NAME_FUNC_OFFSET( 15546, glActiveTexture, _gloffset_ActiveTextureARB ),
+ NAME_FUNC_OFFSET( 15562, glClientActiveTexture, _gloffset_ClientActiveTextureARB ),
+ NAME_FUNC_OFFSET( 15584, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ),
+ NAME_FUNC_OFFSET( 15602, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ),
+ NAME_FUNC_OFFSET( 15621, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ),
+ NAME_FUNC_OFFSET( 15639, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ),
+ NAME_FUNC_OFFSET( 15658, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ),
+ NAME_FUNC_OFFSET( 15676, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ),
+ NAME_FUNC_OFFSET( 15695, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ),
+ NAME_FUNC_OFFSET( 15713, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ),
+ NAME_FUNC_OFFSET( 15732, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ),
+ NAME_FUNC_OFFSET( 15750, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ),
+ NAME_FUNC_OFFSET( 15769, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ),
+ NAME_FUNC_OFFSET( 15787, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ),
+ NAME_FUNC_OFFSET( 15806, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ),
+ NAME_FUNC_OFFSET( 15824, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ),
+ NAME_FUNC_OFFSET( 15843, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ),
+ NAME_FUNC_OFFSET( 15861, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ),
+ NAME_FUNC_OFFSET( 15880, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ),
+ NAME_FUNC_OFFSET( 15898, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ),
+ NAME_FUNC_OFFSET( 15917, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ),
+ NAME_FUNC_OFFSET( 15935, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ),
+ NAME_FUNC_OFFSET( 15954, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ),
+ NAME_FUNC_OFFSET( 15972, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ),
+ NAME_FUNC_OFFSET( 15991, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ),
+ NAME_FUNC_OFFSET( 16009, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ),
+ NAME_FUNC_OFFSET( 16028, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ),
+ NAME_FUNC_OFFSET( 16046, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ),
+ NAME_FUNC_OFFSET( 16065, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ),
+ NAME_FUNC_OFFSET( 16083, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ),
+ NAME_FUNC_OFFSET( 16102, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ),
+ NAME_FUNC_OFFSET( 16120, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ),
+ NAME_FUNC_OFFSET( 16139, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ),
+ NAME_FUNC_OFFSET( 16157, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ),
+ NAME_FUNC_OFFSET( 16176, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ),
+ NAME_FUNC_OFFSET( 16199, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ),
+ NAME_FUNC_OFFSET( 16222, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ),
+ NAME_FUNC_OFFSET( 16245, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ),
+ NAME_FUNC_OFFSET( 16268, glSampleCoverage, _gloffset_SampleCoverageARB ),
+ NAME_FUNC_OFFSET( 16285, glDrawBuffersATI, _gloffset_DrawBuffersARB ),
+ NAME_FUNC_OFFSET( 16302, glSampleMaskEXT, _gloffset_SampleMaskSGIS ),
+ NAME_FUNC_OFFSET( 16318, glSamplePatternEXT, _gloffset_SamplePatternSGIS ),
+ NAME_FUNC_OFFSET( 16337, glPointParameterf, _gloffset_PointParameterfEXT ),
+ NAME_FUNC_OFFSET( 16355, glPointParameterfARB, _gloffset_PointParameterfEXT ),
+ NAME_FUNC_OFFSET( 16376, glPointParameterfSGIS, _gloffset_PointParameterfEXT ),
+ NAME_FUNC_OFFSET( 16398, glPointParameterfv, _gloffset_PointParameterfvEXT ),
+ NAME_FUNC_OFFSET( 16417, glPointParameterfvARB, _gloffset_PointParameterfvEXT ),
+ NAME_FUNC_OFFSET( 16439, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ),
+ NAME_FUNC_OFFSET( 16462, glWindowPos2d, _gloffset_WindowPos2dMESA ),
+ NAME_FUNC_OFFSET( 16476, glWindowPos2dARB, _gloffset_WindowPos2dMESA ),
+ NAME_FUNC_OFFSET( 16493, glWindowPos2dv, _gloffset_WindowPos2dvMESA ),
+ NAME_FUNC_OFFSET( 16508, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ),
+ NAME_FUNC_OFFSET( 16526, glWindowPos2f, _gloffset_WindowPos2fMESA ),
+ NAME_FUNC_OFFSET( 16540, glWindowPos2fARB, _gloffset_WindowPos2fMESA ),
+ NAME_FUNC_OFFSET( 16557, glWindowPos2fv, _gloffset_WindowPos2fvMESA ),
+ NAME_FUNC_OFFSET( 16572, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ),
+ NAME_FUNC_OFFSET( 16590, glWindowPos2i, _gloffset_WindowPos2iMESA ),
+ NAME_FUNC_OFFSET( 16604, glWindowPos2iARB, _gloffset_WindowPos2iMESA ),
+ NAME_FUNC_OFFSET( 16621, glWindowPos2iv, _gloffset_WindowPos2ivMESA ),
+ NAME_FUNC_OFFSET( 16636, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ),
+ NAME_FUNC_OFFSET( 16654, glWindowPos2s, _gloffset_WindowPos2sMESA ),
+ NAME_FUNC_OFFSET( 16668, glWindowPos2sARB, _gloffset_WindowPos2sMESA ),
+ NAME_FUNC_OFFSET( 16685, glWindowPos2sv, _gloffset_WindowPos2svMESA ),
+ NAME_FUNC_OFFSET( 16700, glWindowPos2svARB, _gloffset_WindowPos2svMESA ),
+ NAME_FUNC_OFFSET( 16718, glWindowPos3d, _gloffset_WindowPos3dMESA ),
+ NAME_FUNC_OFFSET( 16732, glWindowPos3dARB, _gloffset_WindowPos3dMESA ),
+ NAME_FUNC_OFFSET( 16749, glWindowPos3dv, _gloffset_WindowPos3dvMESA ),
+ NAME_FUNC_OFFSET( 16764, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ),
+ NAME_FUNC_OFFSET( 16782, glWindowPos3f, _gloffset_WindowPos3fMESA ),
+ NAME_FUNC_OFFSET( 16796, glWindowPos3fARB, _gloffset_WindowPos3fMESA ),
+ NAME_FUNC_OFFSET( 16813, glWindowPos3fv, _gloffset_WindowPos3fvMESA ),
+ NAME_FUNC_OFFSET( 16828, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ),
+ NAME_FUNC_OFFSET( 16846, glWindowPos3i, _gloffset_WindowPos3iMESA ),
+ NAME_FUNC_OFFSET( 16860, glWindowPos3iARB, _gloffset_WindowPos3iMESA ),
+ NAME_FUNC_OFFSET( 16877, glWindowPos3iv, _gloffset_WindowPos3ivMESA ),
+ NAME_FUNC_OFFSET( 16892, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ),
+ NAME_FUNC_OFFSET( 16910, glWindowPos3s, _gloffset_WindowPos3sMESA ),
+ NAME_FUNC_OFFSET( 16924, glWindowPos3sARB, _gloffset_WindowPos3sMESA ),
+ NAME_FUNC_OFFSET( 16941, glWindowPos3sv, _gloffset_WindowPos3svMESA ),
+ NAME_FUNC_OFFSET( 16956, glWindowPos3svARB, _gloffset_WindowPos3svMESA ),
+ NAME_FUNC_OFFSET( 16974, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ),
+ NAME_FUNC_OFFSET( 16994, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ),
+ NAME_FUNC_OFFSET( 17018, glFogCoordf, _gloffset_FogCoordfEXT ),
+ NAME_FUNC_OFFSET( 17030, glFogCoordfv, _gloffset_FogCoordfvEXT ),
+ NAME_FUNC_OFFSET( 17043, glFogCoordd, _gloffset_FogCoorddEXT ),
+ NAME_FUNC_OFFSET( 17055, glFogCoorddv, _gloffset_FogCoorddvEXT ),
+ NAME_FUNC_OFFSET( 17068, glFogCoordPointer, _gloffset_FogCoordPointerEXT ),
+ NAME_FUNC_OFFSET( 17086, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ),
+ NAME_FUNC_OFFSET( 17109, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ),
+ NAME_FUNC_OFFSET( 17132, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ),
+ NAME_FUNC_OFFSET( 17155, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ),
+ NAME_FUNC_OFFSET( 17181, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ),
+ NAME_FUNC_OFFSET( 17207, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ),
+ NAME_FUNC_OFFSET( 17233, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ),
+ NAME_FUNC_OFFSET( 17257, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ),
+ NAME_FUNC_OFFSET( 17276, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ),
+ NAME_FUNC_OFFSET( 17296, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ),
+ NAME_FUNC_OFFSET( 17315, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ),
+ NAME_FUNC_OFFSET( 17335, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ),
+ NAME_FUNC_OFFSET( 17354, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ),
+ NAME_FUNC_OFFSET( 17374, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ),
+ NAME_FUNC_OFFSET( 17393, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ),
+ NAME_FUNC_OFFSET( 17413, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ),
+ NAME_FUNC_OFFSET( 17432, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ),
+ NAME_FUNC_OFFSET( 17452, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ),
+ NAME_FUNC_OFFSET( 17472, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ),
+ NAME_FUNC_OFFSET( 17493, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ),
+ NAME_FUNC_OFFSET( 17513, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ),
+ NAME_FUNC_OFFSET( 17534, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ),
+ NAME_FUNC_OFFSET( 17554, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ),
+ NAME_FUNC_OFFSET( 17575, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ),
+ NAME_FUNC_OFFSET( 17599, glBindProgramARB, _gloffset_BindProgramNV ),
+ NAME_FUNC_OFFSET( 17616, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ),
+ NAME_FUNC_OFFSET( 17636, glGenProgramsARB, _gloffset_GenProgramsNV ),
+ NAME_FUNC_OFFSET( 17653, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ),
+ NAME_FUNC_OFFSET( 17682, glIsProgramARB, _gloffset_IsProgramNV ),
+ NAME_FUNC_OFFSET( 17697, glPointParameteri, _gloffset_PointParameteriNV ),
+ NAME_FUNC_OFFSET( 17715, glPointParameteriv, _gloffset_PointParameterivNV ),
+ NAME_FUNC_OFFSET( 17734, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ),
+ NAME_FUNC_OFFSET( 17752, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ),
+ NAME_FUNC_OFFSET( 17772, glBindBuffer, _gloffset_BindBufferARB ),
+ NAME_FUNC_OFFSET( 17785, glBufferData, _gloffset_BufferDataARB ),
+ NAME_FUNC_OFFSET( 17798, glBufferSubData, _gloffset_BufferSubDataARB ),
+ NAME_FUNC_OFFSET( 17814, glDeleteBuffers, _gloffset_DeleteBuffersARB ),
+ NAME_FUNC_OFFSET( 17830, glGenBuffers, _gloffset_GenBuffersARB ),
+ NAME_FUNC_OFFSET( 17843, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ),
+ NAME_FUNC_OFFSET( 17866, glGetBufferPointerv, _gloffset_GetBufferPointervARB ),
+ NAME_FUNC_OFFSET( 17886, glGetBufferSubData, _gloffset_GetBufferSubDataARB ),
+ NAME_FUNC_OFFSET( 17905, glIsBuffer, _gloffset_IsBufferARB ),
+ NAME_FUNC_OFFSET( 17916, glMapBuffer, _gloffset_MapBufferARB ),
+ NAME_FUNC_OFFSET( 17928, glUnmapBuffer, _gloffset_UnmapBufferARB ),
+ NAME_FUNC_OFFSET( 17942, glGenQueries, _gloffset_GenQueriesARB ),
+ NAME_FUNC_OFFSET( 17955, glDeleteQueries, _gloffset_DeleteQueriesARB ),
+ NAME_FUNC_OFFSET( 17971, glIsQuery, _gloffset_IsQueryARB ),
+ NAME_FUNC_OFFSET( 17981, glBeginQuery, _gloffset_BeginQueryARB ),
+ NAME_FUNC_OFFSET( 17994, glEndQuery, _gloffset_EndQueryARB ),
+ NAME_FUNC_OFFSET( 18005, glGetQueryiv, _gloffset_GetQueryivARB ),
+ NAME_FUNC_OFFSET( 18018, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ),
+ NAME_FUNC_OFFSET( 18037, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ),
+ NAME_FUNC_OFFSET( 18057, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ),
NAME_FUNC_OFFSET( -1, NULL, 0 )
};
diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py
index 24e64ef998..0c59a46c19 100644
--- a/src/mesa/glapi/mesadef.py
+++ b/src/mesa/glapi/mesadef.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id: mesadef.py,v 1.3 2005/09/05 14:09:25 kschultz Exp $
+# $Id: mesadef.py,v 1.3.2.1 2006/03/25 23:48:21 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
@@ -89,6 +89,7 @@ def PrintTail():
print '\twglDescribePixelFormat'
print '\twglGetCurrentContext'
print '\twglGetCurrentDC'
+ print '\twglGetExtensionsStringARB'
print '\twglGetLayerPaletteEntries'
print '\twglGetPixelFormat'
print '\twglGetProcAddress'
diff --git a/src/mesa/glapi/typeexpr.py b/src/mesa/glapi/typeexpr.py
index eface2a521..8ba7de4862 100644
--- a/src/mesa/glapi/typeexpr.py
+++ b/src/mesa/glapi/typeexpr.py
@@ -29,20 +29,21 @@ import string, copy
class type_node:
def __init__(self):
- self.pointer = 0
- self.const = 0
- self.signed = 1
- self.integer = 1
+ self.pointer = 0 # bool
+ self.const = 0 # bool
+ self.signed = 1 # bool
+ self.integer = 1 # bool
# If elements is set to non-zero, then field is an array.
self.elements = 0
self.name = None
- self.size = 0
+ self.size = 0 # type's size in bytes
return
def string(self):
+ """Return string representation of this type_node."""
s = ""
if self.pointer:
@@ -85,16 +86,17 @@ class type_table:
def create_initial_types():
tt = type_table()
- basic_types = [ ["char", 1, 1], \
- ["short", 2, 1], \
- ["int", 4, 1], \
- ["long", 4, 1], \
- ["float", 4, 0], \
- ["double", 8, 0], \
- ["enum", 4, 1] ]
-
-
- for [type_name, type_size, integer] in basic_types:
+ basic_types = [
+ ("char", 1, 1),
+ ("short", 2, 1),
+ ("int", 4, 1),
+ ("long", 4, 1),
+ ("float", 4, 0),
+ ("double", 8, 0),
+ ("enum", 4, 1)
+ ]
+
+ for (type_name, type_size, integer) in basic_types:
te = type_expression(None)
tn = type_node()
tn.name = type_name
@@ -113,22 +115,24 @@ class type_expression:
def __init__(self, type_string, extra_types = None):
self.expr = []
- if not type_string: return
+ if not type_string:
+ return
self.original_string = type_string
if not type_expression.built_in_types:
raise RuntimeError("create_initial_types must be called before creating type_expression objects.")
-
- elements = string.split( string.replace( type_string, "*", " * " ) )
+ # Replace '*' with ' * ' in type_string. Then, split the string
+ # into tokens, separated by spaces.
+ tokens = string.split( string.replace( type_string, "*", " * " ) )
const = 0
t = None
signed = 0
unsigned = 0
- for i in elements:
+ for i in tokens:
if i == "const":
if t and t.pointer:
t.const = 1
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 2f7375bd3a..a6e422640c 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -76,7 +76,9 @@ _mesa_Accum( GLenum op, GLfloat value )
}
if (ctx->DrawBuffer != ctx->ReadBuffer) {
- /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read */
+ /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read,
+ * or GL_EXT_framebuffer_blit.
+ */
_mesa_error(ctx, GL_INVALID_OPERATION,
"glAccum(different read/draw buffers)");
return;
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 84df98dc89..d4c69d25ea 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,10 +29,8 @@
#include "glheader.h"
#include "api_arrayelt.h"
#include "context.h"
-#include "glapi.h"
#include "imports.h"
#include "macros.h"
-#include "mtypes.h"
#include "glapioffsets.h"
#include "dispatch.h"
@@ -145,41 +143,9 @@ static const int NormalFuncs[8] = {
_gloffset_Normal3dv,
};
-#if defined(IN_DRI_DRIVER)
+/* Note: _gloffset_* for these may not be a compile-time constant. */
static int SecondaryColorFuncs[8];
-static int FogCoordFuncs[8] = {
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- 0,
- 0,
-};
-#else
-static const int SecondaryColorFuncs[8] = {
- _gloffset_SecondaryColor3bvEXT,
- _gloffset_SecondaryColor3ubvEXT,
- _gloffset_SecondaryColor3svEXT,
- _gloffset_SecondaryColor3usvEXT,
- _gloffset_SecondaryColor3ivEXT,
- _gloffset_SecondaryColor3uivEXT,
- _gloffset_SecondaryColor3fvEXT,
- _gloffset_SecondaryColor3dvEXT,
-};
-
-static const int FogCoordFuncs[8] = {
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- _gloffset_FogCoordfvEXT,
- _gloffset_FogCoorddvEXT
-};
-#endif
+static int FogCoordFuncs[8];
/**********************************************************************/
@@ -622,7 +588,7 @@ GLboolean _ae_create_context( GLcontext *ctx )
if (ctx->aelt_context)
return GL_TRUE;
-#if defined(IN_DRI_DRIVER)
+ /* These _gloffset_* values may not be compile-time constants */
SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
@@ -632,9 +598,14 @@ GLboolean _ae_create_context( GLcontext *ctx )
SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
+ FogCoordFuncs[0] = -1;
+ FogCoordFuncs[1] = -1;
+ FogCoordFuncs[2] = -1;
+ FogCoordFuncs[3] = -1;
+ FogCoordFuncs[4] = -1;
+ FogCoordFuncs[5] = -1;
FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
-#endif
ctx->aelt_context = MALLOC( sizeof(AEcontext) );
if (!ctx->aelt_context)
@@ -699,7 +670,7 @@ static void _ae_update_state( GLcontext *ctx )
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- if (ctx->Array.TexCoord[i].Enabled) {
+ if (ctx->Array.TexCoord[i].Enabled && ctx->Array.TexCoord[i].Ptr) {
/* NOTE: we use generic glVertexAttrib functions here.
* If we ever de-alias conventional/generic vertex attribs this
* will have to change.
@@ -714,7 +685,8 @@ static void _ae_update_state( GLcontext *ctx )
/* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */
- if (ctx->Array.VertexAttrib[i].Enabled) {
+ if (ctx->Array.VertexAttrib[i].Enabled &&
+ ctx->Array.VertexAttrib[i].Ptr) {
struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i];
at->array = attribArray;
/* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 41119f7937..2eef729469 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -533,16 +533,16 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
enable->SampleCoverageInvert,
GL_SAMPLE_COVERAGE_INVERT_ARB);
- /* GL_NV_vertex_program */
+ /* GL_ARB_vertex_program, GL_NV_vertex_program */
TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
enable->VertexProgram,
- GL_VERTEX_PROGRAM_NV);
+ GL_VERTEX_PROGRAM_ARB);
TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
enable->VertexProgramPointSize,
- GL_VERTEX_PROGRAM_POINT_SIZE_NV);
+ GL_VERTEX_PROGRAM_POINT_SIZE_ARB);
TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
enable->VertexProgramTwoSide,
- GL_VERTEX_PROGRAM_TWO_SIDE_NV);
+ GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
#undef TEST_AND_UPDATE
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 4101c9f1ed..bbefc32804 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -8,7 +8,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -605,7 +605,7 @@ _glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
* and sets the glapi callbacks if the \c MESA_DEBUG environment variable is
* defined.
*
- * \sa _mesa_init_lists(), _math_init().
+ * \sa _math_init().
*/
static void
one_time_init( GLcontext *ctx )
@@ -624,8 +624,6 @@ one_time_init( GLcontext *ctx )
assert( sizeof(GLint) == 4 );
assert( sizeof(GLuint) == 4 );
- _mesa_init_lists();
-
#if _HAVE_FULL_GL
_math_init();
@@ -845,8 +843,8 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
}
_mesa_DeleteHashTable(ss->TexObjects);
-#if FEATURE_NV_vertex_program
- /* Free vertex programs */
+#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_NV_fragment_program)
+ /* Free vertex/fragment programs */
while (1) {
GLuint prog = _mesa_HashFirstEntry(ss->Programs);
if (prog) {
@@ -868,15 +866,33 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
#if FEATURE_ARB_fragment_program
_mesa_delete_program(ctx, ss->DefaultFragmentProgram);
#endif
+
#if FEATURE_ATI_fragment_shader
- _mesa_free(ss->DefaultFragmentShader);
+ /* Free ATI fragment shaders */
+ while (1) {
+ GLuint prog = _mesa_HashFirstEntry(ss->ATIShaders);
+ if (prog) {
+ struct ati_fragment_shader *s = (struct ati_fragment_shader *)
+ _mesa_HashLookup(ss->ATIShaders, prog);
+ ASSERT(s);
+ _mesa_delete_ati_fragment_shader(ctx, s);
+ _mesa_HashRemove(ss->ATIShaders, prog);
+ }
+ else {
+ break;
+ }
+ }
+ _mesa_DeleteHashTable(ss->ATIShaders);
+ _mesa_delete_ati_fragment_shader(ctx, ss->DefaultFragmentShader);
#endif
#if FEATURE_ARB_vertex_buffer_object
_mesa_DeleteHashTable(ss->BufferObjects);
#endif
+#if FEATURE_ARB_shader_objects
_mesa_DeleteHashTable (ss->GL2Objects);
+#endif
#if FEATURE_EXT_framebuffer_object
_mesa_DeleteHashTable(ss->FrameBuffers);
@@ -1404,7 +1420,7 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
if (mask & GL_LIGHTING_BIT) {
GLuint i;
/* begin with memcpy */
- MEMCPY( &dst->Light, &src->Light, sizeof(struct gl_light) );
+ dst->Light = src->Light;
/* fixup linked lists to prevent pointer insanity */
make_empty_list( &(dst->Light.EnabledList) );
for (i = 0; i < MAX_LIGHTS; i++) {
@@ -1479,6 +1495,11 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
/**
* Check if the given context can render into the given framebuffer
* by checking visual attributes.
+ *
+ * XXX this may go away someday because we're moving toward more freedom
+ * in binding contexts to drawables with different visual attributes.
+ * The GL_EXT_f_b_o extension is prompting some of that.
+ *
* \return GL_TRUE if compatible, GL_FALSE otherwise.
*/
static GLboolean
@@ -1492,8 +1513,11 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
if (ctxvis->rgbMode != bufvis->rgbMode)
return GL_FALSE;
+#if 0
+ /* disabling this fixes the fgl_glxgears pbuffer demo */
if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode)
return GL_FALSE;
+#endif
if (ctxvis->stereoMode && !bufvis->stereoMode)
return GL_FALSE;
if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
@@ -1558,23 +1582,22 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
/* Check that the context's and framebuffer's visuals are compatible.
*/
- if (newCtx && drawBuffer && newCtx->DrawBuffer != drawBuffer) {
- if (!check_compatible(newCtx, drawBuffer))
+ if (newCtx && drawBuffer && newCtx->WinSysDrawBuffer != drawBuffer) {
+ if (!check_compatible(newCtx, drawBuffer)) {
+ _mesa_warning(newCtx,
+ "MakeCurrent: incompatible visuals for context and drawbuffer");
return;
+ }
}
- if (newCtx && readBuffer && newCtx->ReadBuffer != readBuffer) {
- if (!check_compatible(newCtx, readBuffer))
+ if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) {
+ if (!check_compatible(newCtx, readBuffer)) {
+ _mesa_warning(newCtx,
+ "MakeCurrent: incompatible visuals for context and readbuffer");
return;
+ }
}
-#if !defined(IN_DRI_DRIVER)
- /* We call this function periodically (just here for now) in
- * order to detect when multithreading has begun. In a DRI driver, this
- * step is done by the driver loader (e.g., libGL).
- */
- _glapi_check_multithread();
-#endif /* !defined(IN_DRI_DRIVER) */
-
+ /* We used to call _glapi_check_multithread() here. Now do it in drivers */
_glapi_set_context((void *) newCtx);
ASSERT(_mesa_get_current_context() == newCtx);
@@ -1591,9 +1614,15 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
ASSERT(readBuffer->Name == 0);
newCtx->WinSysDrawBuffer = drawBuffer;
newCtx->WinSysReadBuffer = readBuffer;
- /* don't replace user-buffer bindings with window system buffer */
+
+ /*
+ * Only set the context's Draw/ReadBuffer fields if they're NULL
+ * or not bound to a user-created FBO.
+ */
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
newCtx->DrawBuffer = drawBuffer;
+ }
+ if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
newCtx->ReadBuffer = readBuffer;
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 8a0ac0fa4a..dba2008ef7 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -169,191 +169,194 @@ do { \
* The fact that these identifiers are assigned consecutive
* integer values starting at 0 is very important, see InstSize array usage)
*/
-typedef enum {
- OPCODE_INVALID = -1, /* Force signed enum */
- OPCODE_ACCUM,
- OPCODE_ALPHA_FUNC,
- OPCODE_BIND_TEXTURE,
- OPCODE_BITMAP,
- OPCODE_BLEND_COLOR,
- OPCODE_BLEND_EQUATION,
- OPCODE_BLEND_EQUATION_SEPARATE,
- OPCODE_BLEND_FUNC_SEPARATE,
- OPCODE_CALL_LIST,
- OPCODE_CALL_LIST_OFFSET,
- OPCODE_CLEAR,
- OPCODE_CLEAR_ACCUM,
- OPCODE_CLEAR_COLOR,
- OPCODE_CLEAR_DEPTH,
- OPCODE_CLEAR_INDEX,
- OPCODE_CLEAR_STENCIL,
- OPCODE_CLIP_PLANE,
- OPCODE_COLOR_MASK,
- OPCODE_COLOR_MATERIAL,
- OPCODE_COLOR_TABLE,
- OPCODE_COLOR_TABLE_PARAMETER_FV,
- OPCODE_COLOR_TABLE_PARAMETER_IV,
- OPCODE_COLOR_SUB_TABLE,
- OPCODE_CONVOLUTION_FILTER_1D,
- OPCODE_CONVOLUTION_FILTER_2D,
- OPCODE_CONVOLUTION_PARAMETER_I,
- OPCODE_CONVOLUTION_PARAMETER_IV,
- OPCODE_CONVOLUTION_PARAMETER_F,
- OPCODE_CONVOLUTION_PARAMETER_FV,
- OPCODE_COPY_COLOR_SUB_TABLE,
- OPCODE_COPY_COLOR_TABLE,
- OPCODE_COPY_PIXELS,
- OPCODE_COPY_TEX_IMAGE1D,
- OPCODE_COPY_TEX_IMAGE2D,
- OPCODE_COPY_TEX_SUB_IMAGE1D,
- OPCODE_COPY_TEX_SUB_IMAGE2D,
- OPCODE_COPY_TEX_SUB_IMAGE3D,
- OPCODE_CULL_FACE,
- OPCODE_DEPTH_FUNC,
- OPCODE_DEPTH_MASK,
- OPCODE_DEPTH_RANGE,
- OPCODE_DISABLE,
- OPCODE_DRAW_BUFFER,
- OPCODE_DRAW_PIXELS,
- OPCODE_ENABLE,
- OPCODE_EVALMESH1,
- OPCODE_EVALMESH2,
- OPCODE_FOG,
- OPCODE_FRONT_FACE,
- OPCODE_FRUSTUM,
- OPCODE_HINT,
- OPCODE_HISTOGRAM,
- OPCODE_INDEX_MASK,
- OPCODE_INIT_NAMES,
- OPCODE_LIGHT,
- OPCODE_LIGHT_MODEL,
- OPCODE_LINE_STIPPLE,
- OPCODE_LINE_WIDTH,
- OPCODE_LIST_BASE,
- OPCODE_LOAD_IDENTITY,
- OPCODE_LOAD_MATRIX,
- OPCODE_LOAD_NAME,
- OPCODE_LOGIC_OP,
- OPCODE_MAP1,
- OPCODE_MAP2,
- OPCODE_MAPGRID1,
- OPCODE_MAPGRID2,
- OPCODE_MATRIX_MODE,
- OPCODE_MIN_MAX,
- OPCODE_MULT_MATRIX,
- OPCODE_ORTHO,
- OPCODE_PASSTHROUGH,
- OPCODE_PIXEL_MAP,
- OPCODE_PIXEL_TRANSFER,
- OPCODE_PIXEL_ZOOM,
- OPCODE_POINT_SIZE,
- OPCODE_POINT_PARAMETERS,
- OPCODE_POLYGON_MODE,
- OPCODE_POLYGON_STIPPLE,
- OPCODE_POLYGON_OFFSET,
- OPCODE_POP_ATTRIB,
- OPCODE_POP_MATRIX,
- OPCODE_POP_NAME,
- OPCODE_PRIORITIZE_TEXTURE,
- OPCODE_PUSH_ATTRIB,
- OPCODE_PUSH_MATRIX,
- OPCODE_PUSH_NAME,
- OPCODE_RASTER_POS,
- OPCODE_READ_BUFFER,
- OPCODE_RESET_HISTOGRAM,
- OPCODE_RESET_MIN_MAX,
- OPCODE_ROTATE,
- OPCODE_SCALE,
- OPCODE_SCISSOR,
- OPCODE_SELECT_TEXTURE_SGIS,
- OPCODE_SELECT_TEXTURE_COORD_SET,
- OPCODE_SHADE_MODEL,
- OPCODE_STENCIL_FUNC,
- OPCODE_STENCIL_MASK,
- OPCODE_STENCIL_OP,
- OPCODE_TEXENV,
- OPCODE_TEXGEN,
- OPCODE_TEXPARAMETER,
- OPCODE_TEX_IMAGE1D,
- OPCODE_TEX_IMAGE2D,
- OPCODE_TEX_IMAGE3D,
- OPCODE_TEX_SUB_IMAGE1D,
- OPCODE_TEX_SUB_IMAGE2D,
- OPCODE_TEX_SUB_IMAGE3D,
- OPCODE_TRANSLATE,
- OPCODE_VIEWPORT,
- OPCODE_WINDOW_POS,
- /* GL_ARB_multitexture */
- OPCODE_ACTIVE_TEXTURE,
- /* GL_ARB_texture_compression */
- OPCODE_COMPRESSED_TEX_IMAGE_1D,
- OPCODE_COMPRESSED_TEX_IMAGE_2D,
- OPCODE_COMPRESSED_TEX_IMAGE_3D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
- /* GL_ARB_multisample */
- OPCODE_SAMPLE_COVERAGE,
- /* GL_ARB_window_pos */
- OPCODE_WINDOW_POS_ARB,
- /* GL_NV_vertex_program */
- OPCODE_BIND_PROGRAM_NV,
- OPCODE_EXECUTE_PROGRAM_NV,
- OPCODE_REQUEST_RESIDENT_PROGRAMS_NV,
- OPCODE_LOAD_PROGRAM_NV,
- OPCODE_PROGRAM_PARAMETER4F_NV,
- OPCODE_TRACK_MATRIX_NV,
- /* GL_NV_fragment_program */
- OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
- OPCODE_PROGRAM_NAMED_PARAMETER_NV,
- /* GL_EXT_stencil_two_side */
- OPCODE_ACTIVE_STENCIL_FACE_EXT,
- /* GL_EXT_depth_bounds_test */
- OPCODE_DEPTH_BOUNDS_EXT,
- /* GL_ARB_vertex/fragment_program */
- OPCODE_PROGRAM_STRING_ARB,
- OPCODE_PROGRAM_ENV_PARAMETER_ARB,
- /* GL_ARB_occlusion_query */
- OPCODE_BEGIN_QUERY_ARB,
- OPCODE_END_QUERY_ARB,
- /* GL_ARB_draw_buffers */
- OPCODE_DRAW_BUFFERS_ARB,
- /* GL_ATI_fragment_shader */
- OPCODE_BIND_FRAGMENT_SHADER_ATI,
- OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
- /* OpenGL 2.0 */
- OPCODE_STENCIL_FUNC_SEPARATE,
- OPCODE_STENCIL_OP_SEPARATE,
- OPCODE_STENCIL_MASK_SEPARATE,
-
- /* Vertex attributes -- fallback for when optimized display
- * list build isn't active.
- */
- OPCODE_ATTR_1F_NV,
- OPCODE_ATTR_2F_NV,
- OPCODE_ATTR_3F_NV,
- OPCODE_ATTR_4F_NV,
- OPCODE_ATTR_1F_ARB,
- OPCODE_ATTR_2F_ARB,
- OPCODE_ATTR_3F_ARB,
- OPCODE_ATTR_4F_ARB,
- OPCODE_MATERIAL,
- OPCODE_INDEX,
- OPCODE_EDGEFLAG,
- OPCODE_BEGIN,
- OPCODE_END,
- OPCODE_RECTF,
- OPCODE_EVAL_C1,
- OPCODE_EVAL_C2,
- OPCODE_EVAL_P1,
- OPCODE_EVAL_P2,
-
-
- /* The following three are meta instructions */
- OPCODE_ERROR, /* raise compiled-in error */
- OPCODE_CONTINUE,
- OPCODE_END_OF_LIST,
- OPCODE_EXT_0
+typedef enum
+{
+ OPCODE_INVALID = -1, /* Force signed enum */
+ OPCODE_ACCUM,
+ OPCODE_ALPHA_FUNC,
+ OPCODE_BIND_TEXTURE,
+ OPCODE_BITMAP,
+ OPCODE_BLEND_COLOR,
+ OPCODE_BLEND_EQUATION,
+ OPCODE_BLEND_EQUATION_SEPARATE,
+ OPCODE_BLEND_FUNC_SEPARATE,
+ OPCODE_CALL_LIST,
+ OPCODE_CALL_LIST_OFFSET,
+ OPCODE_CLEAR,
+ OPCODE_CLEAR_ACCUM,
+ OPCODE_CLEAR_COLOR,
+ OPCODE_CLEAR_DEPTH,
+ OPCODE_CLEAR_INDEX,
+ OPCODE_CLEAR_STENCIL,
+ OPCODE_CLIP_PLANE,
+ OPCODE_COLOR_MASK,
+ OPCODE_COLOR_MATERIAL,
+ OPCODE_COLOR_TABLE,
+ OPCODE_COLOR_TABLE_PARAMETER_FV,
+ OPCODE_COLOR_TABLE_PARAMETER_IV,
+ OPCODE_COLOR_SUB_TABLE,
+ OPCODE_CONVOLUTION_FILTER_1D,
+ OPCODE_CONVOLUTION_FILTER_2D,
+ OPCODE_CONVOLUTION_PARAMETER_I,
+ OPCODE_CONVOLUTION_PARAMETER_IV,
+ OPCODE_CONVOLUTION_PARAMETER_F,
+ OPCODE_CONVOLUTION_PARAMETER_FV,
+ OPCODE_COPY_COLOR_SUB_TABLE,
+ OPCODE_COPY_COLOR_TABLE,
+ OPCODE_COPY_PIXELS,
+ OPCODE_COPY_TEX_IMAGE1D,
+ OPCODE_COPY_TEX_IMAGE2D,
+ OPCODE_COPY_TEX_SUB_IMAGE1D,
+ OPCODE_COPY_TEX_SUB_IMAGE2D,
+ OPCODE_COPY_TEX_SUB_IMAGE3D,
+ OPCODE_CULL_FACE,
+ OPCODE_DEPTH_FUNC,
+ OPCODE_DEPTH_MASK,
+ OPCODE_DEPTH_RANGE,
+ OPCODE_DISABLE,
+ OPCODE_DRAW_BUFFER,
+ OPCODE_DRAW_PIXELS,
+ OPCODE_ENABLE,
+ OPCODE_EVALMESH1,
+ OPCODE_EVALMESH2,
+ OPCODE_FOG,
+ OPCODE_FRONT_FACE,
+ OPCODE_FRUSTUM,
+ OPCODE_HINT,
+ OPCODE_HISTOGRAM,
+ OPCODE_INDEX_MASK,
+ OPCODE_INIT_NAMES,
+ OPCODE_LIGHT,
+ OPCODE_LIGHT_MODEL,
+ OPCODE_LINE_STIPPLE,
+ OPCODE_LINE_WIDTH,
+ OPCODE_LIST_BASE,
+ OPCODE_LOAD_IDENTITY,
+ OPCODE_LOAD_MATRIX,
+ OPCODE_LOAD_NAME,
+ OPCODE_LOGIC_OP,
+ OPCODE_MAP1,
+ OPCODE_MAP2,
+ OPCODE_MAPGRID1,
+ OPCODE_MAPGRID2,
+ OPCODE_MATRIX_MODE,
+ OPCODE_MIN_MAX,
+ OPCODE_MULT_MATRIX,
+ OPCODE_ORTHO,
+ OPCODE_PASSTHROUGH,
+ OPCODE_PIXEL_MAP,
+ OPCODE_PIXEL_TRANSFER,
+ OPCODE_PIXEL_ZOOM,
+ OPCODE_POINT_SIZE,
+ OPCODE_POINT_PARAMETERS,
+ OPCODE_POLYGON_MODE,
+ OPCODE_POLYGON_STIPPLE,
+ OPCODE_POLYGON_OFFSET,
+ OPCODE_POP_ATTRIB,
+ OPCODE_POP_MATRIX,
+ OPCODE_POP_NAME,
+ OPCODE_PRIORITIZE_TEXTURE,
+ OPCODE_PUSH_ATTRIB,
+ OPCODE_PUSH_MATRIX,
+ OPCODE_PUSH_NAME,
+ OPCODE_RASTER_POS,
+ OPCODE_READ_BUFFER,
+ OPCODE_RESET_HISTOGRAM,
+ OPCODE_RESET_MIN_MAX,
+ OPCODE_ROTATE,
+ OPCODE_SCALE,
+ OPCODE_SCISSOR,
+ OPCODE_SELECT_TEXTURE_SGIS,
+ OPCODE_SELECT_TEXTURE_COORD_SET,
+ OPCODE_SHADE_MODEL,
+ OPCODE_STENCIL_FUNC,
+ OPCODE_STENCIL_MASK,
+ OPCODE_STENCIL_OP,
+ OPCODE_TEXENV,
+ OPCODE_TEXGEN,
+ OPCODE_TEXPARAMETER,
+ OPCODE_TEX_IMAGE1D,
+ OPCODE_TEX_IMAGE2D,
+ OPCODE_TEX_IMAGE3D,
+ OPCODE_TEX_SUB_IMAGE1D,
+ OPCODE_TEX_SUB_IMAGE2D,
+ OPCODE_TEX_SUB_IMAGE3D,
+ OPCODE_TRANSLATE,
+ OPCODE_VIEWPORT,
+ OPCODE_WINDOW_POS,
+ /* GL_ARB_multitexture */
+ OPCODE_ACTIVE_TEXTURE,
+ /* GL_ARB_texture_compression */
+ OPCODE_COMPRESSED_TEX_IMAGE_1D,
+ OPCODE_COMPRESSED_TEX_IMAGE_2D,
+ OPCODE_COMPRESSED_TEX_IMAGE_3D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
+ /* GL_ARB_multisample */
+ OPCODE_SAMPLE_COVERAGE,
+ /* GL_ARB_window_pos */
+ OPCODE_WINDOW_POS_ARB,
+ /* GL_NV_vertex_program */
+ OPCODE_BIND_PROGRAM_NV,
+ OPCODE_EXECUTE_PROGRAM_NV,
+ OPCODE_REQUEST_RESIDENT_PROGRAMS_NV,
+ OPCODE_LOAD_PROGRAM_NV,
+ OPCODE_PROGRAM_PARAMETER4F_NV,
+ OPCODE_TRACK_MATRIX_NV,
+ /* GL_NV_fragment_program */
+ OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
+ OPCODE_PROGRAM_NAMED_PARAMETER_NV,
+ /* GL_EXT_stencil_two_side */
+ OPCODE_ACTIVE_STENCIL_FACE_EXT,
+ /* GL_EXT_depth_bounds_test */
+ OPCODE_DEPTH_BOUNDS_EXT,
+ /* GL_ARB_vertex/fragment_program */
+ OPCODE_PROGRAM_STRING_ARB,
+ OPCODE_PROGRAM_ENV_PARAMETER_ARB,
+ /* GL_ARB_occlusion_query */
+ OPCODE_BEGIN_QUERY_ARB,
+ OPCODE_END_QUERY_ARB,
+ /* GL_ARB_draw_buffers */
+ OPCODE_DRAW_BUFFERS_ARB,
+ /* GL_ATI_fragment_shader */
+ OPCODE_BIND_FRAGMENT_SHADER_ATI,
+ OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
+ /* OpenGL 2.0 */
+ OPCODE_STENCIL_FUNC_SEPARATE,
+ OPCODE_STENCIL_OP_SEPARATE,
+ OPCODE_STENCIL_MASK_SEPARATE,
+
+ /* GL_EXT_framebuffer_blit */
+ OPCODE_BLIT_FRAMEBUFFER,
+
+ /* Vertex attributes -- fallback for when optimized display
+ * list build isn't active.
+ */
+ OPCODE_ATTR_1F_NV,
+ OPCODE_ATTR_2F_NV,
+ OPCODE_ATTR_3F_NV,
+ OPCODE_ATTR_4F_NV,
+ OPCODE_ATTR_1F_ARB,
+ OPCODE_ATTR_2F_ARB,
+ OPCODE_ATTR_3F_ARB,
+ OPCODE_ATTR_4F_ARB,
+ OPCODE_MATERIAL,
+ OPCODE_INDEX,
+ OPCODE_EDGEFLAG,
+ OPCODE_BEGIN,
+ OPCODE_END,
+ OPCODE_RECTF,
+ OPCODE_EVAL_C1,
+ OPCODE_EVAL_C2,
+ OPCODE_EVAL_P1,
+ OPCODE_EVAL_P2,
+
+ /* The following three are meta instructions */
+ OPCODE_ERROR, /* raise compiled-in error */
+ OPCODE_CONTINUE,
+ OPCODE_END_OF_LIST,
+ OPCODE_EXT_0
} OpCode;
@@ -369,19 +372,20 @@ typedef enum {
* contiguous nodes in memory.
* Each node is the union of a variety of data types.
*/
-union node {
- OpCode opcode;
- GLboolean b;
- GLbitfield bf;
- GLubyte ub;
- GLshort s;
- GLushort us;
- GLint i;
- GLuint ui;
- GLenum e;
- GLfloat f;
- GLvoid *data;
- void *next; /* If prev node's opcode==OPCODE_CONTINUE */
+union node
+{
+ OpCode opcode;
+ GLboolean b;
+ GLbitfield bf;
+ GLubyte ub;
+ GLshort s;
+ GLushort us;
+ GLint i;
+ GLuint ui;
+ GLenum e;
+ GLfloat f;
+ GLvoid *data;
+ void *next; /* If prev node's opcode==OPCODE_CONTINUE */
};
@@ -398,47 +402,52 @@ union node {
* Number of nodes of storage needed for each instruction.
* Sizes for dynamically allocated opcodes are stored in the context struct.
*/
-static GLuint InstSize[ OPCODE_END_OF_LIST+1 ];
+static GLuint InstSize[OPCODE_END_OF_LIST + 1];
-void mesa_print_display_list( GLuint list );
+void mesa_print_display_list(GLuint list);
/**********************************************************************/
/***** Private *****/
/**********************************************************************/
-/*
+
+/**
* Make an empty display list. This is used by glGenLists() to
- * reserver display list IDs.
+ * reserve display list IDs.
*/
-static struct mesa_display_list *make_list( GLuint list, GLuint count )
+static struct mesa_display_list *
+make_list(GLuint list, GLuint count)
{
- struct mesa_display_list *dlist = CALLOC_STRUCT( mesa_display_list );
+ struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list);
dlist->id = list;
- dlist->node = (Node *) MALLOC( sizeof(Node) * count );
+ dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count);
dlist->node[0].opcode = OPCODE_END_OF_LIST;
return dlist;
}
-/*
+/**
* Destroy all nodes in a display list.
* \param list - display list number
*/
-void _mesa_destroy_list( GLcontext *ctx, GLuint list )
+void
+_mesa_destroy_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
Node *n, *block;
GLboolean done;
- if (list==0)
+ if (list == 0)
return;
- dlist = (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
+ dlist =
+ (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
+ list);
if (!dlist)
return;
-
+
n = block = dlist->node;
done = block ? GL_FALSE : GL_TRUE;
@@ -448,136 +457,136 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list )
GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0;
if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
- ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]);
+ n += ctx->ListExt.Opcode[i].Size;
}
else {
- switch (n[0].opcode) {
- /* for some commands, we need to free malloc'd memory */
- case OPCODE_MAP1:
- FREE(n[6].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_MAP2:
- FREE(n[10].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_DRAW_PIXELS:
- FREE( n[5].data );
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_BITMAP:
- FREE( n[7].data );
- n += InstSize[n[0].opcode];
- break;
+ switch (n[0].opcode) {
+ /* for some commands, we need to free malloc'd memory */
+ case OPCODE_MAP1:
+ _mesa_free(n[6].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_MAP2:
+ _mesa_free(n[10].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_DRAW_PIXELS:
+ _mesa_free(n[5].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_BITMAP:
+ _mesa_free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
case OPCODE_COLOR_TABLE:
- FREE( n[6].data );
+ _mesa_free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_SUB_TABLE:
- FREE( n[6].data );
+ _mesa_free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_1D:
- FREE( n[6].data );
+ _mesa_free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_2D:
- FREE( n[7].data );
+ _mesa_free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_POLYGON_STIPPLE:
- FREE( n[1].data );
- n += InstSize[n[0].opcode];
+ _mesa_free(n[1].data);
+ n += InstSize[n[0].opcode];
break;
- case OPCODE_TEX_IMAGE1D:
- FREE(n[8].data);
+ case OPCODE_TEX_IMAGE1D:
+ _mesa_free(n[8].data);
n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_IMAGE2D:
- FREE( n[9]. data );
+ break;
+ case OPCODE_TEX_IMAGE2D:
+ _mesa_free(n[9].data);
n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_IMAGE3D:
- FREE( n[10]. data );
+ break;
+ case OPCODE_TEX_IMAGE3D:
+ _mesa_free(n[10].data);
n += InstSize[n[0].opcode];
- break;
+ break;
case OPCODE_TEX_SUB_IMAGE1D:
- FREE(n[7].data);
+ _mesa_free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE2D:
- FREE(n[9].data);
+ _mesa_free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE3D:
- FREE(n[11].data);
+ _mesa_free(n[11].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_1D:
- FREE(n[7].data);
+ _mesa_free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_2D:
- FREE(n[8].data);
+ _mesa_free(n[8].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_3D:
- FREE(n[9].data);
+ _mesa_free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
- FREE(n[7].data);
+ _mesa_free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
- FREE(n[9].data);
+ _mesa_free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
- FREE(n[11].data);
+ _mesa_free(n[11].data);
n += InstSize[n[0].opcode];
break;
#if FEATURE_NV_vertex_program
case OPCODE_LOAD_PROGRAM_NV:
- FREE(n[4].data); /* program string */
+ _mesa_free(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- FREE(n[2].data); /* array of program ids */
+ _mesa_free(n[2].data); /* array of program ids */
n += InstSize[n[0].opcode];
break;
#endif
#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- FREE(n[3].data); /* parameter name */
+ _mesa_free(n[3].data); /* parameter name */
n += InstSize[n[0].opcode];
break;
#endif
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_PROGRAM_STRING_ARB:
- FREE(n[4].data); /* program string */
+ _mesa_free(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
#endif
- case OPCODE_CONTINUE:
- n = (Node *) n[1].next;
- FREE( block );
- block = n;
- break;
- case OPCODE_END_OF_LIST:
- FREE( block );
- done = GL_TRUE;
- break;
- default:
- /* Most frequent case */
- n += InstSize[n[0].opcode];
- break;
- }
+ case OPCODE_CONTINUE:
+ n = (Node *) n[1].next;
+ _mesa_free(block);
+ block = n;
+ break;
+ case OPCODE_END_OF_LIST:
+ _mesa_free(block);
+ done = GL_TRUE;
+ break;
+ default:
+ /* Most frequent case */
+ n += InstSize[n[0].opcode];
+ break;
+ }
}
}
- FREE( dlist );
+ _mesa_free(dlist);
_mesa_HashRemove(ctx->Shared->DisplayList, list);
}
@@ -586,7 +595,8 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list )
/*
* Translate the nth element of list from type to GLuint.
*/
-static GLuint translate_id( GLsizei n, GLenum type, const GLvoid *list )
+static GLuint
+translate_id(GLsizei n, GLenum type, const GLvoid * list)
{
GLbyte *bptr;
GLubyte *ubptr;
@@ -597,43 +607,41 @@ static GLuint translate_id( GLsizei n, GLenum type, const GLvoid *list )
GLfloat *fptr;
switch (type) {
- case GL_BYTE:
- bptr = (GLbyte *) list;
- return (GLuint) *(bptr+n);
- case GL_UNSIGNED_BYTE:
- ubptr = (GLubyte *) list;
- return (GLuint) *(ubptr+n);
- case GL_SHORT:
- sptr = (GLshort *) list;
- return (GLuint) *(sptr+n);
- case GL_UNSIGNED_SHORT:
- usptr = (GLushort *) list;
- return (GLuint) *(usptr+n);
- case GL_INT:
- iptr = (GLint *) list;
- return (GLuint) *(iptr+n);
- case GL_UNSIGNED_INT:
- uiptr = (GLuint *) list;
- return (GLuint) *(uiptr+n);
- case GL_FLOAT:
- fptr = (GLfloat *) list;
- return (GLuint) *(fptr+n);
- case GL_2_BYTES:
- ubptr = ((GLubyte *) list) + 2*n;
- return (GLuint) *ubptr * 256 + (GLuint) *(ubptr+1);
- case GL_3_BYTES:
- ubptr = ((GLubyte *) list) + 3*n;
- return (GLuint) *ubptr * 65536
- + (GLuint) *(ubptr+1) * 256
- + (GLuint) *(ubptr+2);
- case GL_4_BYTES:
- ubptr = ((GLubyte *) list) + 4*n;
- return (GLuint) *ubptr * 16777216
- + (GLuint) *(ubptr+1) * 65536
- + (GLuint) *(ubptr+2) * 256
- + (GLuint) *(ubptr+3);
- default:
- return 0;
+ case GL_BYTE:
+ bptr = (GLbyte *) list;
+ return (GLuint) *(bptr + n);
+ case GL_UNSIGNED_BYTE:
+ ubptr = (GLubyte *) list;
+ return (GLuint) *(ubptr + n);
+ case GL_SHORT:
+ sptr = (GLshort *) list;
+ return (GLuint) *(sptr + n);
+ case GL_UNSIGNED_SHORT:
+ usptr = (GLushort *) list;
+ return (GLuint) *(usptr + n);
+ case GL_INT:
+ iptr = (GLint *) list;
+ return (GLuint) *(iptr + n);
+ case GL_UNSIGNED_INT:
+ uiptr = (GLuint *) list;
+ return (GLuint) *(uiptr + n);
+ case GL_FLOAT:
+ fptr = (GLfloat *) list;
+ return (GLuint) *(fptr + n);
+ case GL_2_BYTES:
+ ubptr = ((GLubyte *) list) + 2 * n;
+ return (GLuint) *ubptr * 256 + (GLuint) * (ubptr + 1);
+ case GL_3_BYTES:
+ ubptr = ((GLubyte *) list) + 3 * n;
+ return (GLuint) * ubptr * 65536
+ + (GLuint) *(ubptr + 1) * 256 + (GLuint) * (ubptr + 2);
+ case GL_4_BYTES:
+ ubptr = ((GLubyte *) list) + 4 * n;
+ return (GLuint) *ubptr * 16777216
+ + (GLuint) *(ubptr + 1) * 65536
+ + (GLuint) *(ubptr + 2) * 256 + (GLuint) * (ubptr + 3);
+ default:
+ return 0;
}
}
@@ -645,247 +653,63 @@ static GLuint translate_id( GLsizei n, GLenum type, const GLvoid *list )
/**********************************************************************/
/**
- * Do one-time initialiazations for display lists.
- */
-void
-_mesa_init_lists( void )
-{
- static int init_flag = 0;
-
- if (init_flag==0) {
- InstSize[OPCODE_ACCUM] = 3;
- InstSize[OPCODE_ALPHA_FUNC] = 3;
- InstSize[OPCODE_BIND_TEXTURE] = 3;
- InstSize[OPCODE_BITMAP] = 8;
- InstSize[OPCODE_BLEND_COLOR] = 5;
- InstSize[OPCODE_BLEND_EQUATION] = 2;
- InstSize[OPCODE_BLEND_EQUATION_SEPARATE] = 3;
- InstSize[OPCODE_BLEND_FUNC_SEPARATE] = 5;
- InstSize[OPCODE_CALL_LIST] = 2;
- InstSize[OPCODE_CALL_LIST_OFFSET] = 3;
- InstSize[OPCODE_CLEAR] = 2;
- InstSize[OPCODE_CLEAR_ACCUM] = 5;
- InstSize[OPCODE_CLEAR_COLOR] = 5;
- InstSize[OPCODE_CLEAR_DEPTH] = 2;
- InstSize[OPCODE_CLEAR_INDEX] = 2;
- InstSize[OPCODE_CLEAR_STENCIL] = 2;
- InstSize[OPCODE_CLIP_PLANE] = 6;
- InstSize[OPCODE_COLOR_MASK] = 5;
- InstSize[OPCODE_COLOR_MATERIAL] = 3;
- InstSize[OPCODE_COLOR_TABLE] = 7;
- InstSize[OPCODE_COLOR_TABLE_PARAMETER_FV] = 7;
- InstSize[OPCODE_COLOR_TABLE_PARAMETER_IV] = 7;
- InstSize[OPCODE_COLOR_SUB_TABLE] = 7;
- InstSize[OPCODE_CONVOLUTION_FILTER_1D] = 7;
- InstSize[OPCODE_CONVOLUTION_FILTER_2D] = 8;
- InstSize[OPCODE_CONVOLUTION_PARAMETER_I] = 4;
- InstSize[OPCODE_CONVOLUTION_PARAMETER_IV] = 7;
- InstSize[OPCODE_CONVOLUTION_PARAMETER_F] = 4;
- InstSize[OPCODE_CONVOLUTION_PARAMETER_FV] = 7;
- InstSize[OPCODE_COPY_PIXELS] = 6;
- InstSize[OPCODE_COPY_COLOR_SUB_TABLE] = 6;
- InstSize[OPCODE_COPY_COLOR_TABLE] = 6;
- InstSize[OPCODE_COPY_TEX_IMAGE1D] = 8;
- InstSize[OPCODE_COPY_TEX_IMAGE2D] = 9;
- InstSize[OPCODE_COPY_TEX_SUB_IMAGE1D] = 7;
- InstSize[OPCODE_COPY_TEX_SUB_IMAGE2D] = 9;
- InstSize[OPCODE_COPY_TEX_SUB_IMAGE3D] = 10;
- InstSize[OPCODE_CULL_FACE] = 2;
- InstSize[OPCODE_DEPTH_FUNC] = 2;
- InstSize[OPCODE_DEPTH_MASK] = 2;
- InstSize[OPCODE_DEPTH_RANGE] = 3;
- InstSize[OPCODE_DISABLE] = 2;
- InstSize[OPCODE_DRAW_BUFFER] = 2;
- InstSize[OPCODE_DRAW_PIXELS] = 6;
- InstSize[OPCODE_ENABLE] = 2;
- InstSize[OPCODE_EVALMESH1] = 4;
- InstSize[OPCODE_EVALMESH2] = 6;
- InstSize[OPCODE_FOG] = 6;
- InstSize[OPCODE_FRONT_FACE] = 2;
- InstSize[OPCODE_FRUSTUM] = 7;
- InstSize[OPCODE_HINT] = 3;
- InstSize[OPCODE_HISTOGRAM] = 5;
- InstSize[OPCODE_INDEX_MASK] = 2;
- InstSize[OPCODE_INIT_NAMES] = 1;
- InstSize[OPCODE_LIGHT] = 7;
- InstSize[OPCODE_LIGHT_MODEL] = 6;
- InstSize[OPCODE_LINE_STIPPLE] = 3;
- InstSize[OPCODE_LINE_WIDTH] = 2;
- InstSize[OPCODE_LIST_BASE] = 2;
- InstSize[OPCODE_LOAD_IDENTITY] = 1;
- InstSize[OPCODE_LOAD_MATRIX] = 17;
- InstSize[OPCODE_LOAD_NAME] = 2;
- InstSize[OPCODE_LOGIC_OP] = 2;
- InstSize[OPCODE_MAP1] = 7;
- InstSize[OPCODE_MAP2] = 11;
- InstSize[OPCODE_MAPGRID1] = 4;
- InstSize[OPCODE_MAPGRID2] = 7;
- InstSize[OPCODE_MATRIX_MODE] = 2;
- InstSize[OPCODE_MIN_MAX] = 4;
- InstSize[OPCODE_MULT_MATRIX] = 17;
- InstSize[OPCODE_ORTHO] = 7;
- InstSize[OPCODE_PASSTHROUGH] = 2;
- InstSize[OPCODE_PIXEL_MAP] = 4;
- InstSize[OPCODE_PIXEL_TRANSFER] = 3;
- InstSize[OPCODE_PIXEL_ZOOM] = 3;
- InstSize[OPCODE_POINT_SIZE] = 2;
- InstSize[OPCODE_POINT_PARAMETERS] = 5;
- InstSize[OPCODE_POLYGON_MODE] = 3;
- InstSize[OPCODE_POLYGON_STIPPLE] = 2;
- InstSize[OPCODE_POLYGON_OFFSET] = 3;
- InstSize[OPCODE_POP_ATTRIB] = 1;
- InstSize[OPCODE_POP_MATRIX] = 1;
- InstSize[OPCODE_POP_NAME] = 1;
- InstSize[OPCODE_PRIORITIZE_TEXTURE] = 3;
- InstSize[OPCODE_PUSH_ATTRIB] = 2;
- InstSize[OPCODE_PUSH_MATRIX] = 1;
- InstSize[OPCODE_PUSH_NAME] = 2;
- InstSize[OPCODE_RASTER_POS] = 5;
- InstSize[OPCODE_READ_BUFFER] = 2;
- InstSize[OPCODE_RESET_HISTOGRAM] = 2;
- InstSize[OPCODE_RESET_MIN_MAX] = 2;
- InstSize[OPCODE_ROTATE] = 5;
- InstSize[OPCODE_SCALE] = 4;
- InstSize[OPCODE_SCISSOR] = 5;
- InstSize[OPCODE_STENCIL_FUNC] = 4;
- InstSize[OPCODE_STENCIL_MASK] = 2;
- InstSize[OPCODE_STENCIL_OP] = 4;
- InstSize[OPCODE_SHADE_MODEL] = 2;
- InstSize[OPCODE_TEXENV] = 7;
- InstSize[OPCODE_TEXGEN] = 7;
- InstSize[OPCODE_TEXPARAMETER] = 7;
- InstSize[OPCODE_TEX_IMAGE1D] = 9;
- InstSize[OPCODE_TEX_IMAGE2D] = 10;
- InstSize[OPCODE_TEX_IMAGE3D] = 11;
- InstSize[OPCODE_TEX_SUB_IMAGE1D] = 8;
- InstSize[OPCODE_TEX_SUB_IMAGE2D] = 10;
- InstSize[OPCODE_TEX_SUB_IMAGE3D] = 12;
- InstSize[OPCODE_TRANSLATE] = 4;
- InstSize[OPCODE_VIEWPORT] = 5;
- InstSize[OPCODE_WINDOW_POS] = 5;
- InstSize[OPCODE_CONTINUE] = 2;
- InstSize[OPCODE_ERROR] = 3;
- InstSize[OPCODE_END_OF_LIST] = 1;
- /* GL_ARB_texture_compression */
- InstSize[OPCODE_COMPRESSED_TEX_IMAGE_1D] = 8;
- InstSize[OPCODE_COMPRESSED_TEX_IMAGE_2D] = 9;
- InstSize[OPCODE_COMPRESSED_TEX_IMAGE_3D] = 10;
- InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D] = 8;
- InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D] = 10;
- InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D] = 12;
- /* GL_ARB_multisample */
- InstSize[OPCODE_SAMPLE_COVERAGE] = 3;
- /* GL_ARB_multitexture */
- InstSize[OPCODE_ACTIVE_TEXTURE] = 2;
- /* GL_ARB_window_pos */
- InstSize[OPCODE_WINDOW_POS_ARB] = 4;
- /* GL_NV_vertex_program */
- InstSize[OPCODE_BIND_PROGRAM_NV] = 3;
- InstSize[OPCODE_EXECUTE_PROGRAM_NV] = 7;
- InstSize[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV] = 2;
- InstSize[OPCODE_LOAD_PROGRAM_NV] = 5;
- InstSize[OPCODE_PROGRAM_PARAMETER4F_NV] = 7;
- InstSize[OPCODE_TRACK_MATRIX_NV] = 5;
- /* GL_NV_fragment_program */
- InstSize[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB] = 7;
- InstSize[OPCODE_PROGRAM_NAMED_PARAMETER_NV] = 8;
- /* GL_EXT_stencil_two_side */
- InstSize[OPCODE_ACTIVE_STENCIL_FACE_EXT] = 2;
- /* GL_EXT_depth_bounds_test */
- InstSize[OPCODE_DEPTH_BOUNDS_EXT] = 3;
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- InstSize[OPCODE_PROGRAM_STRING_ARB] = 5;
- InstSize[OPCODE_PROGRAM_ENV_PARAMETER_ARB] = 7;
-#endif
-#if FEATURE_ARB_occlusion_query
- InstSize[OPCODE_BEGIN_QUERY_ARB] = 3;
- InstSize[OPCODE_END_QUERY_ARB] = 2;
-#endif
- InstSize[OPCODE_DRAW_BUFFERS_ARB] = 2 + MAX_DRAW_BUFFERS;
-#if FEATURE_ATI_fragment_shader
- InstSize[OPCODE_BIND_FRAGMENT_SHADER_ATI] = 2;
- InstSize[OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI] = 6;
-#endif
- /* OpenGL 2.0 */
- InstSize[OPCODE_STENCIL_FUNC_SEPARATE] = 5;
- InstSize[OPCODE_STENCIL_MASK_SEPARATE] = 3;
- InstSize[OPCODE_STENCIL_OP_SEPARATE] = 5;
-
- InstSize[OPCODE_ATTR_1F_NV] = 3;
- InstSize[OPCODE_ATTR_2F_NV] = 4;
- InstSize[OPCODE_ATTR_3F_NV] = 5;
- InstSize[OPCODE_ATTR_4F_NV] = 6;
- InstSize[OPCODE_ATTR_1F_ARB] = 3;
- InstSize[OPCODE_ATTR_2F_ARB] = 4;
- InstSize[OPCODE_ATTR_3F_ARB] = 5;
- InstSize[OPCODE_ATTR_4F_ARB] = 6;
- InstSize[OPCODE_MATERIAL] = 7;
- InstSize[OPCODE_INDEX] = 2;
- InstSize[OPCODE_EDGEFLAG] = 2;
- InstSize[OPCODE_BEGIN] = 2;
- InstSize[OPCODE_END] = 1;
- InstSize[OPCODE_RECTF] = 5;
- InstSize[OPCODE_EVAL_C1] = 2;
- InstSize[OPCODE_EVAL_C2] = 3;
- InstSize[OPCODE_EVAL_P1] = 2;
- InstSize[OPCODE_EVAL_P2] = 3;
- }
- init_flag = 1;
-}
-
-
-
-/**
* Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
* \todo This won't suffice when the PBO is really in VRAM/GPU memory.
*/
static GLvoid *
-unpack_image( GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *unpack )
+unpack_image(GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *unpack)
{
if (unpack->BufferObj->Name == 0) {
/* no PBO */
- return _mesa_unpack_image(dimensions, width, height, depth, format, type,
- pixels, unpack);
+ return _mesa_unpack_image(dimensions, width, height, depth, format,
+ type, pixels, unpack);
}
- else if (_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
- format, type, pixels)) {
+ else
+ if (_mesa_validate_pbo_access
+ (dimensions, unpack, width, height, depth, format, type, pixels)) {
const GLubyte *src = ADD_POINTERS(unpack->BufferObj->Data, pixels);
- return _mesa_unpack_image(dimensions, width, height, depth, format, type,
- src, unpack);
+ return _mesa_unpack_image(dimensions, width, height, depth, format,
+ type, src, unpack);
}
/* bad access! */
return NULL;
}
-/*
+/**
* Allocate space for a display list instruction.
- * \param opcode - type of instruction
- * argcount - size in bytes of data required.
+ * \param opcode the instruction opcode (OPCODE_* value)
+ * \param size instruction size in bytes, not counting opcode.
* \return pointer to the usable data area (not including the internal
* opcode).
*/
void *
-_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz )
+_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes)
{
- Node *n, *newblock;
- GLuint count = 1 + (sz + sizeof(Node) - 1) / sizeof(Node);
+ const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
+ Node *n;
-#ifdef DEBUG
- if (opcode < (int) OPCODE_EXT_0) {
- assert( count == InstSize[opcode] );
+ if (opcode < (GLuint) OPCODE_EXT_0) {
+ if (InstSize[opcode] == 0) {
+ /* save instruction size now */
+ InstSize[opcode] = numNodes;
+ }
+ else {
+ /* make sure instruction size agrees */
+ ASSERT(numNodes == InstSize[opcode]);
+ }
}
-#endif
- if (ctx->ListState.CurrentPos + count + 2 > BLOCK_SIZE) {
+ if (ctx->ListState.CurrentPos + numNodes + 2 > BLOCK_SIZE) {
/* This block is full. Allocate a new block and chain to it */
+ Node *newblock;
n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
n[0].opcode = OPCODE_CONTINUE;
- newblock = (Node *) MALLOC( sizeof(Node) * BLOCK_SIZE );
+ newblock = (Node *) _mesa_malloc(sizeof(Node) * BLOCK_SIZE);
if (!newblock) {
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "Building display list" );
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
return NULL;
}
n[1].next = (Node *) newblock;
@@ -894,11 +718,11 @@ _mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz )
}
n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
- ctx->ListState.CurrentPos += count;
+ ctx->ListState.CurrentPos += numNodes;
n[0].opcode = (OpCode) opcode;
- return (void *)&n[1];
+ return (void *) (n + 1); /* return ptr to node following opcode */
}
@@ -913,15 +737,16 @@ _mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz )
* \return the new opcode number or -1 if error
*/
GLint
-_mesa_alloc_opcode( GLcontext *ctx,
- GLuint size,
- void (*execute)( GLcontext *, void * ),
- void (*destroy)( GLcontext *, void * ),
- void (*print)( GLcontext *, void * ) )
+_mesa_alloc_opcode(GLcontext *ctx,
+ GLuint size,
+ void (*execute) (GLcontext *, void *),
+ void (*destroy) (GLcontext *, void *),
+ void (*print) (GLcontext *, void *))
{
if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) {
const GLuint i = ctx->ListExt.NumOpcodes++;
- ctx->ListExt.Opcode[i].Size = 1 + (size + sizeof(Node) - 1)/sizeof(Node);
+ ctx->ListExt.Opcode[i].Size =
+ 1 + (size + sizeof(Node) - 1) / sizeof(Node);
ctx->ListExt.Opcode[i].Execute = execute;
ctx->ListExt.Opcode[i].Destroy = destroy;
ctx->ListExt.Opcode[i].Print = print;
@@ -932,77 +757,82 @@ _mesa_alloc_opcode( GLcontext *ctx,
-/* Mimic the old behaviour of alloc_instruction:
- * - sz is in units of sizeof(Node)
+/**
+ * Allocate display list instruction. Returns Node ptr to where the opcode
+ * is stored.
+ * - nParams is the number of function parameters
* - return value a pointer to sizeof(Node) before the actual
* usable data area.
*/
-#define ALLOC_INSTRUCTION(ctx, opcode, sz) \
- ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
+#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
+ ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
/*
* Display List compilation functions
*/
-static void GLAPIENTRY save_Accum( GLenum op, GLfloat value )
+static void GLAPIENTRY
+save_Accum(GLenum op, GLfloat value)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ACCUM, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ACCUM, 2);
if (n) {
n[1].e = op;
n[2].f = value;
}
if (ctx->ExecuteFlag) {
- CALL_Accum(ctx->Exec, ( op, value ));
+ CALL_Accum(ctx->Exec, (op, value));
}
}
-static void GLAPIENTRY save_AlphaFunc( GLenum func, GLclampf ref )
+static void GLAPIENTRY
+save_AlphaFunc(GLenum func, GLclampf ref)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ALPHA_FUNC, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ALPHA_FUNC, 2);
if (n) {
n[1].e = func;
n[2].f = (GLfloat) ref;
}
if (ctx->ExecuteFlag) {
- CALL_AlphaFunc(ctx->Exec, ( func, ref ));
+ CALL_AlphaFunc(ctx->Exec, (func, ref));
}
}
-static void GLAPIENTRY save_BindTexture( GLenum target, GLuint texture )
+static void GLAPIENTRY
+save_BindTexture(GLenum target, GLuint texture)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BIND_TEXTURE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_TEXTURE, 2);
if (n) {
n[1].e = target;
n[2].ui = texture;
}
if (ctx->ExecuteFlag) {
- CALL_BindTexture(ctx->Exec, ( target, texture ));
+ CALL_BindTexture(ctx->Exec, (target, texture));
}
}
-static void GLAPIENTRY save_Bitmap( GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove,
- const GLubyte *pixels )
+static void GLAPIENTRY
+save_Bitmap(GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove, const GLubyte * pixels)
{
GET_CURRENT_CONTEXT(ctx);
- GLvoid *image = _mesa_unpack_bitmap( width, height, pixels, &ctx->Unpack );
+ GLvoid *image = _mesa_unpack_bitmap(width, height, pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BITMAP, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7);
if (n) {
n[1].i = (GLint) width;
n[2].i = (GLint) height;
@@ -1013,54 +843,56 @@ static void GLAPIENTRY save_Bitmap( GLsizei width, GLsizei height,
n[7].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_Bitmap(ctx->Exec, ( width, height,
- xorig, yorig, xmove, ymove, pixels ));
+ CALL_Bitmap(ctx->Exec, (width, height,
+ xorig, yorig, xmove, ymove, pixels));
}
}
-static void GLAPIENTRY save_BlendEquation( GLenum mode )
+static void GLAPIENTRY
+save_BlendEquation(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_EQUATION, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_BlendEquation(ctx->Exec, ( mode ));
+ CALL_BlendEquation(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_BlendEquationSeparateEXT( GLenum modeRGB,
- GLenum modeA )
+static void GLAPIENTRY
+save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
if (n) {
n[1].e = modeRGB;
n[2].e = modeA;
}
if (ctx->ExecuteFlag) {
- CALL_BlendEquationSeparateEXT(ctx->Exec, ( modeRGB, modeA ));
+ CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA));
}
}
-static void GLAPIENTRY save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA)
+static void GLAPIENTRY
+save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_FUNC_SEPARATE, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
if (n) {
n[1].e = sfactorRGB;
n[2].e = dfactorRGB;
@@ -1068,19 +900,19 @@ static void GLAPIENTRY save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfact
n[4].e = dfactorA;
}
if (ctx->ExecuteFlag) {
- CALL_BlendFuncSeparateEXT(ctx->Exec,
- (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
+ CALL_BlendFuncSeparateEXT(ctx->Exec,
+ (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
}
}
-static void GLAPIENTRY save_BlendColor( GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
+static void GLAPIENTRY
+save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BLEND_COLOR, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_COLOR, 4);
if (n) {
n[1].f = red;
n[2].f = green;
@@ -1088,33 +920,35 @@ static void GLAPIENTRY save_BlendColor( GLfloat red, GLfloat green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- CALL_BlendColor(ctx->Exec, ( red, green, blue, alpha ));
+ CALL_BlendColor(ctx->Exec, (red, green, blue, alpha));
}
}
-void GLAPIENTRY _mesa_save_CallList( GLuint list )
+void GLAPIENTRY
+_mesa_save_CallList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CALL_LIST, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST, 1);
if (n) {
n[1].ui = list;
}
-
+
/* After this, we don't know what begin/end state we're in:
*/
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
if (ctx->ExecuteFlag) {
- CALL_CallList(ctx->Exec, ( list ));
+ CALL_CallList(ctx->Exec, (list));
}
}
-void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
+void GLAPIENTRY
+_mesa_save_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
@@ -1123,25 +957,25 @@ void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *list
SAVE_FLUSH_VERTICES(ctx);
switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- typeErrorFlag = GL_FALSE;
- break;
- default:
- typeErrorFlag = GL_TRUE;
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ typeErrorFlag = GL_FALSE;
+ break;
+ default:
+ typeErrorFlag = GL_TRUE;
}
- for (i=0;i<n;i++) {
- GLuint list = translate_id( i, type, lists );
- Node *n = ALLOC_INSTRUCTION( ctx, OPCODE_CALL_LIST_OFFSET, 2 );
+ for (i = 0; i < n; i++) {
+ GLuint list = translate_id(i, type, lists);
+ Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2);
if (n) {
n[1].ui = list;
n[2].b = typeErrorFlag;
@@ -1153,33 +987,34 @@ void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *list
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
if (ctx->ExecuteFlag) {
- CALL_CallLists(ctx->Exec, ( n, type, lists ));
+ CALL_CallLists(ctx->Exec, (n, type, lists));
}
}
-static void GLAPIENTRY save_Clear( GLbitfield mask )
+static void GLAPIENTRY
+save_Clear(GLbitfield mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR, 1);
if (n) {
n[1].bf = mask;
}
if (ctx->ExecuteFlag) {
- CALL_Clear(ctx->Exec, ( mask ));
+ CALL_Clear(ctx->Exec, (mask));
}
}
-static void GLAPIENTRY save_ClearAccum( GLfloat red, GLfloat green,
- GLfloat blue, GLfloat alpha )
+static void GLAPIENTRY
+save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR_ACCUM, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_ACCUM, 4);
if (n) {
n[1].f = red;
n[2].f = green;
@@ -1187,18 +1022,18 @@ static void GLAPIENTRY save_ClearAccum( GLfloat red, GLfloat green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- CALL_ClearAccum(ctx->Exec, ( red, green, blue, alpha ));
+ CALL_ClearAccum(ctx->Exec, (red, green, blue, alpha));
}
}
-static void GLAPIENTRY save_ClearColor( GLclampf red, GLclampf green,
- GLclampf blue, GLclampf alpha )
+static void GLAPIENTRY
+save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR_COLOR, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_COLOR, 4);
if (n) {
n[1].f = red;
n[2].f = green;
@@ -1206,62 +1041,66 @@ static void GLAPIENTRY save_ClearColor( GLclampf red, GLclampf green,
n[4].f = alpha;
}
if (ctx->ExecuteFlag) {
- CALL_ClearColor(ctx->Exec, ( red, green, blue, alpha ));
+ CALL_ClearColor(ctx->Exec, (red, green, blue, alpha));
}
}
-static void GLAPIENTRY save_ClearDepth( GLclampd depth )
+static void GLAPIENTRY
+save_ClearDepth(GLclampd depth)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR_DEPTH, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_DEPTH, 1);
if (n) {
n[1].f = (GLfloat) depth;
}
if (ctx->ExecuteFlag) {
- CALL_ClearDepth(ctx->Exec, ( depth ));
+ CALL_ClearDepth(ctx->Exec, (depth));
}
}
-static void GLAPIENTRY save_ClearIndex( GLfloat c )
+static void GLAPIENTRY
+save_ClearIndex(GLfloat c)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR_INDEX, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_INDEX, 1);
if (n) {
n[1].f = c;
}
if (ctx->ExecuteFlag) {
- CALL_ClearIndex(ctx->Exec, ( c ));
+ CALL_ClearIndex(ctx->Exec, (c));
}
}
-static void GLAPIENTRY save_ClearStencil( GLint s )
+static void GLAPIENTRY
+save_ClearStencil(GLint s)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLEAR_STENCIL, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_STENCIL, 1);
if (n) {
n[1].i = s;
}
if (ctx->ExecuteFlag) {
- CALL_ClearStencil(ctx->Exec, ( s ));
+ CALL_ClearStencil(ctx->Exec, (s));
}
}
-static void GLAPIENTRY save_ClipPlane( GLenum plane, const GLdouble *equ )
+static void GLAPIENTRY
+save_ClipPlane(GLenum plane, const GLdouble * equ)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CLIP_PLANE, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CLIP_PLANE, 5);
if (n) {
n[1].e = plane;
n[2].f = (GLfloat) equ[0];
@@ -1270,19 +1109,20 @@ static void GLAPIENTRY save_ClipPlane( GLenum plane, const GLdouble *equ )
n[5].f = (GLfloat) equ[3];
}
if (ctx->ExecuteFlag) {
- CALL_ClipPlane(ctx->Exec, ( plane, equ ));
+ CALL_ClipPlane(ctx->Exec, (plane, equ));
}
}
-static void GLAPIENTRY save_ColorMask( GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha )
+static void GLAPIENTRY
+save_ColorMask(GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_MASK, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4);
if (n) {
n[1].b = red;
n[2].b = green;
@@ -1290,44 +1130,46 @@ static void GLAPIENTRY save_ColorMask( GLboolean red, GLboolean green,
n[4].b = alpha;
}
if (ctx->ExecuteFlag) {
- CALL_ColorMask(ctx->Exec, ( red, green, blue, alpha ));
+ CALL_ColorMask(ctx->Exec, (red, green, blue, alpha));
}
}
-static void GLAPIENTRY save_ColorMaterial( GLenum face, GLenum mode )
+static void GLAPIENTRY
+save_ColorMaterial(GLenum face, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_MATERIAL, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2);
if (n) {
n[1].e = face;
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_ColorMaterial(ctx->Exec, ( face, mode ));
+ CALL_ColorMaterial(ctx->Exec, (face, mode));
}
}
-static void GLAPIENTRY save_ColorTable( GLenum target, GLenum internalFormat,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *table )
+static void GLAPIENTRY
+save_ColorTable(GLenum target, GLenum internalFormat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid * table)
{
GET_CURRENT_CONTEXT(ctx);
if (_mesa_is_proxy_texture(target)) {
/* execute immediately */
- CALL_ColorTable(ctx->Exec, ( target, internalFormat, width,
- format, type, table ));
+ CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
+ format, type, table));
}
else {
GLvoid *image = unpack_image(1, width, 1, 1, format, type, table,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_TABLE, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
@@ -1337,11 +1179,11 @@ static void GLAPIENTRY save_ColorTable( GLenum target, GLenum internalFormat,
n[6].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_ColorTable(ctx->Exec, ( target, internalFormat, width,
- format, type, table ));
+ CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
+ format, type, table));
}
}
}
@@ -1349,14 +1191,15 @@ static void GLAPIENTRY save_ColorTable( GLenum target, GLenum internalFormat,
static void GLAPIENTRY
-save_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+save_ColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -1372,7 +1215,7 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
}
if (ctx->ExecuteFlag) {
- CALL_ColorTableParameterfv(ctx->Exec, ( target, pname, params ));
+ CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params));
}
}
@@ -1385,7 +1228,7 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -1401,22 +1244,22 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
}
if (ctx->ExecuteFlag) {
- CALL_ColorTableParameteriv(ctx->Exec, ( target, pname, params ));
+ CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params));
}
}
-static void GLAPIENTRY save_ColorSubTable( GLenum target, GLsizei start, GLsizei count,
- GLenum format, GLenum type,
- const GLvoid *table)
+static void GLAPIENTRY
+save_ColorSubTable(GLenum target, GLsizei start, GLsizei count,
+ GLenum format, GLenum type, const GLvoid * table)
{
GET_CURRENT_CONTEXT(ctx);
GLvoid *image = unpack_image(1, count, 1, 1, format, type, table,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COLOR_SUB_TABLE, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6);
if (n) {
n[1].e = target;
n[2].i = start;
@@ -1426,10 +1269,11 @@ static void GLAPIENTRY save_ColorSubTable( GLenum target, GLsizei start, GLsizei
n[6].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_ColorSubTable(ctx->Exec, (target, start, count, format, type, table));
+ CALL_ColorSubTable(ctx->Exec,
+ (target, start, count, format, type, table));
}
}
@@ -1442,7 +1286,7 @@ save_CopyColorSubTable(GLenum target, GLsizei start,
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
if (n) {
n[1].e = target;
n[2].i = start;
@@ -1464,7 +1308,7 @@ save_CopyColorTable(GLenum target, GLenum internalformat,
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_COLOR_TABLE, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5);
if (n) {
n[1].e = target;
n[2].e = internalformat;
@@ -1480,14 +1324,14 @@ save_CopyColorTable(GLenum target, GLenum internalformat,
static void GLAPIENTRY
save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
- GLenum format, GLenum type, const GLvoid *filter)
+ GLenum format, GLenum type, const GLvoid * filter)
{
GET_CURRENT_CONTEXT(ctx);
GLvoid *image = unpack_image(1, width, 1, 1, format, type, filter,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_FILTER_1D, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
@@ -1497,11 +1341,11 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
n[6].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionFilter1D(ctx->Exec, ( target, internalFormat, width,
- format, type, filter ));
+ CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width,
+ format, type, filter));
}
}
@@ -1509,14 +1353,14 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
static void GLAPIENTRY
save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *filter)
+ GLenum type, const GLvoid * filter)
{
GET_CURRENT_CONTEXT(ctx);
GLvoid *image = unpack_image(2, width, height, 1, format, type, filter,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_FILTER_2D, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
@@ -1527,11 +1371,12 @@ save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
n[7].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionFilter2D(ctx->Exec, ( target, internalFormat, width, height,
- format, type, filter ));
+ CALL_ConvolutionFilter2D(ctx->Exec,
+ (target, internalFormat, width, height, format,
+ type, filter));
}
}
@@ -1542,14 +1387,14 @@ save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].i = param;
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameteri(ctx->Exec, ( target, pname, param ));
+ CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param));
}
}
@@ -1560,7 +1405,7 @@ save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -1577,7 +1422,7 @@ save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
}
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameteriv(ctx->Exec, ( target, pname, params ));
+ CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params));
}
}
@@ -1588,25 +1433,26 @@ save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
n[3].f = param;
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameterf(ctx->Exec, ( target, pname, param ));
+ CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param));
}
}
static void GLAPIENTRY
-save_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+save_ConvolutionParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -1623,19 +1469,18 @@ save_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
}
}
if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameterfv(ctx->Exec, ( target, pname, params ));
+ CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params));
}
}
static void GLAPIENTRY
-save_CopyPixels( GLint x, GLint y,
- GLsizei width, GLsizei height, GLenum type )
+save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_PIXELS, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_PIXELS, 5);
if (n) {
n[1].i = x;
n[2].i = y;
@@ -1644,20 +1489,20 @@ save_CopyPixels( GLint x, GLint y,
n[5].e = type;
}
if (ctx->ExecuteFlag) {
- CALL_CopyPixels(ctx->Exec, ( x, y, width, height, type ));
+ CALL_CopyPixels(ctx->Exec, (x, y, width, height, type));
}
}
static void GLAPIENTRY
-save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLint border )
+save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLint border)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_TEX_IMAGE1D, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -1668,22 +1513,22 @@ save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
n[7].i = border;
}
if (ctx->ExecuteFlag) {
- CALL_CopyTexImage1D(ctx->Exec, ( target, level, internalformat,
- x, y, width, border ));
+ CALL_CopyTexImage1D(ctx->Exec, (target, level, internalformat,
+ x, y, width, border));
}
}
static void GLAPIENTRY
-save_CopyTexImage2D( GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y, GLsizei width,
- GLsizei height, GLint border )
+save_CopyTexImage2D(GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y, GLsizei width,
+ GLsizei height, GLint border)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_TEX_IMAGE2D, 8 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -1695,22 +1540,21 @@ save_CopyTexImage2D( GLenum target, GLint level,
n[8].i = border;
}
if (ctx->ExecuteFlag) {
- CALL_CopyTexImage2D(ctx->Exec, ( target, level, internalformat,
- x, y, width, height, border ));
+ CALL_CopyTexImage2D(ctx->Exec, (target, level, internalformat,
+ x, y, width, height, border));
}
}
static void GLAPIENTRY
-save_CopyTexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y,
- GLsizei width )
+save_CopyTexSubImage1D(GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -1720,21 +1564,21 @@ save_CopyTexSubImage1D( GLenum target, GLint level,
n[6].i = width;
}
if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage1D(ctx->Exec, ( target, level, xoffset, x, y, width ));
+ CALL_CopyTexSubImage1D(ctx->Exec,
+ (target, level, xoffset, x, y, width));
}
}
static void GLAPIENTRY
-save_CopyTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLint height )
+save_CopyTexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLint height)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -1746,22 +1590,21 @@ save_CopyTexSubImage2D( GLenum target, GLint level,
n[8].i = height;
}
if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage2D(ctx->Exec, ( target, level, xoffset, yoffset,
- x, y, width, height ));
+ CALL_CopyTexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
+ x, y, width, height));
}
}
static void GLAPIENTRY
-save_CopyTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y,
- GLsizei width, GLint height )
+save_CopyTexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLint height)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -1774,114 +1617,120 @@ save_CopyTexSubImage3D( GLenum target, GLint level,
n[9].i = height;
}
if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage3D(ctx->Exec, ( target, level,
- xoffset, yoffset, zoffset,
- x, y, width, height ));
+ CALL_CopyTexSubImage3D(ctx->Exec, (target, level,
+ xoffset, yoffset, zoffset,
+ x, y, width, height));
}
}
-static void GLAPIENTRY save_CullFace( GLenum mode )
+static void GLAPIENTRY
+save_CullFace(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_CULL_FACE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_CULL_FACE, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_CullFace(ctx->Exec, ( mode ));
+ CALL_CullFace(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_DepthFunc( GLenum func )
+static void GLAPIENTRY
+save_DepthFunc(GLenum func)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DEPTH_FUNC, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_FUNC, 1);
if (n) {
n[1].e = func;
}
if (ctx->ExecuteFlag) {
- CALL_DepthFunc(ctx->Exec, ( func ));
+ CALL_DepthFunc(ctx->Exec, (func));
}
}
-static void GLAPIENTRY save_DepthMask( GLboolean mask )
+static void GLAPIENTRY
+save_DepthMask(GLboolean mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DEPTH_MASK, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_MASK, 1);
if (n) {
n[1].b = mask;
}
if (ctx->ExecuteFlag) {
- CALL_DepthMask(ctx->Exec, ( mask ));
+ CALL_DepthMask(ctx->Exec, (mask));
}
}
-static void GLAPIENTRY save_DepthRange( GLclampd nearval, GLclampd farval )
+static void GLAPIENTRY
+save_DepthRange(GLclampd nearval, GLclampd farval)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DEPTH_RANGE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_RANGE, 2);
if (n) {
n[1].f = (GLfloat) nearval;
n[2].f = (GLfloat) farval;
}
if (ctx->ExecuteFlag) {
- CALL_DepthRange(ctx->Exec, ( nearval, farval ));
+ CALL_DepthRange(ctx->Exec, (nearval, farval));
}
}
-static void GLAPIENTRY save_Disable( GLenum cap )
+static void GLAPIENTRY
+save_Disable(GLenum cap)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DISABLE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DISABLE, 1);
if (n) {
n[1].e = cap;
}
if (ctx->ExecuteFlag) {
- CALL_Disable(ctx->Exec, ( cap ));
+ CALL_Disable(ctx->Exec, (cap));
}
}
-static void GLAPIENTRY save_DrawBuffer( GLenum mode )
+static void GLAPIENTRY
+save_DrawBuffer(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DRAW_BUFFER, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFER, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_DrawBuffer(ctx->Exec, ( mode ));
+ CALL_DrawBuffer(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_DrawPixels( GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_DrawPixels(GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DRAW_PIXELS, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5);
if (n) {
n[1].i = width;
n[2].i = height;
@@ -1890,54 +1739,57 @@ static void GLAPIENTRY save_DrawPixels( GLsizei width, GLsizei height,
n[5].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_DrawPixels(ctx->Exec, ( width, height, format, type, pixels ));
+ CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels));
}
}
-static void GLAPIENTRY save_Enable( GLenum cap )
+static void GLAPIENTRY
+save_Enable(GLenum cap)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ENABLE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ENABLE, 1);
if (n) {
n[1].e = cap;
}
if (ctx->ExecuteFlag) {
- CALL_Enable(ctx->Exec, ( cap ));
+ CALL_Enable(ctx->Exec, (cap));
}
}
-void GLAPIENTRY _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+static void GLAPIENTRY
+_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVALMESH1, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH1, 3);
if (n) {
n[1].e = mode;
n[2].i = i1;
n[3].i = i2;
}
if (ctx->ExecuteFlag) {
- CALL_EvalMesh1(ctx->Exec, ( mode, i1, i2 ));
+ CALL_EvalMesh1(ctx->Exec, (mode, i1, i2));
}
}
-void GLAPIENTRY _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
+static void GLAPIENTRY
+_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVALMESH2, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH2, 5);
if (n) {
n[1].e = mode;
n[2].i = i1;
@@ -1946,19 +1798,20 @@ void GLAPIENTRY _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1,
n[5].i = j2;
}
if (ctx->ExecuteFlag) {
- CALL_EvalMesh2(ctx->Exec, ( mode, i1, i2, j1, j2 ));
+ CALL_EvalMesh2(ctx->Exec, (mode, i1, i2, j1, j2));
}
}
-static void GLAPIENTRY save_Fogfv( GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_Fogfv(GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_FOG, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_FOG, 5);
if (n) {
n[1].e = pname;
n[2].f = params[0];
@@ -1967,71 +1820,75 @@ static void GLAPIENTRY save_Fogfv( GLenum pname, const GLfloat *params )
n[5].f = params[3];
}
if (ctx->ExecuteFlag) {
- CALL_Fogfv(ctx->Exec, ( pname, params ));
+ CALL_Fogfv(ctx->Exec, (pname, params));
}
}
-static void GLAPIENTRY save_Fogf( GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_Fogf(GLenum pname, GLfloat param)
{
save_Fogfv(pname, &param);
}
-static void GLAPIENTRY save_Fogiv(GLenum pname, const GLint *params )
+static void GLAPIENTRY
+save_Fogiv(GLenum pname, const GLint *params)
{
GLfloat p[4];
switch (pname) {
- case GL_FOG_MODE:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_FOG_INDEX:
- p[0] = (GLfloat) *params;
- break;
- case GL_FOG_COLOR:
- p[0] = INT_TO_FLOAT( params[0] );
- p[1] = INT_TO_FLOAT( params[1] );
- p[2] = INT_TO_FLOAT( params[2] );
- p[3] = INT_TO_FLOAT( params[3] );
- break;
- default:
- /* Error will be caught later in gl_Fogfv */
- ;
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ p[0] = (GLfloat) *params;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT(params[0]);
+ p[1] = INT_TO_FLOAT(params[1]);
+ p[2] = INT_TO_FLOAT(params[2]);
+ p[3] = INT_TO_FLOAT(params[3]);
+ break;
+ default:
+ /* Error will be caught later in gl_Fogfv */
+ ;
}
save_Fogfv(pname, p);
}
-static void GLAPIENTRY save_Fogi(GLenum pname, GLint param )
+static void GLAPIENTRY
+save_Fogi(GLenum pname, GLint param)
{
save_Fogiv(pname, &param);
}
-static void GLAPIENTRY save_FrontFace( GLenum mode )
+static void GLAPIENTRY
+save_FrontFace(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_FRONT_FACE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_FRONT_FACE, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_FrontFace(ctx->Exec, ( mode ));
+ CALL_FrontFace(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_Frustum( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
+static void GLAPIENTRY
+save_Frustum(GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_FRUSTUM, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6);
if (n) {
n[1].f = (GLfloat) left;
n[2].f = (GLfloat) right;
@@ -2041,35 +1898,37 @@ static void GLAPIENTRY save_Frustum( GLdouble left, GLdouble right,
n[6].f = (GLfloat) farval;
}
if (ctx->ExecuteFlag) {
- CALL_Frustum(ctx->Exec, ( left, right, bottom, top, nearval, farval ));
+ CALL_Frustum(ctx->Exec, (left, right, bottom, top, nearval, farval));
}
}
-static void GLAPIENTRY save_Hint( GLenum target, GLenum mode )
+static void GLAPIENTRY
+save_Hint(GLenum target, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_HINT, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_HINT, 2);
if (n) {
n[1].e = target;
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_Hint(ctx->Exec, ( target, mode ));
+ CALL_Hint(ctx->Exec, (target, mode));
}
}
static void GLAPIENTRY
-save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
+save_Histogram(GLenum target, GLsizei width, GLenum internalFormat,
+ GLboolean sink)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_HISTOGRAM, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4);
if (n) {
n[1].e = target;
n[2].i = width;
@@ -2077,147 +1936,154 @@ save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean si
n[4].b = sink;
}
if (ctx->ExecuteFlag) {
- CALL_Histogram(ctx->Exec, ( target, width, internalFormat, sink ));
+ CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink));
}
}
-static void GLAPIENTRY save_IndexMask( GLuint mask )
+static void GLAPIENTRY
+save_IndexMask(GLuint mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_INDEX_MASK, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX_MASK, 1);
if (n) {
n[1].ui = mask;
}
if (ctx->ExecuteFlag) {
- CALL_IndexMask(ctx->Exec, ( mask ));
+ CALL_IndexMask(ctx->Exec, (mask));
}
}
-static void GLAPIENTRY save_InitNames( void )
+static void GLAPIENTRY
+save_InitNames(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_INIT_NAMES, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0);
if (ctx->ExecuteFlag) {
CALL_InitNames(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LIGHT, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT, 6);
if (OPCODE_LIGHT) {
GLint i, nParams;
n[1].e = light;
n[2].e = pname;
switch (pname) {
- case GL_AMBIENT:
- nParams = 4;
- break;
- case GL_DIFFUSE:
- nParams = 4;
- break;
- case GL_SPECULAR:
- nParams = 4;
- break;
- case GL_POSITION:
- nParams = 4;
- break;
- case GL_SPOT_DIRECTION:
- nParams = 3;
- break;
- case GL_SPOT_EXPONENT:
- nParams = 1;
- break;
- case GL_SPOT_CUTOFF:
- nParams = 1;
- break;
- case GL_CONSTANT_ATTENUATION:
- nParams = 1;
- break;
- case GL_LINEAR_ATTENUATION:
- nParams = 1;
- break;
- case GL_QUADRATIC_ATTENUATION:
- nParams = 1;
- break;
- default:
- nParams = 0;
+ case GL_AMBIENT:
+ nParams = 4;
+ break;
+ case GL_DIFFUSE:
+ nParams = 4;
+ break;
+ case GL_SPECULAR:
+ nParams = 4;
+ break;
+ case GL_POSITION:
+ nParams = 4;
+ break;
+ case GL_SPOT_DIRECTION:
+ nParams = 3;
+ break;
+ case GL_SPOT_EXPONENT:
+ nParams = 1;
+ break;
+ case GL_SPOT_CUTOFF:
+ nParams = 1;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_LINEAR_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ nParams = 1;
+ break;
+ default:
+ nParams = 0;
}
for (i = 0; i < nParams; i++) {
- n[3+i].f = params[i];
+ n[3 + i].f = params[i];
}
}
if (ctx->ExecuteFlag) {
- CALL_Lightfv(ctx->Exec, ( light, pname, params ));
+ CALL_Lightfv(ctx->Exec, (light, pname, params));
}
}
-static void GLAPIENTRY save_Lightf( GLenum light, GLenum pname, GLfloat params )
+static void GLAPIENTRY
+save_Lightf(GLenum light, GLenum pname, GLfloat params)
{
save_Lightfv(light, pname, &params);
}
-static void GLAPIENTRY save_Lightiv( GLenum light, GLenum pname, const GLint *params )
+static void GLAPIENTRY
+save_Lightiv(GLenum light, GLenum pname, const GLint *params)
{
GLfloat fparam[4];
switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_POSITION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- fparam[3] = (GLfloat) params[3];
- break;
- case GL_SPOT_DIRECTION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- break;
- case GL_SPOT_EXPONENT:
- case GL_SPOT_CUTOFF:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- fparam[0] = (GLfloat) params[0];
- break;
- default:
- /* error will be caught later in gl_Lightfv */
- ;
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ fparam[1] = INT_TO_FLOAT(params[1]);
+ fparam[2] = INT_TO_FLOAT(params[2]);
+ fparam[3] = INT_TO_FLOAT(params[3]);
+ break;
+ case GL_POSITION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ fparam[3] = (GLfloat) params[3];
+ break;
+ case GL_SPOT_DIRECTION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ break;
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* error will be caught later in gl_Lightfv */
+ ;
}
- save_Lightfv( light, pname, fparam );
+ save_Lightfv(light, pname, fparam);
}
-static void GLAPIENTRY save_Lighti( GLenum light, GLenum pname, GLint param )
+static void GLAPIENTRY
+save_Lighti(GLenum light, GLenum pname, GLint param)
{
- save_Lightiv( light, pname, &param );
+ save_Lightiv(light, pname, &param);
}
-static void GLAPIENTRY save_LightModelfv( GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_LightModelfv(GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LIGHT_MODEL, 5 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT_MODEL, 5);
if (n) {
n[1].e = pname;
n[2].f = params[0];
@@ -2226,122 +2092,131 @@ static void GLAPIENTRY save_LightModelfv( GLenum pname, const GLfloat *params )
n[5].f = params[3];
}
if (ctx->ExecuteFlag) {
- CALL_LightModelfv(ctx->Exec, ( pname, params ));
+ CALL_LightModelfv(ctx->Exec, (pname, params));
}
}
-static void GLAPIENTRY save_LightModelf( GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_LightModelf(GLenum pname, GLfloat param)
{
save_LightModelfv(pname, &param);
}
-static void GLAPIENTRY save_LightModeliv( GLenum pname, const GLint *params )
+static void GLAPIENTRY
+save_LightModeliv(GLenum pname, const GLint *params)
{
GLfloat fparam[4];
switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- fparam[0] = INT_TO_FLOAT( params[0] );
- fparam[1] = INT_TO_FLOAT( params[1] );
- fparam[2] = INT_TO_FLOAT( params[2] );
- fparam[3] = INT_TO_FLOAT( params[3] );
- break;
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- case GL_LIGHT_MODEL_TWO_SIDE:
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- fparam[0] = (GLfloat) params[0];
- break;
- default:
- /* Error will be caught later in gl_LightModelfv */
- ;
+ case GL_LIGHT_MODEL_AMBIENT:
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ fparam[1] = INT_TO_FLOAT(params[1]);
+ fparam[2] = INT_TO_FLOAT(params[2]);
+ fparam[3] = INT_TO_FLOAT(params[3]);
+ break;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* Error will be caught later in gl_LightModelfv */
+ ;
}
save_LightModelfv(pname, fparam);
}
-static void GLAPIENTRY save_LightModeli( GLenum pname, GLint param )
+static void GLAPIENTRY
+save_LightModeli(GLenum pname, GLint param)
{
save_LightModeliv(pname, &param);
}
-static void GLAPIENTRY save_LineStipple( GLint factor, GLushort pattern )
+static void GLAPIENTRY
+save_LineStipple(GLint factor, GLushort pattern)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LINE_STIPPLE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2);
if (n) {
n[1].i = factor;
n[2].us = pattern;
}
if (ctx->ExecuteFlag) {
- CALL_LineStipple(ctx->Exec, ( factor, pattern ));
+ CALL_LineStipple(ctx->Exec, (factor, pattern));
}
}
-static void GLAPIENTRY save_LineWidth( GLfloat width )
+static void GLAPIENTRY
+save_LineWidth(GLfloat width)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LINE_WIDTH, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1);
if (n) {
n[1].f = width;
}
if (ctx->ExecuteFlag) {
- CALL_LineWidth(ctx->Exec, ( width ));
+ CALL_LineWidth(ctx->Exec, (width));
}
}
-static void GLAPIENTRY save_ListBase( GLuint base )
+static void GLAPIENTRY
+save_ListBase(GLuint base)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LIST_BASE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1);
if (n) {
n[1].ui = base;
}
if (ctx->ExecuteFlag) {
- CALL_ListBase(ctx->Exec, ( base ));
+ CALL_ListBase(ctx->Exec, (base));
}
}
-static void GLAPIENTRY save_LoadIdentity( void )
+static void GLAPIENTRY
+save_LoadIdentity(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_LOAD_IDENTITY, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0);
if (ctx->ExecuteFlag) {
CALL_LoadIdentity(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_LoadMatrixf( const GLfloat *m )
+static void GLAPIENTRY
+save_LoadMatrixf(const GLfloat * m)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LOAD_MATRIX, 16 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16);
if (n) {
GLuint i;
- for (i=0;i<16;i++) {
- n[1+i].f = m[i];
+ for (i = 0; i < 16; i++) {
+ n[1 + i].f = m[i];
}
}
if (ctx->ExecuteFlag) {
- CALL_LoadMatrixf(ctx->Exec, ( m ));
+ CALL_LoadMatrixf(ctx->Exec, (m));
}
}
-static void GLAPIENTRY save_LoadMatrixd( const GLdouble *m )
+static void GLAPIENTRY
+save_LoadMatrixd(const GLdouble * m)
{
GLfloat f[16];
GLint i;
@@ -2352,172 +2227,181 @@ static void GLAPIENTRY save_LoadMatrixd( const GLdouble *m )
}
-static void GLAPIENTRY save_LoadName( GLuint name )
+static void GLAPIENTRY
+save_LoadName(GLuint name)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LOAD_NAME, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1);
if (n) {
n[1].ui = name;
}
if (ctx->ExecuteFlag) {
- CALL_LoadName(ctx->Exec, ( name ));
+ CALL_LoadName(ctx->Exec, (name));
}
}
-static void GLAPIENTRY save_LogicOp( GLenum opcode )
+static void GLAPIENTRY
+save_LogicOp(GLenum opcode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LOGIC_OP, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1);
if (n) {
n[1].e = opcode;
}
if (ctx->ExecuteFlag) {
- CALL_LogicOp(ctx->Exec, ( opcode ));
+ CALL_LogicOp(ctx->Exec, (opcode));
}
}
-static void GLAPIENTRY save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
- GLint order, const GLdouble *points)
+static void GLAPIENTRY
+save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble * points)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAP1, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);
if (n) {
- GLfloat *pnts = _mesa_copy_map_points1d( target, stride, order, points );
+ GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
n[1].e = target;
n[2].f = (GLfloat) u1;
n[3].f = (GLfloat) u2;
- n[4].i = _mesa_evaluator_components(target); /* stride */
+ n[4].i = _mesa_evaluator_components(target); /* stride */
n[5].i = order;
n[6].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- CALL_Map1d(ctx->Exec, ( target, u1, u2, stride, order, points ));
+ CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points));
}
}
-static void GLAPIENTRY save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points)
+static void GLAPIENTRY
+save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat * points)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAP1, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);
if (n) {
- GLfloat *pnts = _mesa_copy_map_points1f( target, stride, order, points );
+ GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
n[1].e = target;
n[2].f = u1;
n[3].f = u2;
- n[4].i = _mesa_evaluator_components(target); /* stride */
+ n[4].i = _mesa_evaluator_components(target); /* stride */
n[5].i = order;
n[6].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- CALL_Map1f(ctx->Exec, ( target, u1, u2, stride, order, points ));
+ CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points));
}
}
-static void GLAPIENTRY save_Map2d( GLenum target,
- GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
- GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
- const GLdouble *points )
+static void GLAPIENTRY
+save_Map2d(GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble * points)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAP2, 10 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);
if (n) {
- GLfloat *pnts = _mesa_copy_map_points2d( target, ustride, uorder,
- vstride, vorder, points );
+ GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
+ vstride, vorder, points);
n[1].e = target;
n[2].f = (GLfloat) u1;
n[3].f = (GLfloat) u2;
n[4].f = (GLfloat) v1;
n[5].f = (GLfloat) v2;
/* XXX verify these strides are correct */
- n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/
- n[7].i = _mesa_evaluator_components(target); /*vstride*/
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
+ n[7].i = _mesa_evaluator_components(target); /*vstride */
n[8].i = uorder;
n[9].i = vorder;
n[10].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- CALL_Map2d(ctx->Exec, ( target,
- u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, points ));
+ CALL_Map2d(ctx->Exec, (target,
+ u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points));
}
}
-static void GLAPIENTRY save_Map2f( GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points )
+static void GLAPIENTRY
+save_Map2f(GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat * points)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAP2, 10 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);
if (n) {
- GLfloat *pnts = _mesa_copy_map_points2f( target, ustride, uorder,
- vstride, vorder, points );
+ GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
+ vstride, vorder, points);
n[1].e = target;
n[2].f = u1;
n[3].f = u2;
n[4].f = v1;
n[5].f = v2;
/* XXX verify these strides are correct */
- n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/
- n[7].i = _mesa_evaluator_components(target); /*vstride*/
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
+ n[7].i = _mesa_evaluator_components(target); /*vstride */
n[8].i = uorder;
n[9].i = vorder;
n[10].data = (void *) pnts;
}
if (ctx->ExecuteFlag) {
- CALL_Map2f(ctx->Exec, ( target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, points ));
+ CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points));
}
}
-static void GLAPIENTRY save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
+static void GLAPIENTRY
+save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAPGRID1, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3);
if (n) {
n[1].i = un;
n[2].f = u1;
n[3].f = u2;
}
if (ctx->ExecuteFlag) {
- CALL_MapGrid1f(ctx->Exec, ( un, u1, u2 ));
+ CALL_MapGrid1f(ctx->Exec, (un, u1, u2));
}
}
-static void GLAPIENTRY save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
+static void GLAPIENTRY
+save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
{
save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
}
-static void GLAPIENTRY save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 )
+static void GLAPIENTRY
+save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MAPGRID2, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6);
if (n) {
n[1].i = un;
n[2].f = u1;
@@ -2527,31 +2411,33 @@ static void GLAPIENTRY save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
n[6].f = v2;
}
if (ctx->ExecuteFlag) {
- CALL_MapGrid2f(ctx->Exec, ( un, u1, u2, vn, v1, v2 ));
+ CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2));
}
}
-static void GLAPIENTRY save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
- GLint vn, GLdouble v1, GLdouble v2 )
+static void GLAPIENTRY
+save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2)
{
save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
- vn, (GLfloat) v1, (GLfloat) v2);
+ vn, (GLfloat) v1, (GLfloat) v2);
}
-static void GLAPIENTRY save_MatrixMode( GLenum mode )
+static void GLAPIENTRY
+save_MatrixMode(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MATRIX_MODE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_MatrixMode(ctx->Exec, ( mode ));
+ CALL_MatrixMode(ctx->Exec, (mode));
}
}
@@ -2563,37 +2449,39 @@ save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MIN_MAX, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
n[3].b = sink;
}
if (ctx->ExecuteFlag) {
- CALL_Minmax(ctx->Exec, ( target, internalFormat, sink ));
+ CALL_Minmax(ctx->Exec, (target, internalFormat, sink));
}
}
-static void GLAPIENTRY save_MultMatrixf( const GLfloat *m )
+static void GLAPIENTRY
+save_MultMatrixf(const GLfloat * m)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MULT_MATRIX, 16 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16);
if (n) {
GLuint i;
- for (i=0;i<16;i++) {
- n[1+i].f = m[i];
+ for (i = 0; i < 16; i++) {
+ n[1 + i].f = m[i];
}
}
if (ctx->ExecuteFlag) {
- CALL_MultMatrixf(ctx->Exec, ( m ));
+ CALL_MultMatrixf(ctx->Exec, (m));
}
}
-static void GLAPIENTRY save_MultMatrixd( const GLdouble *m )
+static void GLAPIENTRY
+save_MultMatrixd(const GLdouble * m)
{
GLfloat f[16];
GLint i;
@@ -2604,25 +2492,26 @@ static void GLAPIENTRY save_MultMatrixd( const GLdouble *m )
}
-static void GLAPIENTRY save_NewList( GLuint list, GLenum mode )
+static void GLAPIENTRY
+save_NewList(GLuint list, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
/* It's an error to call this function while building a display list */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glNewList" );
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
(void) list;
(void) mode;
}
-static void GLAPIENTRY save_Ortho( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
+static void GLAPIENTRY
+save_Ortho(GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ORTHO, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6);
if (n) {
n[1].f = (GLfloat) left;
n[2].f = (GLfloat) right;
@@ -2632,43 +2521,43 @@ static void GLAPIENTRY save_Ortho( GLdouble left, GLdouble right,
n[6].f = (GLfloat) farval;
}
if (ctx->ExecuteFlag) {
- CALL_Ortho(ctx->Exec, ( left, right, bottom, top, nearval, farval ));
+ CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval));
}
}
static void GLAPIENTRY
-save_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
+save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PIXEL_MAP, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3);
if (n) {
n[1].e = map;
n[2].i = mapsize;
- n[3].data = (void *) MALLOC( mapsize * sizeof(GLfloat) );
- MEMCPY( n[3].data, (void *) values, mapsize * sizeof(GLfloat) );
+ n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat));
+ MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
}
if (ctx->ExecuteFlag) {
- CALL_PixelMapfv(ctx->Exec, ( map, mapsize, values ));
+ CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
}
}
static void GLAPIENTRY
-save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
+save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLint i;
- if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ for (i = 0; i < mapsize; i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = UINT_TO_FLOAT( values[i] );
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = UINT_TO_FLOAT(values[i]);
}
}
save_PixelMapfv(map, mapsize, fvalues);
@@ -2680,14 +2569,14 @@ save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLint i;
- if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ for (i = 0; i < mapsize; i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
- for (i=0;i<mapsize;i++) {
- fvalues[i] = USHORT_TO_FLOAT( values[i] );
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = USHORT_TO_FLOAT(values[i]);
}
}
save_PixelMapfv(map, mapsize, fvalues);
@@ -2695,53 +2584,53 @@ save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
static void GLAPIENTRY
-save_PixelTransferf( GLenum pname, GLfloat param )
+save_PixelTransferf(GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PIXEL_TRANSFER, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2);
if (n) {
n[1].e = pname;
n[2].f = param;
}
if (ctx->ExecuteFlag) {
- CALL_PixelTransferf(ctx->Exec, ( pname, param ));
+ CALL_PixelTransferf(ctx->Exec, (pname, param));
}
}
static void GLAPIENTRY
-save_PixelTransferi( GLenum pname, GLint param )
+save_PixelTransferi(GLenum pname, GLint param)
{
- save_PixelTransferf( pname, (GLfloat) param );
+ save_PixelTransferf(pname, (GLfloat) param);
}
static void GLAPIENTRY
-save_PixelZoom( GLfloat xfactor, GLfloat yfactor )
+save_PixelZoom(GLfloat xfactor, GLfloat yfactor)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PIXEL_ZOOM, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2);
if (n) {
n[1].f = xfactor;
n[2].f = yfactor;
}
if (ctx->ExecuteFlag) {
- CALL_PixelZoom(ctx->Exec, ( xfactor, yfactor ));
+ CALL_PixelZoom(ctx->Exec, (xfactor, yfactor));
}
}
static void GLAPIENTRY
-save_PointParameterfvEXT( GLenum pname, const GLfloat *params )
+save_PointParameterfvEXT(GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_POINT_PARAMETERS, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_PARAMETERS, 4);
if (n) {
n[1].e = pname;
n[2].f = params[0];
@@ -2749,56 +2638,61 @@ save_PointParameterfvEXT( GLenum pname, const GLfloat *params )
n[4].f = params[2];
}
if (ctx->ExecuteFlag) {
- CALL_PointParameterfvEXT(ctx->Exec, ( pname, params ));
+ CALL_PointParameterfvEXT(ctx->Exec, (pname, params));
}
}
-static void GLAPIENTRY save_PointParameterfEXT( GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_PointParameterfEXT(GLenum pname, GLfloat param)
{
save_PointParameterfvEXT(pname, &param);
}
-static void GLAPIENTRY save_PointParameteriNV( GLenum pname, GLint param )
+static void GLAPIENTRY
+save_PointParameteriNV(GLenum pname, GLint param)
{
GLfloat p = (GLfloat) param;
save_PointParameterfvEXT(pname, &p);
}
-static void GLAPIENTRY save_PointParameterivNV( GLenum pname, const GLint *param )
+static void GLAPIENTRY
+save_PointParameterivNV(GLenum pname, const GLint * param)
{
GLfloat p = (GLfloat) param[0];
save_PointParameterfvEXT(pname, &p);
}
-static void GLAPIENTRY save_PointSize( GLfloat size )
+static void GLAPIENTRY
+save_PointSize(GLfloat size)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_POINT_SIZE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_SIZE, 1);
if (n) {
n[1].f = size;
}
if (ctx->ExecuteFlag) {
- CALL_PointSize(ctx->Exec, ( size ));
+ CALL_PointSize(ctx->Exec, (size));
}
}
-static void GLAPIENTRY save_PolygonMode( GLenum face, GLenum mode )
+static void GLAPIENTRY
+save_PolygonMode(GLenum face, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_POLYGON_MODE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_MODE, 2);
if (n) {
n[1].e = face;
n[2].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_PolygonMode(ctx->Exec, ( face, mode ));
+ CALL_PolygonMode(ctx->Exec, (face, mode));
}
}
@@ -2806,41 +2700,44 @@ static void GLAPIENTRY save_PolygonMode( GLenum face, GLenum mode )
/*
* Polygon stipple must have been upacked already!
*/
-static void GLAPIENTRY save_PolygonStipple( const GLubyte *pattern )
+static void GLAPIENTRY
+save_PolygonStipple(const GLubyte * pattern)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_POLYGON_STIPPLE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1);
if (n) {
void *data;
- n[1].data = MALLOC( 32 * 4 );
- data = n[1].data; /* This needed for Acorn compiler */
- MEMCPY( data, pattern, 32 * 4 );
+ n[1].data = _mesa_malloc(32 * 4);
+ data = n[1].data; /* This needed for Acorn compiler */
+ MEMCPY(data, pattern, 32 * 4);
}
if (ctx->ExecuteFlag) {
- CALL_PolygonStipple(ctx->Exec, ( (GLubyte*) pattern ));
+ CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern));
}
}
-static void GLAPIENTRY save_PolygonOffset( GLfloat factor, GLfloat units )
+static void GLAPIENTRY
+save_PolygonOffset(GLfloat factor, GLfloat units)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_POLYGON_OFFSET, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_OFFSET, 2);
if (n) {
n[1].f = factor;
n[2].f = units;
}
if (ctx->ExecuteFlag) {
- CALL_PolygonOffset(ctx->Exec, ( factor, units ));
+ CALL_PolygonOffset(ctx->Exec, (factor, units));
}
}
-static void GLAPIENTRY save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
+static void GLAPIENTRY
+save_PolygonOffsetEXT(GLfloat factor, GLfloat bias)
{
GET_CURRENT_CONTEXT(ctx);
/* XXX mult by DepthMaxF here??? */
@@ -2848,107 +2745,115 @@ static void GLAPIENTRY save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
}
-static void GLAPIENTRY save_PopAttrib( void )
+static void GLAPIENTRY
+save_PopAttrib(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_POP_ATTRIB, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0);
if (ctx->ExecuteFlag) {
CALL_PopAttrib(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_PopMatrix( void )
+static void GLAPIENTRY
+save_PopMatrix(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_POP_MATRIX, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0);
if (ctx->ExecuteFlag) {
CALL_PopMatrix(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_PopName( void )
+static void GLAPIENTRY
+save_PopName(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_POP_NAME, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0);
if (ctx->ExecuteFlag) {
CALL_PopName(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_PrioritizeTextures( GLsizei num, const GLuint *textures,
- const GLclampf *priorities )
+static void GLAPIENTRY
+save_PrioritizeTextures(GLsizei num, const GLuint * textures,
+ const GLclampf * priorities)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- for (i=0;i<num;i++) {
+ for (i = 0; i < num; i++) {
Node *n;
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PRIORITIZE_TEXTURE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
if (n) {
n[1].ui = textures[i];
n[2].f = priorities[i];
}
}
if (ctx->ExecuteFlag) {
- CALL_PrioritizeTextures(ctx->Exec, ( num, textures, priorities ));
+ CALL_PrioritizeTextures(ctx->Exec, (num, textures, priorities));
}
}
-static void GLAPIENTRY save_PushAttrib( GLbitfield mask )
+static void GLAPIENTRY
+save_PushAttrib(GLbitfield mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PUSH_ATTRIB, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_ATTRIB, 1);
if (n) {
n[1].bf = mask;
}
if (ctx->ExecuteFlag) {
- CALL_PushAttrib(ctx->Exec, ( mask ));
+ CALL_PushAttrib(ctx->Exec, (mask));
}
}
-static void GLAPIENTRY save_PushMatrix( void )
+static void GLAPIENTRY
+save_PushMatrix(void)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_PUSH_MATRIX, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0);
if (ctx->ExecuteFlag) {
CALL_PushMatrix(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_PushName( GLuint name )
+static void GLAPIENTRY
+save_PushName(GLuint name)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PUSH_NAME, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_NAME, 1);
if (n) {
n[1].ui = name;
}
if (ctx->ExecuteFlag) {
- CALL_PushName(ctx->Exec, ( name ));
+ CALL_PushName(ctx->Exec, (name));
}
}
-static void GLAPIENTRY save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_RASTER_POS, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_RASTER_POS, 4);
if (n) {
n[1].f = x;
n[2].f = y;
@@ -2956,154 +2861,179 @@ static void GLAPIENTRY save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloa
n[4].f = w;
}
if (ctx->ExecuteFlag) {
- CALL_RasterPos4f(ctx->Exec, ( x, y, z, w ));
+ CALL_RasterPos4f(ctx->Exec, (x, y, z, w));
}
}
-static void GLAPIENTRY save_RasterPos2d(GLdouble x, GLdouble y)
+static void GLAPIENTRY
+save_RasterPos2d(GLdouble x, GLdouble y)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2f(GLfloat x, GLfloat y)
+static void GLAPIENTRY
+save_RasterPos2f(GLfloat x, GLfloat y)
{
save_RasterPos4f(x, y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2i(GLint x, GLint y)
+static void GLAPIENTRY
+save_RasterPos2i(GLint x, GLint y)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2s(GLshort x, GLshort y)
+static void GLAPIENTRY
+save_RasterPos2s(GLshort x, GLshort y)
{
save_RasterPos4f(x, y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+static void GLAPIENTRY
+save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void GLAPIENTRY save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+static void GLAPIENTRY
+save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
{
save_RasterPos4f(x, y, z, 1.0F);
}
-static void GLAPIENTRY save_RasterPos3i(GLint x, GLint y, GLint z)
+static void GLAPIENTRY
+save_RasterPos3i(GLint x, GLint y, GLint z)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void GLAPIENTRY save_RasterPos3s(GLshort x, GLshort y, GLshort z)
+static void GLAPIENTRY
+save_RasterPos3s(GLshort x, GLshort y, GLshort z)
{
save_RasterPos4f(x, y, z, 1.0F);
}
-static void GLAPIENTRY save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+static void GLAPIENTRY
+save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void GLAPIENTRY save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+static void GLAPIENTRY
+save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
{
save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void GLAPIENTRY save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+static void GLAPIENTRY
+save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
{
save_RasterPos4f(x, y, z, w);
}
-static void GLAPIENTRY save_RasterPos2dv(const GLdouble *v)
+static void GLAPIENTRY
+save_RasterPos2dv(const GLdouble * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2fv(const GLfloat *v)
+static void GLAPIENTRY
+save_RasterPos2fv(const GLfloat * v)
{
save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2iv(const GLint *v)
+static void GLAPIENTRY
+save_RasterPos2iv(const GLint * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos2sv(const GLshort *v)
+static void GLAPIENTRY
+save_RasterPos2sv(const GLshort * v)
{
save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_RasterPos3dv(const GLdouble *v)
+static void GLAPIENTRY
+save_RasterPos3dv(const GLdouble * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void GLAPIENTRY save_RasterPos3fv(const GLfloat *v)
+static void GLAPIENTRY
+save_RasterPos3fv(const GLfloat * v)
{
save_RasterPos4f(v[0], v[1], v[2], 1.0F);
}
-static void GLAPIENTRY save_RasterPos3iv(const GLint *v)
+static void GLAPIENTRY
+save_RasterPos3iv(const GLint * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void GLAPIENTRY save_RasterPos3sv(const GLshort *v)
+static void GLAPIENTRY
+save_RasterPos3sv(const GLshort * v)
{
save_RasterPos4f(v[0], v[1], v[2], 1.0F);
}
-static void GLAPIENTRY save_RasterPos4dv(const GLdouble *v)
+static void GLAPIENTRY
+save_RasterPos4dv(const GLdouble * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
+ (GLfloat) v[2], (GLfloat) v[3]);
}
-static void GLAPIENTRY save_RasterPos4fv(const GLfloat *v)
+static void GLAPIENTRY
+save_RasterPos4fv(const GLfloat * v)
{
save_RasterPos4f(v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_RasterPos4iv(const GLint *v)
+static void GLAPIENTRY
+save_RasterPos4iv(const GLint * v)
{
save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
+ (GLfloat) v[2], (GLfloat) v[3]);
}
-static void GLAPIENTRY save_RasterPos4sv(const GLshort *v)
+static void GLAPIENTRY
+save_RasterPos4sv(const GLshort * v)
{
save_RasterPos4f(v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_PassThrough( GLfloat token )
+static void GLAPIENTRY
+save_PassThrough(GLfloat token)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PASSTHROUGH, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PASSTHROUGH, 1);
if (n) {
n[1].f = token;
}
if (ctx->ExecuteFlag) {
- CALL_PassThrough(ctx->Exec, ( token ));
+ CALL_PassThrough(ctx->Exec, (token));
}
}
-static void GLAPIENTRY save_ReadBuffer( GLenum mode )
+static void GLAPIENTRY
+save_ReadBuffer(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_READ_BUFFER, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_READ_BUFFER, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_ReadBuffer(ctx->Exec, ( mode ));
+ CALL_ReadBuffer(ctx->Exec, (mode));
}
}
@@ -3114,12 +3044,12 @@ save_ResetHistogram(GLenum target)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_RESET_HISTOGRAM, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_HISTOGRAM, 1);
if (n) {
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- CALL_ResetHistogram(ctx->Exec, ( target ));
+ CALL_ResetHistogram(ctx->Exec, (target));
}
}
@@ -3130,22 +3060,23 @@ save_ResetMinmax(GLenum target)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_RESET_MIN_MAX, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_MIN_MAX, 1);
if (n) {
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- CALL_ResetMinmax(ctx->Exec, ( target ));
+ CALL_ResetMinmax(ctx->Exec, (target));
}
}
-static void GLAPIENTRY save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ROTATE, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ROTATE, 4);
if (n) {
n[1].f = angle;
n[2].f = x;
@@ -3153,46 +3084,50 @@ static void GLAPIENTRY save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloa
n[4].f = z;
}
if (ctx->ExecuteFlag) {
- CALL_Rotatef(ctx->Exec, ( angle, x, y, z ));
+ CALL_Rotatef(ctx->Exec, (angle, x, y, z));
}
}
-static void GLAPIENTRY save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY
+save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
{
save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void GLAPIENTRY save_Scalef( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Scalef(GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_SCALE, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_SCALE, 3);
if (n) {
n[1].f = x;
n[2].f = y;
n[3].f = z;
}
if (ctx->ExecuteFlag) {
- CALL_Scalef(ctx->Exec, ( x, y, z ));
+ CALL_Scalef(ctx->Exec, (x, y, z));
}
}
-static void GLAPIENTRY save_Scaled( GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY
+save_Scaled(GLdouble x, GLdouble y, GLdouble z)
{
save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void GLAPIENTRY save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+static void GLAPIENTRY
+save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_SCISSOR, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_SCISSOR, 4);
if (n) {
n[1].i = x;
n[2].i = y;
@@ -3200,71 +3135,75 @@ static void GLAPIENTRY save_Scissor( GLint x, GLint y, GLsizei width, GLsizei he
n[4].i = height;
}
if (ctx->ExecuteFlag) {
- CALL_Scissor(ctx->Exec, ( x, y, width, height ));
+ CALL_Scissor(ctx->Exec, (x, y, width, height));
}
}
-static void GLAPIENTRY save_ShadeModel( GLenum mode )
+static void GLAPIENTRY
+save_ShadeModel(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_SHADE_MODEL, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1);
if (n) {
n[1].e = mode;
}
if (ctx->ExecuteFlag) {
- CALL_ShadeModel(ctx->Exec, ( mode ));
+ CALL_ShadeModel(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_StencilFunc( GLenum func, GLint ref, GLuint mask )
+static void GLAPIENTRY
+save_StencilFunc(GLenum func, GLint ref, GLuint mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_STENCIL_FUNC, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC, 3);
if (n) {
n[1].e = func;
n[2].i = ref;
n[3].ui = mask;
}
if (ctx->ExecuteFlag) {
- CALL_StencilFunc(ctx->Exec, ( func, ref, mask ));
+ CALL_StencilFunc(ctx->Exec, (func, ref, mask));
}
}
-static void GLAPIENTRY save_StencilMask( GLuint mask )
+static void GLAPIENTRY
+save_StencilMask(GLuint mask)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_STENCIL_MASK, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK, 1);
if (n) {
n[1].ui = mask;
}
if (ctx->ExecuteFlag) {
- CALL_StencilMask(ctx->Exec, ( mask ));
+ CALL_StencilMask(ctx->Exec, (mask));
}
}
-static void GLAPIENTRY save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
+static void GLAPIENTRY
+save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_STENCIL_OP, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP, 3);
if (n) {
n[1].e = fail;
n[2].e = zfail;
n[3].e = zpass;
}
if (ctx->ExecuteFlag) {
- CALL_StencilOp(ctx->Exec, ( fail, zfail, zpass ));
+ CALL_StencilOp(ctx->Exec, (fail, zfail, zpass));
}
}
@@ -3311,7 +3250,7 @@ save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_STENCIL_OP_SEPARATE, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
if (n) {
n[1].e = face;
n[2].e = fail;
@@ -3324,12 +3263,13 @@ save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
}
-static void GLAPIENTRY save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEXENV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXENV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -3345,49 +3285,53 @@ static void GLAPIENTRY save_TexEnvfv( GLenum target, GLenum pname, const GLfloat
}
}
if (ctx->ExecuteFlag) {
- CALL_TexEnvfv(ctx->Exec, ( target, pname, params ));
+ CALL_TexEnvfv(ctx->Exec, (target, pname, params));
}
}
-static void GLAPIENTRY save_TexEnvf( GLenum target, GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_TexEnvf(GLenum target, GLenum pname, GLfloat param)
{
- save_TexEnvfv( target, pname, &param );
+ save_TexEnvfv(target, pname, &param);
}
-static void GLAPIENTRY save_TexEnvi( GLenum target, GLenum pname, GLint param )
+static void GLAPIENTRY
+save_TexEnvi(GLenum target, GLenum pname, GLint param)
{
GLfloat p[4];
p[0] = (GLfloat) param;
p[1] = p[2] = p[3] = 0.0;
- save_TexEnvfv( target, pname, p );
+ save_TexEnvfv(target, pname, p);
}
-static void GLAPIENTRY save_TexEnviv( GLenum target, GLenum pname, const GLint *param )
+static void GLAPIENTRY
+save_TexEnviv(GLenum target, GLenum pname, const GLint * param)
{
GLfloat p[4];
if (pname == GL_TEXTURE_ENV_COLOR) {
- p[0] = INT_TO_FLOAT( param[0] );
- p[1] = INT_TO_FLOAT( param[1] );
- p[2] = INT_TO_FLOAT( param[2] );
- p[3] = INT_TO_FLOAT( param[3] );
+ p[0] = INT_TO_FLOAT(param[0]);
+ p[1] = INT_TO_FLOAT(param[1]);
+ p[2] = INT_TO_FLOAT(param[2]);
+ p[3] = INT_TO_FLOAT(param[3]);
}
else {
p[0] = (GLfloat) param[0];
p[1] = p[2] = p[3] = 0.0F;
}
- save_TexEnvfv( target, pname, p );
+ save_TexEnvfv(target, pname, p);
}
-static void GLAPIENTRY save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEXGEN, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXGEN, 6);
if (n) {
n[1].e = coord;
n[2].e = pname;
@@ -3397,12 +3341,13 @@ static void GLAPIENTRY save_TexGenfv( GLenum coord, GLenum pname, const GLfloat
n[6].f = params[3];
}
if (ctx->ExecuteFlag) {
- CALL_TexGenfv(ctx->Exec, ( coord, pname, params ));
+ CALL_TexGenfv(ctx->Exec, (coord, pname, params));
}
}
-static void GLAPIENTRY save_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
+static void GLAPIENTRY
+save_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
{
GLfloat p[4];
p[0] = (GLfloat) params[0];
@@ -3413,43 +3358,47 @@ static void GLAPIENTRY save_TexGeniv(GLenum coord, GLenum pname, const GLint *pa
}
-static void GLAPIENTRY save_TexGend(GLenum coord, GLenum pname, GLdouble param )
+static void GLAPIENTRY
+save_TexGend(GLenum coord, GLenum pname, GLdouble param)
{
GLfloat p = (GLfloat) param;
- save_TexGenfv( coord, pname, &p );
+ save_TexGenfv(coord, pname, &p);
}
-static void GLAPIENTRY save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params )
+static void GLAPIENTRY
+save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
{
GLfloat p[4];
p[0] = (GLfloat) params[0];
p[1] = (GLfloat) params[1];
p[2] = (GLfloat) params[2];
p[3] = (GLfloat) params[3];
- save_TexGenfv( coord, pname, p );
+ save_TexGenfv(coord, pname, p);
}
-static void GLAPIENTRY save_TexGenf( GLenum coord, GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_TexGenf(GLenum coord, GLenum pname, GLfloat param)
{
save_TexGenfv(coord, pname, &param);
}
-static void GLAPIENTRY save_TexGeni( GLenum coord, GLenum pname, GLint param )
+static void GLAPIENTRY
+save_TexGeni(GLenum coord, GLenum pname, GLint param)
{
- save_TexGeniv( coord, pname, &param );
+ save_TexGeniv(coord, pname, &param);
}
-static void GLAPIENTRY save_TexParameterfv( GLenum target,
- GLenum pname, const GLfloat *params )
+static void GLAPIENTRY
+save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEXPARAMETER, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXPARAMETER, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
@@ -3459,18 +3408,20 @@ static void GLAPIENTRY save_TexParameterfv( GLenum target,
n[6].f = params[3];
}
if (ctx->ExecuteFlag) {
- CALL_TexParameterfv(ctx->Exec, ( target, pname, params ));
+ CALL_TexParameterfv(ctx->Exec, (target, pname, params));
}
}
-static void GLAPIENTRY save_TexParameterf( GLenum target, GLenum pname, GLfloat param )
+static void GLAPIENTRY
+save_TexParameterf(GLenum target, GLenum pname, GLfloat param)
{
save_TexParameterfv(target, pname, &param);
}
-static void GLAPIENTRY save_TexParameteri( GLenum target, GLenum pname, GLint param )
+static void GLAPIENTRY
+save_TexParameteri(GLenum target, GLenum pname, GLint param)
{
GLfloat fparam[4];
fparam[0] = (GLfloat) param;
@@ -3479,7 +3430,8 @@ static void GLAPIENTRY save_TexParameteri( GLenum target, GLenum pname, GLint pa
}
-static void GLAPIENTRY save_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
+static void GLAPIENTRY
+save_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GLfloat fparam[4];
fparam[0] = (GLfloat) params[0];
@@ -3488,24 +3440,24 @@ static void GLAPIENTRY save_TexParameteriv( GLenum target, GLenum pname, const G
}
-static void GLAPIENTRY save_TexImage1D( GLenum target,
- GLint level, GLint components,
- GLsizei width, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_TexImage1D(GLenum target,
+ GLint level, GLint components,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_1D) {
/* don't compile, execute immediately */
- CALL_TexImage1D(ctx->Exec, ( target, level, components, width,
- border, format, type, pixels ));
+ CALL_TexImage1D(ctx->Exec, (target, level, components, width,
+ border, format, type, pixels));
}
else {
GLvoid *image = unpack_image(1, width, 1, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_IMAGE1D, 8 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3517,34 +3469,34 @@ static void GLAPIENTRY save_TexImage1D( GLenum target,
n[8].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexImage1D(ctx->Exec, ( target, level, components, width,
- border, format, type, pixels ));
+ CALL_TexImage1D(ctx->Exec, (target, level, components, width,
+ border, format, type, pixels));
}
}
}
-static void GLAPIENTRY save_TexImage2D( GLenum target,
- GLint level, GLint components,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels)
+static void GLAPIENTRY
+save_TexImage2D(GLenum target,
+ GLint level, GLint components,
+ GLsizei width, GLsizei height, GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_2D) {
/* don't compile, execute immediately */
- CALL_TexImage2D(ctx->Exec, ( target, level, components, width,
- height, border, format, type, pixels ));
+ CALL_TexImage2D(ctx->Exec, (target, level, components, width,
+ height, border, format, type, pixels));
}
else {
GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_IMAGE2D, 9 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3557,35 +3509,36 @@ static void GLAPIENTRY save_TexImage2D( GLenum target,
n[9].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexImage2D(ctx->Exec, ( target, level, components, width,
- height, border, format, type, pixels ));
+ CALL_TexImage2D(ctx->Exec, (target, level, components, width,
+ height, border, format, type, pixels));
}
}
}
-static void GLAPIENTRY save_TexImage3D( GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_TexImage3D(GLenum target,
+ GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_3D) {
/* don't compile, execute immediately */
- CALL_TexImage3D(ctx->Exec, ( target, level, internalFormat, width,
- height, depth, border, format, type, pixels ));
+ CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
+ height, depth, border, format, type,
+ pixels));
}
else {
Node *n;
GLvoid *image = unpack_image(3, width, height, depth, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_IMAGE3D, 10 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3599,26 +3552,28 @@ static void GLAPIENTRY save_TexImage3D( GLenum target,
n[10].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexImage3D(ctx->Exec, ( target, level, internalFormat, width,
- height, depth, border, format, type, pixels ));
+ CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
+ height, depth, border, format, type,
+ pixels));
}
}
}
-static void GLAPIENTRY save_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_TexSubImage1D(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = unpack_image(1, width, 1, 1, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE1D, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3629,27 +3584,27 @@ static void GLAPIENTRY save_TexSubImage1D( GLenum target, GLint level, GLint xof
n[7].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexSubImage1D(ctx->Exec, ( target, level, xoffset, width,
- format, type, pixels ));
+ CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width,
+ format, type, pixels));
}
}
-static void GLAPIENTRY save_TexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_TexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE2D, 9 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3662,27 +3617,27 @@ static void GLAPIENTRY save_TexSubImage2D( GLenum target, GLint level,
n[9].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexSubImage2D(ctx->Exec, ( target, level, xoffset, yoffset,
- width, height, format, type, pixels ));
+ CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
+ width, height, format, type, pixels));
}
}
-static void GLAPIENTRY save_TexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels )
+static void GLAPIENTRY
+save_TexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
GLvoid *image = unpack_image(3, width, height, depth, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE3D, 11 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3697,46 +3652,50 @@ static void GLAPIENTRY save_TexSubImage3D( GLenum target, GLint level,
n[11].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_TexSubImage3D(ctx->Exec, ( target, level,
- xoffset, yoffset, zoffset,
- width, height, depth, format, type, pixels ));
+ CALL_TexSubImage3D(ctx->Exec, (target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth, format, type,
+ pixels));
}
}
-static void GLAPIENTRY save_Translatef( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Translatef(GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TRANSLATE, 3 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TRANSLATE, 3);
if (n) {
n[1].f = x;
n[2].f = y;
n[3].f = z;
}
if (ctx->ExecuteFlag) {
- CALL_Translatef(ctx->Exec, ( x, y, z ));
+ CALL_Translatef(ctx->Exec, (x, y, z));
}
}
-static void GLAPIENTRY save_Translated( GLdouble x, GLdouble y, GLdouble z )
+static void GLAPIENTRY
+save_Translated(GLdouble x, GLdouble y, GLdouble z)
{
save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
-static void GLAPIENTRY save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
+static void GLAPIENTRY
+save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_VIEWPORT, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_VIEWPORT, 4);
if (n) {
n[1].i = x;
n[2].i = y;
@@ -3744,17 +3703,18 @@ static void GLAPIENTRY save_Viewport( GLint x, GLint y, GLsizei width, GLsizei h
n[4].i = (GLint) height;
}
if (ctx->ExecuteFlag) {
- CALL_Viewport(ctx->Exec, ( x, y, width, height ));
+ CALL_Viewport(ctx->Exec, (x, y, width, height));
}
}
-static void GLAPIENTRY save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_WINDOW_POS, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_WINDOW_POS, 4);
if (n) {
n[1].f = x;
n[2].f = y;
@@ -3762,123 +3722,146 @@ static void GLAPIENTRY save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GL
n[4].f = w;
}
if (ctx->ExecuteFlag) {
- CALL_WindowPos4fMESA(ctx->Exec, ( x, y, z, w ));
+ CALL_WindowPos4fMESA(ctx->Exec, (x, y, z, w));
}
}
-static void GLAPIENTRY save_WindowPos2dMESA(GLdouble x, GLdouble y)
+static void GLAPIENTRY
+save_WindowPos2dMESA(GLdouble x, GLdouble y)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2fMESA(GLfloat x, GLfloat y)
+static void GLAPIENTRY
+save_WindowPos2fMESA(GLfloat x, GLfloat y)
{
save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2iMESA(GLint x, GLint y)
+static void GLAPIENTRY
+save_WindowPos2iMESA(GLint x, GLint y)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2sMESA(GLshort x, GLshort y)
+static void GLAPIENTRY
+save_WindowPos2sMESA(GLshort x, GLshort y)
{
save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
+static void GLAPIENTRY
+save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void GLAPIENTRY save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
+static void GLAPIENTRY
+save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
{
save_WindowPos4fMESA(x, y, z, 1.0F);
}
-static void GLAPIENTRY save_WindowPos3iMESA(GLint x, GLint y, GLint z)
+static void GLAPIENTRY
+save_WindowPos3iMESA(GLint x, GLint y, GLint z)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
-static void GLAPIENTRY save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
+static void GLAPIENTRY
+save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
{
save_WindowPos4fMESA(x, y, z, 1.0F);
}
-static void GLAPIENTRY save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+static void GLAPIENTRY
+save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void GLAPIENTRY save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
+static void GLAPIENTRY
+save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
{
save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
-static void GLAPIENTRY save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
+static void GLAPIENTRY
+save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
{
save_WindowPos4fMESA(x, y, z, w);
}
-static void GLAPIENTRY save_WindowPos2dvMESA(const GLdouble *v)
+static void GLAPIENTRY
+save_WindowPos2dvMESA(const GLdouble * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2fvMESA(const GLfloat *v)
+static void GLAPIENTRY
+save_WindowPos2fvMESA(const GLfloat * v)
{
save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2ivMESA(const GLint *v)
+static void GLAPIENTRY
+save_WindowPos2ivMESA(const GLint * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos2svMESA(const GLshort *v)
+static void GLAPIENTRY
+save_WindowPos2svMESA(const GLshort * v)
{
save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
}
-static void GLAPIENTRY save_WindowPos3dvMESA(const GLdouble *v)
+static void GLAPIENTRY
+save_WindowPos3dvMESA(const GLdouble * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void GLAPIENTRY save_WindowPos3fvMESA(const GLfloat *v)
+static void GLAPIENTRY
+save_WindowPos3fvMESA(const GLfloat * v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
}
-static void GLAPIENTRY save_WindowPos3ivMESA(const GLint *v)
+static void GLAPIENTRY
+save_WindowPos3ivMESA(const GLint * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
-static void GLAPIENTRY save_WindowPos3svMESA(const GLshort *v)
+static void GLAPIENTRY
+save_WindowPos3svMESA(const GLshort * v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
}
-static void GLAPIENTRY save_WindowPos4dvMESA(const GLdouble *v)
+static void GLAPIENTRY
+save_WindowPos4dvMESA(const GLdouble * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
+ (GLfloat) v[2], (GLfloat) v[3]);
}
-static void GLAPIENTRY save_WindowPos4fvMESA(const GLfloat *v)
+static void GLAPIENTRY
+save_WindowPos4fvMESA(const GLfloat * v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_WindowPos4ivMESA(const GLint *v)
+static void GLAPIENTRY
+save_WindowPos4ivMESA(const GLint * v)
{
save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
+ (GLfloat) v[2], (GLfloat) v[3]);
}
-static void GLAPIENTRY save_WindowPos4svMESA(const GLshort *v)
+static void GLAPIENTRY
+save_WindowPos4svMESA(const GLshort * v)
{
save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
}
@@ -3886,24 +3869,26 @@ static void GLAPIENTRY save_WindowPos4svMESA(const GLshort *v)
/* GL_ARB_multitexture */
-static void GLAPIENTRY save_ActiveTextureARB( GLenum target )
+static void GLAPIENTRY
+save_ActiveTextureARB(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ACTIVE_TEXTURE, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_TEXTURE, 1);
if (n) {
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- CALL_ActiveTextureARB(ctx->Exec, ( target ));
+ CALL_ActiveTextureARB(ctx->Exec, (target));
}
}
/* GL_ARB_transpose_matrix */
-static void GLAPIENTRY save_LoadTransposeMatrixdARB( const GLdouble m[16] )
+static void GLAPIENTRY
+save_LoadTransposeMatrixdARB(const GLdouble m[16])
{
GLfloat tm[16];
_math_transposefd(tm, m);
@@ -3911,7 +3896,8 @@ static void GLAPIENTRY save_LoadTransposeMatrixdARB( const GLdouble m[16] )
}
-static void GLAPIENTRY save_LoadTransposeMatrixfARB( const GLfloat m[16] )
+static void GLAPIENTRY
+save_LoadTransposeMatrixfARB(const GLfloat m[16])
{
GLfloat tm[16];
_math_transposef(tm, m);
@@ -3920,7 +3906,7 @@ static void GLAPIENTRY save_LoadTransposeMatrixfARB( const GLfloat m[16] )
static void GLAPIENTRY
-save_MultTransposeMatrixdARB( const GLdouble m[16] )
+save_MultTransposeMatrixdARB(const GLdouble m[16])
{
GLfloat tm[16];
_math_transposefd(tm, m);
@@ -3929,7 +3915,7 @@ save_MultTransposeMatrixdARB( const GLdouble m[16] )
static void GLAPIENTRY
-save_MultTransposeMatrixfARB( const GLfloat m[16] )
+save_MultTransposeMatrixfARB(const GLfloat m[16])
{
GLfloat tm[16];
_math_transposef(tm, m);
@@ -3942,26 +3928,27 @@ static void GLAPIENTRY
save_CompressedTexImage1DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLint border, GLsizei imageSize,
- const GLvoid *data)
+ const GLvoid * data)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_1D) {
/* don't compile, execute immediately */
CALL_CompressedTexImage1DARB(ctx->Exec, (target, level, internalFormat,
- width, border, imageSize, data));
+ width, border, imageSize,
+ data));
}
else {
Node *n;
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -3972,11 +3959,12 @@ save_CompressedTexImage1DARB(GLenum target, GLint level,
n[7].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage1DARB(ctx->Exec, (target, level, internalFormat,
- width, border, imageSize, data));
+ CALL_CompressedTexImage1DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ border, imageSize, data));
}
}
}
@@ -3986,26 +3974,27 @@ static void GLAPIENTRY
save_CompressedTexImage2DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLsizei height, GLint border, GLsizei imageSize,
- const GLvoid *data)
+ const GLvoid * data)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_2D) {
/* don't compile, execute immediately */
CALL_CompressedTexImage2DARB(ctx->Exec, (target, level, internalFormat,
- width, height, border, imageSize, data));
+ width, height, border,
+ imageSize, data));
}
else {
Node *n;
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -4017,11 +4006,12 @@ save_CompressedTexImage2DARB(GLenum target, GLint level,
n[8].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage2DARB(ctx->Exec, (target, level, internalFormat,
- width, height, border, imageSize, data));
+ CALL_CompressedTexImage2DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ height, border, imageSize, data));
}
}
}
@@ -4031,26 +4021,27 @@ static void GLAPIENTRY
save_CompressedTexImage3DARB(GLenum target, GLint level,
GLenum internalFormat, GLsizei width,
GLsizei height, GLsizei depth, GLint border,
- GLsizei imageSize, const GLvoid *data)
+ GLsizei imageSize, const GLvoid * data)
{
GET_CURRENT_CONTEXT(ctx);
if (target == GL_PROXY_TEXTURE_3D) {
/* don't compile, execute immediately */
CALL_CompressedTexImage3DARB(ctx->Exec, (target, level, internalFormat,
- width, height, depth, border, imageSize, data));
+ width, height, depth, border,
+ imageSize, data));
}
else {
Node *n;
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -4063,11 +4054,13 @@ save_CompressedTexImage3DARB(GLenum target, GLint level,
n[9].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage3DARB(ctx->Exec, (target, level, internalFormat,
- width, height, depth, border, imageSize, data));
+ CALL_CompressedTexImage3DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ height, depth, border, imageSize,
+ data));
}
}
}
@@ -4076,7 +4069,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level,
static void GLAPIENTRY
save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
GLsizei width, GLenum format,
- GLsizei imageSize, const GLvoid *data)
+ GLsizei imageSize, const GLvoid * data)
{
Node *n;
GLvoid *image;
@@ -4085,13 +4078,13 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -4102,11 +4095,12 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
n[7].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset,
- width, format, imageSize, data));
+ width, format, imageSize,
+ data));
}
}
@@ -4115,7 +4109,7 @@ static void GLAPIENTRY
save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
- const GLvoid *data)
+ const GLvoid * data)
{
Node *n;
GLvoid *image;
@@ -4124,13 +4118,13 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -4143,11 +4137,12 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
n[9].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_CompressedTexSubImage2DARB(ctx->Exec, (target, level, xoffset, yoffset,
- width, height, format, imageSize, data));
+ CALL_CompressedTexSubImage2DARB(ctx->Exec,
+ (target, level, xoffset, yoffset, width,
+ height, format, imageSize, data));
}
}
@@ -4156,7 +4151,7 @@ static void GLAPIENTRY
save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth, GLenum format,
- GLsizei imageSize, const GLvoid *data)
+ GLsizei imageSize, const GLvoid * data)
{
Node *n;
GLvoid *image;
@@ -4165,13 +4160,13 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = MALLOC(imageSize);
+ image = _mesa_malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB");
return;
}
MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11);
if (n) {
n[1].e = target;
n[2].i = level;
@@ -4186,11 +4181,13 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
n[11].data = image;
}
else if (image) {
- FREE(image);
+ _mesa_free(image);
}
if (ctx->ExecuteFlag) {
- CALL_CompressedTexSubImage3DARB(ctx->Exec, (target, level, xoffset, yoffset,
- zoffset, width, height, depth, format, imageSize, data));
+ CALL_CompressedTexSubImage3DARB(ctx->Exec,
+ (target, level, xoffset, yoffset,
+ zoffset, width, height, depth, format,
+ imageSize, data));
}
}
@@ -4202,13 +4199,13 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_SAMPLE_COVERAGE, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_SAMPLE_COVERAGE, 2);
if (n) {
n[1].f = value;
n[2].b = invert;
}
if (ctx->ExecuteFlag) {
- CALL_SampleCoverageARB(ctx->Exec, ( value, invert ));
+ CALL_SampleCoverageARB(ctx->Exec, (value, invert));
}
}
@@ -4223,13 +4220,13 @@ save_BindProgramNV(GLenum target, GLuint id)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BIND_PROGRAM_NV, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_PROGRAM_NV, 2);
if (n) {
n[1].e = target;
n[2].ui = id;
}
if (ctx->ExecuteFlag) {
- CALL_BindProgramNV(ctx->Exec, ( target, id ));
+ CALL_BindProgramNV(ctx->Exec, (target, id));
}
}
#endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
@@ -4241,7 +4238,7 @@ save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EXECUTE_PROGRAM_NV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
if (n) {
n[1].e = target;
n[2].ui = id;
@@ -4258,13 +4255,12 @@ save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
static void GLAPIENTRY
save_ProgramParameter4fNV(GLenum target, GLuint index,
- GLfloat x, GLfloat y,
- GLfloat z, GLfloat w)
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_PARAMETER4F_NV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_PARAMETER4F_NV, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4280,7 +4276,8 @@ save_ProgramParameter4fNV(GLenum target, GLuint index,
static void GLAPIENTRY
-save_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params)
+save_ProgramParameter4fvNV(GLenum target, GLuint index,
+ const GLfloat *params)
{
save_ProgramParameter4fNV(target, index, params[0], params[1],
params[2], params[3]);
@@ -4289,8 +4286,7 @@ save_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params)
static void GLAPIENTRY
save_ProgramParameter4dNV(GLenum target, GLuint index,
- GLdouble x, GLdouble y,
- GLdouble z, GLdouble w)
+ GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_ProgramParameter4fNV(target, index, (GLfloat) x, (GLfloat) y,
(GLfloat) z, (GLfloat) w);
@@ -4331,7 +4327,7 @@ save_ProgramParameters4fvNV(GLenum target, GLuint index,
static void GLAPIENTRY
save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
- const GLubyte *program)
+ const GLubyte * program)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
@@ -4345,7 +4341,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
_mesa_memcpy(programCopy, program, len);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_LOAD_PROGRAM_NV, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4);
if (n) {
n[1].e = target;
n[2].ui = id;
@@ -4359,7 +4355,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
static void GLAPIENTRY
-save_RequestResidentProgramsNV(GLsizei num, const GLuint *ids)
+save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
@@ -4370,7 +4366,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint *ids)
}
_mesa_memcpy(idCopy, ids, num * sizeof(GLuint));
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TRACK_MATRIX_NV, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2);
if (n) {
n[1].i = num;
n[2].data = idCopy;
@@ -4388,7 +4384,7 @@ save_TrackMatrixNV(GLenum target, GLuint address,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_TRACK_MATRIX_NV, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4);
if (n) {
n[1].e = target;
n[2].ui = address;
@@ -4413,7 +4409,7 @@ save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4435,7 +4431,7 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4458,7 +4454,7 @@ save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4480,7 +4476,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4495,7 +4491,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
}
static void GLAPIENTRY
-save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
+save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
@@ -4508,7 +4504,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
_mesa_memcpy(nameCopy, name, len);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6);
if (n) {
n[1].ui = id;
n[2].i = len;
@@ -4525,7 +4521,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
static void GLAPIENTRY
-save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name,
+save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name,
const float v[])
{
save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]);
@@ -4533,16 +4529,16 @@ save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name,
static void GLAPIENTRY
-save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name,
+save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name,
GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y,
- (GLfloat) z,(GLfloat) w);
+ (GLfloat) z, (GLfloat) w);
}
static void GLAPIENTRY
-save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name,
+save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
const double v[])
{
save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0],
@@ -4555,34 +4551,36 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name,
/* GL_EXT_stencil_two_side */
-static void GLAPIENTRY save_ActiveStencilFaceEXT( GLenum face )
+static void GLAPIENTRY
+save_ActiveStencilFaceEXT(GLenum face)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
if (n) {
n[1].e = face;
}
if (ctx->ExecuteFlag) {
- CALL_ActiveStencilFaceEXT(ctx->Exec, ( face ));
+ CALL_ActiveStencilFaceEXT(ctx->Exec, (face));
}
}
/* GL_EXT_depth_bounds_test */
-static void GLAPIENTRY save_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
+static void GLAPIENTRY
+save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DEPTH_BOUNDS_EXT, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
if (n) {
n[1].f = (GLfloat) zmin;
n[2].f = (GLfloat) zmax;
}
if (ctx->ExecuteFlag) {
- CALL_DepthBoundsEXT(ctx->Exec, ( zmin, zmax ));
+ CALL_DepthBoundsEXT(ctx->Exec, (zmin, zmax));
}
}
@@ -4592,7 +4590,7 @@ static void GLAPIENTRY save_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
static void GLAPIENTRY
save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
- const GLvoid *string)
+ const GLvoid * string)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
@@ -4606,7 +4604,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
_mesa_memcpy(programCopy, string, len);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_STRING_ARB, 4 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4);
if (n) {
n[1].e = target;
n[2].e = format;
@@ -4626,7 +4624,7 @@ save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
@@ -4636,7 +4634,7 @@ save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
n[6].f = w;
}
if (ctx->ExecuteFlag) {
- CALL_ProgramEnvParameter4fARB(ctx->Exec, ( target, index, x, y, z, w));
+ CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
}
}
@@ -4656,9 +4654,7 @@ save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
{
save_ProgramEnvParameter4fARB(target, index,
(GLfloat) x,
- (GLfloat) y,
- (GLfloat) z,
- (GLfloat) w);
+ (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
@@ -4669,8 +4665,7 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
save_ProgramEnvParameter4fARB(target, index,
(GLfloat) params[0],
(GLfloat) params[1],
- (GLfloat) params[2],
- (GLfloat) params[3]);
+ (GLfloat) params[2], (GLfloat) params[3]);
}
#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
@@ -4684,13 +4679,13 @@ save_BeginQueryARB(GLenum target, GLuint id)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BEGIN_QUERY_ARB, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
if (n) {
n[1].e = target;
n[2].ui = id;
}
if (ctx->ExecuteFlag) {
- CALL_BeginQueryARB(ctx->Exec, ( target, id ));
+ CALL_BeginQueryARB(ctx->Exec, (target, id));
}
}
@@ -4701,12 +4696,12 @@ save_EndQueryARB(GLenum target)
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_END_QUERY_ARB, 1 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_END_QUERY_ARB, 1);
if (n) {
n[1].e = target;
}
if (ctx->ExecuteFlag) {
- CALL_EndQueryARB(ctx->Exec, ( target ));
+ CALL_EndQueryARB(ctx->Exec, (target));
}
}
@@ -4714,19 +4709,19 @@ save_EndQueryARB(GLenum target)
static void GLAPIENTRY
-save_DrawBuffersARB(GLsizei count, const GLenum *buffers)
+save_DrawBuffersARB(GLsizei count, const GLenum * buffers)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION( ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
if (n) {
GLint i;
n[1].i = count;
if (count > MAX_DRAW_BUFFERS)
- count = MAX_DRAW_BUFFERS;
+ count = MAX_DRAW_BUFFERS;
for (i = 0; i < count; i++) {
- n[2 + i].e = buffers[i];
+ n[2 + i].e = buffers[i];
}
}
if (ctx->ExecuteFlag) {
@@ -4740,10 +4735,10 @@ save_BindFragmentShaderATI(GLuint id)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
-
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
+
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
if (n) {
- n[1].ui = id;
+ n[1].ui = id;
}
if (ctx->ExecuteFlag) {
CALL_BindFragmentShaderATI(ctx->Exec, (id));
@@ -4755,14 +4750,14 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
-
- n = ALLOC_INSTRUCTION( ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
+
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
if (n) {
- n[1].ui = dst;
- n[2].f = value[0];
- n[3].f = value[1];
- n[4].f = value[2];
- n[5].f = value[3];
+ n[1].ui = dst;
+ n[2].f = value[0];
+ n[3].f = value[1];
+ n[4].f = value[2];
+ n[5].f = value[3];
}
if (ctx->ExecuteFlag) {
CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value));
@@ -4770,12 +4765,13 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
}
#endif
-static void save_Attr1fNV( GLenum attr, GLfloat x )
+static void
+save_Attr1fNV(GLenum attr, GLfloat x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_1F_NV, 2 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_NV, 2);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4783,19 +4779,20 @@ static void save_Attr1fNV( GLenum attr, GLfloat x )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 1;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib1fNV(ctx->Exec, ( attr, x ));
+ CALL_VertexAttrib1fNV(ctx->Exec, (attr, x));
}
}
-static void save_Attr2fNV( GLenum attr, GLfloat x, GLfloat y )
+static void
+save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_2F_NV, 3 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_NV, 3);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4804,19 +4801,20 @@ static void save_Attr2fNV( GLenum attr, GLfloat x, GLfloat y )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 2;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib2fNV(ctx->Exec, ( attr, x, y ));
+ CALL_VertexAttrib2fNV(ctx->Exec, (attr, x, y));
}
}
-static void save_Attr3fNV( GLenum attr, GLfloat x, GLfloat y, GLfloat z )
+static void
+save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_3F_NV, 4 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_NV, 4);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4826,20 +4824,20 @@ static void save_Attr3fNV( GLenum attr, GLfloat x, GLfloat y, GLfloat z )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 3;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib3fNV(ctx->Exec, ( attr, x, y, z ));
+ CALL_VertexAttrib3fNV(ctx->Exec, (attr, x, y, z));
}
}
-static void save_Attr4fNV( GLenum attr, GLfloat x, GLfloat y, GLfloat z,
- GLfloat w )
+static void
+save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_4F_NV, 5 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_NV, 5);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4850,20 +4848,21 @@ static void save_Attr4fNV( GLenum attr, GLfloat x, GLfloat y, GLfloat z,
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 4;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, w);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib4fNV(ctx->Exec, ( attr, x, y, z, w ));
+ CALL_VertexAttrib4fNV(ctx->Exec, (attr, x, y, z, w));
}
}
-static void save_Attr1fARB( GLenum attr, GLfloat x )
+static void
+save_Attr1fARB(GLenum attr, GLfloat x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_1F_ARB, 2 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_ARB, 2);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4871,19 +4870,20 @@ static void save_Attr1fARB( GLenum attr, GLfloat x )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 1;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib1fARB(ctx->Exec, ( attr, x ));
+ CALL_VertexAttrib1fARB(ctx->Exec, (attr, x));
}
}
-static void save_Attr2fARB( GLenum attr, GLfloat x, GLfloat y )
+static void
+save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_2F_ARB, 3 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_ARB, 3);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4892,19 +4892,20 @@ static void save_Attr2fARB( GLenum attr, GLfloat x, GLfloat y )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 2;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib2fARB(ctx->Exec, ( attr, x, y ));
+ CALL_VertexAttrib2fARB(ctx->Exec, (attr, x, y));
}
}
-static void save_Attr3fARB( GLenum attr, GLfloat x, GLfloat y, GLfloat z )
+static void
+save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_3F_ARB, 4 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_ARB, 4);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4914,20 +4915,20 @@ static void save_Attr3fARB( GLenum attr, GLfloat x, GLfloat y, GLfloat z )
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 3;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib3fARB(ctx->Exec, ( attr, x, y, z ));
+ CALL_VertexAttrib3fARB(ctx->Exec, (attr, x, y, z));
}
}
-static void save_Attr4fARB( GLenum attr, GLfloat x, GLfloat y, GLfloat z,
- GLfloat w )
+static void
+save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ATTR_4F_ARB, 5 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_ARB, 5);
if (n) {
n[1].e = attr;
n[2].f = x;
@@ -4938,89 +4939,96 @@ static void save_Attr4fARB( GLenum attr, GLfloat x, GLfloat y, GLfloat z,
ASSERT(attr < VERT_ATTRIB_MAX);
ctx->ListState.ActiveAttribSize[attr] = 4;
- ASSIGN_4V( ctx->ListState.CurrentAttrib[attr], x, y, z, w);
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
if (ctx->ExecuteFlag) {
- CALL_VertexAttrib4fARB(ctx->Exec, ( attr, x, y, z, w ));
+ CALL_VertexAttrib4fARB(ctx->Exec, (attr, x, y, z, w));
}
}
-static void GLAPIENTRY save_EvalCoord1f( GLfloat x )
+static void GLAPIENTRY
+save_EvalCoord1f(GLfloat x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_C1, 1 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1);
if (n) {
n[1].f = x;
}
if (ctx->ExecuteFlag) {
- CALL_EvalCoord1f(ctx->Exec, ( x ));
+ CALL_EvalCoord1f(ctx->Exec, (x));
}
}
-static void GLAPIENTRY save_EvalCoord1fv( const GLfloat *v )
+static void GLAPIENTRY
+save_EvalCoord1fv(const GLfloat * v)
{
- save_EvalCoord1f( v[0] );
+ save_EvalCoord1f(v[0]);
}
-static void GLAPIENTRY save_EvalCoord2f( GLfloat x, GLfloat y )
+static void GLAPIENTRY
+save_EvalCoord2f(GLfloat x, GLfloat y)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_C2, 2 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2);
if (n) {
n[1].f = x;
n[2].f = y;
}
if (ctx->ExecuteFlag) {
- CALL_EvalCoord2f(ctx->Exec, ( x, y ));
+ CALL_EvalCoord2f(ctx->Exec, (x, y));
}
}
-static void GLAPIENTRY save_EvalCoord2fv( const GLfloat *v )
+static void GLAPIENTRY
+save_EvalCoord2fv(const GLfloat * v)
{
- save_EvalCoord2f( v[0], v[1] );
+ save_EvalCoord2f(v[0], v[1]);
}
-static void GLAPIENTRY save_EvalPoint1( GLint x )
+static void GLAPIENTRY
+save_EvalPoint1(GLint x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_P1, 1 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1);
if (n) {
n[1].i = x;
}
if (ctx->ExecuteFlag) {
- CALL_EvalPoint1(ctx->Exec, ( x ));
+ CALL_EvalPoint1(ctx->Exec, (x));
}
}
-static void GLAPIENTRY save_EvalPoint2( GLint x, GLint y )
+static void GLAPIENTRY
+save_EvalPoint2(GLint x, GLint y)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EVAL_P2, 2 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2);
if (n) {
n[1].i = x;
n[2].i = y;
}
if (ctx->ExecuteFlag) {
- CALL_EvalPoint2(ctx->Exec, ( x, y ));
+ CALL_EvalPoint2(ctx->Exec, (x, y));
}
}
-static void GLAPIENTRY save_Indexf( GLfloat x )
+static void GLAPIENTRY
+save_Indexf(GLfloat x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_INDEX, 1 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX, 1);
if (n) {
n[1].f = x;
}
@@ -5029,21 +5037,23 @@ static void GLAPIENTRY save_Indexf( GLfloat x )
ctx->ListState.CurrentIndex = x;
if (ctx->ExecuteFlag) {
- CALL_Indexi(ctx->Exec, ( (GLint) x ));
+ CALL_Indexi(ctx->Exec, ((GLint) x));
}
}
-static void GLAPIENTRY save_Indexfv( const GLfloat *v )
+static void GLAPIENTRY
+save_Indexfv(const GLfloat * v)
{
- save_Indexf( v[0] );
+ save_Indexf(v[0]);
}
-static void GLAPIENTRY save_EdgeFlag( GLboolean x )
+static void GLAPIENTRY
+save_EdgeFlag(GLboolean x)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_EDGEFLAG, 1 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_EDGEFLAG, 1);
if (n) {
n[1].b = x;
}
@@ -5052,22 +5062,24 @@ static void GLAPIENTRY save_EdgeFlag( GLboolean x )
ctx->ListState.CurrentEdgeFlag = x;
if (ctx->ExecuteFlag) {
- CALL_EdgeFlag(ctx->Exec, ( x ));
+ CALL_EdgeFlag(ctx->Exec, (x));
}
}
-static void GLAPIENTRY save_EdgeFlagv( const GLboolean *v )
+static void GLAPIENTRY
+save_EdgeFlagv(const GLboolean * v)
{
- save_EdgeFlag( v[0] );
+ save_EdgeFlag(v[0]);
}
-static void GLAPIENTRY save_Materialfv( GLenum face, GLenum pname, const GLfloat *param )
+static void GLAPIENTRY
+save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
int args, i;
- SAVE_FLUSH_VERTICES( ctx );
+ SAVE_FLUSH_VERTICES(ctx);
switch (face) {
case GL_BACK:
@@ -5075,7 +5087,7 @@ static void GLAPIENTRY save_Materialfv( GLenum face, GLenum pname, const GLfloat
case GL_FRONT_AND_BACK:
break;
default:
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "material(face)" );
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(face)");
return;
}
@@ -5094,40 +5106,41 @@ static void GLAPIENTRY save_Materialfv( GLenum face, GLenum pname, const GLfloat
args = 3;
break;
default:
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "material(pname)" );
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(pname)");
return;
}
- n = ALLOC_INSTRUCTION( ctx, OPCODE_MATERIAL, 6 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6);
if (n) {
n[1].e = face;
n[2].e = pname;
- for (i = 0 ; i < args ; i++)
- n[3+i].f = param[i];
+ for (i = 0; i < args; i++)
+ n[3 + i].f = param[i];
}
{
- GLuint bitmask = _mesa_material_bitmask( ctx, face, pname, ~0, NULL );
- for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
- if (bitmask & (1<<i)) {
- ctx->ListState.ActiveMaterialSize[i] = args;
- COPY_SZ_4V( ctx->ListState.CurrentMaterial[i], args, param );
- }
+ GLuint bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL);
+ for (i = 0; i < MAT_ATTRIB_MAX; i++)
+ if (bitmask & (1 << i)) {
+ ctx->ListState.ActiveMaterialSize[i] = args;
+ COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param);
+ }
}
if (ctx->ExecuteFlag) {
- CALL_Materialfv(ctx->Exec, ( face, pname, param ));
+ CALL_Materialfv(ctx->Exec, (face, pname, param));
}
}
-static void GLAPIENTRY save_Begin( GLenum mode )
+static void GLAPIENTRY
+save_Begin(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
GLboolean error = GL_FALSE;
- if (/*mode < GL_POINTS ||*/ mode > GL_POLYGON) {
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "Begin (mode)");
+ if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) {
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)");
error = GL_TRUE;
}
else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {
@@ -5141,7 +5154,7 @@ static void GLAPIENTRY save_Begin( GLenum mode )
ctx->Driver.CurrentSavePrimitive = mode;
}
else {
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "recursive begin" );
+ _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive begin");
error = GL_TRUE;
}
@@ -5149,38 +5162,40 @@ static void GLAPIENTRY save_Begin( GLenum mode )
/* Give the driver an opportunity to hook in an optimized
* display list compiler.
*/
- if (ctx->Driver.NotifySaveBegin( ctx, mode ))
- return;
+ if (ctx->Driver.NotifySaveBegin(ctx, mode))
+ return;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_BEGIN, 1 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1);
if (n) {
- n[1].e = mode;
+ n[1].e = mode;
}
}
if (ctx->ExecuteFlag) {
- CALL_Begin(ctx->Exec, ( mode ));
+ CALL_Begin(ctx->Exec, (mode));
}
}
-static void GLAPIENTRY save_End( void )
+static void GLAPIENTRY
+save_End(void)
{
GET_CURRENT_CONTEXT(ctx);
- SAVE_FLUSH_VERTICES( ctx );
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_END, 0 );
+ SAVE_FLUSH_VERTICES(ctx);
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0);
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
if (ctx->ExecuteFlag) {
- CALL_End(ctx->Exec, ( ));
+ CALL_End(ctx->Exec, ());
}
}
-static void GLAPIENTRY save_Rectf( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
+static void GLAPIENTRY
+save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- SAVE_FLUSH_VERTICES( ctx );
- n = ALLOC_INSTRUCTION( ctx, OPCODE_RECTF, 4 );
+ SAVE_FLUSH_VERTICES(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_RECTF, 4);
if (n) {
n[1].f = a;
n[2].f = b;
@@ -5188,373 +5203,447 @@ static void GLAPIENTRY save_Rectf( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
n[4].f = d;
}
if (ctx->ExecuteFlag) {
- CALL_Rectf(ctx->Exec, ( a, b, c, d ));
+ CALL_Rectf(ctx->Exec, (a, b, c, d));
}
}
-static void GLAPIENTRY save_Vertex2f( GLfloat x, GLfloat y )
+static void GLAPIENTRY
+save_Vertex2f(GLfloat x, GLfloat y)
{
- save_Attr2fNV( VERT_ATTRIB_POS, x, y );
+ save_Attr2fNV(VERT_ATTRIB_POS, x, y);
}
-static void GLAPIENTRY save_Vertex2fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Vertex2fv(const GLfloat * v)
{
- save_Attr2fNV( VERT_ATTRIB_POS, v[0], v[1] );
+ save_Attr2fNV(VERT_ATTRIB_POS, v[0], v[1]);
}
-static void GLAPIENTRY save_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
{
- save_Attr3fNV( VERT_ATTRIB_POS, x, y, z );
+ save_Attr3fNV(VERT_ATTRIB_POS, x, y, z);
}
-static void GLAPIENTRY save_Vertex3fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Vertex3fv(const GLfloat * v)
{
- save_Attr3fNV( VERT_ATTRIB_POS, v[0], v[1], v[2] );
+ save_Attr3fNV(VERT_ATTRIB_POS, v[0], v[1], v[2]);
}
-static void GLAPIENTRY save_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- save_Attr4fNV( VERT_ATTRIB_POS, x, y, z, w );
+ save_Attr4fNV(VERT_ATTRIB_POS, x, y, z, w);
}
-static void GLAPIENTRY save_Vertex4fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Vertex4fv(const GLfloat * v)
{
- save_Attr4fNV( VERT_ATTRIB_POS, v[0], v[1], v[2], v[3] );
+ save_Attr4fNV(VERT_ATTRIB_POS, v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_TexCoord1f( GLfloat x )
+static void GLAPIENTRY
+save_TexCoord1f(GLfloat x)
{
- save_Attr1fNV( VERT_ATTRIB_TEX0, x );
+ save_Attr1fNV(VERT_ATTRIB_TEX0, x);
}
-static void GLAPIENTRY save_TexCoord1fv( const GLfloat *v )
+static void GLAPIENTRY
+save_TexCoord1fv(const GLfloat * v)
{
- save_Attr1fNV( VERT_ATTRIB_TEX0, v[0] );
+ save_Attr1fNV(VERT_ATTRIB_TEX0, v[0]);
}
-static void GLAPIENTRY save_TexCoord2f( GLfloat x, GLfloat y )
+static void GLAPIENTRY
+save_TexCoord2f(GLfloat x, GLfloat y)
{
- save_Attr2fNV( VERT_ATTRIB_TEX0, x, y );
+ save_Attr2fNV(VERT_ATTRIB_TEX0, x, y);
}
-static void GLAPIENTRY save_TexCoord2fv( const GLfloat *v )
+static void GLAPIENTRY
+save_TexCoord2fv(const GLfloat * v)
{
- save_Attr2fNV( VERT_ATTRIB_TEX0, v[0], v[1] );
+ save_Attr2fNV(VERT_ATTRIB_TEX0, v[0], v[1]);
}
-static void GLAPIENTRY save_TexCoord3f( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_TexCoord3f(GLfloat x, GLfloat y, GLfloat z)
{
- save_Attr3fNV( VERT_ATTRIB_TEX0, x, y, z );
+ save_Attr3fNV(VERT_ATTRIB_TEX0, x, y, z);
}
-static void GLAPIENTRY save_TexCoord3fv( const GLfloat *v )
+static void GLAPIENTRY
+save_TexCoord3fv(const GLfloat * v)
{
- save_Attr3fNV( VERT_ATTRIB_TEX0, v[0], v[1], v[2] );
+ save_Attr3fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2]);
}
-static void GLAPIENTRY save_TexCoord4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- save_Attr4fNV( VERT_ATTRIB_TEX0, x, y, z, w );
+ save_Attr4fNV(VERT_ATTRIB_TEX0, x, y, z, w);
}
-static void GLAPIENTRY save_TexCoord4fv( const GLfloat *v )
+static void GLAPIENTRY
+save_TexCoord4fv(const GLfloat * v)
{
- save_Attr4fNV( VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3] );
+ save_Attr4fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_Normal3f( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Normal3f(GLfloat x, GLfloat y, GLfloat z)
{
- save_Attr3fNV( VERT_ATTRIB_NORMAL, x, y, z );
+ save_Attr3fNV(VERT_ATTRIB_NORMAL, x, y, z);
}
-static void GLAPIENTRY save_Normal3fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Normal3fv(const GLfloat * v)
{
- save_Attr3fNV( VERT_ATTRIB_NORMAL, v[0], v[1], v[2] );
+ save_Attr3fNV(VERT_ATTRIB_NORMAL, v[0], v[1], v[2]);
}
-static void GLAPIENTRY save_FogCoordfEXT( GLfloat x )
+static void GLAPIENTRY
+save_FogCoordfEXT(GLfloat x)
{
- save_Attr1fNV( VERT_ATTRIB_FOG, x );
+ save_Attr1fNV(VERT_ATTRIB_FOG, x);
}
-static void GLAPIENTRY save_FogCoordfvEXT( const GLfloat *v )
+static void GLAPIENTRY
+save_FogCoordfvEXT(const GLfloat * v)
{
- save_Attr1fNV( VERT_ATTRIB_FOG, v[0] );
+ save_Attr1fNV(VERT_ATTRIB_FOG, v[0]);
}
-static void GLAPIENTRY save_Color3f( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_Color3f(GLfloat x, GLfloat y, GLfloat z)
{
- save_Attr3fNV( VERT_ATTRIB_COLOR0, x, y, z );
+ save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z);
}
-static void GLAPIENTRY save_Color3fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Color3fv(const GLfloat * v)
{
- save_Attr3fNV( VERT_ATTRIB_COLOR0, v[0], v[1], v[2] );
+ save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]);
}
-static void GLAPIENTRY save_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- save_Attr4fNV( VERT_ATTRIB_COLOR0, x, y, z, w );
+ save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w);
}
-static void GLAPIENTRY save_Color4fv( const GLfloat *v )
+static void GLAPIENTRY
+save_Color4fv(const GLfloat * v)
{
- save_Attr4fNV( VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3] );
+ save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]);
}
-static void GLAPIENTRY save_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z )
+static void GLAPIENTRY
+save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z)
{
- save_Attr3fNV( VERT_ATTRIB_COLOR1, x, y, z );
+ save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z);
}
-static void GLAPIENTRY save_SecondaryColor3fvEXT( const GLfloat *v )
+static void GLAPIENTRY
+save_SecondaryColor3fvEXT(const GLfloat * v)
{
- save_Attr3fNV( VERT_ATTRIB_COLOR1, v[0], v[1], v[2] );
+ save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]);
}
/* Just call the respective ATTR for texcoord
*/
-static void GLAPIENTRY save_MultiTexCoord1f( GLenum target, GLfloat x )
+static void GLAPIENTRY
+save_MultiTexCoord1f(GLenum target, GLfloat x)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr1fNV( attr, x );
+ save_Attr1fNV(attr, x);
}
-static void GLAPIENTRY save_MultiTexCoord1fv( GLenum target, const GLfloat *v )
+static void GLAPIENTRY
+save_MultiTexCoord1fv(GLenum target, const GLfloat * v)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr1fNV( attr, v[0] );
+ save_Attr1fNV(attr, v[0]);
}
-static void GLAPIENTRY save_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y )
+static void GLAPIENTRY
+save_MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr2fNV( attr, x, y );
+ save_Attr2fNV(attr, x, y);
}
-static void GLAPIENTRY save_MultiTexCoord2fv( GLenum target, const GLfloat *v )
+static void GLAPIENTRY
+save_MultiTexCoord2fv(GLenum target, const GLfloat * v)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr2fNV( attr, v[0], v[1] );
+ save_Attr2fNV(attr, v[0], v[1]);
}
-static void GLAPIENTRY save_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y,
- GLfloat z)
+static void GLAPIENTRY
+save_MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr3fNV( attr, x, y, z );
+ save_Attr3fNV(attr, x, y, z);
}
-static void GLAPIENTRY save_MultiTexCoord3fv( GLenum target, const GLfloat *v )
+static void GLAPIENTRY
+save_MultiTexCoord3fv(GLenum target, const GLfloat * v)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr3fNV( attr, v[0], v[1], v[2] );
+ save_Attr3fNV(attr, v[0], v[1], v[2]);
}
-static void GLAPIENTRY save_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr4fNV( attr, x, y, z, w );
+ save_Attr4fNV(attr, x, y, z, w);
}
-static void GLAPIENTRY save_MultiTexCoord4fv( GLenum target, const GLfloat *v )
+static void GLAPIENTRY
+save_MultiTexCoord4fv(GLenum target, const GLfloat * v)
{
GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr4fNV( attr, v[0], v[1], v[2], v[3] );
+ save_Attr4fNV(attr, v[0], v[1], v[2], v[3]);
}
-static void enum_error( void )
+/**
+ * Record a GL_INVALID_VALUE error when a invalid vertex attribute
+ * index is found.
+ */
+static void
+index_error(void)
{
- GET_CURRENT_CONTEXT( ctx );
- _mesa_error( ctx, GL_INVALID_ENUM, "VertexAttribfNV" );
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
}
+
/* First level for NV_vertex_program:
*
* Check for errors at compile time?.
*/
-static void GLAPIENTRY save_VertexAttrib1fNV( GLuint index, GLfloat x )
+static void GLAPIENTRY
+save_VertexAttrib1fNV(GLuint index, GLfloat x)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr1fNV( index, x );
+ save_Attr1fNV(index, x);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
+static void GLAPIENTRY
+save_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr1fNV( index, v[0] );
+ save_Attr1fNV(index, v[0]);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
+static void GLAPIENTRY
+save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr2fNV( index, x, y );
+ save_Attr2fNV(index, x, y);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
+static void GLAPIENTRY
+save_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr2fNV( index, v[0], v[1] );
+ save_Attr2fNV(index, v[0], v[1]);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
- GLfloat z )
+static void GLAPIENTRY
+save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr3fNV( index, x, y, z );
+ save_Attr3fNV(index, x, y, z);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
+static void GLAPIENTRY
+save_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr3fNV( index, v[0], v[1], v[2] );
+ save_Attr3fNV(index, v[0], v[1], v[2]);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w )
+static void GLAPIENTRY
+save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr4fNV( index, x, y, z, w );
+ save_Attr4fNV(index, x, y, z, w);
else
- enum_error();
+ index_error();
}
-static void GLAPIENTRY save_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+static void GLAPIENTRY
+save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr4fNV( index, v[0], v[1], v[2], v[3] );
+ save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib1fARB( GLuint index, GLfloat x )
+save_VertexAttrib1fARB(GLuint index, GLfloat x)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr1fARB( index, x );
+ save_Attr1fARB(index, x);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
+save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr1fARB( index, v[0] );
+ save_Attr1fARB(index, v[0]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
+save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr2fARB( index, x, y );
+ save_Attr2fARB(index, x, y);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
+save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr2fARB( index, v[0], v[1] );
+ save_Attr2fARB(index, v[0], v[1]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib3fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z )
+save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr3fARB( index, x, y, z );
+ save_Attr3fARB(index, x, y, z);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
+save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr3fARB( index, v[0], v[1], v[2] );
+ save_Attr3fARB(index, v[0], v[1], v[2]);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib4fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr4fARB( index, x, y, z, w );
+ save_Attr4fARB(index, x, y, z, w);
else
- enum_error();
+ index_error();
}
static void GLAPIENTRY
-save_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
+save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
{
if (index < VERT_ATTRIB_MAX)
- save_Attr4fARB( index, v[0], v[1], v[2], v[3] );
+ save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
else
- enum_error();
+ index_error();
}
+#if FEATURE_EXT_framebuffer_blit
+static void GLAPIENTRY
+save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
+ if (n) {
+ n[1].i = srcX0;
+ n[2].i = srcY0;
+ n[3].i = srcX1;
+ n[4].i = srcY1;
+ n[5].i = dstX0;
+ n[6].i = dstY0;
+ n[7].i = dstX1;
+ n[8].i = dstY1;
+ n[9].i = mask;
+ n[10].e = filter;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlitFramebufferEXT(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter));
+ }
+}
+#endif
-
-/* KW: Compile commands
+/**
+ * Save an error-generating command into display list.
*
- * Will appear in the list before the vertex buffer containing the
+ * KW: Will appear in the list before the vertex buffer containing the
* command that provoked the error. I don't see this as a problem.
*/
-void
-_mesa_save_error( GLcontext *ctx, GLenum error, const char *s )
+static void
+save_error(GLcontext *ctx, GLenum error, const char *s)
{
Node *n;
- n = ALLOC_INSTRUCTION( ctx, OPCODE_ERROR, 2 );
+ n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2);
if (n) {
n[1].e = error;
n[2].data = (void *) s;
}
- /* execute already done */
}
-/*
+/**
* Compile an error into current display list.
*/
void
-_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
+_mesa_compile_error(GLcontext *ctx, GLenum error, const char *s)
{
if (ctx->CompileFlag)
- _mesa_save_error( ctx, error, s );
-
+ save_error(ctx, error, s);
if (ctx->ExecuteFlag)
- _mesa_error( ctx, error, s );
+ _mesa_error(ctx, error, s);
}
-
+/**
+ * Test if ID names a display list.
+ */
static GLboolean
islist(GLcontext *ctx, GLuint list)
{
@@ -5579,14 +5668,14 @@ islist(GLcontext *ctx, GLuint list)
* the absolute list number, not relative to ListBase.
* \param list - display list number
*/
-static void GLAPIENTRY
-execute_list( GLcontext *ctx, GLuint list )
+static void
+execute_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
Node *n;
GLboolean done;
- if (list == 0 || !islist(ctx,list))
+ if (list == 0 || !islist(ctx, list))
return;
if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
@@ -5595,96 +5684,100 @@ execute_list( GLcontext *ctx, GLuint list )
}
- dlist = (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
+ dlist =
+ (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
+ list);
if (!dlist)
return;
ctx->ListState.CallStack[ctx->ListState.CallDepth++] = dlist;
if (ctx->Driver.BeginCallList)
- ctx->Driver.BeginCallList( ctx, dlist );
+ ctx->Driver.BeginCallList(ctx, dlist);
n = dlist->node;
done = GL_FALSE;
while (!done) {
OpCode opcode = n[0].opcode;
- int i = (int)n[0].opcode - (int)OPCODE_EXT_0;
+ int i = (int) n[0].opcode - (int) OPCODE_EXT_0;
if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
/* this is a driver-extended opcode */
- ctx->ListExt.Opcode[i].Execute(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ ctx->ListExt.Opcode[i].Execute(ctx, &n[1]);
+ n += ctx->ListExt.Opcode[i].Size;
}
else {
- switch (opcode) {
- case OPCODE_ERROR:
- _mesa_error( ctx, n[1].e, (const char *) n[2].data );
- break;
+ switch (opcode) {
+ case OPCODE_ERROR:
+ _mesa_error(ctx, n[1].e, (const char *) n[2].data);
+ break;
case OPCODE_ACCUM:
- CALL_Accum(ctx->Exec, ( n[1].e, n[2].f ));
- break;
+ CALL_Accum(ctx->Exec, (n[1].e, n[2].f));
+ break;
case OPCODE_ALPHA_FUNC:
- CALL_AlphaFunc(ctx->Exec, ( n[1].e, n[2].f ));
- break;
+ CALL_AlphaFunc(ctx->Exec, (n[1].e, n[2].f));
+ break;
case OPCODE_BIND_TEXTURE:
- CALL_BindTexture(ctx->Exec, ( n[1].e, n[2].ui ));
+ CALL_BindTexture(ctx->Exec, (n[1].e, n[2].ui));
break;
- case OPCODE_BITMAP:
+ case OPCODE_BITMAP:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_Bitmap(ctx->Exec, ( (GLsizei) n[1].i, (GLsizei) n[2].i,
- n[3].f, n[4].f, n[5].f, n[6].f, (const GLubyte *) n[7].data ));
- ctx->Unpack = save; /* restore */
+ CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i,
+ n[3].f, n[4].f, n[5].f, n[6].f,
+ (const GLubyte *) n[7].data));
+ ctx->Unpack = save; /* restore */
}
- break;
- case OPCODE_BLEND_COLOR:
- CALL_BlendColor(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
- break;
- case OPCODE_BLEND_EQUATION:
- CALL_BlendEquation(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_BLEND_EQUATION_SEPARATE:
- CALL_BlendEquationSeparateEXT(ctx->Exec, ( n[1].e, n[2].e ));
- break;
- case OPCODE_BLEND_FUNC_SEPARATE:
- CALL_BlendFuncSeparateEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, n[4].e));
- break;
+ break;
+ case OPCODE_BLEND_COLOR:
+ CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_BLEND_EQUATION:
+ CALL_BlendEquation(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_BLEND_EQUATION_SEPARATE:
+ CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_BLEND_FUNC_SEPARATE:
+ CALL_BlendFuncSeparateEXT(ctx->Exec,
+ (n[1].e, n[2].e, n[3].e, n[4].e));
+ break;
case OPCODE_CALL_LIST:
- /* Generated by glCallList(), don't add ListBase */
- if (ctx->ListState.CallDepth<MAX_LIST_NESTING) {
- execute_list( ctx, n[1].ui );
+ /* Generated by glCallList(), don't add ListBase */
+ if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
+ execute_list(ctx, n[1].ui);
}
break;
case OPCODE_CALL_LIST_OFFSET:
- /* Generated by glCallLists() so we must add ListBase */
+ /* Generated by glCallLists() so we must add ListBase */
if (n[2].b) {
/* user specified a bad data type at compile time */
_mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
}
else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
- execute_list( ctx, ctx->List.ListBase + n[1].ui );
+ execute_list(ctx, ctx->List.ListBase + n[1].ui);
}
break;
- case OPCODE_CLEAR:
- CALL_Clear(ctx->Exec, ( n[1].bf ));
- break;
- case OPCODE_CLEAR_COLOR:
- CALL_ClearColor(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
- break;
- case OPCODE_CLEAR_ACCUM:
- CALL_ClearAccum(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
- break;
- case OPCODE_CLEAR_DEPTH:
- CALL_ClearDepth(ctx->Exec, ( (GLclampd) n[1].f ));
- break;
- case OPCODE_CLEAR_INDEX:
- CALL_ClearIndex(ctx->Exec, ( (GLfloat) n[1].ui ));
- break;
- case OPCODE_CLEAR_STENCIL:
- CALL_ClearStencil(ctx->Exec, ( n[1].i ));
- break;
+ case OPCODE_CLEAR:
+ CALL_Clear(ctx->Exec, (n[1].bf));
+ break;
+ case OPCODE_CLEAR_COLOR:
+ CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_CLEAR_ACCUM:
+ CALL_ClearAccum(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_CLEAR_DEPTH:
+ CALL_ClearDepth(ctx->Exec, ((GLclampd) n[1].f));
+ break;
+ case OPCODE_CLEAR_INDEX:
+ CALL_ClearIndex(ctx->Exec, ((GLfloat) n[1].ui));
+ break;
+ case OPCODE_CLEAR_STENCIL:
+ CALL_ClearStencil(ctx->Exec, (n[1].i));
+ break;
case OPCODE_CLIP_PLANE:
{
GLdouble eq[4];
@@ -5692,22 +5785,22 @@ execute_list( GLcontext *ctx, GLuint list )
eq[1] = n[3].f;
eq[2] = n[4].f;
eq[3] = n[5].f;
- CALL_ClipPlane(ctx->Exec, ( n[1].e, eq ));
+ CALL_ClipPlane(ctx->Exec, (n[1].e, eq));
}
break;
- case OPCODE_COLOR_MASK:
- CALL_ColorMask(ctx->Exec, ( n[1].b, n[2].b, n[3].b, n[4].b ));
- break;
- case OPCODE_COLOR_MATERIAL:
- CALL_ColorMaterial(ctx->Exec, ( n[1].e, n[2].e ));
- break;
+ case OPCODE_COLOR_MASK:
+ CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
+ break;
+ case OPCODE_COLOR_MATERIAL:
+ CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
+ break;
case OPCODE_COLOR_TABLE:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_ColorTable(ctx->Exec, ( n[1].e, n[2].e, n[3].i, n[4].e,
- n[5].e, n[6].data ));
- ctx->Unpack = save; /* restore */
+ CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e,
+ n[5].e, n[6].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
@@ -5717,7 +5810,8 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- CALL_ColorTableParameterfv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_ColorTableParameterfv(ctx->Exec,
+ (n[1].e, n[2].e, params));
}
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
@@ -5727,38 +5821,41 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].i;
params[2] = n[5].i;
params[3] = n[6].i;
- CALL_ColorTableParameteriv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_ColorTableParameteriv(ctx->Exec,
+ (n[1].e, n[2].e, params));
}
break;
case OPCODE_COLOR_SUB_TABLE:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_ColorSubTable(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].e, n[5].e, n[6].data ));
- ctx->Unpack = save; /* restore */
+ CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].e, n[5].e, n[6].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_FILTER_1D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_ConvolutionFilter1D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].e, n[5].e, n[6].data ));
- ctx->Unpack = save; /* restore */
+ CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].e, n[5].e,
+ n[6].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_FILTER_2D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_ConvolutionFilter2D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e, n[6].e, n[7].data ));
- ctx->Unpack = save; /* restore */
+ CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e, n[6].e,
+ n[7].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_CONVOLUTION_PARAMETER_I:
- CALL_ConvolutionParameteri(ctx->Exec, ( n[1].e, n[2].e, n[3].i ));
+ CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i));
break;
case OPCODE_CONVOLUTION_PARAMETER_IV:
{
@@ -5767,11 +5864,12 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].i;
params[2] = n[5].i;
params[3] = n[6].i;
- CALL_ConvolutionParameteriv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_ConvolutionParameteriv(ctx->Exec,
+ (n[1].e, n[2].e, params));
}
break;
case OPCODE_CONVOLUTION_PARAMETER_F:
- CALL_ConvolutionParameterf(ctx->Exec, ( n[1].e, n[2].e, n[3].f ));
+ CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f));
break;
case OPCODE_CONVOLUTION_PARAMETER_FV:
{
@@ -5780,168 +5878,175 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- CALL_ConvolutionParameterfv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_ConvolutionParameterfv(ctx->Exec,
+ (n[1].e, n[2].e, params));
}
break;
case OPCODE_COPY_COLOR_SUB_TABLE:
- CALL_CopyColorSubTable(ctx->Exec, ( n[1].e, n[2].i,
- n[3].i, n[4].i, n[5].i ));
+ CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
+ n[3].i, n[4].i, n[5].i));
break;
case OPCODE_COPY_COLOR_TABLE:
- CALL_CopyColorSubTable(ctx->Exec, ( n[1].e, n[2].i,
- n[3].i, n[4].i, n[5].i ));
+ CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
+ n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_COPY_PIXELS:
+ CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i,
+ (GLsizei) n[3].i, (GLsizei) n[4].i,
+ n[5].e));
break;
- case OPCODE_COPY_PIXELS:
- CALL_CopyPixels(ctx->Exec, ( n[1].i, n[2].i,
- (GLsizei) n[3].i, (GLsizei) n[4].i, n[5].e ));
- break;
case OPCODE_COPY_TEX_IMAGE1D:
- CALL_CopyTexImage1D(ctx->Exec, ( n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i ));
+ CALL_CopyTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i));
break;
case OPCODE_COPY_TEX_IMAGE2D:
- CALL_CopyTexImage2D(ctx->Exec, ( n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i ));
+ CALL_CopyTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i));
break;
case OPCODE_COPY_TEX_SUB_IMAGE1D:
- CALL_CopyTexSubImage1D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i ));
+ CALL_CopyTexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i));
break;
case OPCODE_COPY_TEX_SUB_IMAGE2D:
- CALL_CopyTexSubImage2D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i, n[8].i ));
+ CALL_CopyTexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i));
break;
case OPCODE_COPY_TEX_SUB_IMAGE3D:
- CALL_CopyTexSubImage3D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i, n[8].i , n[9].i));
+ CALL_CopyTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i, n[9].i));
break;
- case OPCODE_CULL_FACE:
- CALL_CullFace(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_DEPTH_FUNC:
- CALL_DepthFunc(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_DEPTH_MASK:
- CALL_DepthMask(ctx->Exec, ( n[1].b ));
- break;
- case OPCODE_DEPTH_RANGE:
- CALL_DepthRange(ctx->Exec, ( (GLclampd) n[1].f, (GLclampd) n[2].f ));
- break;
- case OPCODE_DISABLE:
- CALL_Disable(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_DRAW_BUFFER:
- CALL_DrawBuffer(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_DRAW_PIXELS:
+ case OPCODE_CULL_FACE:
+ CALL_CullFace(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DEPTH_FUNC:
+ CALL_DepthFunc(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DEPTH_MASK:
+ CALL_DepthMask(ctx->Exec, (n[1].b));
+ break;
+ case OPCODE_DEPTH_RANGE:
+ CALL_DepthRange(ctx->Exec,
+ ((GLclampd) n[1].f, (GLclampd) n[2].f));
+ break;
+ case OPCODE_DISABLE:
+ CALL_Disable(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DRAW_BUFFER:
+ CALL_DrawBuffer(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DRAW_PIXELS:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_DrawPixels(ctx->Exec, ( n[1].i, n[2].i, n[3].e, n[4].e,
- n[5].data ));
- ctx->Unpack = save; /* restore */
+ CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e,
+ n[5].data));
+ ctx->Unpack = save; /* restore */
}
- break;
- case OPCODE_ENABLE:
- CALL_Enable(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_EVALMESH1:
- CALL_EvalMesh1(ctx->Exec, ( n[1].e, n[2].i, n[3].i ));
- break;
- case OPCODE_EVALMESH2:
- CALL_EvalMesh2(ctx->Exec, ( n[1].e, n[2].i, n[3].i, n[4].i, n[5].i ));
- break;
- case OPCODE_FOG:
- {
- GLfloat p[4];
- p[0] = n[2].f;
- p[1] = n[3].f;
- p[2] = n[4].f;
- p[3] = n[5].f;
- CALL_Fogfv(ctx->Exec, ( n[1].e, p ));
- }
- break;
- case OPCODE_FRONT_FACE:
- CALL_FrontFace(ctx->Exec, ( n[1].e ));
- break;
+ break;
+ case OPCODE_ENABLE:
+ CALL_Enable(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_EVALMESH1:
+ CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i));
+ break;
+ case OPCODE_EVALMESH2:
+ CALL_EvalMesh2(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_FOG:
+ {
+ GLfloat p[4];
+ p[0] = n[2].f;
+ p[1] = n[3].f;
+ p[2] = n[4].f;
+ p[3] = n[5].f;
+ CALL_Fogfv(ctx->Exec, (n[1].e, p));
+ }
+ break;
+ case OPCODE_FRONT_FACE:
+ CALL_FrontFace(ctx->Exec, (n[1].e));
+ break;
case OPCODE_FRUSTUM:
- CALL_Frustum(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ));
+ CALL_Frustum(ctx->Exec,
+ (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
+ break;
+ case OPCODE_HINT:
+ CALL_Hint(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_HISTOGRAM:
+ CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b));
+ break;
+ case OPCODE_INDEX_MASK:
+ CALL_IndexMask(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_INIT_NAMES:
+ CALL_InitNames(ctx->Exec, ());
break;
- case OPCODE_HINT:
- CALL_Hint(ctx->Exec, ( n[1].e, n[2].e ));
- break;
- case OPCODE_HISTOGRAM:
- CALL_Histogram(ctx->Exec, ( n[1].e, n[2].i, n[3].e, n[4].b ));
- break;
- case OPCODE_INDEX_MASK:
- CALL_IndexMask(ctx->Exec, ( n[1].ui ));
- break;
- case OPCODE_INIT_NAMES:
- CALL_InitNames(ctx->Exec, ());
- break;
case OPCODE_LIGHT:
- {
- GLfloat p[4];
- p[0] = n[3].f;
- p[1] = n[4].f;
- p[2] = n[5].f;
- p[3] = n[6].f;
- CALL_Lightfv(ctx->Exec, ( n[1].e, n[2].e, p ));
- }
- break;
+ {
+ GLfloat p[4];
+ p[0] = n[3].f;
+ p[1] = n[4].f;
+ p[2] = n[5].f;
+ p[3] = n[6].f;
+ CALL_Lightfv(ctx->Exec, (n[1].e, n[2].e, p));
+ }
+ break;
case OPCODE_LIGHT_MODEL:
- {
- GLfloat p[4];
- p[0] = n[2].f;
- p[1] = n[3].f;
- p[2] = n[4].f;
- p[3] = n[5].f;
- CALL_LightModelfv(ctx->Exec, ( n[1].e, p ));
- }
- break;
- case OPCODE_LINE_STIPPLE:
- CALL_LineStipple(ctx->Exec, ( n[1].i, n[2].us ));
- break;
- case OPCODE_LINE_WIDTH:
- CALL_LineWidth(ctx->Exec, ( n[1].f ));
- break;
- case OPCODE_LIST_BASE:
- CALL_ListBase(ctx->Exec, ( n[1].ui ));
- break;
- case OPCODE_LOAD_IDENTITY:
+ {
+ GLfloat p[4];
+ p[0] = n[2].f;
+ p[1] = n[3].f;
+ p[2] = n[4].f;
+ p[3] = n[5].f;
+ CALL_LightModelfv(ctx->Exec, (n[1].e, p));
+ }
+ break;
+ case OPCODE_LINE_STIPPLE:
+ CALL_LineStipple(ctx->Exec, (n[1].i, n[2].us));
+ break;
+ case OPCODE_LINE_WIDTH:
+ CALL_LineWidth(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_LIST_BASE:
+ CALL_ListBase(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_LOAD_IDENTITY:
CALL_LoadIdentity(ctx->Exec, ());
break;
- case OPCODE_LOAD_MATRIX:
- if (sizeof(Node)==sizeof(GLfloat)) {
- CALL_LoadMatrixf(ctx->Exec, ( &n[1].f ));
- }
- else {
- GLfloat m[16];
- GLuint i;
- for (i=0;i<16;i++) {
- m[i] = n[1+i].f;
- }
- CALL_LoadMatrixf(ctx->Exec, ( m ));
- }
- break;
- case OPCODE_LOAD_NAME:
- CALL_LoadName(ctx->Exec, ( n[1].ui ));
- break;
- case OPCODE_LOGIC_OP:
- CALL_LogicOp(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_MAP1:
+ case OPCODE_LOAD_MATRIX:
+ if (sizeof(Node) == sizeof(GLfloat)) {
+ CALL_LoadMatrixf(ctx->Exec, (&n[1].f));
+ }
+ else {
+ GLfloat m[16];
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ m[i] = n[1 + i].f;
+ }
+ CALL_LoadMatrixf(ctx->Exec, (m));
+ }
+ break;
+ case OPCODE_LOAD_NAME:
+ CALL_LoadName(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_LOGIC_OP:
+ CALL_LogicOp(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_MAP1:
{
GLenum target = n[1].e;
GLint ustride = _mesa_evaluator_components(target);
GLint uorder = n[5].i;
GLfloat u1 = n[2].f;
GLfloat u2 = n[3].f;
- CALL_Map1f(ctx->Exec, ( target, u1, u2, ustride, uorder,
- (GLfloat *) n[6].data ));
+ CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ (GLfloat *) n[6].data));
}
- break;
- case OPCODE_MAP2:
+ break;
+ case OPCODE_MAP2:
{
GLenum target = n[1].e;
GLfloat u1 = n[2].f;
@@ -5952,135 +6057,140 @@ execute_list( GLcontext *ctx, GLuint list )
GLint vstride = n[7].i;
GLint uorder = n[8].i;
GLint vorder = n[9].i;
- CALL_Map2f(ctx->Exec, ( target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder,
- (GLfloat *) n[10].data ));
+ CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder,
+ (GLfloat *) n[10].data));
}
- break;
- case OPCODE_MAPGRID1:
- CALL_MapGrid1f(ctx->Exec, ( n[1].i, n[2].f, n[3].f ));
- break;
- case OPCODE_MAPGRID2:
- CALL_MapGrid2f(ctx->Exec, ( n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
- break;
+ break;
+ case OPCODE_MAPGRID1:
+ CALL_MapGrid1f(ctx->Exec, (n[1].i, n[2].f, n[3].f));
+ break;
+ case OPCODE_MAPGRID2:
+ CALL_MapGrid2f(ctx->Exec,
+ (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
+ break;
case OPCODE_MATRIX_MODE:
- CALL_MatrixMode(ctx->Exec, ( n[1].e ));
+ CALL_MatrixMode(ctx->Exec, (n[1].e));
break;
case OPCODE_MIN_MAX:
CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b));
break;
- case OPCODE_MULT_MATRIX:
- if (sizeof(Node)==sizeof(GLfloat)) {
- CALL_MultMatrixf(ctx->Exec, ( &n[1].f ));
- }
- else {
- GLfloat m[16];
- GLuint i;
- for (i=0;i<16;i++) {
- m[i] = n[1+i].f;
- }
- CALL_MultMatrixf(ctx->Exec, ( m ));
- }
- break;
+ case OPCODE_MULT_MATRIX:
+ if (sizeof(Node) == sizeof(GLfloat)) {
+ CALL_MultMatrixf(ctx->Exec, (&n[1].f));
+ }
+ else {
+ GLfloat m[16];
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ m[i] = n[1 + i].f;
+ }
+ CALL_MultMatrixf(ctx->Exec, (m));
+ }
+ break;
case OPCODE_ORTHO:
- CALL_Ortho(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ));
+ CALL_Ortho(ctx->Exec,
+ (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
+ break;
+ case OPCODE_PASSTHROUGH:
+ CALL_PassThrough(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_PIXEL_MAP:
+ CALL_PixelMapfv(ctx->Exec,
+ (n[1].e, n[2].i, (GLfloat *) n[3].data));
+ break;
+ case OPCODE_PIXEL_TRANSFER:
+ CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_PIXEL_ZOOM:
+ CALL_PixelZoom(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_POINT_SIZE:
+ CALL_PointSize(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_POINT_PARAMETERS:
+ {
+ GLfloat params[3];
+ params[0] = n[2].f;
+ params[1] = n[3].f;
+ params[2] = n[4].f;
+ CALL_PointParameterfvEXT(ctx->Exec, (n[1].e, params));
+ }
+ break;
+ case OPCODE_POLYGON_MODE:
+ CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_POLYGON_STIPPLE:
+ CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data));
+ break;
+ case OPCODE_POLYGON_OFFSET:
+ CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_POP_ATTRIB:
+ CALL_PopAttrib(ctx->Exec, ());
+ break;
+ case OPCODE_POP_MATRIX:
+ CALL_PopMatrix(ctx->Exec, ());
+ break;
+ case OPCODE_POP_NAME:
+ CALL_PopName(ctx->Exec, ());
+ break;
+ case OPCODE_PRIORITIZE_TEXTURE:
+ CALL_PrioritizeTextures(ctx->Exec, (1, &n[1].ui, &n[2].f));
+ break;
+ case OPCODE_PUSH_ATTRIB:
+ CALL_PushAttrib(ctx->Exec, (n[1].bf));
+ break;
+ case OPCODE_PUSH_MATRIX:
+ CALL_PushMatrix(ctx->Exec, ());
+ break;
+ case OPCODE_PUSH_NAME:
+ CALL_PushName(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_RASTER_POS:
+ CALL_RasterPos4f(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_READ_BUFFER:
+ CALL_ReadBuffer(ctx->Exec, (n[1].e));
break;
- case OPCODE_PASSTHROUGH:
- CALL_PassThrough(ctx->Exec, ( n[1].f ));
- break;
- case OPCODE_PIXEL_MAP:
- CALL_PixelMapfv(ctx->Exec, ( n[1].e, n[2].i, (GLfloat *) n[3].data ));
- break;
- case OPCODE_PIXEL_TRANSFER:
- CALL_PixelTransferf(ctx->Exec, ( n[1].e, n[2].f ));
- break;
- case OPCODE_PIXEL_ZOOM:
- CALL_PixelZoom(ctx->Exec, ( n[1].f, n[2].f ));
- break;
- case OPCODE_POINT_SIZE:
- CALL_PointSize(ctx->Exec, ( n[1].f ));
- break;
- case OPCODE_POINT_PARAMETERS:
- {
- GLfloat params[3];
- params[0] = n[2].f;
- params[1] = n[3].f;
- params[2] = n[4].f;
- CALL_PointParameterfvEXT(ctx->Exec, ( n[1].e, params ));
- }
- break;
- case OPCODE_POLYGON_MODE:
- CALL_PolygonMode(ctx->Exec, ( n[1].e, n[2].e ));
- break;
- case OPCODE_POLYGON_STIPPLE:
- CALL_PolygonStipple(ctx->Exec, ( (GLubyte *) n[1].data ));
- break;
- case OPCODE_POLYGON_OFFSET:
- CALL_PolygonOffset(ctx->Exec, ( n[1].f, n[2].f ));
- break;
- case OPCODE_POP_ATTRIB:
- CALL_PopAttrib(ctx->Exec, ());
- break;
- case OPCODE_POP_MATRIX:
- CALL_PopMatrix(ctx->Exec, ());
- break;
- case OPCODE_POP_NAME:
- CALL_PopName(ctx->Exec, ());
- break;
- case OPCODE_PRIORITIZE_TEXTURE:
- CALL_PrioritizeTextures(ctx->Exec, ( 1, &n[1].ui, &n[2].f ));
- break;
- case OPCODE_PUSH_ATTRIB:
- CALL_PushAttrib(ctx->Exec, ( n[1].bf ));
- break;
- case OPCODE_PUSH_MATRIX:
- CALL_PushMatrix(ctx->Exec, ());
- break;
- case OPCODE_PUSH_NAME:
- CALL_PushName(ctx->Exec, ( n[1].ui ));
- break;
- case OPCODE_RASTER_POS:
- CALL_RasterPos4f(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
- break;
- case OPCODE_READ_BUFFER:
- CALL_ReadBuffer(ctx->Exec, ( n[1].e ));
- break;
case OPCODE_RESET_HISTOGRAM:
- CALL_ResetHistogram(ctx->Exec, ( n[1].e ));
+ CALL_ResetHistogram(ctx->Exec, (n[1].e));
break;
case OPCODE_RESET_MIN_MAX:
- CALL_ResetMinmax(ctx->Exec, ( n[1].e ));
+ CALL_ResetMinmax(ctx->Exec, (n[1].e));
break;
case OPCODE_ROTATE:
- CALL_Rotatef(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
+ CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
break;
case OPCODE_SCALE:
- CALL_Scalef(ctx->Exec, ( n[1].f, n[2].f, n[3].f ));
+ CALL_Scalef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
+ break;
+ case OPCODE_SCISSOR:
+ CALL_Scissor(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
+ break;
+ case OPCODE_SHADE_MODEL:
+ CALL_ShadeModel(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_STENCIL_FUNC:
+ CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui));
+ break;
+ case OPCODE_STENCIL_MASK:
+ CALL_StencilMask(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_STENCIL_OP:
+ CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e));
+ break;
+ case OPCODE_STENCIL_FUNC_SEPARATE:
+ CALL_StencilFuncSeparate(ctx->Exec,
+ (n[1].e, n[2].e, n[3].i, n[4].ui));
+ break;
+ case OPCODE_STENCIL_MASK_SEPARATE:
+ CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui));
+ break;
+ case OPCODE_STENCIL_OP_SEPARATE:
+ CALL_StencilOpSeparate(ctx->Exec,
+ (n[1].e, n[2].e, n[3].e, n[4].e));
break;
- case OPCODE_SCISSOR:
- CALL_Scissor(ctx->Exec, ( n[1].i, n[2].i, n[3].i, n[4].i ));
- break;
- case OPCODE_SHADE_MODEL:
- CALL_ShadeModel(ctx->Exec, ( n[1].e ));
- break;
- case OPCODE_STENCIL_FUNC:
- CALL_StencilFunc(ctx->Exec, ( n[1].e, n[2].i, n[3].ui ));
- break;
- case OPCODE_STENCIL_MASK:
- CALL_StencilMask(ctx->Exec, ( n[1].ui ));
- break;
- case OPCODE_STENCIL_OP:
- CALL_StencilOp(ctx->Exec, ( n[1].e, n[2].e, n[3].e ));
- break;
- case OPCODE_STENCIL_FUNC_SEPARATE:
- CALL_StencilFuncSeparate(ctx->Exec, ( n[1].e, n[2].e, n[3].i, n[4].ui ));
- break;
- case OPCODE_STENCIL_MASK_SEPARATE:
- CALL_StencilMaskSeparate(ctx->Exec, ( n[1].e, n[2].ui ));
- break;
- case OPCODE_STENCIL_OP_SEPARATE:
- CALL_StencilOpSeparate(ctx->Exec, ( n[1].e, n[2].e, n[3].e, n[4].e ));
- break;
case OPCODE_TEXENV:
{
GLfloat params[4];
@@ -6088,7 +6198,7 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- CALL_TexEnvfv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_TexEnvfv(ctx->Exec, (n[1].e, n[2].e, params));
}
break;
case OPCODE_TEXGEN:
@@ -6098,7 +6208,7 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- CALL_TexGenfv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_TexGenfv(ctx->Exec, (n[1].e, n[2].e, params));
}
break;
case OPCODE_TEXPARAMETER:
@@ -6108,138 +6218,144 @@ execute_list( GLcontext *ctx, GLuint list )
params[1] = n[4].f;
params[2] = n[5].f;
params[3] = n[6].f;
- CALL_TexParameterfv(ctx->Exec, ( n[1].e, n[2].e, params ));
+ CALL_TexParameterfv(ctx->Exec, (n[1].e, n[2].e, params));
}
break;
- case OPCODE_TEX_IMAGE1D:
+ case OPCODE_TEX_IMAGE1D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage1D(ctx->Exec, (
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].e, /* border */
- n[6].e, /* format */
- n[7].e, /* type */
- n[8].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexImage1D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].e, /* border */
+ n[6].e, /* format */
+ n[7].e, /* type */
+ n[8].data));
+ ctx->Unpack = save; /* restore */
}
- break;
- case OPCODE_TEX_IMAGE2D:
+ break;
+ case OPCODE_TEX_IMAGE2D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage2D(ctx->Exec, (
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].e, /* border */
- n[7].e, /* format */
- n[8].e, /* type */
- n[9].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexImage2D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].e, /* border */
+ n[7].e, /* format */
+ n[8].e, /* type */
+ n[9].data));
+ ctx->Unpack = save; /* restore */
}
- break;
+ break;
case OPCODE_TEX_IMAGE3D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage3D(ctx->Exec, (
- n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].i, /* depth */
- n[7].e, /* border */
- n[8].e, /* format */
- n[9].e, /* type */
- n[10].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexImage3D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].i, /* depth */
+ n[7].e, /* border */
+ n[8].e, /* format */
+ n[9].e, /* type */
+ n[10].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_SUB_IMAGE1D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage1D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e,
- n[6].e, n[7].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e,
+ n[6].e, n[7].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_SUB_IMAGE2D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage2D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e,
- n[6].i, n[7].e, n[8].e, n[9].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e,
+ n[6].i, n[7].e, n[8].e,
+ n[9].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TEX_SUB_IMAGE3D:
{
const struct gl_pixelstore_attrib save = ctx->Unpack;
ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage3D(ctx->Exec, ( n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i,
- n[8].i, n[9].e, n[10].e,
- n[11].data ));
- ctx->Unpack = save; /* restore */
+ CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i, n[9].e, n[10].e,
+ n[11].data));
+ ctx->Unpack = save; /* restore */
}
break;
case OPCODE_TRANSLATE:
- CALL_Translatef(ctx->Exec, ( n[1].f, n[2].f, n[3].f ));
+ CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
break;
- case OPCODE_VIEWPORT:
- CALL_Viewport(ctx->Exec, (n[1].i, n[2].i,
- (GLsizei) n[3].i, (GLsizei) n[4].i));
- break;
- case OPCODE_WINDOW_POS:
- CALL_WindowPos4fMESA(ctx->Exec, ( n[1].f, n[2].f, n[3].f, n[4].f ));
- break;
- case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
- CALL_ActiveTextureARB(ctx->Exec, ( n[1].e ));
+ case OPCODE_VIEWPORT:
+ CALL_Viewport(ctx->Exec, (n[1].i, n[2].i,
+ (GLsizei) n[3].i, (GLsizei) n[4].i));
+ break;
+ case OPCODE_WINDOW_POS:
+ CALL_WindowPos4fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
break;
- case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
+ case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
+ CALL_ActiveTextureARB(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
CALL_CompressedTexImage1DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i, n[7].data));
+ n[4].i, n[5].i, n[6].i,
+ n[7].data));
break;
- case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
+ case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
CALL_CompressedTexImage2DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i, n[7].i, n[8].data));
+ n[4].i, n[5].i, n[6].i,
+ n[7].i, n[8].data));
break;
- case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
+ case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
CALL_CompressedTexImage3DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i, n[7].i, n[8].i, n[9].data));
+ n[4].i, n[5].i, n[6].i,
+ n[7].i, n[8].i,
+ n[9].data));
break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage1DARB(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e, n[6].i, n[7].data));
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage1DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].e, n[6].i, n[7].data));
break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage2DARB(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].e, n[8].i, n[9].data));
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage2DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].e, n[8].i,
+ n[9].data));
break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage3DARB(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i, n[8].i,
- n[9].e, n[10].i, n[11].data));
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage3DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i,
+ n[9].e, n[10].i, n[11].data));
break;
- case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
+ case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
CALL_SampleCoverageARB(ctx->Exec, (n[1].f, n[2].b));
break;
- case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
- CALL_WindowPos3fMESA(ctx->Exec, ( n[1].f, n[2].f, n[3].f ));
- break;
+ case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
+ CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
+ break;
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
- CALL_BindProgramNV(ctx->Exec, ( n[1].e, n[2].ui ));
+ case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
+ CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui));
break;
#endif
#if FEATURE_NV_vertex_program
@@ -6255,15 +6371,15 @@ execute_list( GLcontext *ctx, GLuint list )
break;
case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui,
- (GLuint *) n[2].data));
+ (GLuint *) n[2].data));
break;
case OPCODE_LOAD_PROGRAM_NV:
CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i,
- (const GLubyte *) n[4].data));
+ (const GLubyte *) n[4].data));
break;
case OPCODE_PROGRAM_PARAMETER4F_NV:
CALL_ProgramParameter4fNV(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
- n[4].f, n[5].f, n[6].f));
+ n[4].f, n[5].f, n[6].f));
break;
case OPCODE_TRACK_MATRIX_NV:
CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
@@ -6272,13 +6388,15 @@ execute_list( GLcontext *ctx, GLuint list )
#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
- CALL_ProgramLocalParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
- n[4].f, n[5].f, n[6].f));
+ CALL_ProgramLocalParameter4fARB(ctx->Exec,
+ (n[1].e, n[2].ui, n[3].f, n[4].f,
+ n[5].f, n[6].f));
break;
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i,
- (const GLubyte *) n[3].data,
- n[4].f, n[5].f, n[6].f, n[7].f));
+ (const GLubyte *) n[3].
+ data, n[4].f, n[5].f,
+ n[6].f, n[7].f));
break;
#endif
@@ -6290,11 +6408,13 @@ execute_list( GLcontext *ctx, GLuint list )
break;
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_PROGRAM_STRING_ARB:
- CALL_ProgramStringARB(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].data));
+ CALL_ProgramStringARB(ctx->Exec,
+ (n[1].e, n[2].e, n[3].i, n[4].data));
break;
case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
- n[4].f, n[5].f, n[6].f));
+ n[4].f, n[5].f,
+ n[6].f));
break;
#endif
#if FEATURE_ARB_occlusion_query
@@ -6306,221 +6426,223 @@ execute_list( GLcontext *ctx, GLuint list )
break;
#endif
case OPCODE_DRAW_BUFFERS_ARB:
- {
- GLenum buffers[MAX_DRAW_BUFFERS];
- GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
- for (i = 0; i < count; i++)
- buffers[i] = n[2 + i].e;
- CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers));
- }
+ {
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
+ for (i = 0; i < count; i++)
+ buffers[i] = n[2 + i].e;
+ CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers));
+ }
break;
-#if FEATURE_ATI_fragment_shader
- case OPCODE_BIND_FRAGMENT_SHADER_ATI:
- CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
+#if FEATURE_EXT_framebuffer_blit
+ case OPCODE_BLIT_FRAMEBUFFER:
+ CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i,
+ n[9].i, n[10].e));
break;
- case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
- {
- GLfloat values[4];
- GLuint i, dst = n[1].ui;
-
- for (i = 0; i < 4; i++)
- values[i] = n[1+i].f;
- CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values));
- }
- break;
#endif
- case OPCODE_ATTR_1F_NV:
- CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_ATTR_2F_NV:
- /* Really shouldn't have to do this - the Node structure
- * is convenient, but it would be better to store the data
- * packed appropriately so that it can be sent directly
- * on. With x86_64 becoming common, this will start to
- * matter more.
- */
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f));
- break;
- case OPCODE_ATTR_3F_NV:
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f));
- break;
- case OPCODE_ATTR_4F_NV:
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f, n[5].f));
- break;
- case OPCODE_ATTR_1F_ARB:
- CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_ATTR_2F_ARB:
- /* Really shouldn't have to do this - the Node structure
- * is convenient, but it would be better to store the data
- * packed appropriately so that it can be sent directly
- * on. With x86_64 becoming common, this will start to
- * matter more.
- */
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f));
- break;
- case OPCODE_ATTR_3F_ARB:
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f));
- break;
- case OPCODE_ATTR_4F_ARB:
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f, n[5].f));
- break;
- case OPCODE_MATERIAL:
- if (sizeof(Node)==sizeof(GLfloat))
- CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f));
- else {
- GLfloat f[4];
- f[0] = n[3].f;
- f[1] = n[4].f;
- f[2] = n[5].f;
- f[3] = n[6].f;
- CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f));
- }
- break;
- case OPCODE_INDEX:
- CALL_Indexi(ctx->Exec, (n[1].i));
- break;
- case OPCODE_EDGEFLAG:
- CALL_EdgeFlag(ctx->Exec, (n[1].b));
- break;
- case OPCODE_BEGIN:
- CALL_Begin(ctx->Exec, (n[1].e));
- break;
- case OPCODE_END:
- CALL_End(ctx->Exec, ());
- break;
- case OPCODE_RECTF:
- CALL_Rectf(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_EVAL_C1:
- CALL_EvalCoord1f(ctx->Exec, (n[1].f));
- break;
- case OPCODE_EVAL_C2:
- CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f));
- break;
- case OPCODE_EVAL_P1:
- CALL_EvalPoint1(ctx->Exec, (n[1].i));
- break;
- case OPCODE_EVAL_P2:
- CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
- break;
+#if FEATURE_ATI_fragment_shader
+ case OPCODE_BIND_FRAGMENT_SHADER_ATI:
+ CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
+ {
+ GLfloat values[4];
+ GLuint i, dst = n[1].ui;
+ for (i = 0; i < 4; i++)
+ values[i] = n[1 + i].f;
+ CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values));
+ }
+ break;
+#endif
+ case OPCODE_ATTR_1F_NV:
+ CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_ATTR_2F_NV:
+ /* Really shouldn't have to do this - the Node structure
+ * is convenient, but it would be better to store the data
+ * packed appropriately so that it can be sent directly
+ * on. With x86_64 becoming common, this will start to
+ * matter more.
+ */
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f));
+ break;
+ case OPCODE_ATTR_3F_NV:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f));
+ break;
+ case OPCODE_ATTR_4F_NV:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f, n[5].f));
+ break;
+ case OPCODE_ATTR_1F_ARB:
+ CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_ATTR_2F_ARB:
+ /* Really shouldn't have to do this - the Node structure
+ * is convenient, but it would be better to store the data
+ * packed appropriately so that it can be sent directly
+ * on. With x86_64 becoming common, this will start to
+ * matter more.
+ */
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f));
+ break;
+ case OPCODE_ATTR_3F_ARB:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f));
+ break;
+ case OPCODE_ATTR_4F_ARB:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f, n[5].f));
+ break;
+ case OPCODE_MATERIAL:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f));
+ else {
+ GLfloat f[4];
+ f[0] = n[3].f;
+ f[1] = n[4].f;
+ f[2] = n[5].f;
+ f[3] = n[6].f;
+ CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f));
+ }
+ break;
+ case OPCODE_INDEX:
+ CALL_Indexi(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_EDGEFLAG:
+ CALL_EdgeFlag(ctx->Exec, (n[1].b));
+ break;
+ case OPCODE_BEGIN:
+ CALL_Begin(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_END:
+ CALL_End(ctx->Exec, ());
+ break;
+ case OPCODE_RECTF:
+ CALL_Rectf(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_EVAL_C1:
+ CALL_EvalCoord1f(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_EVAL_C2:
+ CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_EVAL_P1:
+ CALL_EvalPoint1(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_EVAL_P2:
+ CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
+ break;
- case OPCODE_CONTINUE:
- n = (Node *) n[1].next;
- break;
- case OPCODE_END_OF_LIST:
- done = GL_TRUE;
- break;
- default:
+
+ case OPCODE_CONTINUE:
+ n = (Node *) n[1].next;
+ break;
+ case OPCODE_END_OF_LIST:
+ done = GL_TRUE;
+ break;
+ default:
{
char msg[1000];
- _mesa_sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode);
+ _mesa_sprintf(msg, "Error in execute_list: opcode=%d",
+ (int) opcode);
_mesa_problem(ctx, msg);
}
done = GL_TRUE;
- }
+ }
- /* increment n to point to next compiled command */
- if (opcode!=OPCODE_CONTINUE) {
- n += InstSize[opcode];
- }
+ /* increment n to point to next compiled command */
+ if (opcode != OPCODE_CONTINUE) {
+ n += InstSize[opcode];
+ }
}
}
if (ctx->Driver.EndCallList)
- ctx->Driver.EndCallList( ctx );
+ ctx->Driver.EndCallList(ctx);
ctx->ListState.CallStack[ctx->ListState.CallDepth--] = NULL;
}
-
-
/**********************************************************************/
/* GL functions */
/**********************************************************************/
-
-
-
-/*
+/**
* Test if a display list number is valid.
*/
GLboolean GLAPIENTRY
-_mesa_IsList( GLuint list )
+_mesa_IsList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
return islist(ctx, list);
}
-/*
+/**
* Delete a sequence of consecutive display lists.
*/
void GLAPIENTRY
-_mesa_DeleteLists( GLuint list, GLsizei range )
+_mesa_DeleteLists(GLuint list, GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (range<0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glDeleteLists" );
+ if (range < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists");
return;
}
- for (i=list;i<list+range;i++) {
- _mesa_destroy_list( ctx, i );
+ for (i = list; i < list + range; i++) {
+ _mesa_destroy_list(ctx, i);
}
}
-
-/*
+/**
* Return a display list number, n, such that lists n through n+range-1
* are free.
*/
GLuint GLAPIENTRY
-_mesa_GenLists(GLsizei range )
+_mesa_GenLists(GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
GLuint base;
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
- if (range<0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glGenLists" );
+ if (range < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists");
return 0;
}
- if (range==0) {
+ if (range == 0) {
return 0;
}
@@ -6533,8 +6655,9 @@ _mesa_GenLists(GLsizei range )
if (base) {
/* reserve the list IDs by with empty/dummy lists */
GLint i;
- for (i=0; i<range; i++) {
- _mesa_HashInsert(ctx->Shared->DisplayList, base+i, make_list(base+i, 1));
+ for (i = 0; i < range; i++) {
+ _mesa_HashInsert(ctx->Shared->DisplayList, base + i,
+ make_list(base + i, 1));
}
}
@@ -6544,36 +6667,35 @@ _mesa_GenLists(GLsizei range )
}
-
-/*
+/**
* Begin a new display list.
*/
void GLAPIENTRY
-_mesa_NewList( GLuint list, GLenum mode )
+_mesa_NewList(GLuint list, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
- FLUSH_CURRENT(ctx, 0); /* must be called before assert */
+ FLUSH_CURRENT(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (MESA_VERBOSE&VERBOSE_API)
+ if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glNewList %u %s\n", list,
_mesa_lookup_enum_by_nr(mode));
- if (list==0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glNewList" );
+ if (list == 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
return;
}
- if (mode!=GL_COMPILE && mode!=GL_COMPILE_AND_EXECUTE) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glNewList" );
+ if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glNewList");
return;
}
if (ctx->ListState.CurrentListPtr) {
/* already compiling a display list */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glNewList" );
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
return;
}
@@ -6582,7 +6704,7 @@ _mesa_NewList( GLuint list, GLenum mode )
/* Allocate new display list */
ctx->ListState.CurrentListNum = list;
- ctx->ListState.CurrentList = make_list( list, BLOCK_SIZE );
+ ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE);
ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node;
ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock;
ctx->ListState.CurrentPos = 0;
@@ -6594,50 +6716,50 @@ _mesa_NewList( GLuint list, GLenum mode )
for (i = 0; i < MAT_ATTRIB_MAX; i++)
ctx->ListState.ActiveMaterialSize[i] = 0;
-
+
ctx->ListState.ActiveIndex = 0;
ctx->ListState.ActiveEdgeFlag = 0;
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
- ctx->Driver.NewList( ctx, list, mode );
+ ctx->Driver.NewList(ctx, list, mode);
ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch( ctx->CurrentDispatch );
+ _glapi_set_dispatch(ctx->CurrentDispatch);
}
-
-/*
+/**
* End definition of current display list.
*/
void GLAPIENTRY
-_mesa_EndList( void )
+_mesa_EndList(void)
{
GET_CURRENT_CONTEXT(ctx);
SAVE_FLUSH_VERTICES(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (MESA_VERBOSE&VERBOSE_API)
+ if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glEndList\n");
/* Check that a list is under construction */
if (!ctx->ListState.CurrentListPtr) {
- _mesa_error( ctx, GL_INVALID_OPERATION, "glEndList" );
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
return;
}
- (void) ALLOC_INSTRUCTION( ctx, OPCODE_END_OF_LIST, 0 );
+ (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
/* Destroy old list, if any */
_mesa_destroy_list(ctx, ctx->ListState.CurrentListNum);
/* Install the list */
- _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, ctx->ListState.CurrentList);
+ _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum,
+ ctx->ListState.CurrentList);
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
mesa_print_display_list(ctx->ListState.CurrentListNum);
- ctx->Driver.EndList( ctx );
+ ctx->Driver.EndList(ctx);
ctx->ListState.CurrentList = NULL;
ctx->ListState.CurrentListNum = 0;
@@ -6646,13 +6768,12 @@ _mesa_EndList( void )
ctx->CompileFlag = GL_FALSE;
ctx->CurrentDispatch = ctx->Exec;
- _glapi_set_dispatch( ctx->CurrentDispatch );
+ _glapi_set_dispatch(ctx->CurrentDispatch);
}
-
void GLAPIENTRY
-_mesa_CallList( GLuint list )
+_mesa_CallList(GLuint list)
{
GLboolean save_compile_flag;
GET_CURRENT_CONTEXT(ctx);
@@ -6675,23 +6796,22 @@ _mesa_CallList( GLuint list )
ctx->CompileFlag = GL_FALSE;
}
- execute_list( ctx, list );
+ execute_list(ctx, list);
ctx->CompileFlag = save_compile_flag;
/* also restore API function pointers to point to "save" versions */
if (save_compile_flag) {
ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch( ctx->CurrentDispatch );
+ _glapi_set_dispatch(ctx->CurrentDispatch);
}
}
-
-/*
+/**
* Execute glCallLists: call multiple display lists.
*/
void GLAPIENTRY
-_mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
+_mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
{
GET_CURRENT_CONTEXT(ctx);
GLuint list;
@@ -6702,21 +6822,21 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
_mesa_debug(ctx, "glCallLists %d\n", n);
switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- /* OK */
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
- return;
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ /* OK */
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
+ return;
}
/* Save the CompileFlag status, turn it off, execute display list,
@@ -6725,9 +6845,9 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
save_compile_flag = ctx->CompileFlag;
ctx->CompileFlag = GL_FALSE;
- for (i=0;i<n;i++) {
- list = translate_id( i, type, lists );
- execute_list( ctx, ctx->List.ListBase + list );
+ for (i = 0; i < n; i++) {
+ list = translate_id(i, type, lists);
+ execute_list(ctx, ctx->List.ListBase + list);
}
ctx->CompileFlag = save_compile_flag;
@@ -6735,20 +6855,19 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
/* also restore API function pointers to point to "save" versions */
if (save_compile_flag) {
ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch( ctx->CurrentDispatch );
+ _glapi_set_dispatch(ctx->CurrentDispatch);
}
}
-
-/*
+/**
* Set the offset added to list numbers in glCallLists.
*/
void GLAPIENTRY
-_mesa_ListBase( GLuint base )
+_mesa_ListBase(GLuint base)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END(ctx);
ctx->List.ListBase = base;
}
@@ -6756,658 +6875,732 @@ _mesa_ListBase( GLuint base )
/* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
*/
-static void GLAPIENTRY exec_Finish( void )
+static void GLAPIENTRY
+exec_Finish(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_Finish(ctx->Exec, ());
}
-static void GLAPIENTRY exec_Flush( void )
+static void GLAPIENTRY
+exec_Flush(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_Flush(ctx->Exec, ( ));
+ CALL_Flush(ctx->Exec, ());
}
-static void GLAPIENTRY exec_GetBooleanv( GLenum pname, GLboolean *params )
+static void GLAPIENTRY
+exec_GetBooleanv(GLenum pname, GLboolean *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetBooleanv(ctx->Exec, ( pname, params ));
+ CALL_GetBooleanv(ctx->Exec, (pname, params));
}
-static void GLAPIENTRY exec_GetClipPlane( GLenum plane, GLdouble *equation )
+static void GLAPIENTRY
+exec_GetClipPlane(GLenum plane, GLdouble * equation)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetClipPlane(ctx->Exec, ( plane, equation ));
+ CALL_GetClipPlane(ctx->Exec, (plane, equation));
}
-static void GLAPIENTRY exec_GetDoublev( GLenum pname, GLdouble *params )
+static void GLAPIENTRY
+exec_GetDoublev(GLenum pname, GLdouble *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetDoublev(ctx->Exec, ( pname, params ));
+ CALL_GetDoublev(ctx->Exec, (pname, params));
}
-static GLenum GLAPIENTRY exec_GetError( void )
+static GLenum GLAPIENTRY
+exec_GetError(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_GetError(ctx->Exec, ( ));
+ return CALL_GetError(ctx->Exec, ());
}
-static void GLAPIENTRY exec_GetFloatv( GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetFloatv(GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetFloatv(ctx->Exec, ( pname, params ));
+ CALL_GetFloatv(ctx->Exec, (pname, params));
}
-static void GLAPIENTRY exec_GetIntegerv( GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetIntegerv(GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetIntegerv(ctx->Exec, ( pname, params ));
+ CALL_GetIntegerv(ctx->Exec, (pname, params));
}
-static void GLAPIENTRY exec_GetLightfv( GLenum light, GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetLightfv(ctx->Exec, ( light, pname, params ));
+ CALL_GetLightfv(ctx->Exec, (light, pname, params));
}
-static void GLAPIENTRY exec_GetLightiv( GLenum light, GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetLightiv(GLenum light, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetLightiv(ctx->Exec, ( light, pname, params ));
+ CALL_GetLightiv(ctx->Exec, (light, pname, params));
}
-static void GLAPIENTRY exec_GetMapdv( GLenum target, GLenum query, GLdouble *v )
+static void GLAPIENTRY
+exec_GetMapdv(GLenum target, GLenum query, GLdouble * v)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMapdv(ctx->Exec, ( target, query, v ));
+ CALL_GetMapdv(ctx->Exec, (target, query, v));
}
-static void GLAPIENTRY exec_GetMapfv( GLenum target, GLenum query, GLfloat *v )
+static void GLAPIENTRY
+exec_GetMapfv(GLenum target, GLenum query, GLfloat * v)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMapfv(ctx->Exec, ( target, query, v ));
+ CALL_GetMapfv(ctx->Exec, (target, query, v));
}
-static void GLAPIENTRY exec_GetMapiv( GLenum target, GLenum query, GLint *v )
+static void GLAPIENTRY
+exec_GetMapiv(GLenum target, GLenum query, GLint * v)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMapiv(ctx->Exec, ( target, query, v ));
+ CALL_GetMapiv(ctx->Exec, (target, query, v));
}
-static void GLAPIENTRY exec_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMaterialfv(ctx->Exec, ( face, pname, params ));
+ CALL_GetMaterialfv(ctx->Exec, (face, pname, params));
}
-static void GLAPIENTRY exec_GetMaterialiv( GLenum face, GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetMaterialiv(GLenum face, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMaterialiv(ctx->Exec, ( face, pname, params ));
+ CALL_GetMaterialiv(ctx->Exec, (face, pname, params));
}
-static void GLAPIENTRY exec_GetPixelMapfv( GLenum map, GLfloat *values )
+static void GLAPIENTRY
+exec_GetPixelMapfv(GLenum map, GLfloat *values)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapfv(ctx->Exec, ( map, values ));
+ CALL_GetPixelMapfv(ctx->Exec, (map, values));
}
-static void GLAPIENTRY exec_GetPixelMapuiv( GLenum map, GLuint *values )
+static void GLAPIENTRY
+exec_GetPixelMapuiv(GLenum map, GLuint *values)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapuiv(ctx->Exec, ( map, values ));
+ CALL_GetPixelMapuiv(ctx->Exec, (map, values));
}
-static void GLAPIENTRY exec_GetPixelMapusv( GLenum map, GLushort *values )
+static void GLAPIENTRY
+exec_GetPixelMapusv(GLenum map, GLushort *values)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapusv(ctx->Exec, ( map, values ));
+ CALL_GetPixelMapusv(ctx->Exec, (map, values));
}
-static void GLAPIENTRY exec_GetPolygonStipple( GLubyte *dest )
+static void GLAPIENTRY
+exec_GetPolygonStipple(GLubyte * dest)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetPolygonStipple(ctx->Exec, ( dest ));
+ CALL_GetPolygonStipple(ctx->Exec, (dest));
}
-static const GLubyte * GLAPIENTRY exec_GetString( GLenum name )
+static const GLubyte *GLAPIENTRY
+exec_GetString(GLenum name)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_GetString(ctx->Exec, ( name ));
+ return CALL_GetString(ctx->Exec, (name));
}
-static void GLAPIENTRY exec_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexEnvfv(ctx->Exec, ( target, pname, params ));
+ CALL_GetTexEnvfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexEnviv(ctx->Exec, ( target, pname, params ));
+ CALL_GetTexEnviv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
+static void GLAPIENTRY
+exec_GetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGendv(ctx->Exec, ( coord, pname, params ));
+ CALL_GetTexGendv(ctx->Exec, (coord, pname, params));
}
-static void GLAPIENTRY exec_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGenfv(ctx->Exec, ( coord, pname, params ));
+ CALL_GetTexGenfv(ctx->Exec, (coord, pname, params));
}
-static void GLAPIENTRY exec_GetTexGeniv( GLenum coord, GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetTexGeniv(GLenum coord, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGeniv(ctx->Exec, ( coord, pname, params ));
+ CALL_GetTexGeniv(ctx->Exec, (coord, pname, params));
}
-static void GLAPIENTRY exec_GetTexImage( GLenum target, GLint level, GLenum format,
- GLenum type, GLvoid *pixels )
+static void GLAPIENTRY
+exec_GetTexImage(GLenum target, GLint level, GLenum format,
+ GLenum type, GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexImage(ctx->Exec, ( target, level, format, type, pixels ));
+ CALL_GetTexImage(ctx->Exec, (target, level, format, type, pixels));
}
-static void GLAPIENTRY exec_GetTexLevelParameterfv( GLenum target, GLint level,
- GLenum pname, GLfloat *params )
+static void GLAPIENTRY
+exec_GetTexLevelParameterfv(GLenum target, GLint level,
+ GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexLevelParameterfv(ctx->Exec, ( target, level, pname, params ));
+ CALL_GetTexLevelParameterfv(ctx->Exec, (target, level, pname, params));
}
-static void GLAPIENTRY exec_GetTexLevelParameteriv( GLenum target, GLint level,
- GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetTexLevelParameteriv(GLenum target, GLint level,
+ GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexLevelParameteriv(ctx->Exec, ( target, level, pname, params ));
+ CALL_GetTexLevelParameteriv(ctx->Exec, (target, level, pname, params));
}
-static void GLAPIENTRY exec_GetTexParameterfv( GLenum target, GLenum pname,
- GLfloat *params )
+static void GLAPIENTRY
+exec_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameterfv(ctx->Exec, ( target, pname, params ));
+ CALL_GetTexParameterfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
+static void GLAPIENTRY
+exec_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameteriv(ctx->Exec, ( target, pname, params ));
+ CALL_GetTexParameteriv(ctx->Exec, (target, pname, params));
}
-static GLboolean GLAPIENTRY exec_IsEnabled( GLenum cap )
+static GLboolean GLAPIENTRY
+exec_IsEnabled(GLenum cap)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_IsEnabled(ctx->Exec, ( cap ));
+ return CALL_IsEnabled(ctx->Exec, (cap));
}
-static void GLAPIENTRY exec_PixelStoref( GLenum pname, GLfloat param )
+static void GLAPIENTRY
+exec_PixelStoref(GLenum pname, GLfloat param)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_PixelStoref(ctx->Exec, ( pname, param ));
+ CALL_PixelStoref(ctx->Exec, (pname, param));
}
-static void GLAPIENTRY exec_PixelStorei( GLenum pname, GLint param )
+static void GLAPIENTRY
+exec_PixelStorei(GLenum pname, GLint param)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_PixelStorei(ctx->Exec, ( pname, param ));
+ CALL_PixelStorei(ctx->Exec, (pname, param));
}
-static void GLAPIENTRY exec_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels )
+static void GLAPIENTRY
+exec_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid * pixels)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_ReadPixels(ctx->Exec, ( x, y, width, height, format, type, pixels ));
+ CALL_ReadPixels(ctx->Exec, (x, y, width, height, format, type, pixels));
}
-static GLint GLAPIENTRY exec_RenderMode( GLenum mode )
+static GLint GLAPIENTRY
+exec_RenderMode(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_RenderMode(ctx->Exec, ( mode ));
+ return CALL_RenderMode(ctx->Exec, (mode));
}
-static void GLAPIENTRY exec_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
+static void GLAPIENTRY
+exec_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_FeedbackBuffer(ctx->Exec, ( size, type, buffer ));
+ CALL_FeedbackBuffer(ctx->Exec, (size, type, buffer));
}
-static void GLAPIENTRY exec_SelectBuffer( GLsizei size, GLuint *buffer )
+static void GLAPIENTRY
+exec_SelectBuffer(GLsizei size, GLuint * buffer)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_SelectBuffer(ctx->Exec, ( size, buffer ));
+ CALL_SelectBuffer(ctx->Exec, (size, buffer));
}
-static GLboolean GLAPIENTRY exec_AreTexturesResident(GLsizei n, const GLuint *texName,
- GLboolean *residences)
+static GLboolean GLAPIENTRY
+exec_AreTexturesResident(GLsizei n, const GLuint * texName,
+ GLboolean * residences)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_AreTexturesResident(ctx->Exec, ( n, texName, residences));
+ return CALL_AreTexturesResident(ctx->Exec, (n, texName, residences));
}
-static void GLAPIENTRY exec_ColorPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_ColorPointer(ctx->Exec, ( size, type, stride, ptr));
+ CALL_ColorPointer(ctx->Exec, (size, type, stride, ptr));
}
-static void GLAPIENTRY exec_DeleteTextures( GLsizei n, const GLuint *texName)
+static void GLAPIENTRY
+exec_DeleteTextures(GLsizei n, const GLuint * texName)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_DeleteTextures(ctx->Exec, ( n, texName));
+ CALL_DeleteTextures(ctx->Exec, (n, texName));
}
-static void GLAPIENTRY exec_DisableClientState( GLenum cap )
+static void GLAPIENTRY
+exec_DisableClientState(GLenum cap)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_DisableClientState(ctx->Exec, ( cap ));
+ CALL_DisableClientState(ctx->Exec, (cap));
}
-static void GLAPIENTRY exec_EdgeFlagPointer(GLsizei stride, const GLvoid *vptr)
+static void GLAPIENTRY
+exec_EdgeFlagPointer(GLsizei stride, const GLvoid * vptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_EdgeFlagPointer(ctx->Exec, ( stride, vptr));
+ CALL_EdgeFlagPointer(ctx->Exec, (stride, vptr));
}
-static void GLAPIENTRY exec_EnableClientState( GLenum cap )
+static void GLAPIENTRY
+exec_EnableClientState(GLenum cap)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_EnableClientState(ctx->Exec, ( cap ));
+ CALL_EnableClientState(ctx->Exec, (cap));
}
-static void GLAPIENTRY exec_GenTextures( GLsizei n, GLuint *texName )
+static void GLAPIENTRY
+exec_GenTextures(GLsizei n, GLuint * texName)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GenTextures(ctx->Exec, ( n, texName ));
+ CALL_GenTextures(ctx->Exec, (n, texName));
}
-static void GLAPIENTRY exec_GetPointerv( GLenum pname, GLvoid **params )
+static void GLAPIENTRY
+exec_GetPointerv(GLenum pname, GLvoid **params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetPointerv(ctx->Exec, ( pname, params ));
+ CALL_GetPointerv(ctx->Exec, (pname, params));
}
-static void GLAPIENTRY exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+static void GLAPIENTRY
+exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_IndexPointer(ctx->Exec, ( type, stride, ptr));
+ CALL_IndexPointer(ctx->Exec, (type, stride, ptr));
}
-static void GLAPIENTRY exec_InterleavedArrays(GLenum format, GLsizei stride,
- const GLvoid *pointer)
+static void GLAPIENTRY
+exec_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_InterleavedArrays(ctx->Exec, ( format, stride, pointer));
+ CALL_InterleavedArrays(ctx->Exec, (format, stride, pointer));
}
-static GLboolean GLAPIENTRY exec_IsTexture( GLuint texture )
+static GLboolean GLAPIENTRY
+exec_IsTexture(GLuint texture)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- return CALL_IsTexture(ctx->Exec, ( texture ));
+ return CALL_IsTexture(ctx->Exec, (texture));
}
-static void GLAPIENTRY exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
+static void GLAPIENTRY
+exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_NormalPointer(ctx->Exec, ( type, stride, ptr ));
+ CALL_NormalPointer(ctx->Exec, (type, stride, ptr));
}
-static void GLAPIENTRY exec_PopClientAttrib(void)
+static void GLAPIENTRY
+exec_PopClientAttrib(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_PopClientAttrib(ctx->Exec, ());
}
-static void GLAPIENTRY exec_PushClientAttrib(GLbitfield mask)
+static void GLAPIENTRY
+exec_PushClientAttrib(GLbitfield mask)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_PushClientAttrib(ctx->Exec, ( mask));
+ CALL_PushClientAttrib(ctx->Exec, (mask));
}
-static void GLAPIENTRY exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_TexCoordPointer(ctx->Exec, ( size, type, stride, ptr));
+ CALL_TexCoordPointer(ctx->Exec, (size, type, stride, ptr));
}
-static void GLAPIENTRY exec_GetCompressedTexImageARB(GLenum target, GLint level,
- GLvoid *img)
+static void GLAPIENTRY
+exec_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetCompressedTexImageARB(ctx->Exec, ( target, level, img));
+ CALL_GetCompressedTexImageARB(ctx->Exec, (target, level, img));
}
-static void GLAPIENTRY exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_VertexPointer(ctx->Exec, ( size, type, stride, ptr));
+ CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr));
}
-static void GLAPIENTRY exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width)
+static void GLAPIENTRY
+exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_CopyConvolutionFilter1D(ctx->Exec, ( target, internalFormat, x, y, width));
+ CALL_CopyConvolutionFilter1D(ctx->Exec,
+ (target, internalFormat, x, y, width));
}
-static void GLAPIENTRY exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width,
- GLsizei height)
+static void GLAPIENTRY
+exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_CopyConvolutionFilter2D(ctx->Exec, ( target, internalFormat, x, y, width,
- height));
+ CALL_CopyConvolutionFilter2D(ctx->Exec,
+ (target, internalFormat, x, y, width,
+ height));
}
-static void GLAPIENTRY exec_GetColorTable( GLenum target, GLenum format,
- GLenum type, GLvoid *data )
+static void GLAPIENTRY
+exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTable(ctx->Exec, ( target, format, type, data ));
+ CALL_GetColorTable(ctx->Exec, (target, format, type, data));
}
-static void GLAPIENTRY exec_GetColorTableParameterfv( GLenum target, GLenum pname,
- GLfloat *params )
+static void GLAPIENTRY
+exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTableParameterfv(ctx->Exec, ( target, pname, params ));
+ CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetColorTableParameteriv( GLenum target, GLenum pname,
- GLint *params )
+static void GLAPIENTRY
+exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTableParameteriv(ctx->Exec, ( target, pname, params ));
+ CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *image)
+static void GLAPIENTRY
+exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid * image)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionFilter(ctx->Exec, ( target, format, type, image));
+ CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image));
}
-static void GLAPIENTRY exec_GetConvolutionParameterfv(GLenum target, GLenum pname,
- GLfloat *params)
+static void GLAPIENTRY
+exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionParameterfv(ctx->Exec, ( target, pname, params));
+ CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetConvolutionParameteriv(GLenum target, GLenum pname,
- GLint *params)
+static void GLAPIENTRY
+exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionParameteriv(ctx->Exec, ( target, pname, params));
+ CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLvoid *values)
+static void GLAPIENTRY
+exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogram(ctx->Exec, ( target, reset, format, type, values));
+ CALL_GetHistogram(ctx->Exec, (target, reset, format, type, values));
}
-static void GLAPIENTRY exec_GetHistogramParameterfv(GLenum target, GLenum pname,
- GLfloat *params)
+static void GLAPIENTRY
+exec_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogramParameterfv(ctx->Exec, ( target, pname, params));
+ CALL_GetHistogramParameterfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetHistogramParameteriv(GLenum target, GLenum pname,
- GLint *params)
+static void GLAPIENTRY
+exec_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogramParameteriv(ctx->Exec, ( target, pname, params));
+ CALL_GetHistogramParameteriv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLvoid *values)
+static void GLAPIENTRY
+exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmax(ctx->Exec, ( target, reset, format, type, values));
+ CALL_GetMinmax(ctx->Exec, (target, reset, format, type, values));
}
-static void GLAPIENTRY exec_GetMinmaxParameterfv(GLenum target, GLenum pname,
- GLfloat *params)
+static void GLAPIENTRY
+exec_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmaxParameterfv(ctx->Exec, ( target, pname, params));
+ CALL_GetMinmaxParameterfv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetMinmaxParameteriv(GLenum target, GLenum pname,
- GLint *params)
+static void GLAPIENTRY
+exec_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmaxParameteriv(ctx->Exec, ( target, pname, params));
+ CALL_GetMinmaxParameteriv(ctx->Exec, (target, pname, params));
}
-static void GLAPIENTRY exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span)
+static void GLAPIENTRY
+exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_GetSeparableFilter(ctx->Exec, ( target, format, type, row, column, span));
+ CALL_GetSeparableFilter(ctx->Exec,
+ (target, format, type, row, column, span));
}
-static void GLAPIENTRY exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *row,
- const GLvoid *column)
+static void GLAPIENTRY
+exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_SeparableFilter2D(ctx->Exec, ( target, internalFormat, width, height, format,
- type, row, column));
+ CALL_SeparableFilter2D(ctx->Exec,
+ (target, internalFormat, width, height, format,
+ type, row, column));
}
-static void GLAPIENTRY exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
+static void GLAPIENTRY
+exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_ColorPointerEXT(ctx->Exec, ( size, type, stride, count, ptr));
+ CALL_ColorPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
}
-static void GLAPIENTRY exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count,
- const GLboolean *ptr)
+static void GLAPIENTRY
+exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_EdgeFlagPointerEXT(ctx->Exec, ( stride, count, ptr));
+ CALL_EdgeFlagPointerEXT(ctx->Exec, (stride, count, ptr));
}
-static void GLAPIENTRY exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_IndexPointerEXT(ctx->Exec, ( type, stride, count, ptr));
+ CALL_IndexPointerEXT(ctx->Exec, (type, stride, count, ptr));
}
-static void GLAPIENTRY exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_NormalPointerEXT(ctx->Exec, ( type, stride, count, ptr));
+ CALL_NormalPointerEXT(ctx->Exec, (type, stride, count, ptr));
}
-static void GLAPIENTRY exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
+static void GLAPIENTRY
+exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_TexCoordPointerEXT(ctx->Exec, ( size, type, stride, count, ptr));
+ CALL_TexCoordPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
}
-static void GLAPIENTRY exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
+static void GLAPIENTRY
+exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_VertexPointerEXT(ctx->Exec, ( size, type, stride, count, ptr));
+ CALL_VertexPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
}
-static void GLAPIENTRY exec_LockArraysEXT(GLint first, GLsizei count)
+static void GLAPIENTRY
+exec_LockArraysEXT(GLint first, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_LockArraysEXT(ctx->Exec, ( first, count));
+ CALL_LockArraysEXT(ctx->Exec, (first, count));
}
-static void GLAPIENTRY exec_UnlockArraysEXT( void )
+static void GLAPIENTRY
+exec_UnlockArraysEXT(void)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_UnlockArraysEXT(ctx->Exec, ( ));
+ CALL_UnlockArraysEXT(ctx->Exec, ());
}
-static void GLAPIENTRY exec_ClientActiveTextureARB( GLenum target )
+static void GLAPIENTRY
+exec_ClientActiveTextureARB(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
CALL_ClientActiveTextureARB(ctx->Exec, (target));
}
-static void GLAPIENTRY exec_SecondaryColorPointerEXT(GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr)
+static void GLAPIENTRY
+exec_SecondaryColorPointerEXT(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_SecondaryColorPointerEXT(ctx->Exec, ( size, type, stride, ptr));
+ CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr));
}
-static void GLAPIENTRY exec_FogCoordPointerEXT(GLenum type, GLsizei stride,
- const GLvoid *ptr)
+static void GLAPIENTRY
+exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_FogCoordPointerEXT(ctx->Exec, ( type, stride, ptr));
+ CALL_FogCoordPointerEXT(ctx->Exec, (type, stride, ptr));
}
/* GL_EXT_multi_draw_arrays */
-static void GLAPIENTRY exec_MultiDrawArraysEXT(GLenum mode, GLint *first,
- GLsizei *count, GLsizei primcount)
+static void GLAPIENTRY
+exec_MultiDrawArraysEXT(GLenum mode, GLint * first,
+ GLsizei * count, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_MultiDrawArraysEXT(ctx->Exec, ( mode, first, count, primcount ));
+ CALL_MultiDrawArraysEXT(ctx->Exec, (mode, first, count, primcount));
}
/* GL_EXT_multi_draw_arrays */
-static void GLAPIENTRY exec_MultiDrawElementsEXT(GLenum mode, const GLsizei *count,
- GLenum type, const GLvoid **indices,
- GLsizei primcount)
+static void GLAPIENTRY
+exec_MultiDrawElementsEXT(GLenum mode, const GLsizei * count,
+ GLenum type, const GLvoid ** indices,
+ GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_MultiDrawElementsEXT(ctx->Exec, (mode, count, type, indices, primcount));
+ CALL_MultiDrawElementsEXT(ctx->Exec,
+ (mode, count, type, indices, primcount));
}
/* GL_IBM_multimode_draw_arrays */
-static void GLAPIENTRY exec_MultiModeDrawArraysIBM(const GLenum *mode, const GLint *first,
- const GLsizei *count, GLsizei primcount,
- GLint modestride)
+static void GLAPIENTRY
+exec_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
+ const GLsizei * count, GLsizei primcount,
+ GLint modestride)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_MultiModeDrawArraysIBM(ctx->Exec, (mode, first, count, primcount, modestride));
+ CALL_MultiModeDrawArraysIBM(ctx->Exec,
+ (mode, first, count, primcount, modestride));
}
/* GL_IBM_multimode_draw_arrays */
-static void GLAPIENTRY exec_MultiModeDrawElementsIBM(const GLenum *mode,
- const GLsizei *count,
- GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount, GLint modestride)
+static void GLAPIENTRY
+exec_MultiModeDrawElementsIBM(const GLenum * mode,
+ const GLsizei * count,
+ GLenum type,
+ const GLvoid * const *indices,
+ GLsizei primcount, GLint modestride)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
- CALL_MultiModeDrawElementsIBM(ctx->Exec, (mode, count, type, indices, primcount,
- modestride));
+ CALL_MultiModeDrawElementsIBM(ctx->Exec,
+ (mode, count, type, indices, primcount,
+ modestride));
}
-
/**
* Setup the given dispatch table to point to Mesa's display list
* building functions.
@@ -7417,15 +7610,15 @@ static void GLAPIENTRY exec_MultiModeDrawElementsIBM(const GLenum *mode,
* struct.
*/
void
-_mesa_init_dlist_table( struct _glapi_table *table )
+_mesa_init_dlist_table(struct _glapi_table *table)
{
- _mesa_loopback_init_api_table( table );
+ _mesa_loopback_init_api_table(table);
/* GL 1.0 */
SET_Accum(table, save_Accum);
SET_AlphaFunc(table, save_AlphaFunc);
SET_Bitmap(table, save_Bitmap);
- SET_BlendFunc(table, _mesa_BlendFunc); /* loops-back to BlendFuncSeparate */
+ SET_BlendFunc(table, _mesa_BlendFunc); /* loops-back to BlendFuncSeparate */
SET_CallList(table, _mesa_save_CallList);
SET_CallLists(table, _mesa_save_CallLists);
SET_Clear(table, save_Clear);
@@ -7823,14 +8016,18 @@ _mesa_init_dlist_table( struct _glapi_table *table )
SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV);
- SET_GetProgramNamedParameterfvNV(table, _mesa_GetProgramNamedParameterfvNV);
- SET_GetProgramNamedParameterdvNV(table, _mesa_GetProgramNamedParameterdvNV);
+ SET_GetProgramNamedParameterfvNV(table,
+ _mesa_GetProgramNamedParameterfvNV);
+ SET_GetProgramNamedParameterdvNV(table,
+ _mesa_GetProgramNamedParameterdvNV);
SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
- SET_GetProgramLocalParameterdvARB(table, _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(table, _mesa_GetProgramLocalParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(table,
+ _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(table,
+ _mesa_GetProgramLocalParameterfvARB);
#endif
/* 262. GL_NV_point_sprite */
@@ -7897,8 +8094,10 @@ _mesa_init_dlist_table( struct _glapi_table *table )
SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
SET_GetProgramEnvParameterdvARB(table, _mesa_GetProgramEnvParameterdvARB);
SET_GetProgramEnvParameterfvARB(table, _mesa_GetProgramEnvParameterfvARB);
- SET_GetProgramLocalParameterdvARB(table, _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(table, _mesa_GetProgramLocalParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(table,
+ _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(table,
+ _mesa_GetProgramLocalParameterfvARB);
SET_GetProgramivARB(table, _mesa_GetProgramivARB);
SET_GetProgramStringARB(table, _mesa_GetProgramStringARB);
#endif
@@ -7931,43 +8130,47 @@ _mesa_init_dlist_table( struct _glapi_table *table )
#endif
SET_DrawBuffersARB(table, save_DrawBuffersARB);
+#if FEATURE_EXT_framebuffer_blit
+ SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT);
+#endif
+
/* 299. GL_EXT_blend_equation_separate */
SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
}
-/***
- *** Debugging code
- ***/
-static const char *enum_string( GLenum k )
+static const char *
+enum_string(GLenum k)
{
- return _mesa_lookup_enum_by_nr( k );
+ return _mesa_lookup_enum_by_nr(k);
}
-/*
+/**
* Print the commands in a display list. For debugging only.
* TODO: many commands aren't handled yet.
*/
-static void GLAPIENTRY print_list( GLcontext *ctx, GLuint list )
+static void GLAPIENTRY
+print_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
Node *n;
GLboolean done;
- if (!CALL_IsList(GET_DISPATCH(), (list))) {
+ if (!islist(ctx, list)) {
_mesa_printf("%u is not a display list ID\n", list);
return;
}
- dlist = (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
+ dlist = (struct mesa_display_list *)
+ _mesa_HashLookup(ctx->Shared->DisplayList, list);
if (!dlist)
return;
n = dlist->node;
-
- _mesa_printf("START-LIST %u, address %p\n", list, (void*)n );
+
+ _mesa_printf("START-LIST %u, address %p\n", list, (void *) n);
done = n ? GL_FALSE : GL_TRUE;
while (!done) {
@@ -7976,256 +8179,255 @@ static void GLAPIENTRY print_list( GLcontext *ctx, GLuint list )
if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
/* this is a driver-extended opcode */
- ctx->ListExt.Opcode[i].Print(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ ctx->ListExt.Opcode[i].Print(ctx, &n[1]);
+ n += ctx->ListExt.Opcode[i].Size;
}
else {
- switch (opcode) {
+ switch (opcode) {
case OPCODE_ACCUM:
- _mesa_printf("accum %s %g\n", enum_string(n[1].e), n[2].f );
- break;
- case OPCODE_BITMAP:
+ _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
+ break;
+ case OPCODE_BITMAP:
_mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
- n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data );
- break;
+ n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data);
+ break;
case OPCODE_CALL_LIST:
- _mesa_printf("CallList %d\n", (int) n[1].ui );
+ _mesa_printf("CallList %d\n", (int) n[1].ui);
break;
case OPCODE_CALL_LIST_OFFSET:
_mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
- ctx->List.ListBase, ctx->List.ListBase + n[1].ui );
+ ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
_mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
- enum_string(n[1].e), enum_string(n[2].e),
- n[3].f, n[4].f, n[5].f, n[6].f);
+ enum_string(n[1].e), enum_string(n[2].e),
+ n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
_mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
- enum_string(n[1].e), enum_string(n[2].e),
- n[3].i, n[4].i, n[5].i, n[6].i);
+ enum_string(n[1].e), enum_string(n[2].e),
+ n[3].i, n[4].i, n[5].i, n[6].i);
break;
- case OPCODE_DISABLE:
+ case OPCODE_DISABLE:
_mesa_printf("Disable %s\n", enum_string(n[1].e));
- break;
- case OPCODE_ENABLE:
+ break;
+ case OPCODE_ENABLE:
_mesa_printf("Enable %s\n", enum_string(n[1].e));
- break;
+ break;
case OPCODE_FRUSTUM:
_mesa_printf("Frustum %g %g %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+ n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
- case OPCODE_LINE_STIPPLE:
- _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us );
- break;
- case OPCODE_LOAD_IDENTITY:
+ case OPCODE_LINE_STIPPLE:
+ _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
+ break;
+ case OPCODE_LOAD_IDENTITY:
_mesa_printf("LoadIdentity\n");
- break;
- case OPCODE_LOAD_MATRIX:
+ break;
+ case OPCODE_LOAD_MATRIX:
_mesa_printf("LoadMatrix\n");
_mesa_printf(" %8f %8f %8f %8f\n",
- n[1].f, n[5].f, n[9].f, n[13].f);
+ n[1].f, n[5].f, n[9].f, n[13].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
- break;
- case OPCODE_MULT_MATRIX:
+ break;
+ case OPCODE_MULT_MATRIX:
_mesa_printf("MultMatrix (or Rotate)\n");
_mesa_printf(" %8f %8f %8f %8f\n",
- n[1].f, n[5].f, n[9].f, n[13].f);
+ n[1].f, n[5].f, n[9].f, n[13].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
_mesa_printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
- break;
+ break;
case OPCODE_ORTHO:
_mesa_printf("Ortho %g %g %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+ n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
- case OPCODE_POP_ATTRIB:
+ case OPCODE_POP_ATTRIB:
_mesa_printf("PopAttrib\n");
- break;
- case OPCODE_POP_MATRIX:
+ break;
+ case OPCODE_POP_MATRIX:
_mesa_printf("PopMatrix\n");
- break;
- case OPCODE_POP_NAME:
+ break;
+ case OPCODE_POP_NAME:
_mesa_printf("PopName\n");
- break;
- case OPCODE_PUSH_ATTRIB:
- _mesa_printf("PushAttrib %x\n", n[1].bf );
- break;
- case OPCODE_PUSH_MATRIX:
+ break;
+ case OPCODE_PUSH_ATTRIB:
+ _mesa_printf("PushAttrib %x\n", n[1].bf);
+ break;
+ case OPCODE_PUSH_MATRIX:
_mesa_printf("PushMatrix\n");
- break;
- case OPCODE_PUSH_NAME:
- _mesa_printf("PushName %d\n", (int) n[1].ui );
- break;
- case OPCODE_RASTER_POS:
+ break;
+ case OPCODE_PUSH_NAME:
+ _mesa_printf("PushName %d\n", (int) n[1].ui);
+ break;
+ case OPCODE_RASTER_POS:
_mesa_printf("RasterPos %g %g %g %g\n",
- n[1].f, n[2].f,n[3].f,n[4].f);
- break;
+ n[1].f, n[2].f, n[3].f, n[4].f);
+ break;
case OPCODE_ROTATE:
_mesa_printf("Rotate %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f );
+ n[1].f, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_SCALE:
- _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_TRANSLATE:
- _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f );
+ _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_BIND_TEXTURE:
- _mesa_printf("BindTexture %s %d\n",
+ _mesa_printf("BindTexture %s %d\n",
_mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
- break;
+ break;
case OPCODE_SHADE_MODEL:
- _mesa_printf("ShadeModel %s\n",
- _mesa_lookup_enum_by_nr(n[1].ui));
- break;
- case OPCODE_MAP1:
- _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
- n[2].f, n[3].f, n[4].i, n[5].i);
- break;
- case OPCODE_MAP2:
- _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ break;
+ case OPCODE_MAP1:
+ _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui),
+ n[2].f, n[3].f, n[4].i, n[5].i);
+ break;
+ case OPCODE_MAP2:
+ _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].f, n[5].f,
n[6].i, n[7].i, n[8].i, n[9].i);
- break;
- case OPCODE_MAPGRID1:
- _mesa_printf("MapGrid1 %d %.3f %.3f\n",
- n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_MAPGRID2:
- _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
- n[1].i, n[2].f, n[3].f,
- n[4].i, n[5].f, n[6].f);
- break;
- case OPCODE_EVALMESH1:
- _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
- break;
- case OPCODE_EVALMESH2:
- _mesa_printf("EvalMesh2 %d %d %d %d\n",
+ break;
+ case OPCODE_MAPGRID1:
+ _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_MAPGRID2:
+ _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
+ break;
+ case OPCODE_EVALMESH1:
+ _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ break;
+ case OPCODE_EVALMESH2:
+ _mesa_printf("EvalMesh2 %d %d %d %d\n",
n[1].i, n[2].i, n[3].i, n[4].i);
- break;
+ break;
- case OPCODE_ATTR_1F_NV:
- _mesa_printf("ATTR_1F_NV attr %d: %f\n",
- n[1].i, n[2].f);
- break;
- case OPCODE_ATTR_2F_NV:
- _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
- n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_ATTR_3F_NV:
- _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_ATTR_4F_NV:
- _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
- break;
- case OPCODE_ATTR_1F_ARB:
- _mesa_printf("ATTR_1F_ARB attr %d: %f\n",
- n[1].i, n[2].f);
- break;
- case OPCODE_ATTR_2F_ARB:
- _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
- n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_ATTR_3F_ARB:
- _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_ATTR_4F_ARB:
- _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
- break;
+ case OPCODE_ATTR_1F_NV:
+ _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
+ break;
+ case OPCODE_ATTR_2F_NV:
+ _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
+ n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_ATTR_3F_NV:
+ _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_ATTR_4F_NV:
+ _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
+ break;
+ case OPCODE_ATTR_1F_ARB:
+ _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
+ break;
+ case OPCODE_ATTR_2F_ARB:
+ _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
+ n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_ATTR_3F_ARB:
+ _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_ATTR_4F_ARB:
+ _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
+ break;
- case OPCODE_MATERIAL:
- _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
- n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
- break;
- case OPCODE_INDEX:
- _mesa_printf("INDEX: %f\n", n[1].f);
- break;
- case OPCODE_EDGEFLAG:
- _mesa_printf("EDGEFLAG: %d\n", n[1].i);
- break;
- case OPCODE_BEGIN:
- _mesa_printf("BEGIN %x\n", n[1].i);
- break;
- case OPCODE_END:
- _mesa_printf("END\n");
- break;
- case OPCODE_RECTF:
- _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_EVAL_C1:
- _mesa_printf("EVAL_C1 %f\n", n[1].f);
- break;
- case OPCODE_EVAL_C2:
- _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
- break;
- case OPCODE_EVAL_P1:
- _mesa_printf("EVAL_P1 %d\n", n[1].i);
- break;
- case OPCODE_EVAL_P2:
- _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
- break;
+ case OPCODE_MATERIAL:
+ _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
+ n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_INDEX:
+ _mesa_printf("INDEX: %f\n", n[1].f);
+ break;
+ case OPCODE_EDGEFLAG:
+ _mesa_printf("EDGEFLAG: %d\n", n[1].i);
+ break;
+ case OPCODE_BEGIN:
+ _mesa_printf("BEGIN %x\n", n[1].i);
+ break;
+ case OPCODE_END:
+ _mesa_printf("END\n");
+ break;
+ case OPCODE_RECTF:
+ _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
+ n[4].f);
+ break;
+ case OPCODE_EVAL_C1:
+ _mesa_printf("EVAL_C1 %f\n", n[1].f);
+ break;
+ case OPCODE_EVAL_C2:
+ _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
+ break;
+ case OPCODE_EVAL_P1:
+ _mesa_printf("EVAL_P1 %d\n", n[1].i);
+ break;
+ case OPCODE_EVAL_P2:
+ _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
+ break;
- /*
- * meta opcodes/commands
- */
+ /*
+ * meta opcodes/commands
+ */
case OPCODE_ERROR:
_mesa_printf("Error: %s %s\n",
- enum_string(n[1].e), (const char *)n[2].data );
+ enum_string(n[1].e), (const char *) n[2].data);
break;
- case OPCODE_CONTINUE:
+ case OPCODE_CONTINUE:
_mesa_printf("DISPLAY-LIST-CONTINUE\n");
- n = (Node *) n[1].next;
- break;
- case OPCODE_END_OF_LIST:
+ n = (Node *) n[1].next;
+ break;
+ case OPCODE_END_OF_LIST:
_mesa_printf("END-LIST %u\n", list);
- done = GL_TRUE;
- break;
+ done = GL_TRUE;
+ break;
default:
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
- opcode, (void*) n);
+ _mesa_printf
+ ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
+ opcode, (void *) n);
return;
}
else {
- _mesa_printf("command %d, %u operands\n", opcode, InstSize[opcode]);
+ _mesa_printf("command %d, %u operands\n", opcode,
+ InstSize[opcode]);
}
- }
- /* increment n to point to next compiled command */
- if (opcode!=OPCODE_CONTINUE) {
- n += InstSize[opcode];
- }
+ }
+ /* increment n to point to next compiled command */
+ if (opcode != OPCODE_CONTINUE) {
+ n += InstSize[opcode];
+ }
}
}
}
-/*
+/**
* Clients may call this function to help debug display list problems.
* This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
* changed, or break in the future without notice.
*/
-void mesa_print_display_list( GLuint list )
+void
+mesa_print_display_list(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
- print_list( ctx, list );
+ print_list(ctx, list);
}
@@ -8233,10 +8435,10 @@ void mesa_print_display_list( GLuint list )
/***** Initialization *****/
/**********************************************************************/
-
-void _mesa_save_vtxfmt_init( GLvertexformat *vfmt )
+void
+_mesa_save_vtxfmt_init(GLvertexformat * vfmt)
{
- vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
vfmt->Begin = save_Begin;
vfmt->CallList = _mesa_save_CallList;
vfmt->CallLists = _mesa_save_CallLists;
@@ -8319,9 +8521,20 @@ void _mesa_save_vtxfmt_init( GLvertexformat *vfmt )
}
-
-void _mesa_init_display_list( GLcontext * ctx )
+/**
+ * Initialize display list state for given context.
+ */
+void
+_mesa_init_display_list(GLcontext *ctx)
{
+ static GLboolean tableInitialized = GL_FALSE;
+
+ /* zero-out the instruction size table, just once */
+ if (!tableInitialized) {
+ _mesa_bzero(InstSize, sizeof(InstSize));
+ tableInitialized = GL_TRUE;
+ }
+
/* Display list */
ctx->ListState.CallDepth = 0;
ctx->ExecuteFlag = GL_TRUE;
@@ -8334,5 +8547,5 @@ void _mesa_init_display_list( GLcontext * ctx )
/* Display List group */
ctx->List.ListBase = 0;
- _mesa_save_vtxfmt_init( &ctx->ListState.ListVtxfmt );
+ _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
}
diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h
index 1a5b391e76..9436603d0a 100644
--- a/src/mesa/main/dlist.h
+++ b/src/mesa/main/dlist.h
@@ -38,8 +38,6 @@
#if _HAVE_FULL_GL
-extern void _mesa_init_lists( void );
-
extern void _mesa_destroy_list( GLcontext *ctx, GLuint list );
extern void GLAPIENTRY _mesa_CallList( GLuint list );
@@ -58,35 +56,32 @@ extern void GLAPIENTRY _mesa_ListBase( GLuint base );
extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode );
-extern void _mesa_init_dlist_table( struct _glapi_table *table );
+extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-extern void _mesa_save_error( GLcontext *ctx, GLenum error, const char *s );
+extern void GLAPIENTRY _mesa_save_CallList( GLuint list );
+
+
+
+extern void _mesa_init_dlist_table( struct _glapi_table *table );
extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
-extern void *_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz );
+extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz);
extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
void (*execute)( GLcontext *, void * ),
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
-extern void GLAPIENTRY _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2,
- GLint j1, GLint j2 );
-extern void GLAPIENTRY _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
-extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-extern void GLAPIENTRY _mesa_save_CallList( GLuint list );
extern void _mesa_init_display_list( GLcontext * ctx );
+
extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt );
#else
/** No-op */
-#define _mesa_init_lists() ((void)0)
-
-/** No-op */
#define _mesa_destroy_list(c,l) ((void)0)
/** No-op */
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 931aa2cc26..af54fea30b 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -759,7 +759,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
- CHECK_EXTENSION(EXT_secondary_color, cap);
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap);
if (ctx->Fog.ColorSumEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
@@ -821,28 +821,30 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Point.PointSprite = state;
break;
-#if FEATURE_NV_vertex_program
- case GL_VERTEX_PROGRAM_NV:
- CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ case GL_VERTEX_PROGRAM_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
if (ctx->VertexProgram.Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->VertexProgram.Enabled = state;
break;
- case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
- CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
if (ctx->VertexProgram.PointSizeEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->VertexProgram.PointSizeEnabled = state;
break;
- case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
- CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap);
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
if (ctx->VertexProgram.TwoSideEnabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->VertexProgram.TwoSideEnabled = state;
break;
+#endif
+#if FEATURE_NV_vertex_program
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
case GL_MAP1_VERTEX_ATTRIB1_4_NV:
case GL_MAP1_VERTEX_ATTRIB2_4_NV:
@@ -1035,6 +1037,12 @@ _mesa_Disable( GLenum cap )
return GL_FALSE; \
}
+#undef CHECK_EXTENSION2
+#define CHECK_EXTENSION2(EXT1, EXT2) \
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \
+ return GL_FALSE; \
+ }
/**
* Test whether a capability is enabled.
@@ -1260,6 +1268,11 @@ _mesa_IsEnabled( GLenum cap )
return (texUnit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE;
}
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program);
+ return ctx->Fog.ColorSumEnabled;
+
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
CHECK_EXTENSION(ARB_multisample);
@@ -1284,18 +1297,21 @@ _mesa_IsEnabled( GLenum cap )
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
return ctx->Point.PointSprite;
-#if FEATURE_NV_vertex_program
- case GL_VERTEX_PROGRAM_NV:
- CHECK_EXTENSION(NV_vertex_program);
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ case GL_VERTEX_PROGRAM_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.Enabled;
- case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
- CHECK_EXTENSION(NV_vertex_program);
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.PointSizeEnabled;
- case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
- CHECK_EXTENSION(NV_vertex_program);
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.TwoSideEnabled;
+#endif
+#if FEATURE_NV_vertex_program
case GL_VERTEX_ATTRIB_ARRAY0_NV:
case GL_VERTEX_ATTRIB_ARRAY1_NV:
case GL_VERTEX_ATTRIB_ARRAY2_NV:
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index 3487797d7f..ecda0bfb5e 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -502,6 +502,10 @@ static const char enum_string_table[] =
"GL_GENERATE_MIPMAP_HINT_SGIS\0"
"GL_GENERATE_MIPMAP_SGIS\0"
"GL_GEQUAL\0"
+ "GL_GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_GL_DRAW_FRAMEBUFFER_EXT\0"
+ "GL_GL_READ_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_GL_READ_FRAMEBUFFER_EXT\0"
"GL_GL_TIME_ELAPSED_EXT\0"
"GL_GREATER\0"
"GL_GREEN\0"
@@ -1650,7 +1654,7 @@ static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[1613] =
+static const enum_elt all_enums[1617] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -2119,1232 +2123,1236 @@ static const enum_elt all_enums[1613] =
{ 9525, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
{ 9554, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
{ 9578, 0x00000206 }, /* GL_GEQUAL */
- { 9588, 0x000088BF }, /* GL_GL_TIME_ELAPSED_EXT */
- { 9611, 0x00000204 }, /* GL_GREATER */
- { 9622, 0x00001904 }, /* GL_GREEN */
- { 9631, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 9645, 0x00000D53 }, /* GL_GREEN_BITS */
- { 9659, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 9674, 0x00008000 }, /* GL_HINT_BIT */
- { 9686, 0x00008024 }, /* GL_HISTOGRAM */
- { 9699, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 9723, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 9751, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 9774, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 9801, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 9818, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 9838, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 9862, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 9886, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 9914, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 9942, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 9974, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 9996, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 10022, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 10040, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 10062, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 10081, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 10104, 0x0000862A }, /* GL_IDENTITY_NV */
- { 10119, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 10139, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 10179, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 10217, 0x00001E02 }, /* GL_INCR */
- { 10225, 0x00008507 }, /* GL_INCR_WRAP */
- { 10238, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 10255, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 10270, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 10300, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 10334, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 10357, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 10379, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 10399, 0x00000D51 }, /* GL_INDEX_BITS */
- { 10413, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 10434, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 10452, 0x00000C30 }, /* GL_INDEX_MODE */
- { 10466, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 10482, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 10497, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 10516, 0x00001404 }, /* GL_INT */
- { 10523, 0x00008049 }, /* GL_INTENSITY */
- { 10536, 0x0000804C }, /* GL_INTENSITY12 */
- { 10551, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 10570, 0x0000804D }, /* GL_INTENSITY16 */
- { 10585, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 10604, 0x0000804A }, /* GL_INTENSITY4 */
- { 10618, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 10636, 0x0000804B }, /* GL_INTENSITY8 */
- { 10650, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 10668, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 10685, 0x00008575 }, /* GL_INTERPOLATE */
- { 10700, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 10719, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 10738, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 10754, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 10770, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 10786, 0x00000500 }, /* GL_INVALID_ENUM */
- { 10802, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 10839, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 10860, 0x00000501 }, /* GL_INVALID_VALUE */
- { 10877, 0x0000862B }, /* GL_INVERSE_NV */
- { 10891, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 10915, 0x0000150A }, /* GL_INVERT */
- { 10925, 0x00001E00 }, /* GL_KEEP */
- { 10933, 0x00000406 }, /* GL_LEFT */
- { 10941, 0x00000203 }, /* GL_LEQUAL */
- { 10951, 0x00000201 }, /* GL_LESS */
- { 10959, 0x00004000 }, /* GL_LIGHT0 */
- { 10969, 0x00004001 }, /* GL_LIGHT1 */
- { 10979, 0x00004002 }, /* GL_LIGHT2 */
- { 10989, 0x00004003 }, /* GL_LIGHT3 */
- { 10999, 0x00004004 }, /* GL_LIGHT4 */
- { 11009, 0x00004005 }, /* GL_LIGHT5 */
- { 11019, 0x00004006 }, /* GL_LIGHT6 */
- { 11029, 0x00004007 }, /* GL_LIGHT7 */
- { 11039, 0x00000B50 }, /* GL_LIGHTING */
- { 11051, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 11067, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 11090, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 11119, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 11152, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 11180, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 11204, 0x00001B01 }, /* GL_LINE */
- { 11212, 0x00002601 }, /* GL_LINEAR */
- { 11222, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 11244, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 11274, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 11305, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 11329, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 11354, 0x00000001 }, /* GL_LINES */
- { 11363, 0x00000004 }, /* GL_LINE_BIT */
- { 11375, 0x00000002 }, /* GL_LINE_LOOP */
- { 11388, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 11408, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 11423, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 11443, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 11459, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 11483, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 11506, 0x00000003 }, /* GL_LINE_STRIP */
- { 11520, 0x00000702 }, /* GL_LINE_TOKEN */
- { 11534, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 11548, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 11574, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 11594, 0x00000B32 }, /* GL_LIST_BASE */
- { 11607, 0x00020000 }, /* GL_LIST_BIT */
- { 11619, 0x00000B33 }, /* GL_LIST_INDEX */
- { 11633, 0x00000B30 }, /* GL_LIST_MODE */
- { 11646, 0x00000101 }, /* GL_LOAD */
- { 11654, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 11666, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 11683, 0x00001909 }, /* GL_LUMINANCE */
- { 11696, 0x00008041 }, /* GL_LUMINANCE12 */
- { 11711, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 11734, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 11761, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 11783, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 11809, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 11828, 0x00008042 }, /* GL_LUMINANCE16 */
- { 11843, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 11866, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 11893, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 11912, 0x0000803F }, /* GL_LUMINANCE4 */
- { 11926, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 11947, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 11972, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 11990, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 12011, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 12036, 0x00008040 }, /* GL_LUMINANCE8 */
- { 12050, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 12071, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 12096, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 12114, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 12133, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 12149, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 12169, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 12191, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 12205, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 12220, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 12244, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 12268, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 12292, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 12316, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 12333, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 12350, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 12378, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 12407, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 12436, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 12465, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 12494, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 12523, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 12552, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 12580, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 12608, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 12636, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 12664, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 12692, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 12720, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 12748, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 12776, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 12804, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 12820, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 12840, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 12862, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 12876, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 12891, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 12915, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 12939, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 12963, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 12987, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 13004, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 13021, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 13049, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 13078, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 13107, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 13136, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 13165, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 13194, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 13223, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 13251, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 13279, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 13307, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 13335, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 13363, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 13391, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 13419, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 13447, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 13475, 0x00000D10 }, /* GL_MAP_COLOR */
- { 13488, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 13503, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 13518, 0x00008630 }, /* GL_MATRIX0_NV */
- { 13532, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 13548, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 13564, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 13580, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 13596, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 13612, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 13628, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 13644, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 13660, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 13676, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 13692, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 13707, 0x00008631 }, /* GL_MATRIX1_NV */
- { 13721, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 13737, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 13753, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 13769, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 13785, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 13801, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 13817, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 13833, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 13849, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 13865, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 13881, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 13896, 0x00008632 }, /* GL_MATRIX2_NV */
- { 13910, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 13926, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 13942, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 13957, 0x00008633 }, /* GL_MATRIX3_NV */
- { 13971, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 13986, 0x00008634 }, /* GL_MATRIX4_NV */
- { 14000, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 14015, 0x00008635 }, /* GL_MATRIX5_NV */
- { 14029, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 14044, 0x00008636 }, /* GL_MATRIX6_NV */
- { 14058, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 14073, 0x00008637 }, /* GL_MATRIX7_NV */
- { 14087, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 14102, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 14117, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 14143, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 14177, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 14208, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 14241, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 14272, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 14287, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 14309, 0x00008008 }, /* GL_MAX */
- { 14316, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 14339, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 14365, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 14398, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 14424, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 14458, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 14477, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 14506, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 14538, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 14574, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 14614, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 14640, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 14670, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 14695, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 14724, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 14753, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 14786, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 14810, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 14834, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 14858, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 14883, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 14901, 0x00008008 }, /* GL_MAX_EXT */
- { 14912, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 14951, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 14965, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 14985, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 15023, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 15052, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 15076, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 15104, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 15127, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 15164, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 15200, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 15227, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 15256, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 15290, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 15326, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 15353, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 15385, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 15421, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 15450, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 15479, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 15507, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 15545, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 15589, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 15632, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 15666, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 15705, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 15742, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 15780, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 15823, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 15866, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 15896, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 15927, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 15963, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 15999, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 16029, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 16063, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 16096, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 16125, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 16145, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 16169, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 16195, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 16226, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 16250, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 16284, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 16304, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 16331, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 16352, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 16377, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 16402, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 16437, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 16463, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 16489, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 16527, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 16564, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 16588, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 16609, 0x00008007 }, /* GL_MIN */
- { 16616, 0x0000802E }, /* GL_MINMAX */
- { 16626, 0x0000802E }, /* GL_MINMAX_EXT */
- { 16640, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 16657, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 16678, 0x00008030 }, /* GL_MINMAX_SINK */
- { 16693, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 16712, 0x00008007 }, /* GL_MIN_EXT */
- { 16723, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 16742, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 16765, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 16788, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 16808, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 16828, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 16858, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 16886, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 16914, 0x00001700 }, /* GL_MODELVIEW */
- { 16927, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 16945, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 16964, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 16983, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 17002, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 17021, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 17040, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 17059, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 17078, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 17097, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 17116, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 17135, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 17153, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 17172, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 17191, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 17210, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 17229, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 17248, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 17267, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 17286, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 17305, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 17324, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 17343, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 17361, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 17380, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 17399, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 17417, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 17435, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 17453, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 17471, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 17489, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 17507, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 17525, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 17545, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 17572, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 17597, 0x00002100 }, /* GL_MODULATE */
- { 17609, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 17629, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 17656, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 17681, 0x00000103 }, /* GL_MULT */
- { 17689, 0x0000809D }, /* GL_MULTISAMPLE */
- { 17704, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 17724, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 17743, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 17762, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 17786, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 17809, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 17839, 0x00002A25 }, /* GL_N3F_V3F */
- { 17850, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 17870, 0x0000150E }, /* GL_NAND */
- { 17878, 0x00002600 }, /* GL_NEAREST */
- { 17889, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 17920, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 17952, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 17977, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 18003, 0x00000200 }, /* GL_NEVER */
- { 18012, 0x00001102 }, /* GL_NICEST */
- { 18022, 0x00000000 }, /* GL_NONE */
- { 18030, 0x00001505 }, /* GL_NOOP */
- { 18038, 0x00001508 }, /* GL_NOR */
- { 18045, 0x00000BA1 }, /* GL_NORMALIZE */
- { 18058, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 18074, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 18105, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 18140, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 18164, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 18187, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 18208, 0x00008511 }, /* GL_NORMAL_MAP */
- { 18222, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 18240, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 18257, 0x00000205 }, /* GL_NOTEQUAL */
- { 18269, 0x00000000 }, /* GL_NO_ERROR */
- { 18281, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 18315, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 18353, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 18385, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 18427, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 18457, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 18497, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 18528, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 18557, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 18585, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 18615, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 18632, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 18658, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 18674, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 18709, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 18731, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 18750, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 18780, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 18801, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 18829, 0x00000001 }, /* GL_ONE */
- { 18836, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 18864, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 18896, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 18924, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 18956, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 18979, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 19002, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 19025, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 19048, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 19066, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 19088, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 19110, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 19126, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 19146, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 19166, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 19184, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 19206, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 19228, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 19244, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 19264, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 19284, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 19302, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 19324, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 19346, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 19362, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 19382, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 19402, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 19423, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 19442, 0x00001507 }, /* GL_OR */
- { 19448, 0x00000A01 }, /* GL_ORDER */
- { 19457, 0x0000150D }, /* GL_OR_INVERTED */
- { 19472, 0x0000150B }, /* GL_OR_REVERSE */
- { 19486, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 19503, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 19521, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 19542, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 19562, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 19580, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 19599, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 19619, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 19639, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 19657, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 19676, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 19701, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 19725, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 19746, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 19768, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 19790, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 19815, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 19839, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 19860, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 19882, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 19904, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 19926, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 19957, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 19977, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 20002, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 20022, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 20047, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 20067, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 20092, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 20112, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 20137, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 20157, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 20182, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 20202, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 20227, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 20247, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 20272, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 20292, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 20317, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 20337, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 20362, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 20382, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 20407, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 20425, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 20458, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 20483, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 20518, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 20545, 0x00001B00 }, /* GL_POINT */
- { 20554, 0x00000000 }, /* GL_POINTS */
- { 20564, 0x00000002 }, /* GL_POINT_BIT */
- { 20577, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 20607, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 20641, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 20675, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 20710, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 20739, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 20772, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 20805, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 20839, 0x00000B11 }, /* GL_POINT_SIZE */
- { 20853, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 20879, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 20897, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 20919, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 20941, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 20964, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 20982, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 21004, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 21026, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 21049, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 21069, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 21085, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 21106, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 21126, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 21155, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 21174, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 21200, 0x00000701 }, /* GL_POINT_TOKEN */
- { 21215, 0x00000009 }, /* GL_POLYGON */
- { 21226, 0x00000008 }, /* GL_POLYGON_BIT */
- { 21241, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 21257, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 21280, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 21305, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 21328, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 21351, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 21375, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 21399, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 21417, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 21440, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 21459, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 21482, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 21499, 0x00001203 }, /* GL_POSITION */
- { 21511, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 21543, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 21579, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 21612, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 21649, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 21680, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 21715, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 21747, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 21783, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 21816, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 21848, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 21884, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 21917, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 21954, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 21984, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 22018, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 22049, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 22084, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 22115, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 22150, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 22182, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 22218, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 22248, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 22282, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 22313, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 22348, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 22380, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 22411, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 22446, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 22478, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 22514, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 22543, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 22576, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 22606, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 22640, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 22679, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 22712, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 22752, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 22786, 0x00008578 }, /* GL_PREVIOUS */
- { 22798, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 22814, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 22830, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 22847, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 22868, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 22889, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 22922, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 22954, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 22977, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 23000, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 23030, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 23059, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 23087, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 23109, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 23137, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 23165, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 23187, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 23208, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 23248, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 23287, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 23317, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 23352, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 23385, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 23419, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 23458, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 23497, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 23519, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 23545, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 23569, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 23592, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 23614, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 23635, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 23656, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 23683, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 23715, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 23747, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 23782, 0x00001701 }, /* GL_PROJECTION */
- { 23796, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 23817, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 23843, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 23864, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 23883, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 23906, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 23945, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 23983, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 24003, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 24027, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 24047, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 24071, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 24091, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 24124, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 24150, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 24180, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 24211, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 24241, 0x00002003 }, /* GL_Q */
- { 24246, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 24271, 0x00000007 }, /* GL_QUADS */
- { 24280, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 24297, 0x00000008 }, /* GL_QUAD_STRIP */
- { 24311, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 24333, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 24359, 0x00008866 }, /* GL_QUERY_RESULT */
- { 24375, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 24395, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 24421, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 24451, 0x00002002 }, /* GL_R */
- { 24456, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 24468, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 24501, 0x00000C02 }, /* GL_READ_BUFFER */
- { 24516, 0x000088B8 }, /* GL_READ_ONLY */
- { 24529, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 24546, 0x000088BA }, /* GL_READ_WRITE */
- { 24560, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 24578, 0x00001903 }, /* GL_RED */
- { 24585, 0x00008016 }, /* GL_REDUCE */
- { 24595, 0x00008016 }, /* GL_REDUCE_EXT */
- { 24609, 0x00000D15 }, /* GL_RED_BIAS */
- { 24621, 0x00000D52 }, /* GL_RED_BITS */
- { 24633, 0x00000D14 }, /* GL_RED_SCALE */
- { 24646, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 24664, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 24686, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 24707, 0x00001C00 }, /* GL_RENDER */
- { 24717, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 24745, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 24765, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 24792, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 24828, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 24854, 0x00001F01 }, /* GL_RENDERER */
- { 24866, 0x00000C40 }, /* GL_RENDER_MODE */
- { 24881, 0x00002901 }, /* GL_REPEAT */
- { 24891, 0x00001E01 }, /* GL_REPLACE */
- { 24902, 0x00008062 }, /* GL_REPLACE_EXT */
- { 24917, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 24940, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 24958, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 24980, 0x00000102 }, /* GL_RETURN */
- { 24990, 0x00001907 }, /* GL_RGB */
- { 24997, 0x00008052 }, /* GL_RGB10 */
- { 25006, 0x00008059 }, /* GL_RGB10_A2 */
- { 25018, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 25034, 0x00008052 }, /* GL_RGB10_EXT */
- { 25047, 0x00008053 }, /* GL_RGB12 */
- { 25056, 0x00008053 }, /* GL_RGB12_EXT */
- { 25069, 0x00008054 }, /* GL_RGB16 */
- { 25078, 0x00008054 }, /* GL_RGB16_EXT */
- { 25091, 0x0000804E }, /* GL_RGB2_EXT */
- { 25103, 0x0000804F }, /* GL_RGB4 */
- { 25111, 0x0000804F }, /* GL_RGB4_EXT */
- { 25123, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 25136, 0x00008050 }, /* GL_RGB5 */
- { 25144, 0x00008057 }, /* GL_RGB5_A1 */
- { 25155, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 25170, 0x00008050 }, /* GL_RGB5_EXT */
- { 25182, 0x00008051 }, /* GL_RGB8 */
- { 25190, 0x00008051 }, /* GL_RGB8_EXT */
- { 25202, 0x00001908 }, /* GL_RGBA */
- { 25210, 0x0000805A }, /* GL_RGBA12 */
- { 25220, 0x0000805A }, /* GL_RGBA12_EXT */
- { 25234, 0x0000805B }, /* GL_RGBA16 */
- { 25244, 0x0000805B }, /* GL_RGBA16_EXT */
- { 25258, 0x00008055 }, /* GL_RGBA2 */
- { 25267, 0x00008055 }, /* GL_RGBA2_EXT */
- { 25280, 0x00008056 }, /* GL_RGBA4 */
- { 25289, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 25308, 0x00008056 }, /* GL_RGBA4_EXT */
- { 25321, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 25335, 0x00008058 }, /* GL_RGBA8 */
- { 25344, 0x00008058 }, /* GL_RGBA8_EXT */
- { 25357, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 25375, 0x00000C31 }, /* GL_RGBA_MODE */
- { 25388, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 25401, 0x000083A0 }, /* GL_RGB_S3TC */
- { 25413, 0x00008573 }, /* GL_RGB_SCALE */
- { 25426, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 25443, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 25460, 0x00000407 }, /* GL_RIGHT */
- { 25469, 0x00002000 }, /* GL_S */
- { 25474, 0x000080A9 }, /* GL_SAMPLES */
- { 25485, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 25501, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 25516, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 25534, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 25556, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 25584, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 25616, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 25639, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 25666, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 25684, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 25707, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 25729, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 25748, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 25771, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 25797, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 25827, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 25852, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 25881, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 25896, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 25911, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 25927, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 25952, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 25992, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 26036, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 26069, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 26099, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 26131, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 26161, 0x00001C02 }, /* GL_SELECT */
- { 26171, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 26199, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 26224, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 26240, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 26267, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 26298, 0x0000150F }, /* GL_SET */
- { 26305, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 26326, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 26341, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 26364, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 26394, 0x00001601 }, /* GL_SHININESS */
- { 26407, 0x00001402 }, /* GL_SHORT */
- { 26416, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 26432, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 26452, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 26471, 0x00001D01 }, /* GL_SMOOTH */
- { 26481, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 26514, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 26541, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 26574, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 26601, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 26618, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 26639, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 26660, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 26675, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 26694, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 26713, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 26730, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 26751, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 26772, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 26787, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 26806, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 26825, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 26842, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 26863, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 26884, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 26899, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 26918, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 26937, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 26957, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 26975, 0x00001202 }, /* GL_SPECULAR */
- { 26987, 0x00002402 }, /* GL_SPHERE_MAP */
- { 27001, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 27016, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 27034, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 27051, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 27065, 0x00008580 }, /* GL_SRC0_RGB */
- { 27077, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 27091, 0x00008581 }, /* GL_SRC1_RGB */
- { 27103, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 27117, 0x00008582 }, /* GL_SRC2_RGB */
- { 27129, 0x00000302 }, /* GL_SRC_ALPHA */
- { 27142, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 27164, 0x00000300 }, /* GL_SRC_COLOR */
- { 27177, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 27195, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 27214, 0x000088E6 }, /* GL_STATIC_COPY */
- { 27229, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 27248, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 27263, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 27282, 0x000088E5 }, /* GL_STATIC_READ */
- { 27297, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 27316, 0x00001802 }, /* GL_STENCIL */
- { 27327, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 27353, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 27369, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 27391, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 27414, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 27430, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 27446, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 27463, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 27486, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 27508, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 27530, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 27552, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 27573, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 27600, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 27627, 0x00000B97 }, /* GL_STENCIL_REF */
- { 27642, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 27658, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 27687, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 27709, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 27730, 0x00000C33 }, /* GL_STEREO */
- { 27740, 0x000088E2 }, /* GL_STREAM_COPY */
- { 27755, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 27774, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 27789, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 27808, 0x000088E1 }, /* GL_STREAM_READ */
- { 27823, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 27842, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 27859, 0x000084E7 }, /* GL_SUBTRACT */
- { 27871, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 27887, 0x00002001 }, /* GL_T */
- { 27892, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 27907, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 27926, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 27942, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 27957, 0x00002A27 }, /* GL_T2F_V3F */
- { 27968, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 27987, 0x00002A28 }, /* GL_T4F_V4F */
- { 27998, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 28021, 0x00001702 }, /* GL_TEXTURE */
- { 28032, 0x000084C0 }, /* GL_TEXTURE0 */
- { 28044, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 28060, 0x000084C1 }, /* GL_TEXTURE1 */
- { 28072, 0x000084CA }, /* GL_TEXTURE10 */
- { 28085, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 28102, 0x000084CB }, /* GL_TEXTURE11 */
- { 28115, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 28132, 0x000084CC }, /* GL_TEXTURE12 */
- { 28145, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 28162, 0x000084CD }, /* GL_TEXTURE13 */
- { 28175, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 28192, 0x000084CE }, /* GL_TEXTURE14 */
- { 28205, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 28222, 0x000084CF }, /* GL_TEXTURE15 */
- { 28235, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 28252, 0x000084D0 }, /* GL_TEXTURE16 */
- { 28265, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 28282, 0x000084D1 }, /* GL_TEXTURE17 */
- { 28295, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 28312, 0x000084D2 }, /* GL_TEXTURE18 */
- { 28325, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 28342, 0x000084D3 }, /* GL_TEXTURE19 */
- { 28355, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 28372, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 28388, 0x000084C2 }, /* GL_TEXTURE2 */
- { 28400, 0x000084D4 }, /* GL_TEXTURE20 */
- { 28413, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 28430, 0x000084D5 }, /* GL_TEXTURE21 */
- { 28443, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 28460, 0x000084D6 }, /* GL_TEXTURE22 */
- { 28473, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 28490, 0x000084D7 }, /* GL_TEXTURE23 */
- { 28503, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 28520, 0x000084D8 }, /* GL_TEXTURE24 */
- { 28533, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 28550, 0x000084D9 }, /* GL_TEXTURE25 */
- { 28563, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 28580, 0x000084DA }, /* GL_TEXTURE26 */
- { 28593, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 28610, 0x000084DB }, /* GL_TEXTURE27 */
- { 28623, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 28640, 0x000084DC }, /* GL_TEXTURE28 */
- { 28653, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 28670, 0x000084DD }, /* GL_TEXTURE29 */
- { 28683, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 28700, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 28716, 0x000084C3 }, /* GL_TEXTURE3 */
- { 28728, 0x000084DE }, /* GL_TEXTURE30 */
- { 28741, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 28758, 0x000084DF }, /* GL_TEXTURE31 */
- { 28771, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 28788, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 28804, 0x000084C4 }, /* GL_TEXTURE4 */
- { 28816, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 28832, 0x000084C5 }, /* GL_TEXTURE5 */
- { 28844, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 28860, 0x000084C6 }, /* GL_TEXTURE6 */
- { 28872, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 28888, 0x000084C7 }, /* GL_TEXTURE7 */
- { 28900, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 28916, 0x000084C8 }, /* GL_TEXTURE8 */
- { 28928, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 28944, 0x000084C9 }, /* GL_TEXTURE9 */
- { 28956, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 28972, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 28986, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 29000, 0x0000806F }, /* GL_TEXTURE_3D */
- { 29014, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 29036, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 29062, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 29084, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 29106, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 29128, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 29150, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 29178, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 29210, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 29243, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 29275, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 29290, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 29311, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 29336, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 29354, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 29378, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 29409, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 29439, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 29469, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 29504, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 29535, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 29573, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 29600, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 29632, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 29666, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 29690, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 29718, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 29742, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 29770, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 29803, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 29827, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 29849, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 29871, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 29897, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 29931, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 29964, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 30001, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 30029, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 30061, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 30084, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 30122, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 30164, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 30195, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 30223, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 30253, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 30281, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 30301, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 30325, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 30356, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 30391, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 30422, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 30457, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 30488, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 30523, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 30554, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 30589, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 30620, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 30655, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 30686, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 30721, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 30738, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 30760, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 30786, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 30801, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 30822, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 30842, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 30868, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 30888, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 30905, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 30922, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 30939, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 30956, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 30981, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 31003, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 31029, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 31047, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 31073, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 31099, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 31129, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 31156, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 31181, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 31201, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 31225, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 31252, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 31279, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 31306, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 31332, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 31362, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 31384, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 31402, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 31432, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 31460, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 31488, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 31516, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 31537, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 31556, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 31578, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 31597, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 31617, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 31642, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 31666, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 31686, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 31710, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 31730, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 31753, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 31778, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 31812, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 31829, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 31847, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 31865, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 31883, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 31902, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 31931, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 31948, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 31974, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 32004, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 32036, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 32066, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 32100, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 32116, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 32147, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 32182, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 32210, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 32242, 0x00000004 }, /* GL_TRIANGLES */
- { 32255, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 32271, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 32292, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 32310, 0x00000001 }, /* GL_TRUE */
- { 32318, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 32338, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 32361, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 32381, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 32402, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 32424, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 32446, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 32466, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 32487, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 32504, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 32531, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 32554, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 32570, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 32597, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 32621, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 32652, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 32676, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 32704, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 32722, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 32752, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 32778, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 32808, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 32834, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 32858, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 32886, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 32914, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 32941, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 32973, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 33004, 0x00002A20 }, /* GL_V2F */
- { 33011, 0x00002A21 }, /* GL_V3F */
- { 33018, 0x00001F00 }, /* GL_VENDOR */
- { 33028, 0x00001F02 }, /* GL_VERSION */
- { 33039, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 33055, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 33086, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 33121, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 33145, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 33166, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 33189, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 33210, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 33237, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 33265, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 33293, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 33321, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 33349, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 33377, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 33405, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 33432, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 33459, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 33486, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 33513, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 33540, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 33567, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 33594, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 33621, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 33648, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 33686, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 33728, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 33763, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 33801, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 33836, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 33868, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 33902, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 33934, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 33954, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 33976, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 34005, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 34026, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 34059, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 34091, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 34122, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 34152, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 34173, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 34200, 0x00000BA2 }, /* GL_VIEWPORT */
- { 34212, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 34228, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 34248, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 34279, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 34314, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 34342, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 34367, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 34394, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 34419, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 34443, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 34462, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 34476, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 34494, 0x00001506 }, /* GL_XOR */
- { 34501, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 34520, 0x00008757 }, /* GL_YCBCR_MESA */
- { 34534, 0x00000000 }, /* GL_ZERO */
- { 34542, 0x00000D16 }, /* GL_ZOOM_X */
- { 34552, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 9588, 0x00008CA6 }, /* GL_GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 9623, 0x00008CA9 }, /* GL_GL_DRAW_FRAMEBUFFER_EXT */
+ { 9650, 0x00008CAA }, /* GL_GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 9685, 0x00008CA8 }, /* GL_GL_READ_FRAMEBUFFER_EXT */
+ { 9712, 0x000088BF }, /* GL_GL_TIME_ELAPSED_EXT */
+ { 9735, 0x00000204 }, /* GL_GREATER */
+ { 9746, 0x00001904 }, /* GL_GREEN */
+ { 9755, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 9769, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 9783, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 9798, 0x00008000 }, /* GL_HINT_BIT */
+ { 9810, 0x00008024 }, /* GL_HISTOGRAM */
+ { 9823, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 9847, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 9875, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 9898, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 9925, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 9942, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 9962, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 9986, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 10010, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 10038, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 10066, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 10098, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 10120, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 10146, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 10164, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 10186, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 10205, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 10228, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 10243, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 10263, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 10303, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 10341, 0x00001E02 }, /* GL_INCR */
+ { 10349, 0x00008507 }, /* GL_INCR_WRAP */
+ { 10362, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 10379, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 10394, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 10424, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 10458, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 10481, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 10503, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 10523, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 10537, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 10558, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 10576, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 10590, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 10606, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 10621, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 10640, 0x00001404 }, /* GL_INT */
+ { 10647, 0x00008049 }, /* GL_INTENSITY */
+ { 10660, 0x0000804C }, /* GL_INTENSITY12 */
+ { 10675, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 10694, 0x0000804D }, /* GL_INTENSITY16 */
+ { 10709, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 10728, 0x0000804A }, /* GL_INTENSITY4 */
+ { 10742, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 10760, 0x0000804B }, /* GL_INTENSITY8 */
+ { 10774, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 10792, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 10809, 0x00008575 }, /* GL_INTERPOLATE */
+ { 10824, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 10843, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 10862, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 10878, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 10894, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 10910, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 10926, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 10963, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 10984, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 11001, 0x0000862B }, /* GL_INVERSE_NV */
+ { 11015, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 11039, 0x0000150A }, /* GL_INVERT */
+ { 11049, 0x00001E00 }, /* GL_KEEP */
+ { 11057, 0x00000406 }, /* GL_LEFT */
+ { 11065, 0x00000203 }, /* GL_LEQUAL */
+ { 11075, 0x00000201 }, /* GL_LESS */
+ { 11083, 0x00004000 }, /* GL_LIGHT0 */
+ { 11093, 0x00004001 }, /* GL_LIGHT1 */
+ { 11103, 0x00004002 }, /* GL_LIGHT2 */
+ { 11113, 0x00004003 }, /* GL_LIGHT3 */
+ { 11123, 0x00004004 }, /* GL_LIGHT4 */
+ { 11133, 0x00004005 }, /* GL_LIGHT5 */
+ { 11143, 0x00004006 }, /* GL_LIGHT6 */
+ { 11153, 0x00004007 }, /* GL_LIGHT7 */
+ { 11163, 0x00000B50 }, /* GL_LIGHTING */
+ { 11175, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 11191, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 11214, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 11243, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 11276, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 11304, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 11328, 0x00001B01 }, /* GL_LINE */
+ { 11336, 0x00002601 }, /* GL_LINEAR */
+ { 11346, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 11368, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 11398, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 11429, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 11453, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 11478, 0x00000001 }, /* GL_LINES */
+ { 11487, 0x00000004 }, /* GL_LINE_BIT */
+ { 11499, 0x00000002 }, /* GL_LINE_LOOP */
+ { 11512, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 11532, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 11547, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 11567, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 11583, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 11607, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 11630, 0x00000003 }, /* GL_LINE_STRIP */
+ { 11644, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 11658, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 11672, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 11698, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 11718, 0x00000B32 }, /* GL_LIST_BASE */
+ { 11731, 0x00020000 }, /* GL_LIST_BIT */
+ { 11743, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 11757, 0x00000B30 }, /* GL_LIST_MODE */
+ { 11770, 0x00000101 }, /* GL_LOAD */
+ { 11778, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 11790, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 11807, 0x00001909 }, /* GL_LUMINANCE */
+ { 11820, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 11835, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 11858, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 11885, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 11907, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 11933, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 11952, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 11967, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 11990, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 12017, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 12036, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 12050, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 12071, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 12096, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 12114, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 12135, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 12160, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 12174, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 12195, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 12220, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 12238, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 12257, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 12273, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 12293, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 12315, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 12329, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 12344, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 12368, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 12392, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 12416, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 12440, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 12457, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 12474, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 12502, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 12531, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 12560, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 12589, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 12618, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 12647, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 12676, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 12704, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 12732, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 12760, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 12788, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 12816, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 12844, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 12872, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 12900, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 12928, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 12944, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 12964, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 12986, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 13000, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 13015, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 13039, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 13063, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 13087, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 13111, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 13128, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 13145, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 13173, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 13202, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 13231, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 13260, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 13289, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 13318, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 13347, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 13375, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 13403, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 13431, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 13459, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 13487, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 13515, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 13543, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 13571, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 13599, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 13612, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 13627, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 13642, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 13656, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 13672, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 13688, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 13704, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 13720, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 13736, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 13752, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 13768, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 13784, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 13800, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 13816, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 13831, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 13845, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 13861, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 13877, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 13893, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 13909, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 13925, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 13941, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 13957, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 13973, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 13989, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 14005, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 14020, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 14034, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 14050, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 14066, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 14081, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 14095, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 14110, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 14124, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 14139, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 14153, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 14168, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 14182, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 14197, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 14211, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 14226, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 14241, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 14267, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 14301, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 14332, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 14365, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 14396, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 14411, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 14433, 0x00008008 }, /* GL_MAX */
+ { 14440, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 14463, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 14489, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 14522, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 14548, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 14582, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 14601, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 14630, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 14662, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 14698, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 14738, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 14764, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 14794, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 14819, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 14848, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 14877, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 14910, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 14934, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 14958, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 14982, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 15007, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 15025, 0x00008008 }, /* GL_MAX_EXT */
+ { 15036, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 15075, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 15089, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 15109, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 15147, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 15176, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 15200, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 15228, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 15251, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 15288, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 15324, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 15351, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 15380, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 15414, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 15450, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 15477, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 15509, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 15545, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 15574, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 15603, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 15631, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 15669, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 15713, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 15756, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 15790, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 15829, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 15866, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 15904, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 15947, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 15990, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 16020, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 16051, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 16087, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 16123, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 16153, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 16187, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 16220, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 16249, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 16269, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 16293, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 16319, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 16350, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 16374, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 16408, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 16428, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 16455, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 16476, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 16501, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 16526, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 16561, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 16587, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 16613, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 16651, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 16688, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 16712, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 16733, 0x00008007 }, /* GL_MIN */
+ { 16740, 0x0000802E }, /* GL_MINMAX */
+ { 16750, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 16764, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 16781, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 16802, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 16817, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 16836, 0x00008007 }, /* GL_MIN_EXT */
+ { 16847, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 16866, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 16889, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 16912, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 16932, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 16952, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 16982, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 17010, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 17038, 0x00001700 }, /* GL_MODELVIEW */
+ { 17051, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 17069, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 17088, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 17107, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 17126, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 17145, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 17164, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 17183, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 17202, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 17221, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 17240, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 17259, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 17277, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 17296, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 17315, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 17334, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 17353, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 17372, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 17391, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 17410, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 17429, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 17448, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 17467, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 17485, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 17504, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 17523, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 17541, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 17559, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 17577, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 17595, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 17613, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 17631, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 17649, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 17669, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 17696, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 17721, 0x00002100 }, /* GL_MODULATE */
+ { 17733, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 17753, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 17780, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 17805, 0x00000103 }, /* GL_MULT */
+ { 17813, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 17828, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 17848, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 17867, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 17886, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 17910, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 17933, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 17963, 0x00002A25 }, /* GL_N3F_V3F */
+ { 17974, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 17994, 0x0000150E }, /* GL_NAND */
+ { 18002, 0x00002600 }, /* GL_NEAREST */
+ { 18013, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 18044, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 18076, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 18101, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 18127, 0x00000200 }, /* GL_NEVER */
+ { 18136, 0x00001102 }, /* GL_NICEST */
+ { 18146, 0x00000000 }, /* GL_NONE */
+ { 18154, 0x00001505 }, /* GL_NOOP */
+ { 18162, 0x00001508 }, /* GL_NOR */
+ { 18169, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 18182, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 18198, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 18229, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 18264, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 18288, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 18311, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 18332, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 18346, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 18364, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 18381, 0x00000205 }, /* GL_NOTEQUAL */
+ { 18393, 0x00000000 }, /* GL_NO_ERROR */
+ { 18405, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 18439, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 18477, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 18509, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 18551, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 18581, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 18621, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 18652, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 18681, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 18709, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 18739, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 18756, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 18782, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 18798, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 18833, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 18855, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 18874, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 18904, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 18925, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 18953, 0x00000001 }, /* GL_ONE */
+ { 18960, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 18988, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 19020, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 19048, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 19080, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 19103, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 19126, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 19149, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 19172, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 19190, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 19212, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 19234, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 19250, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 19270, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 19290, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 19308, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 19330, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 19352, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 19368, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 19388, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 19408, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 19426, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 19448, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 19470, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 19486, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 19506, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 19526, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 19547, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 19566, 0x00001507 }, /* GL_OR */
+ { 19572, 0x00000A01 }, /* GL_ORDER */
+ { 19581, 0x0000150D }, /* GL_OR_INVERTED */
+ { 19596, 0x0000150B }, /* GL_OR_REVERSE */
+ { 19610, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 19627, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 19645, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 19666, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 19686, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 19704, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 19723, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 19743, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 19763, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 19781, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 19800, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 19825, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 19849, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 19870, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 19892, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 19914, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 19939, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 19963, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 19984, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 20006, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 20028, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 20050, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 20081, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 20101, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 20126, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 20146, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 20171, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 20191, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 20216, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 20236, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 20261, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 20281, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 20306, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 20326, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 20351, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 20371, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 20396, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 20416, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 20441, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 20461, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 20486, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 20506, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 20531, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 20549, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 20582, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 20607, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 20642, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 20669, 0x00001B00 }, /* GL_POINT */
+ { 20678, 0x00000000 }, /* GL_POINTS */
+ { 20688, 0x00000002 }, /* GL_POINT_BIT */
+ { 20701, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 20731, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 20765, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 20799, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 20834, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 20863, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 20896, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 20929, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 20963, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 20977, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 21003, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 21021, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 21043, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 21065, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 21088, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 21106, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 21128, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 21150, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 21173, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 21193, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 21209, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 21230, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 21250, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 21279, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 21298, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 21324, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 21339, 0x00000009 }, /* GL_POLYGON */
+ { 21350, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 21365, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 21381, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 21404, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 21429, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 21452, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 21475, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 21499, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 21523, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 21541, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 21564, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 21583, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 21606, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 21623, 0x00001203 }, /* GL_POSITION */
+ { 21635, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 21667, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 21703, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 21736, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 21773, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 21804, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 21839, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 21871, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 21907, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 21940, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 21972, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 22008, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 22041, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 22078, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 22108, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 22142, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 22173, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 22208, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 22239, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 22274, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 22306, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 22342, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 22372, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 22406, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 22437, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 22472, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 22504, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 22535, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 22570, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 22602, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 22638, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 22667, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 22700, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 22730, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 22764, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 22803, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 22836, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 22876, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 22910, 0x00008578 }, /* GL_PREVIOUS */
+ { 22922, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 22938, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 22954, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 22971, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 22992, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 23013, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 23046, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 23078, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 23101, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 23124, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 23154, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 23183, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 23211, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 23233, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 23261, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 23289, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 23311, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 23332, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 23372, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 23411, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 23441, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 23476, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 23509, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 23543, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 23582, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 23621, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 23643, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 23669, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 23693, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 23716, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 23738, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 23759, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 23780, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 23807, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 23839, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 23871, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 23906, 0x00001701 }, /* GL_PROJECTION */
+ { 23920, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 23941, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 23967, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 23988, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 24007, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 24030, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 24069, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 24107, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 24127, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 24151, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 24171, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 24195, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 24215, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 24248, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 24274, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 24304, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 24335, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 24365, 0x00002003 }, /* GL_Q */
+ { 24370, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 24395, 0x00000007 }, /* GL_QUADS */
+ { 24404, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 24421, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 24435, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 24457, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 24483, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 24499, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 24519, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 24545, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 24575, 0x00002002 }, /* GL_R */
+ { 24580, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 24592, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 24625, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 24640, 0x000088B8 }, /* GL_READ_ONLY */
+ { 24653, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 24670, 0x000088BA }, /* GL_READ_WRITE */
+ { 24684, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 24702, 0x00001903 }, /* GL_RED */
+ { 24709, 0x00008016 }, /* GL_REDUCE */
+ { 24719, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 24733, 0x00000D15 }, /* GL_RED_BIAS */
+ { 24745, 0x00000D52 }, /* GL_RED_BITS */
+ { 24757, 0x00000D14 }, /* GL_RED_SCALE */
+ { 24770, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 24788, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 24810, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 24831, 0x00001C00 }, /* GL_RENDER */
+ { 24841, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 24869, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 24889, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 24916, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 24952, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 24978, 0x00001F01 }, /* GL_RENDERER */
+ { 24990, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 25005, 0x00002901 }, /* GL_REPEAT */
+ { 25015, 0x00001E01 }, /* GL_REPLACE */
+ { 25026, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 25041, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 25064, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 25082, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 25104, 0x00000102 }, /* GL_RETURN */
+ { 25114, 0x00001907 }, /* GL_RGB */
+ { 25121, 0x00008052 }, /* GL_RGB10 */
+ { 25130, 0x00008059 }, /* GL_RGB10_A2 */
+ { 25142, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 25158, 0x00008052 }, /* GL_RGB10_EXT */
+ { 25171, 0x00008053 }, /* GL_RGB12 */
+ { 25180, 0x00008053 }, /* GL_RGB12_EXT */
+ { 25193, 0x00008054 }, /* GL_RGB16 */
+ { 25202, 0x00008054 }, /* GL_RGB16_EXT */
+ { 25215, 0x0000804E }, /* GL_RGB2_EXT */
+ { 25227, 0x0000804F }, /* GL_RGB4 */
+ { 25235, 0x0000804F }, /* GL_RGB4_EXT */
+ { 25247, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 25260, 0x00008050 }, /* GL_RGB5 */
+ { 25268, 0x00008057 }, /* GL_RGB5_A1 */
+ { 25279, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 25294, 0x00008050 }, /* GL_RGB5_EXT */
+ { 25306, 0x00008051 }, /* GL_RGB8 */
+ { 25314, 0x00008051 }, /* GL_RGB8_EXT */
+ { 25326, 0x00001908 }, /* GL_RGBA */
+ { 25334, 0x0000805A }, /* GL_RGBA12 */
+ { 25344, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 25358, 0x0000805B }, /* GL_RGBA16 */
+ { 25368, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 25382, 0x00008055 }, /* GL_RGBA2 */
+ { 25391, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 25404, 0x00008056 }, /* GL_RGBA4 */
+ { 25413, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 25432, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 25445, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 25459, 0x00008058 }, /* GL_RGBA8 */
+ { 25468, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 25481, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 25499, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 25512, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 25525, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 25537, 0x00008573 }, /* GL_RGB_SCALE */
+ { 25550, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 25567, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 25584, 0x00000407 }, /* GL_RIGHT */
+ { 25593, 0x00002000 }, /* GL_S */
+ { 25598, 0x000080A9 }, /* GL_SAMPLES */
+ { 25609, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 25625, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 25640, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 25658, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 25680, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 25708, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 25740, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 25763, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 25790, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 25808, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 25831, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 25853, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 25872, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 25895, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 25921, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 25951, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 25976, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 26005, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 26020, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 26035, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 26051, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 26076, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 26116, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 26160, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 26193, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 26223, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 26255, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 26285, 0x00001C02 }, /* GL_SELECT */
+ { 26295, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 26323, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 26348, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 26364, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 26391, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 26422, 0x0000150F }, /* GL_SET */
+ { 26429, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 26450, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 26465, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 26488, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 26518, 0x00001601 }, /* GL_SHININESS */
+ { 26531, 0x00001402 }, /* GL_SHORT */
+ { 26540, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 26556, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 26576, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 26595, 0x00001D01 }, /* GL_SMOOTH */
+ { 26605, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 26638, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 26665, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 26698, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 26725, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 26742, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 26763, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 26784, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 26799, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 26818, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 26837, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 26854, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 26875, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 26896, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 26911, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 26930, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 26949, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 26966, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 26987, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 27008, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 27023, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 27042, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 27061, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 27081, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 27099, 0x00001202 }, /* GL_SPECULAR */
+ { 27111, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 27125, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 27140, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 27158, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 27175, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 27189, 0x00008580 }, /* GL_SRC0_RGB */
+ { 27201, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 27215, 0x00008581 }, /* GL_SRC1_RGB */
+ { 27227, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 27241, 0x00008582 }, /* GL_SRC2_RGB */
+ { 27253, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 27266, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 27288, 0x00000300 }, /* GL_SRC_COLOR */
+ { 27301, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 27319, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 27338, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 27353, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 27372, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 27387, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 27406, 0x000088E5 }, /* GL_STATIC_READ */
+ { 27421, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 27440, 0x00001802 }, /* GL_STENCIL */
+ { 27451, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 27477, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 27493, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 27515, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 27538, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 27554, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 27570, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 27587, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 27610, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 27632, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 27654, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 27676, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 27697, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 27724, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 27751, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 27766, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 27782, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 27811, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 27833, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 27854, 0x00000C33 }, /* GL_STEREO */
+ { 27864, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 27879, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 27898, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 27913, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 27932, 0x000088E1 }, /* GL_STREAM_READ */
+ { 27947, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 27966, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 27983, 0x000084E7 }, /* GL_SUBTRACT */
+ { 27995, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 28011, 0x00002001 }, /* GL_T */
+ { 28016, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 28031, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 28050, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 28066, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 28081, 0x00002A27 }, /* GL_T2F_V3F */
+ { 28092, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 28111, 0x00002A28 }, /* GL_T4F_V4F */
+ { 28122, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 28145, 0x00001702 }, /* GL_TEXTURE */
+ { 28156, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 28168, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 28184, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 28196, 0x000084CA }, /* GL_TEXTURE10 */
+ { 28209, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 28226, 0x000084CB }, /* GL_TEXTURE11 */
+ { 28239, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 28256, 0x000084CC }, /* GL_TEXTURE12 */
+ { 28269, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 28286, 0x000084CD }, /* GL_TEXTURE13 */
+ { 28299, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 28316, 0x000084CE }, /* GL_TEXTURE14 */
+ { 28329, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 28346, 0x000084CF }, /* GL_TEXTURE15 */
+ { 28359, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 28376, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 28389, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 28406, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 28419, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 28436, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 28449, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 28466, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 28479, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 28496, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 28512, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 28524, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 28537, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 28554, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 28567, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 28584, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 28597, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 28614, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 28627, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 28644, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 28657, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 28674, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 28687, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 28704, 0x000084DA }, /* GL_TEXTURE26 */
+ { 28717, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 28734, 0x000084DB }, /* GL_TEXTURE27 */
+ { 28747, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 28764, 0x000084DC }, /* GL_TEXTURE28 */
+ { 28777, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 28794, 0x000084DD }, /* GL_TEXTURE29 */
+ { 28807, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 28824, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 28840, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 28852, 0x000084DE }, /* GL_TEXTURE30 */
+ { 28865, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 28882, 0x000084DF }, /* GL_TEXTURE31 */
+ { 28895, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 28912, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 28928, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 28940, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 28956, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 28968, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 28984, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 28996, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 29012, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 29024, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 29040, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 29052, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 29068, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 29080, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 29096, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 29110, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 29124, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 29138, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 29160, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 29186, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 29208, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 29230, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 29252, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 29274, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 29302, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 29334, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 29367, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 29399, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 29414, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 29435, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 29460, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 29478, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 29502, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 29533, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 29563, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 29593, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 29628, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 29659, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 29697, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 29724, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 29756, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 29790, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 29814, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 29842, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 29866, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 29894, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 29927, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 29951, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 29973, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 29995, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 30021, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 30055, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 30088, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 30125, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 30153, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 30185, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 30208, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 30246, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 30288, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 30319, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 30347, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 30377, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 30405, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 30425, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 30449, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 30480, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 30515, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 30546, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 30581, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 30612, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 30647, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 30678, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 30713, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 30744, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 30779, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 30810, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 30845, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 30862, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 30884, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 30910, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 30925, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 30946, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 30966, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 30992, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 31012, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 31029, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 31046, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 31063, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 31080, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 31105, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 31127, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 31153, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 31171, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 31197, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 31223, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 31253, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 31280, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 31305, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 31325, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 31349, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 31376, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 31403, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 31430, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 31456, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 31486, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 31508, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 31526, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 31556, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 31584, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 31612, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 31640, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 31661, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 31680, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 31702, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 31721, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 31741, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 31766, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 31790, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 31810, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 31834, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 31854, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 31877, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 31902, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 31936, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 31953, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 31971, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 31989, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 32007, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 32026, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 32055, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 32072, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 32098, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 32128, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 32160, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 32190, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 32224, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 32240, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 32271, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 32306, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 32334, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 32366, 0x00000004 }, /* GL_TRIANGLES */
+ { 32379, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 32395, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 32416, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 32434, 0x00000001 }, /* GL_TRUE */
+ { 32442, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 32462, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 32485, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 32505, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 32526, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 32548, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 32570, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 32590, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 32611, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 32628, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 32655, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 32678, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 32694, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 32721, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 32745, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 32776, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 32800, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 32828, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 32846, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 32876, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 32902, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 32932, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 32958, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 32982, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 33010, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 33038, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 33065, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 33097, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 33128, 0x00002A20 }, /* GL_V2F */
+ { 33135, 0x00002A21 }, /* GL_V3F */
+ { 33142, 0x00001F00 }, /* GL_VENDOR */
+ { 33152, 0x00001F02 }, /* GL_VERSION */
+ { 33163, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 33179, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 33210, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 33245, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 33269, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 33290, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 33313, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 33334, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 33361, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 33389, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 33417, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 33445, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 33473, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 33501, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 33529, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 33556, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 33583, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 33610, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 33637, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 33664, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 33691, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 33718, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 33745, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 33772, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 33810, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 33852, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 33887, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 33925, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 33960, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 33992, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 34026, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 34058, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 34078, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 34100, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 34129, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 34150, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 34183, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 34215, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 34246, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 34276, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 34297, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 34324, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 34336, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 34352, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 34372, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 34403, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 34438, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 34466, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 34491, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 34518, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 34543, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 34567, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 34586, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 34600, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 34618, 0x00001506 }, /* GL_XOR */
+ { 34625, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 34644, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 34658, 0x00000000 }, /* GL_ZERO */
+ { 34666, 0x00000D16 }, /* GL_ZOOM_X */
+ { 34676, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1233] =
+static const unsigned reduced_enums[1236] =
{
26, /* GL_ALL_CLIENT_ATTRIB_BITS */
389, /* GL_FALSE */
- 562, /* GL_LINES */
- 564, /* GL_LINE_LOOP */
- 571, /* GL_LINE_STRIP */
- 1516, /* GL_TRIANGLES */
- 1519, /* GL_TRIANGLE_STRIP */
- 1517, /* GL_TRIANGLE_FAN */
- 1113, /* GL_QUADS */
- 1115, /* GL_QUAD_STRIP */
- 1003, /* GL_POLYGON */
- 1015, /* GL_POLYGON_STIPPLE_BIT */
- 969, /* GL_PIXEL_MODE_BIT */
- 549, /* GL_LIGHTING_BIT */
+ 566, /* GL_LINES */
+ 568, /* GL_LINE_LOOP */
+ 575, /* GL_LINE_STRIP */
+ 1520, /* GL_TRIANGLES */
+ 1523, /* GL_TRIANGLE_STRIP */
+ 1521, /* GL_TRIANGLE_FAN */
+ 1117, /* GL_QUADS */
+ 1119, /* GL_QUAD_STRIP */
+ 1007, /* GL_POLYGON */
+ 1019, /* GL_POLYGON_STIPPLE_BIT */
+ 973, /* GL_PIXEL_MODE_BIT */
+ 553, /* GL_LIGHTING_BIT */
405, /* GL_FOG_BIT */
8, /* GL_ACCUM */
- 580, /* GL_LOAD */
- 1153, /* GL_RETURN */
- 842, /* GL_MULT */
+ 584, /* GL_LOAD */
+ 1157, /* GL_RETURN */
+ 846, /* GL_MULT */
19, /* GL_ADD */
- 858, /* GL_NEVER */
- 539, /* GL_LESS */
+ 862, /* GL_NEVER */
+ 543, /* GL_LESS */
379, /* GL_EQUAL */
- 538, /* GL_LEQUAL */
- 468, /* GL_GREATER */
- 873, /* GL_NOTEQUAL */
+ 542, /* GL_LEQUAL */
+ 472, /* GL_GREATER */
+ 877, /* GL_NOTEQUAL */
466, /* GL_GEQUAL */
42, /* GL_ALWAYS */
- 1277, /* GL_SRC_COLOR */
- 902, /* GL_ONE_MINUS_SRC_COLOR */
- 1275, /* GL_SRC_ALPHA */
- 901, /* GL_ONE_MINUS_SRC_ALPHA */
+ 1281, /* GL_SRC_COLOR */
+ 906, /* GL_ONE_MINUS_SRC_COLOR */
+ 1279, /* GL_SRC_ALPHA */
+ 905, /* GL_ONE_MINUS_SRC_ALPHA */
359, /* GL_DST_ALPHA */
- 899, /* GL_ONE_MINUS_DST_ALPHA */
+ 903, /* GL_ONE_MINUS_DST_ALPHA */
360, /* GL_DST_COLOR */
- 900, /* GL_ONE_MINUS_DST_COLOR */
- 1276, /* GL_SRC_ALPHA_SATURATE */
+ 904, /* GL_ONE_MINUS_DST_COLOR */
+ 1280, /* GL_SRC_ALPHA_SATURATE */
454, /* GL_FRONT_LEFT */
455, /* GL_FRONT_RIGHT */
64, /* GL_BACK_LEFT */
65, /* GL_BACK_RIGHT */
451, /* GL_FRONT */
63, /* GL_BACK */
- 537, /* GL_LEFT */
- 1193, /* GL_RIGHT */
+ 541, /* GL_LEFT */
+ 1197, /* GL_RIGHT */
452, /* GL_FRONT_AND_BACK */
58, /* GL_AUX0 */
59, /* GL_AUX1 */
60, /* GL_AUX2 */
61, /* GL_AUX3 */
- 529, /* GL_INVALID_ENUM */
- 532, /* GL_INVALID_VALUE */
- 531, /* GL_INVALID_OPERATION */
- 1278, /* GL_STACK_OVERFLOW */
- 1279, /* GL_STACK_UNDERFLOW */
- 927, /* GL_OUT_OF_MEMORY */
- 530, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ 533, /* GL_INVALID_ENUM */
+ 536, /* GL_INVALID_VALUE */
+ 535, /* GL_INVALID_OPERATION */
+ 1282, /* GL_STACK_OVERFLOW */
+ 1283, /* GL_STACK_UNDERFLOW */
+ 931, /* GL_OUT_OF_MEMORY */
+ 534, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 947, /* GL_PASS_THROUGH_TOKEN */
- 1002, /* GL_POINT_TOKEN */
- 572, /* GL_LINE_TOKEN */
- 1016, /* GL_POLYGON_TOKEN */
+ 951, /* GL_PASS_THROUGH_TOKEN */
+ 1006, /* GL_POINT_TOKEN */
+ 576, /* GL_LINE_TOKEN */
+ 1020, /* GL_POLYGON_TOKEN */
69, /* GL_BITMAP_TOKEN */
358, /* GL_DRAW_PIXEL_TOKEN */
248, /* GL_COPY_PIXEL_TOKEN */
- 565, /* GL_LINE_RESET_TOKEN */
+ 569, /* GL_LINE_RESET_TOKEN */
382, /* GL_EXP */
383, /* GL_EXP2 */
279, /* GL_CW */
106, /* GL_CCW */
127, /* GL_COEFF */
- 924, /* GL_ORDER */
+ 928, /* GL_ORDER */
315, /* GL_DOMAIN */
256, /* GL_CURRENT_COLOR */
259, /* GL_CURRENT_INDEX */
@@ -3356,33 +3364,33 @@ static const unsigned reduced_enums[1233] =
272, /* GL_CURRENT_RASTER_POSITION */
273, /* GL_CURRENT_RASTER_POSITION_VALID */
270, /* GL_CURRENT_RASTER_DISTANCE */
- 996, /* GL_POINT_SMOOTH */
- 985, /* GL_POINT_SIZE */
- 995, /* GL_POINT_SIZE_RANGE */
- 986, /* GL_POINT_SIZE_GRANULARITY */
- 566, /* GL_LINE_SMOOTH */
- 573, /* GL_LINE_WIDTH */
- 575, /* GL_LINE_WIDTH_RANGE */
- 574, /* GL_LINE_WIDTH_GRANULARITY */
- 568, /* GL_LINE_STIPPLE */
- 569, /* GL_LINE_STIPPLE_PATTERN */
- 570, /* GL_LINE_STIPPLE_REPEAT */
- 579, /* GL_LIST_MODE */
- 733, /* GL_MAX_LIST_NESTING */
- 576, /* GL_LIST_BASE */
- 578, /* GL_LIST_INDEX */
- 1005, /* GL_POLYGON_MODE */
- 1012, /* GL_POLYGON_SMOOTH */
- 1014, /* GL_POLYGON_STIPPLE */
+ 1000, /* GL_POINT_SMOOTH */
+ 989, /* GL_POINT_SIZE */
+ 999, /* GL_POINT_SIZE_RANGE */
+ 990, /* GL_POINT_SIZE_GRANULARITY */
+ 570, /* GL_LINE_SMOOTH */
+ 577, /* GL_LINE_WIDTH */
+ 579, /* GL_LINE_WIDTH_RANGE */
+ 578, /* GL_LINE_WIDTH_GRANULARITY */
+ 572, /* GL_LINE_STIPPLE */
+ 573, /* GL_LINE_STIPPLE_PATTERN */
+ 574, /* GL_LINE_STIPPLE_REPEAT */
+ 583, /* GL_LIST_MODE */
+ 737, /* GL_MAX_LIST_NESTING */
+ 580, /* GL_LIST_BASE */
+ 582, /* GL_LIST_INDEX */
+ 1009, /* GL_POLYGON_MODE */
+ 1016, /* GL_POLYGON_SMOOTH */
+ 1018, /* GL_POLYGON_STIPPLE */
367, /* GL_EDGE_FLAG */
249, /* GL_CULL_FACE */
250, /* GL_CULL_FACE_MODE */
453, /* GL_FRONT_FACE */
- 548, /* GL_LIGHTING */
- 553, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 554, /* GL_LIGHT_MODEL_TWO_SIDE */
- 550, /* GL_LIGHT_MODEL_AMBIENT */
- 1231, /* GL_SHADE_MODEL */
+ 552, /* GL_LIGHTING */
+ 557, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 558, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 554, /* GL_LIGHT_MODEL_AMBIENT */
+ 1235, /* GL_SHADE_MODEL */
158, /* GL_COLOR_MATERIAL_FACE */
159, /* GL_COLOR_MATERIAL_PARAMETER */
157, /* GL_COLOR_MATERIAL */
@@ -3399,24 +3407,24 @@ static const unsigned reduced_enums[1233] =
292, /* GL_DEPTH_CLEAR_VALUE */
303, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1302, /* GL_STENCIL_TEST */
- 1290, /* GL_STENCIL_CLEAR_VALUE */
- 1292, /* GL_STENCIL_FUNC */
- 1304, /* GL_STENCIL_VALUE_MASK */
- 1291, /* GL_STENCIL_FAIL */
- 1299, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1300, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1301, /* GL_STENCIL_REF */
- 1305, /* GL_STENCIL_WRITEMASK */
- 706, /* GL_MATRIX_MODE */
- 863, /* GL_NORMALIZE */
- 1594, /* GL_VIEWPORT */
- 837, /* GL_MODELVIEW_STACK_DEPTH */
- 1095, /* GL_PROJECTION_STACK_DEPTH */
- 1496, /* GL_TEXTURE_STACK_DEPTH */
- 835, /* GL_MODELVIEW_MATRIX */
- 1094, /* GL_PROJECTION_MATRIX */
- 1481, /* GL_TEXTURE_MATRIX */
+ 1306, /* GL_STENCIL_TEST */
+ 1294, /* GL_STENCIL_CLEAR_VALUE */
+ 1296, /* GL_STENCIL_FUNC */
+ 1308, /* GL_STENCIL_VALUE_MASK */
+ 1295, /* GL_STENCIL_FAIL */
+ 1303, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1304, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1305, /* GL_STENCIL_REF */
+ 1309, /* GL_STENCIL_WRITEMASK */
+ 710, /* GL_MATRIX_MODE */
+ 867, /* GL_NORMALIZE */
+ 1598, /* GL_VIEWPORT */
+ 841, /* GL_MODELVIEW_STACK_DEPTH */
+ 1099, /* GL_PROJECTION_STACK_DEPTH */
+ 1500, /* GL_TEXTURE_STACK_DEPTH */
+ 839, /* GL_MODELVIEW_MATRIX */
+ 1098, /* GL_PROJECTION_MATRIX */
+ 1485, /* GL_TEXTURE_MATRIX */
56, /* GL_ATTRIB_STACK_DEPTH */
117, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
39, /* GL_ALPHA_TEST */
@@ -3426,161 +3434,161 @@ static const unsigned reduced_enums[1233] =
73, /* GL_BLEND_DST */
80, /* GL_BLEND_SRC */
70, /* GL_BLEND */
- 582, /* GL_LOGIC_OP_MODE */
- 507, /* GL_INDEX_LOGIC_OP */
+ 586, /* GL_LOGIC_OP_MODE */
+ 511, /* GL_INDEX_LOGIC_OP */
156, /* GL_COLOR_LOGIC_OP */
62, /* GL_AUX_BUFFERS */
325, /* GL_DRAW_BUFFER */
- 1125, /* GL_READ_BUFFER */
- 1214, /* GL_SCISSOR_BOX */
- 1215, /* GL_SCISSOR_TEST */
- 506, /* GL_INDEX_CLEAR_VALUE */
- 511, /* GL_INDEX_WRITEMASK */
+ 1129, /* GL_READ_BUFFER */
+ 1218, /* GL_SCISSOR_BOX */
+ 1219, /* GL_SCISSOR_TEST */
+ 510, /* GL_INDEX_CLEAR_VALUE */
+ 515, /* GL_INDEX_WRITEMASK */
153, /* GL_COLOR_CLEAR_VALUE */
185, /* GL_COLOR_WRITEMASK */
- 508, /* GL_INDEX_MODE */
- 1187, /* GL_RGBA_MODE */
+ 512, /* GL_INDEX_MODE */
+ 1191, /* GL_RGBA_MODE */
324, /* GL_DOUBLEBUFFER */
- 1306, /* GL_STEREO */
- 1146, /* GL_RENDER_MODE */
- 948, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 997, /* GL_POINT_SMOOTH_HINT */
- 567, /* GL_LINE_SMOOTH_HINT */
- 1013, /* GL_POLYGON_SMOOTH_HINT */
+ 1310, /* GL_STEREO */
+ 1150, /* GL_RENDER_MODE */
+ 952, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1001, /* GL_POINT_SMOOTH_HINT */
+ 571, /* GL_LINE_SMOOTH_HINT */
+ 1017, /* GL_POLYGON_SMOOTH_HINT */
425, /* GL_FOG_HINT */
- 1462, /* GL_TEXTURE_GEN_S */
- 1463, /* GL_TEXTURE_GEN_T */
- 1461, /* GL_TEXTURE_GEN_R */
- 1460, /* GL_TEXTURE_GEN_Q */
- 961, /* GL_PIXEL_MAP_I_TO_I */
- 967, /* GL_PIXEL_MAP_S_TO_S */
- 963, /* GL_PIXEL_MAP_I_TO_R */
- 959, /* GL_PIXEL_MAP_I_TO_G */
- 957, /* GL_PIXEL_MAP_I_TO_B */
- 955, /* GL_PIXEL_MAP_I_TO_A */
- 965, /* GL_PIXEL_MAP_R_TO_R */
- 953, /* GL_PIXEL_MAP_G_TO_G */
- 951, /* GL_PIXEL_MAP_B_TO_B */
- 949, /* GL_PIXEL_MAP_A_TO_A */
- 962, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 968, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 964, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 960, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 958, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 956, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 966, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 954, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 952, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 950, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 1528, /* GL_UNPACK_SWAP_BYTES */
- 1523, /* GL_UNPACK_LSB_FIRST */
- 1524, /* GL_UNPACK_ROW_LENGTH */
- 1527, /* GL_UNPACK_SKIP_ROWS */
- 1526, /* GL_UNPACK_SKIP_PIXELS */
- 1521, /* GL_UNPACK_ALIGNMENT */
- 936, /* GL_PACK_SWAP_BYTES */
- 931, /* GL_PACK_LSB_FIRST */
- 932, /* GL_PACK_ROW_LENGTH */
- 935, /* GL_PACK_SKIP_ROWS */
- 934, /* GL_PACK_SKIP_PIXELS */
- 928, /* GL_PACK_ALIGNMENT */
- 659, /* GL_MAP_COLOR */
- 660, /* GL_MAP_STENCIL */
- 510, /* GL_INDEX_SHIFT */
- 509, /* GL_INDEX_OFFSET */
- 1135, /* GL_RED_SCALE */
- 1133, /* GL_RED_BIAS */
- 1611, /* GL_ZOOM_X */
- 1612, /* GL_ZOOM_Y */
- 472, /* GL_GREEN_SCALE */
- 470, /* GL_GREEN_BIAS */
+ 1466, /* GL_TEXTURE_GEN_S */
+ 1467, /* GL_TEXTURE_GEN_T */
+ 1465, /* GL_TEXTURE_GEN_R */
+ 1464, /* GL_TEXTURE_GEN_Q */
+ 965, /* GL_PIXEL_MAP_I_TO_I */
+ 971, /* GL_PIXEL_MAP_S_TO_S */
+ 967, /* GL_PIXEL_MAP_I_TO_R */
+ 963, /* GL_PIXEL_MAP_I_TO_G */
+ 961, /* GL_PIXEL_MAP_I_TO_B */
+ 959, /* GL_PIXEL_MAP_I_TO_A */
+ 969, /* GL_PIXEL_MAP_R_TO_R */
+ 957, /* GL_PIXEL_MAP_G_TO_G */
+ 955, /* GL_PIXEL_MAP_B_TO_B */
+ 953, /* GL_PIXEL_MAP_A_TO_A */
+ 966, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 972, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 968, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 964, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 962, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 960, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 970, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 958, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 956, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 954, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 1532, /* GL_UNPACK_SWAP_BYTES */
+ 1527, /* GL_UNPACK_LSB_FIRST */
+ 1528, /* GL_UNPACK_ROW_LENGTH */
+ 1531, /* GL_UNPACK_SKIP_ROWS */
+ 1530, /* GL_UNPACK_SKIP_PIXELS */
+ 1525, /* GL_UNPACK_ALIGNMENT */
+ 940, /* GL_PACK_SWAP_BYTES */
+ 935, /* GL_PACK_LSB_FIRST */
+ 936, /* GL_PACK_ROW_LENGTH */
+ 939, /* GL_PACK_SKIP_ROWS */
+ 938, /* GL_PACK_SKIP_PIXELS */
+ 932, /* GL_PACK_ALIGNMENT */
+ 663, /* GL_MAP_COLOR */
+ 664, /* GL_MAP_STENCIL */
+ 514, /* GL_INDEX_SHIFT */
+ 513, /* GL_INDEX_OFFSET */
+ 1139, /* GL_RED_SCALE */
+ 1137, /* GL_RED_BIAS */
+ 1615, /* GL_ZOOM_X */
+ 1616, /* GL_ZOOM_Y */
+ 476, /* GL_GREEN_SCALE */
+ 474, /* GL_GREEN_BIAS */
86, /* GL_BLUE_SCALE */
84, /* GL_BLUE_BIAS */
38, /* GL_ALPHA_SCALE */
36, /* GL_ALPHA_BIAS */
305, /* GL_DEPTH_SCALE */
286, /* GL_DEPTH_BIAS */
- 729, /* GL_MAX_EVAL_ORDER */
- 732, /* GL_MAX_LIGHTS */
- 714, /* GL_MAX_CLIP_PLANES */
- 774, /* GL_MAX_TEXTURE_SIZE */
- 738, /* GL_MAX_PIXEL_MAP_TABLE */
- 710, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 735, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 736, /* GL_MAX_NAME_STACK_DEPTH */
- 764, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 775, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 785, /* GL_MAX_VIEWPORT_DIMS */
- 711, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1313, /* GL_SUBPIXEL_BITS */
- 505, /* GL_INDEX_BITS */
- 1134, /* GL_RED_BITS */
- 471, /* GL_GREEN_BITS */
+ 733, /* GL_MAX_EVAL_ORDER */
+ 736, /* GL_MAX_LIGHTS */
+ 718, /* GL_MAX_CLIP_PLANES */
+ 778, /* GL_MAX_TEXTURE_SIZE */
+ 742, /* GL_MAX_PIXEL_MAP_TABLE */
+ 714, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 739, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 740, /* GL_MAX_NAME_STACK_DEPTH */
+ 768, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 779, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 789, /* GL_MAX_VIEWPORT_DIMS */
+ 715, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1317, /* GL_SUBPIXEL_BITS */
+ 509, /* GL_INDEX_BITS */
+ 1138, /* GL_RED_BITS */
+ 475, /* GL_GREEN_BITS */
85, /* GL_BLUE_BITS */
37, /* GL_ALPHA_BITS */
287, /* GL_DEPTH_BITS */
- 1288, /* GL_STENCIL_BITS */
+ 1292, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
9, /* GL_ACCUM_ALPHA_BITS */
- 851, /* GL_NAME_STACK_DEPTH */
+ 855, /* GL_NAME_STACK_DEPTH */
57, /* GL_AUTO_NORMAL */
- 605, /* GL_MAP1_COLOR_4 */
- 608, /* GL_MAP1_INDEX */
- 609, /* GL_MAP1_NORMAL */
- 610, /* GL_MAP1_TEXTURE_COORD_1 */
- 611, /* GL_MAP1_TEXTURE_COORD_2 */
- 612, /* GL_MAP1_TEXTURE_COORD_3 */
- 613, /* GL_MAP1_TEXTURE_COORD_4 */
- 614, /* GL_MAP1_VERTEX_3 */
- 615, /* GL_MAP1_VERTEX_4 */
- 632, /* GL_MAP2_COLOR_4 */
- 635, /* GL_MAP2_INDEX */
- 636, /* GL_MAP2_NORMAL */
- 637, /* GL_MAP2_TEXTURE_COORD_1 */
- 638, /* GL_MAP2_TEXTURE_COORD_2 */
- 639, /* GL_MAP2_TEXTURE_COORD_3 */
- 640, /* GL_MAP2_TEXTURE_COORD_4 */
- 641, /* GL_MAP2_VERTEX_3 */
- 642, /* GL_MAP2_VERTEX_4 */
- 606, /* GL_MAP1_GRID_DOMAIN */
- 607, /* GL_MAP1_GRID_SEGMENTS */
- 633, /* GL_MAP2_GRID_DOMAIN */
- 634, /* GL_MAP2_GRID_SEGMENTS */
- 1390, /* GL_TEXTURE_1D */
- 1391, /* GL_TEXTURE_2D */
+ 609, /* GL_MAP1_COLOR_4 */
+ 612, /* GL_MAP1_INDEX */
+ 613, /* GL_MAP1_NORMAL */
+ 614, /* GL_MAP1_TEXTURE_COORD_1 */
+ 615, /* GL_MAP1_TEXTURE_COORD_2 */
+ 616, /* GL_MAP1_TEXTURE_COORD_3 */
+ 617, /* GL_MAP1_TEXTURE_COORD_4 */
+ 618, /* GL_MAP1_VERTEX_3 */
+ 619, /* GL_MAP1_VERTEX_4 */
+ 636, /* GL_MAP2_COLOR_4 */
+ 639, /* GL_MAP2_INDEX */
+ 640, /* GL_MAP2_NORMAL */
+ 641, /* GL_MAP2_TEXTURE_COORD_1 */
+ 642, /* GL_MAP2_TEXTURE_COORD_2 */
+ 643, /* GL_MAP2_TEXTURE_COORD_3 */
+ 644, /* GL_MAP2_TEXTURE_COORD_4 */
+ 645, /* GL_MAP2_VERTEX_3 */
+ 646, /* GL_MAP2_VERTEX_4 */
+ 610, /* GL_MAP1_GRID_DOMAIN */
+ 611, /* GL_MAP1_GRID_SEGMENTS */
+ 637, /* GL_MAP2_GRID_DOMAIN */
+ 638, /* GL_MAP2_GRID_SEGMENTS */
+ 1394, /* GL_TEXTURE_1D */
+ 1395, /* GL_TEXTURE_2D */
392, /* GL_FEEDBACK_BUFFER_POINTER */
393, /* GL_FEEDBACK_BUFFER_SIZE */
394, /* GL_FEEDBACK_BUFFER_TYPE */
- 1224, /* GL_SELECTION_BUFFER_POINTER */
- 1225, /* GL_SELECTION_BUFFER_SIZE */
- 1499, /* GL_TEXTURE_WIDTH */
- 1467, /* GL_TEXTURE_HEIGHT */
- 1423, /* GL_TEXTURE_COMPONENTS */
- 1407, /* GL_TEXTURE_BORDER_COLOR */
- 1406, /* GL_TEXTURE_BORDER */
+ 1228, /* GL_SELECTION_BUFFER_POINTER */
+ 1229, /* GL_SELECTION_BUFFER_SIZE */
+ 1503, /* GL_TEXTURE_WIDTH */
+ 1471, /* GL_TEXTURE_HEIGHT */
+ 1427, /* GL_TEXTURE_COMPONENTS */
+ 1411, /* GL_TEXTURE_BORDER_COLOR */
+ 1410, /* GL_TEXTURE_BORDER */
316, /* GL_DONT_CARE */
390, /* GL_FASTEST */
- 859, /* GL_NICEST */
+ 863, /* GL_NICEST */
43, /* GL_AMBIENT */
313, /* GL_DIFFUSE */
- 1264, /* GL_SPECULAR */
- 1017, /* GL_POSITION */
- 1267, /* GL_SPOT_DIRECTION */
- 1268, /* GL_SPOT_EXPONENT */
- 1266, /* GL_SPOT_CUTOFF */
+ 1268, /* GL_SPECULAR */
+ 1021, /* GL_POSITION */
+ 1271, /* GL_SPOT_DIRECTION */
+ 1272, /* GL_SPOT_EXPONENT */
+ 1270, /* GL_SPOT_CUTOFF */
223, /* GL_CONSTANT_ATTENUATION */
- 557, /* GL_LINEAR_ATTENUATION */
- 1112, /* GL_QUADRATIC_ATTENUATION */
+ 561, /* GL_LINEAR_ATTENUATION */
+ 1116, /* GL_QUADRATIC_ATTENUATION */
198, /* GL_COMPILE */
199, /* GL_COMPILE_AND_EXECUTE */
101, /* GL_BYTE */
- 1529, /* GL_UNSIGNED_BYTE */
- 1235, /* GL_SHORT */
- 1538, /* GL_UNSIGNED_SHORT */
- 512, /* GL_INT */
- 1532, /* GL_UNSIGNED_INT */
+ 1533, /* GL_UNSIGNED_BYTE */
+ 1239, /* GL_SHORT */
+ 1542, /* GL_UNSIGNED_SHORT */
+ 516, /* GL_INT */
+ 1536, /* GL_UNSIGNED_INT */
397, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
@@ -3591,284 +3599,284 @@ static const unsigned reduced_enums[1233] =
47, /* GL_AND_REVERSE */
246, /* GL_COPY */
46, /* GL_AND_INVERTED */
- 861, /* GL_NOOP */
- 1607, /* GL_XOR */
- 923, /* GL_OR */
- 862, /* GL_NOR */
+ 865, /* GL_NOOP */
+ 1611, /* GL_XOR */
+ 927, /* GL_OR */
+ 866, /* GL_NOR */
380, /* GL_EQUIV */
- 535, /* GL_INVERT */
- 926, /* GL_OR_REVERSE */
+ 539, /* GL_INVERT */
+ 930, /* GL_OR_REVERSE */
247, /* GL_COPY_INVERTED */
- 925, /* GL_OR_INVERTED */
- 852, /* GL_NAND */
- 1229, /* GL_SET */
+ 929, /* GL_OR_INVERTED */
+ 856, /* GL_NAND */
+ 1233, /* GL_SET */
377, /* GL_EMISSION */
- 1234, /* GL_SHININESS */
+ 1238, /* GL_SHININESS */
44, /* GL_AMBIENT_AND_DIFFUSE */
155, /* GL_COLOR_INDEXES */
- 802, /* GL_MODELVIEW */
- 1093, /* GL_PROJECTION */
- 1325, /* GL_TEXTURE */
+ 806, /* GL_MODELVIEW */
+ 1097, /* GL_PROJECTION */
+ 1329, /* GL_TEXTURE */
128, /* GL_COLOR */
284, /* GL_DEPTH */
- 1286, /* GL_STENCIL */
+ 1290, /* GL_STENCIL */
154, /* GL_COLOR_INDEX */
- 1293, /* GL_STENCIL_INDEX */
+ 1297, /* GL_STENCIL_INDEX */
293, /* GL_DEPTH_COMPONENT */
- 1130, /* GL_RED */
- 469, /* GL_GREEN */
+ 1134, /* GL_RED */
+ 473, /* GL_GREEN */
83, /* GL_BLUE */
27, /* GL_ALPHA */
- 1154, /* GL_RGB */
- 1173, /* GL_RGBA */
- 583, /* GL_LUMINANCE */
- 604, /* GL_LUMINANCE_ALPHA */
+ 1158, /* GL_RGB */
+ 1177, /* GL_RGBA */
+ 587, /* GL_LUMINANCE */
+ 608, /* GL_LUMINANCE_ALPHA */
68, /* GL_BITMAP */
- 974, /* GL_POINT */
- 555, /* GL_LINE */
+ 978, /* GL_POINT */
+ 559, /* GL_LINE */
395, /* GL_FILL */
- 1139, /* GL_RENDER */
+ 1143, /* GL_RENDER */
391, /* GL_FEEDBACK */
- 1223, /* GL_SELECT */
+ 1227, /* GL_SELECT */
396, /* GL_FLAT */
- 1239, /* GL_SMOOTH */
- 536, /* GL_KEEP */
- 1148, /* GL_REPLACE */
- 496, /* GL_INCR */
+ 1243, /* GL_SMOOTH */
+ 540, /* GL_KEEP */
+ 1152, /* GL_REPLACE */
+ 500, /* GL_INCR */
281, /* GL_DECR */
- 1551, /* GL_VENDOR */
- 1145, /* GL_RENDERER */
- 1552, /* GL_VERSION */
+ 1555, /* GL_VENDOR */
+ 1149, /* GL_RENDERER */
+ 1556, /* GL_VERSION */
384, /* GL_EXTENSIONS */
- 1194, /* GL_S */
- 1316, /* GL_T */
- 1122, /* GL_R */
- 1111, /* GL_Q */
- 838, /* GL_MODULATE */
+ 1198, /* GL_S */
+ 1320, /* GL_T */
+ 1126, /* GL_R */
+ 1115, /* GL_Q */
+ 842, /* GL_MODULATE */
280, /* GL_DECAL */
- 1457, /* GL_TEXTURE_ENV_MODE */
- 1456, /* GL_TEXTURE_ENV_COLOR */
- 1455, /* GL_TEXTURE_ENV */
+ 1461, /* GL_TEXTURE_ENV_MODE */
+ 1460, /* GL_TEXTURE_ENV_COLOR */
+ 1459, /* GL_TEXTURE_ENV */
385, /* GL_EYE_LINEAR */
- 885, /* GL_OBJECT_LINEAR */
- 1265, /* GL_SPHERE_MAP */
- 1459, /* GL_TEXTURE_GEN_MODE */
- 887, /* GL_OBJECT_PLANE */
+ 889, /* GL_OBJECT_LINEAR */
+ 1269, /* GL_SPHERE_MAP */
+ 1463, /* GL_TEXTURE_GEN_MODE */
+ 891, /* GL_OBJECT_PLANE */
386, /* GL_EYE_PLANE */
- 853, /* GL_NEAREST */
- 556, /* GL_LINEAR */
- 857, /* GL_NEAREST_MIPMAP_NEAREST */
- 561, /* GL_LINEAR_MIPMAP_NEAREST */
- 856, /* GL_NEAREST_MIPMAP_LINEAR */
- 560, /* GL_LINEAR_MIPMAP_LINEAR */
- 1480, /* GL_TEXTURE_MAG_FILTER */
- 1488, /* GL_TEXTURE_MIN_FILTER */
- 1501, /* GL_TEXTURE_WRAP_S */
- 1502, /* GL_TEXTURE_WRAP_T */
+ 857, /* GL_NEAREST */
+ 560, /* GL_LINEAR */
+ 861, /* GL_NEAREST_MIPMAP_NEAREST */
+ 565, /* GL_LINEAR_MIPMAP_NEAREST */
+ 860, /* GL_NEAREST_MIPMAP_LINEAR */
+ 564, /* GL_LINEAR_MIPMAP_LINEAR */
+ 1484, /* GL_TEXTURE_MAG_FILTER */
+ 1492, /* GL_TEXTURE_MIN_FILTER */
+ 1505, /* GL_TEXTURE_WRAP_S */
+ 1506, /* GL_TEXTURE_WRAP_T */
107, /* GL_CLAMP */
- 1147, /* GL_REPEAT */
- 1011, /* GL_POLYGON_OFFSET_UNITS */
- 1010, /* GL_POLYGON_OFFSET_POINT */
- 1009, /* GL_POLYGON_OFFSET_LINE */
- 1123, /* GL_R3_G3_B2 */
- 1549, /* GL_V2F */
- 1550, /* GL_V3F */
+ 1151, /* GL_REPEAT */
+ 1015, /* GL_POLYGON_OFFSET_UNITS */
+ 1014, /* GL_POLYGON_OFFSET_POINT */
+ 1013, /* GL_POLYGON_OFFSET_LINE */
+ 1127, /* GL_R3_G3_B2 */
+ 1553, /* GL_V2F */
+ 1554, /* GL_V3F */
104, /* GL_C4UB_V2F */
105, /* GL_C4UB_V3F */
102, /* GL_C3F_V3F */
- 850, /* GL_N3F_V3F */
+ 854, /* GL_N3F_V3F */
103, /* GL_C4F_N3F_V3F */
- 1321, /* GL_T2F_V3F */
- 1323, /* GL_T4F_V4F */
- 1319, /* GL_T2F_C4UB_V3F */
- 1317, /* GL_T2F_C3F_V3F */
- 1320, /* GL_T2F_N3F_V3F */
- 1318, /* GL_T2F_C4F_N3F_V3F */
- 1322, /* GL_T4F_C4F_N3F_V4F */
+ 1325, /* GL_T2F_V3F */
+ 1327, /* GL_T4F_V4F */
+ 1323, /* GL_T2F_C4UB_V3F */
+ 1321, /* GL_T2F_C3F_V3F */
+ 1324, /* GL_T2F_N3F_V3F */
+ 1322, /* GL_T2F_C4F_N3F_V3F */
+ 1326, /* GL_T4F_C4F_N3F_V4F */
120, /* GL_CLIP_PLANE0 */
121, /* GL_CLIP_PLANE1 */
122, /* GL_CLIP_PLANE2 */
123, /* GL_CLIP_PLANE3 */
124, /* GL_CLIP_PLANE4 */
125, /* GL_CLIP_PLANE5 */
- 540, /* GL_LIGHT0 */
- 541, /* GL_LIGHT1 */
- 542, /* GL_LIGHT2 */
- 543, /* GL_LIGHT3 */
- 544, /* GL_LIGHT4 */
- 545, /* GL_LIGHT5 */
- 546, /* GL_LIGHT6 */
- 547, /* GL_LIGHT7 */
- 473, /* GL_HINT_BIT */
+ 544, /* GL_LIGHT0 */
+ 545, /* GL_LIGHT1 */
+ 546, /* GL_LIGHT2 */
+ 547, /* GL_LIGHT3 */
+ 548, /* GL_LIGHT4 */
+ 549, /* GL_LIGHT5 */
+ 550, /* GL_LIGHT6 */
+ 551, /* GL_LIGHT7 */
+ 477, /* GL_HINT_BIT */
225, /* GL_CONSTANT_COLOR */
- 897, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 901, /* GL_ONE_MINUS_CONSTANT_COLOR */
220, /* GL_CONSTANT_ALPHA */
- 895, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 899, /* GL_ONE_MINUS_CONSTANT_ALPHA */
71, /* GL_BLEND_COLOR */
456, /* GL_FUNC_ADD */
- 786, /* GL_MIN */
- 708, /* GL_MAX */
+ 790, /* GL_MIN */
+ 712, /* GL_MAX */
76, /* GL_BLEND_EQUATION */
460, /* GL_FUNC_SUBTRACT */
458, /* GL_FUNC_REVERSE_SUBTRACT */
228, /* GL_CONVOLUTION_1D */
229, /* GL_CONVOLUTION_2D */
- 1226, /* GL_SEPARABLE_2D */
+ 1230, /* GL_SEPARABLE_2D */
232, /* GL_CONVOLUTION_BORDER_MODE */
236, /* GL_CONVOLUTION_FILTER_SCALE */
234, /* GL_CONVOLUTION_FILTER_BIAS */
- 1131, /* GL_REDUCE */
+ 1135, /* GL_REDUCE */
238, /* GL_CONVOLUTION_FORMAT */
242, /* GL_CONVOLUTION_WIDTH */
240, /* GL_CONVOLUTION_HEIGHT */
- 721, /* GL_MAX_CONVOLUTION_WIDTH */
- 719, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1050, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1046, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1041, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1037, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1048, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1044, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1039, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1035, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 474, /* GL_HISTOGRAM */
- 1097, /* GL_PROXY_HISTOGRAM */
- 490, /* GL_HISTOGRAM_WIDTH */
- 480, /* GL_HISTOGRAM_FORMAT */
- 486, /* GL_HISTOGRAM_RED_SIZE */
- 482, /* GL_HISTOGRAM_GREEN_SIZE */
- 477, /* GL_HISTOGRAM_BLUE_SIZE */
- 475, /* GL_HISTOGRAM_ALPHA_SIZE */
- 484, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 488, /* GL_HISTOGRAM_SINK */
- 787, /* GL_MINMAX */
- 789, /* GL_MINMAX_FORMAT */
- 791, /* GL_MINMAX_SINK */
- 1324, /* GL_TABLE_TOO_LARGE_EXT */
- 1531, /* GL_UNSIGNED_BYTE_3_3_2 */
- 1540, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 1542, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 1536, /* GL_UNSIGNED_INT_8_8_8_8 */
- 1533, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1008, /* GL_POLYGON_OFFSET_FILL */
- 1007, /* GL_POLYGON_OFFSET_FACTOR */
- 1006, /* GL_POLYGON_OFFSET_BIAS */
- 1151, /* GL_RESCALE_NORMAL */
+ 725, /* GL_MAX_CONVOLUTION_WIDTH */
+ 723, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1054, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1050, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1045, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1041, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1052, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1048, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1043, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1039, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 478, /* GL_HISTOGRAM */
+ 1101, /* GL_PROXY_HISTOGRAM */
+ 494, /* GL_HISTOGRAM_WIDTH */
+ 484, /* GL_HISTOGRAM_FORMAT */
+ 490, /* GL_HISTOGRAM_RED_SIZE */
+ 486, /* GL_HISTOGRAM_GREEN_SIZE */
+ 481, /* GL_HISTOGRAM_BLUE_SIZE */
+ 479, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 488, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 492, /* GL_HISTOGRAM_SINK */
+ 791, /* GL_MINMAX */
+ 793, /* GL_MINMAX_FORMAT */
+ 795, /* GL_MINMAX_SINK */
+ 1328, /* GL_TABLE_TOO_LARGE_EXT */
+ 1535, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 1544, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 1546, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 1540, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 1537, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1012, /* GL_POLYGON_OFFSET_FILL */
+ 1011, /* GL_POLYGON_OFFSET_FACTOR */
+ 1010, /* GL_POLYGON_OFFSET_BIAS */
+ 1155, /* GL_RESCALE_NORMAL */
32, /* GL_ALPHA4 */
34, /* GL_ALPHA8 */
28, /* GL_ALPHA12 */
30, /* GL_ALPHA16 */
- 594, /* GL_LUMINANCE4 */
- 600, /* GL_LUMINANCE8 */
- 584, /* GL_LUMINANCE12 */
- 590, /* GL_LUMINANCE16 */
- 595, /* GL_LUMINANCE4_ALPHA4 */
- 598, /* GL_LUMINANCE6_ALPHA2 */
- 601, /* GL_LUMINANCE8_ALPHA8 */
- 587, /* GL_LUMINANCE12_ALPHA4 */
- 585, /* GL_LUMINANCE12_ALPHA12 */
- 591, /* GL_LUMINANCE16_ALPHA16 */
- 513, /* GL_INTENSITY */
- 518, /* GL_INTENSITY4 */
- 520, /* GL_INTENSITY8 */
- 514, /* GL_INTENSITY12 */
- 516, /* GL_INTENSITY16 */
- 1163, /* GL_RGB2_EXT */
- 1164, /* GL_RGB4 */
- 1167, /* GL_RGB5 */
- 1171, /* GL_RGB8 */
- 1155, /* GL_RGB10 */
- 1159, /* GL_RGB12 */
- 1161, /* GL_RGB16 */
- 1178, /* GL_RGBA2 */
- 1180, /* GL_RGBA4 */
- 1168, /* GL_RGB5_A1 */
- 1184, /* GL_RGBA8 */
- 1156, /* GL_RGB10_A2 */
- 1174, /* GL_RGBA12 */
- 1176, /* GL_RGBA16 */
- 1493, /* GL_TEXTURE_RED_SIZE */
- 1465, /* GL_TEXTURE_GREEN_SIZE */
- 1404, /* GL_TEXTURE_BLUE_SIZE */
- 1393, /* GL_TEXTURE_ALPHA_SIZE */
- 1478, /* GL_TEXTURE_LUMINANCE_SIZE */
- 1469, /* GL_TEXTURE_INTENSITY_SIZE */
- 1149, /* GL_REPLACE_EXT */
- 1101, /* GL_PROXY_TEXTURE_1D */
- 1103, /* GL_PROXY_TEXTURE_2D */
- 1497, /* GL_TEXTURE_TOO_LARGE_EXT */
- 1490, /* GL_TEXTURE_PRIORITY */
- 1495, /* GL_TEXTURE_RESIDENT */
- 1396, /* GL_TEXTURE_BINDING_1D */
- 1397, /* GL_TEXTURE_BINDING_2D */
- 1398, /* GL_TEXTURE_BINDING_3D */
- 933, /* GL_PACK_SKIP_IMAGES */
- 929, /* GL_PACK_IMAGE_HEIGHT */
- 1525, /* GL_UNPACK_SKIP_IMAGES */
- 1522, /* GL_UNPACK_IMAGE_HEIGHT */
- 1392, /* GL_TEXTURE_3D */
- 1105, /* GL_PROXY_TEXTURE_3D */
- 1452, /* GL_TEXTURE_DEPTH */
- 1500, /* GL_TEXTURE_WRAP_R */
- 709, /* GL_MAX_3D_TEXTURE_SIZE */
- 1553, /* GL_VERTEX_ARRAY */
- 864, /* GL_NORMAL_ARRAY */
+ 598, /* GL_LUMINANCE4 */
+ 604, /* GL_LUMINANCE8 */
+ 588, /* GL_LUMINANCE12 */
+ 594, /* GL_LUMINANCE16 */
+ 599, /* GL_LUMINANCE4_ALPHA4 */
+ 602, /* GL_LUMINANCE6_ALPHA2 */
+ 605, /* GL_LUMINANCE8_ALPHA8 */
+ 591, /* GL_LUMINANCE12_ALPHA4 */
+ 589, /* GL_LUMINANCE12_ALPHA12 */
+ 595, /* GL_LUMINANCE16_ALPHA16 */
+ 517, /* GL_INTENSITY */
+ 522, /* GL_INTENSITY4 */
+ 524, /* GL_INTENSITY8 */
+ 518, /* GL_INTENSITY12 */
+ 520, /* GL_INTENSITY16 */
+ 1167, /* GL_RGB2_EXT */
+ 1168, /* GL_RGB4 */
+ 1171, /* GL_RGB5 */
+ 1175, /* GL_RGB8 */
+ 1159, /* GL_RGB10 */
+ 1163, /* GL_RGB12 */
+ 1165, /* GL_RGB16 */
+ 1182, /* GL_RGBA2 */
+ 1184, /* GL_RGBA4 */
+ 1172, /* GL_RGB5_A1 */
+ 1188, /* GL_RGBA8 */
+ 1160, /* GL_RGB10_A2 */
+ 1178, /* GL_RGBA12 */
+ 1180, /* GL_RGBA16 */
+ 1497, /* GL_TEXTURE_RED_SIZE */
+ 1469, /* GL_TEXTURE_GREEN_SIZE */
+ 1408, /* GL_TEXTURE_BLUE_SIZE */
+ 1397, /* GL_TEXTURE_ALPHA_SIZE */
+ 1482, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 1473, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1153, /* GL_REPLACE_EXT */
+ 1105, /* GL_PROXY_TEXTURE_1D */
+ 1107, /* GL_PROXY_TEXTURE_2D */
+ 1501, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 1494, /* GL_TEXTURE_PRIORITY */
+ 1499, /* GL_TEXTURE_RESIDENT */
+ 1400, /* GL_TEXTURE_BINDING_1D */
+ 1401, /* GL_TEXTURE_BINDING_2D */
+ 1402, /* GL_TEXTURE_BINDING_3D */
+ 937, /* GL_PACK_SKIP_IMAGES */
+ 933, /* GL_PACK_IMAGE_HEIGHT */
+ 1529, /* GL_UNPACK_SKIP_IMAGES */
+ 1526, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1396, /* GL_TEXTURE_3D */
+ 1109, /* GL_PROXY_TEXTURE_3D */
+ 1456, /* GL_TEXTURE_DEPTH */
+ 1504, /* GL_TEXTURE_WRAP_R */
+ 713, /* GL_MAX_3D_TEXTURE_SIZE */
+ 1557, /* GL_VERTEX_ARRAY */
+ 868, /* GL_NORMAL_ARRAY */
129, /* GL_COLOR_ARRAY */
- 499, /* GL_INDEX_ARRAY */
- 1431, /* GL_TEXTURE_COORD_ARRAY */
+ 503, /* GL_INDEX_ARRAY */
+ 1435, /* GL_TEXTURE_COORD_ARRAY */
368, /* GL_EDGE_FLAG_ARRAY */
- 1557, /* GL_VERTEX_ARRAY_SIZE */
- 1559, /* GL_VERTEX_ARRAY_TYPE */
- 1558, /* GL_VERTEX_ARRAY_STRIDE */
- 869, /* GL_NORMAL_ARRAY_TYPE */
- 868, /* GL_NORMAL_ARRAY_STRIDE */
+ 1561, /* GL_VERTEX_ARRAY_SIZE */
+ 1563, /* GL_VERTEX_ARRAY_TYPE */
+ 1562, /* GL_VERTEX_ARRAY_STRIDE */
+ 873, /* GL_NORMAL_ARRAY_TYPE */
+ 872, /* GL_NORMAL_ARRAY_STRIDE */
133, /* GL_COLOR_ARRAY_SIZE */
135, /* GL_COLOR_ARRAY_TYPE */
134, /* GL_COLOR_ARRAY_STRIDE */
- 504, /* GL_INDEX_ARRAY_TYPE */
- 503, /* GL_INDEX_ARRAY_STRIDE */
- 1435, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 1437, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 1436, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 508, /* GL_INDEX_ARRAY_TYPE */
+ 507, /* GL_INDEX_ARRAY_STRIDE */
+ 1439, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 1441, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 1440, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
372, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 1556, /* GL_VERTEX_ARRAY_POINTER */
- 867, /* GL_NORMAL_ARRAY_POINTER */
+ 1560, /* GL_VERTEX_ARRAY_POINTER */
+ 871, /* GL_NORMAL_ARRAY_POINTER */
132, /* GL_COLOR_ARRAY_POINTER */
- 502, /* GL_INDEX_ARRAY_POINTER */
- 1434, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 506, /* GL_INDEX_ARRAY_POINTER */
+ 1438, /* GL_TEXTURE_COORD_ARRAY_POINTER */
371, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 843, /* GL_MULTISAMPLE */
- 1200, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1202, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1207, /* GL_SAMPLE_COVERAGE */
- 1204, /* GL_SAMPLE_BUFFERS */
- 1195, /* GL_SAMPLES */
- 1211, /* GL_SAMPLE_COVERAGE_VALUE */
- 1209, /* GL_SAMPLE_COVERAGE_INVERT */
+ 847, /* GL_MULTISAMPLE */
+ 1204, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1206, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1211, /* GL_SAMPLE_COVERAGE */
+ 1208, /* GL_SAMPLE_BUFFERS */
+ 1199, /* GL_SAMPLES */
+ 1215, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1213, /* GL_SAMPLE_COVERAGE_INVERT */
160, /* GL_COLOR_MATRIX */
162, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 716, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1033, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1029, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1024, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1020, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1031, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1027, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1022, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1018, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 1414, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1106, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 1416, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 720, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1037, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1033, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1028, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1024, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1035, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1031, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1026, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1022, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 1418, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1110, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 1420, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
75, /* GL_BLEND_DST_RGB */
82, /* GL_BLEND_SRC_RGB */
74, /* GL_BLEND_DST_ALPHA */
81, /* GL_BLEND_SRC_ALPHA */
166, /* GL_COLOR_TABLE */
- 1043, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1026, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1096, /* GL_PROXY_COLOR_TABLE */
- 1100, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1099, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1047, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1030, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1100, /* GL_PROXY_COLOR_TABLE */
+ 1104, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1103, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
182, /* GL_COLOR_TABLE_SCALE */
169, /* GL_COLOR_TABLE_BIAS */
172, /* GL_COLOR_TABLE_FORMAT */
@@ -3881,86 +3889,86 @@ static const unsigned reduced_enums[1233] =
176, /* GL_COLOR_TABLE_INTENSITY_SIZE */
66, /* GL_BGR */
67, /* GL_BGRA */
- 728, /* GL_MAX_ELEMENTS_VERTICES */
- 727, /* GL_MAX_ELEMENTS_INDICES */
- 1468, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 732, /* GL_MAX_ELEMENTS_VERTICES */
+ 731, /* GL_MAX_ELEMENTS_INDICES */
+ 1472, /* GL_TEXTURE_INDEX_SIZE_EXT */
126, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 991, /* GL_POINT_SIZE_MIN */
- 987, /* GL_POINT_SIZE_MAX */
- 981, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 977, /* GL_POINT_DISTANCE_ATTENUATION */
+ 995, /* GL_POINT_SIZE_MIN */
+ 991, /* GL_POINT_SIZE_MAX */
+ 985, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 981, /* GL_POINT_DISTANCE_ATTENUATION */
108, /* GL_CLAMP_TO_BORDER */
111, /* GL_CLAMP_TO_EDGE */
- 1489, /* GL_TEXTURE_MIN_LOD */
- 1487, /* GL_TEXTURE_MAX_LOD */
- 1395, /* GL_TEXTURE_BASE_LEVEL */
- 1486, /* GL_TEXTURE_MAX_LEVEL */
- 493, /* GL_IGNORE_BORDER_HP */
+ 1493, /* GL_TEXTURE_MIN_LOD */
+ 1491, /* GL_TEXTURE_MAX_LOD */
+ 1399, /* GL_TEXTURE_BASE_LEVEL */
+ 1490, /* GL_TEXTURE_MAX_LEVEL */
+ 497, /* GL_IGNORE_BORDER_HP */
224, /* GL_CONSTANT_BORDER_HP */
- 1150, /* GL_REPLICATE_BORDER_HP */
+ 1154, /* GL_REPLICATE_BORDER_HP */
230, /* GL_CONVOLUTION_BORDER_COLOR */
- 892, /* GL_OCCLUSION_TEST_HP */
- 893, /* GL_OCCLUSION_TEST_RESULT_HP */
- 558, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 1408, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 1410, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 1412, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 1413, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1411, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 1409, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 712, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 713, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1053, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1055, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1052, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1054, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 1476, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 1477, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 1475, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 896, /* GL_OCCLUSION_TEST_HP */
+ 897, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 562, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 1412, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 1414, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 1416, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 1417, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1415, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 1413, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 716, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 717, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1057, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1059, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1056, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1058, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 1480, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 1481, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 1479, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
462, /* GL_GENERATE_MIPMAP */
463, /* GL_GENERATE_MIPMAP_HINT */
428, /* GL_FOG_OFFSET_SGIX */
429, /* GL_FOG_OFFSET_VALUE_SGIX */
- 1422, /* GL_TEXTURE_COMPARE_SGIX */
- 1421, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 1472, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 1464, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 1426, /* GL_TEXTURE_COMPARE_SGIX */
+ 1425, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 1476, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 1468, /* GL_TEXTURE_GEQUAL_R_SGIX */
294, /* GL_DEPTH_COMPONENT16 */
297, /* GL_DEPTH_COMPONENT24 */
300, /* GL_DEPTH_COMPONENT32 */
251, /* GL_CULL_VERTEX_EXT */
253, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
252, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 1604, /* GL_WRAP_BORDER_SUN */
- 1415, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 551, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1236, /* GL_SINGLE_COLOR */
- 1227, /* GL_SEPARATE_SPECULAR_COLOR */
- 1233, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 1530, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 1543, /* GL_UNSIGNED_SHORT_5_6_5 */
- 1544, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 1541, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 1539, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 1537, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 1535, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 1484, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 1485, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 1483, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 794, /* GL_MIRRORED_REPEAT */
- 1189, /* GL_RGB_S3TC */
- 1166, /* GL_RGB4_S3TC */
- 1188, /* GL_RGBA_S3TC */
- 1183, /* GL_RGBA4_S3TC */
- 1186, /* GL_RGBA_DXT5_S3TC */
- 1181, /* GL_RGBA4_DXT5_S3TC */
+ 1608, /* GL_WRAP_BORDER_SUN */
+ 1419, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 555, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1240, /* GL_SINGLE_COLOR */
+ 1231, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1237, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 1534, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 1547, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 1548, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 1545, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 1543, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 1541, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 1539, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 1488, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 1489, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 1487, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 798, /* GL_MIRRORED_REPEAT */
+ 1193, /* GL_RGB_S3TC */
+ 1170, /* GL_RGB4_S3TC */
+ 1192, /* GL_RGBA_S3TC */
+ 1187, /* GL_RGBA4_S3TC */
+ 1190, /* GL_RGBA_DXT5_S3TC */
+ 1185, /* GL_RGBA4_DXT5_S3TC */
217, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
212, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
213, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
214, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 855, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 854, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 559, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 859, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 858, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 563, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
415, /* GL_FOG_COORDINATE_SOURCE */
407, /* GL_FOG_COORD */
431, /* GL_FRAGMENT_DEPTH */
@@ -3971,286 +3979,286 @@ static const unsigned reduced_enums[1233] =
409, /* GL_FOG_COORDINATE_ARRAY */
164, /* GL_COLOR_SUM */
275, /* GL_CURRENT_SECONDARY_COLOR */
- 1220, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1222, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1221, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1219, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1216, /* GL_SECONDARY_COLOR_ARRAY */
+ 1224, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1226, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1225, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1223, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1220, /* GL_SECONDARY_COLOR_ARRAY */
24, /* GL_ALIASED_POINT_SIZE_RANGE */
23, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1326, /* GL_TEXTURE0 */
- 1328, /* GL_TEXTURE1 */
- 1350, /* GL_TEXTURE2 */
- 1372, /* GL_TEXTURE3 */
- 1378, /* GL_TEXTURE4 */
- 1380, /* GL_TEXTURE5 */
- 1382, /* GL_TEXTURE6 */
- 1384, /* GL_TEXTURE7 */
- 1386, /* GL_TEXTURE8 */
- 1388, /* GL_TEXTURE9 */
- 1329, /* GL_TEXTURE10 */
- 1331, /* GL_TEXTURE11 */
- 1333, /* GL_TEXTURE12 */
- 1335, /* GL_TEXTURE13 */
- 1337, /* GL_TEXTURE14 */
- 1339, /* GL_TEXTURE15 */
- 1341, /* GL_TEXTURE16 */
- 1343, /* GL_TEXTURE17 */
- 1345, /* GL_TEXTURE18 */
- 1347, /* GL_TEXTURE19 */
- 1351, /* GL_TEXTURE20 */
- 1353, /* GL_TEXTURE21 */
- 1355, /* GL_TEXTURE22 */
- 1357, /* GL_TEXTURE23 */
- 1359, /* GL_TEXTURE24 */
- 1361, /* GL_TEXTURE25 */
- 1363, /* GL_TEXTURE26 */
- 1365, /* GL_TEXTURE27 */
- 1367, /* GL_TEXTURE28 */
- 1369, /* GL_TEXTURE29 */
- 1373, /* GL_TEXTURE30 */
- 1375, /* GL_TEXTURE31 */
+ 1330, /* GL_TEXTURE0 */
+ 1332, /* GL_TEXTURE1 */
+ 1354, /* GL_TEXTURE2 */
+ 1376, /* GL_TEXTURE3 */
+ 1382, /* GL_TEXTURE4 */
+ 1384, /* GL_TEXTURE5 */
+ 1386, /* GL_TEXTURE6 */
+ 1388, /* GL_TEXTURE7 */
+ 1390, /* GL_TEXTURE8 */
+ 1392, /* GL_TEXTURE9 */
+ 1333, /* GL_TEXTURE10 */
+ 1335, /* GL_TEXTURE11 */
+ 1337, /* GL_TEXTURE12 */
+ 1339, /* GL_TEXTURE13 */
+ 1341, /* GL_TEXTURE14 */
+ 1343, /* GL_TEXTURE15 */
+ 1345, /* GL_TEXTURE16 */
+ 1347, /* GL_TEXTURE17 */
+ 1349, /* GL_TEXTURE18 */
+ 1351, /* GL_TEXTURE19 */
+ 1355, /* GL_TEXTURE20 */
+ 1357, /* GL_TEXTURE21 */
+ 1359, /* GL_TEXTURE22 */
+ 1361, /* GL_TEXTURE23 */
+ 1363, /* GL_TEXTURE24 */
+ 1365, /* GL_TEXTURE25 */
+ 1367, /* GL_TEXTURE26 */
+ 1369, /* GL_TEXTURE27 */
+ 1371, /* GL_TEXTURE28 */
+ 1373, /* GL_TEXTURE29 */
+ 1377, /* GL_TEXTURE30 */
+ 1379, /* GL_TEXTURE31 */
16, /* GL_ACTIVE_TEXTURE */
114, /* GL_CLIENT_ACTIVE_TEXTURE */
- 776, /* GL_MAX_TEXTURE_UNITS */
- 1509, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 1512, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 1514, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 1506, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1314, /* GL_SUBTRACT */
- 767, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ 780, /* GL_MAX_TEXTURE_UNITS */
+ 1513, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 1516, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 1518, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 1510, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1318, /* GL_SUBTRACT */
+ 771, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
200, /* GL_COMPRESSED_ALPHA */
204, /* GL_COMPRESSED_LUMINANCE */
205, /* GL_COMPRESSED_LUMINANCE_ALPHA */
202, /* GL_COMPRESSED_INTENSITY */
208, /* GL_COMPRESSED_RGB */
209, /* GL_COMPRESSED_RGBA */
- 1429, /* GL_TEXTURE_COMPRESSION_HINT */
- 1491, /* GL_TEXTURE_RECTANGLE_ARB */
- 1401, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- 1109, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- 765, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ 1433, /* GL_TEXTURE_COMPRESSION_HINT */
+ 1495, /* GL_TEXTURE_RECTANGLE_ARB */
+ 1405, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ 1113, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ 769, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
306, /* GL_DEPTH_STENCIL_NV */
- 1534, /* GL_UNSIGNED_INT_24_8_NV */
- 772, /* GL_MAX_TEXTURE_LOD_BIAS */
- 1482, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 773, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 1458, /* GL_TEXTURE_FILTER_CONTROL */
- 1473, /* GL_TEXTURE_LOD_BIAS */
+ 1538, /* GL_UNSIGNED_INT_24_8_NV */
+ 776, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 1486, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 777, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1462, /* GL_TEXTURE_FILTER_CONTROL */
+ 1477, /* GL_TEXTURE_LOD_BIAS */
187, /* GL_COMBINE4 */
- 768, /* GL_MAX_SHININESS_NV */
- 769, /* GL_MAX_SPOT_EXPONENT_NV */
- 497, /* GL_INCR_WRAP */
+ 772, /* GL_MAX_SHININESS_NV */
+ 773, /* GL_MAX_SPOT_EXPONENT_NV */
+ 501, /* GL_INCR_WRAP */
282, /* GL_DECR_WRAP */
- 814, /* GL_MODELVIEW1_ARB */
- 870, /* GL_NORMAL_MAP */
- 1136, /* GL_REFLECTION_MAP */
- 1438, /* GL_TEXTURE_CUBE_MAP */
- 1399, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 1446, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 1440, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 1448, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 1442, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 1450, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 1444, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1107, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 723, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 849, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 818, /* GL_MODELVIEW1_ARB */
+ 874, /* GL_NORMAL_MAP */
+ 1140, /* GL_REFLECTION_MAP */
+ 1442, /* GL_TEXTURE_CUBE_MAP */
+ 1403, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 1450, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 1444, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 1452, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 1446, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 1454, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 1448, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1111, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 727, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 853, /* GL_MULTISAMPLE_FILTER_HINT_NV */
423, /* GL_FOG_DISTANCE_MODE_NV */
388, /* GL_EYE_RADIAL_NV */
387, /* GL_EYE_PLANE_ABSOLUTE_NV */
186, /* GL_COMBINE */
193, /* GL_COMBINE_RGB */
188, /* GL_COMBINE_ALPHA */
- 1190, /* GL_RGB_SCALE */
+ 1194, /* GL_RGB_SCALE */
20, /* GL_ADD_SIGNED */
- 523, /* GL_INTERPOLATE */
+ 527, /* GL_INTERPOLATE */
219, /* GL_CONSTANT */
- 1059, /* GL_PRIMARY_COLOR */
- 1056, /* GL_PREVIOUS */
- 1247, /* GL_SOURCE0_RGB */
- 1253, /* GL_SOURCE1_RGB */
- 1259, /* GL_SOURCE2_RGB */
- 1263, /* GL_SOURCE3_RGB_NV */
- 1244, /* GL_SOURCE0_ALPHA */
- 1250, /* GL_SOURCE1_ALPHA */
- 1256, /* GL_SOURCE2_ALPHA */
- 1262, /* GL_SOURCE3_ALPHA_NV */
- 906, /* GL_OPERAND0_RGB */
- 912, /* GL_OPERAND1_RGB */
- 918, /* GL_OPERAND2_RGB */
- 922, /* GL_OPERAND3_RGB_NV */
- 903, /* GL_OPERAND0_ALPHA */
- 909, /* GL_OPERAND1_ALPHA */
- 915, /* GL_OPERAND2_ALPHA */
- 921, /* GL_OPERAND3_ALPHA_NV */
- 1608, /* GL_YCBCR_422_APPLE */
- 1545, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 1547, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 1238, /* GL_SLICE_ACCUM_SUN */
- 1114, /* GL_QUAD_MESH_SUN */
- 1518, /* GL_TRIANGLE_MESH_SUN */
- 1585, /* GL_VERTEX_PROGRAM_ARB */
- 1593, /* GL_VERTEX_STATE_PROGRAM_NV */
- 1578, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- 1581, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- 1582, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- 1583, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ 1063, /* GL_PRIMARY_COLOR */
+ 1060, /* GL_PREVIOUS */
+ 1251, /* GL_SOURCE0_RGB */
+ 1257, /* GL_SOURCE1_RGB */
+ 1263, /* GL_SOURCE2_RGB */
+ 1267, /* GL_SOURCE3_RGB_NV */
+ 1248, /* GL_SOURCE0_ALPHA */
+ 1254, /* GL_SOURCE1_ALPHA */
+ 1260, /* GL_SOURCE2_ALPHA */
+ 1266, /* GL_SOURCE3_ALPHA_NV */
+ 910, /* GL_OPERAND0_RGB */
+ 916, /* GL_OPERAND1_RGB */
+ 922, /* GL_OPERAND2_RGB */
+ 926, /* GL_OPERAND3_RGB_NV */
+ 907, /* GL_OPERAND0_ALPHA */
+ 913, /* GL_OPERAND1_ALPHA */
+ 919, /* GL_OPERAND2_ALPHA */
+ 925, /* GL_OPERAND3_ALPHA_NV */
+ 1612, /* GL_YCBCR_422_APPLE */
+ 1549, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 1551, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 1242, /* GL_SLICE_ACCUM_SUN */
+ 1118, /* GL_QUAD_MESH_SUN */
+ 1522, /* GL_TRIANGLE_MESH_SUN */
+ 1589, /* GL_VERTEX_PROGRAM_ARB */
+ 1597, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 1582, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ 1585, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ 1586, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ 1587, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
277, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- 1072, /* GL_PROGRAM_LENGTH_ARB */
- 1086, /* GL_PROGRAM_STRING_ARB */
- 836, /* GL_MODELVIEW_PROJECTION_NV */
- 492, /* GL_IDENTITY_NV */
- 533, /* GL_INVERSE_NV */
- 1511, /* GL_TRANSPOSE_NV */
- 534, /* GL_INVERSE_TRANSPOSE_NV */
- 751, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 750, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 662, /* GL_MATRIX0_NV */
- 674, /* GL_MATRIX1_NV */
- 686, /* GL_MATRIX2_NV */
- 690, /* GL_MATRIX3_NV */
- 692, /* GL_MATRIX4_NV */
- 694, /* GL_MATRIX5_NV */
- 696, /* GL_MATRIX6_NV */
- 698, /* GL_MATRIX7_NV */
+ 1076, /* GL_PROGRAM_LENGTH_ARB */
+ 1090, /* GL_PROGRAM_STRING_ARB */
+ 840, /* GL_MODELVIEW_PROJECTION_NV */
+ 496, /* GL_IDENTITY_NV */
+ 537, /* GL_INVERSE_NV */
+ 1515, /* GL_TRANSPOSE_NV */
+ 538, /* GL_INVERSE_TRANSPOSE_NV */
+ 755, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 754, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 666, /* GL_MATRIX0_NV */
+ 678, /* GL_MATRIX1_NV */
+ 690, /* GL_MATRIX2_NV */
+ 694, /* GL_MATRIX3_NV */
+ 696, /* GL_MATRIX4_NV */
+ 698, /* GL_MATRIX5_NV */
+ 700, /* GL_MATRIX6_NV */
+ 702, /* GL_MATRIX7_NV */
263, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
260, /* GL_CURRENT_MATRIX_ARB */
- 1588, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- 1590, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- 1084, /* GL_PROGRAM_PARAMETER_NV */
- 1580, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- 1088, /* GL_PROGRAM_TARGET_NV */
- 1085, /* GL_PROGRAM_RESIDENT_NV */
- 1503, /* GL_TRACK_MATRIX_NV */
- 1504, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 1586, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1066, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 1592, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ 1594, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ 1088, /* GL_PROGRAM_PARAMETER_NV */
+ 1584, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ 1092, /* GL_PROGRAM_TARGET_NV */
+ 1089, /* GL_PROGRAM_RESIDENT_NV */
+ 1507, /* GL_TRACK_MATRIX_NV */
+ 1508, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 1590, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1070, /* GL_PROGRAM_ERROR_POSITION_ARB */
291, /* GL_DEPTH_CLAMP_NV */
- 1560, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 1567, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 1568, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 1569, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 1570, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 1571, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 1572, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 1573, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 1574, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 1575, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 1561, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 1562, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 1563, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 1564, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 1565, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 1566, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 616, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 623, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 624, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 625, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 626, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 627, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 628, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 629, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 630, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 631, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 617, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 618, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 619, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 620, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 621, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 622, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 643, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 650, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 651, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 652, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 653, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 654, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 655, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1065, /* GL_PROGRAM_BINDING_ARB */
- 657, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 658, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 644, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 645, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 646, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 647, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 648, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 649, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 1427, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 1424, /* GL_TEXTURE_COMPRESSED */
- 875, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 1564, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 1571, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 1572, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 1573, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 1574, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 1575, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 1576, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 1577, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 1578, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 1579, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 1565, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 1566, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 1567, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 1568, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 1569, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 1570, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 620, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 627, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 628, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 629, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 630, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 631, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 632, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 633, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 634, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 635, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 621, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 622, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 623, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 624, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 625, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 626, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 647, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 654, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 655, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 656, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 657, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 658, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 659, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1069, /* GL_PROGRAM_BINDING_ARB */
+ 661, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 662, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 648, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 649, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 650, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 651, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 652, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 653, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 1431, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 1428, /* GL_TEXTURE_COMPRESSED */
+ 879, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
218, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 784, /* GL_MAX_VERTEX_UNITS_ARB */
+ 788, /* GL_MAX_VERTEX_UNITS_ARB */
18, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 1603, /* GL_WEIGHT_SUM_UNITY_ARB */
- 1584, /* GL_VERTEX_BLEND_ARB */
+ 1607, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 1588, /* GL_VERTEX_BLEND_ARB */
278, /* GL_CURRENT_WEIGHT_ARB */
- 1602, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 1601, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 1600, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 1599, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 1596, /* GL_WEIGHT_ARRAY_ARB */
+ 1606, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 1605, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 1604, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 1603, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 1600, /* GL_WEIGHT_ARRAY_ARB */
317, /* GL_DOT3_RGB */
318, /* GL_DOT3_RGBA */
216, /* GL_COMPRESSED_RGB_FXT1_3DFX */
211, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 844, /* GL_MULTISAMPLE_3DFX */
- 1205, /* GL_SAMPLE_BUFFERS_3DFX */
- 1196, /* GL_SAMPLES_3DFX */
- 825, /* GL_MODELVIEW2_ARB */
- 828, /* GL_MODELVIEW3_ARB */
- 829, /* GL_MODELVIEW4_ARB */
- 830, /* GL_MODELVIEW5_ARB */
- 831, /* GL_MODELVIEW6_ARB */
- 832, /* GL_MODELVIEW7_ARB */
- 833, /* GL_MODELVIEW8_ARB */
- 834, /* GL_MODELVIEW9_ARB */
- 804, /* GL_MODELVIEW10_ARB */
- 805, /* GL_MODELVIEW11_ARB */
- 806, /* GL_MODELVIEW12_ARB */
- 807, /* GL_MODELVIEW13_ARB */
- 808, /* GL_MODELVIEW14_ARB */
- 809, /* GL_MODELVIEW15_ARB */
- 810, /* GL_MODELVIEW16_ARB */
- 811, /* GL_MODELVIEW17_ARB */
- 812, /* GL_MODELVIEW18_ARB */
- 813, /* GL_MODELVIEW19_ARB */
- 815, /* GL_MODELVIEW20_ARB */
- 816, /* GL_MODELVIEW21_ARB */
- 817, /* GL_MODELVIEW22_ARB */
- 818, /* GL_MODELVIEW23_ARB */
- 819, /* GL_MODELVIEW24_ARB */
- 820, /* GL_MODELVIEW25_ARB */
- 821, /* GL_MODELVIEW26_ARB */
- 822, /* GL_MODELVIEW27_ARB */
- 823, /* GL_MODELVIEW28_ARB */
- 824, /* GL_MODELVIEW29_ARB */
- 826, /* GL_MODELVIEW30_ARB */
- 827, /* GL_MODELVIEW31_ARB */
+ 848, /* GL_MULTISAMPLE_3DFX */
+ 1209, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1200, /* GL_SAMPLES_3DFX */
+ 829, /* GL_MODELVIEW2_ARB */
+ 832, /* GL_MODELVIEW3_ARB */
+ 833, /* GL_MODELVIEW4_ARB */
+ 834, /* GL_MODELVIEW5_ARB */
+ 835, /* GL_MODELVIEW6_ARB */
+ 836, /* GL_MODELVIEW7_ARB */
+ 837, /* GL_MODELVIEW8_ARB */
+ 838, /* GL_MODELVIEW9_ARB */
+ 808, /* GL_MODELVIEW10_ARB */
+ 809, /* GL_MODELVIEW11_ARB */
+ 810, /* GL_MODELVIEW12_ARB */
+ 811, /* GL_MODELVIEW13_ARB */
+ 812, /* GL_MODELVIEW14_ARB */
+ 813, /* GL_MODELVIEW15_ARB */
+ 814, /* GL_MODELVIEW16_ARB */
+ 815, /* GL_MODELVIEW17_ARB */
+ 816, /* GL_MODELVIEW18_ARB */
+ 817, /* GL_MODELVIEW19_ARB */
+ 819, /* GL_MODELVIEW20_ARB */
+ 820, /* GL_MODELVIEW21_ARB */
+ 821, /* GL_MODELVIEW22_ARB */
+ 822, /* GL_MODELVIEW23_ARB */
+ 823, /* GL_MODELVIEW24_ARB */
+ 824, /* GL_MODELVIEW25_ARB */
+ 825, /* GL_MODELVIEW26_ARB */
+ 826, /* GL_MODELVIEW27_ARB */
+ 827, /* GL_MODELVIEW28_ARB */
+ 828, /* GL_MODELVIEW29_ARB */
+ 830, /* GL_MODELVIEW30_ARB */
+ 831, /* GL_MODELVIEW31_ARB */
322, /* GL_DOT3_RGB_EXT */
320, /* GL_DOT3_RGBA_EXT */
- 798, /* GL_MIRROR_CLAMP_EXT */
- 801, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 839, /* GL_MODULATE_ADD_ATI */
- 840, /* GL_MODULATE_SIGNED_ADD_ATI */
- 841, /* GL_MODULATE_SUBTRACT_ATI */
- 1609, /* GL_YCBCR_MESA */
- 930, /* GL_PACK_INVERT_MESA */
+ 802, /* GL_MIRROR_CLAMP_EXT */
+ 805, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 843, /* GL_MODULATE_ADD_ATI */
+ 844, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 845, /* GL_MODULATE_SUBTRACT_ATI */
+ 1613, /* GL_YCBCR_MESA */
+ 934, /* GL_PACK_INVERT_MESA */
97, /* GL_BUFFER_SIZE */
99, /* GL_BUFFER_USAGE */
432, /* GL_FRAGMENT_PROGRAM_ARB */
- 1063, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1091, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1090, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1075, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1081, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1080, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 740, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 763, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 762, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 753, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 759, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 758, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 725, /* GL_MAX_DRAW_BUFFERS_ARB */
+ 1067, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1095, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1094, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1079, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1085, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1084, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 744, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 767, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 766, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 757, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 763, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 762, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 729, /* GL_MAX_DRAW_BUFFERS_ARB */
326, /* GL_DRAW_BUFFER0_ARB */
340, /* GL_DRAW_BUFFER1_ARB */
342, /* GL_DRAW_BUFFER2_ARB */
@@ -4268,156 +4276,156 @@ static const unsigned reduced_enums[1233] =
336, /* GL_DRAW_BUFFER14_ARB */
338, /* GL_DRAW_BUFFER15_ARB */
77, /* GL_BLEND_EQUATION_ALPHA_EXT */
- 707, /* GL_MATRIX_PALETTE_ARB */
- 734, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 737, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 711, /* GL_MATRIX_PALETTE_ARB */
+ 738, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 741, /* GL_MAX_PALETTE_MATRICES_ARB */
266, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 701, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 705, /* GL_MATRIX_INDEX_ARRAY_ARB */
261, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 703, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 705, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 704, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 702, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 1453, /* GL_TEXTURE_DEPTH_SIZE */
+ 707, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 709, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 708, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 706, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 1457, /* GL_TEXTURE_DEPTH_SIZE */
310, /* GL_DEPTH_TEXTURE_MODE */
- 1419, /* GL_TEXTURE_COMPARE_MODE */
- 1417, /* GL_TEXTURE_COMPARE_FUNC */
+ 1423, /* GL_TEXTURE_COMPARE_MODE */
+ 1421, /* GL_TEXTURE_COMPARE_FUNC */
196, /* GL_COMPARE_R_TO_TEXTURE */
- 998, /* GL_POINT_SPRITE_ARB */
+ 1002, /* GL_POINT_SPRITE_ARB */
244, /* GL_COORD_REPLACE_ARB */
- 1001, /* GL_POINT_SPRITE_R_MODE_NV */
- 1116, /* GL_QUERY_COUNTER_BITS */
+ 1005, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1120, /* GL_QUERY_COUNTER_BITS */
267, /* GL_CURRENT_QUERY */
- 1118, /* GL_QUERY_RESULT */
- 1120, /* GL_QUERY_RESULT_AVAILABLE */
- 781, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- 1579, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ 1122, /* GL_QUERY_RESULT */
+ 1124, /* GL_QUERY_RESULT_AVAILABLE */
+ 785, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ 1583, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
308, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
307, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 770, /* GL_MAX_TEXTURE_COORDS_ARB */
- 771, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- 1068, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1070, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1069, /* GL_PROGRAM_FORMAT_ARB */
- 1498, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 774, /* GL_MAX_TEXTURE_COORDS_ARB */
+ 775, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ 1072, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1074, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1073, /* GL_PROGRAM_FORMAT_ARB */
+ 1502, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
289, /* GL_DEPTH_BOUNDS_TEST_EXT */
288, /* GL_DEPTH_BOUNDS_EXT */
48, /* GL_ARRAY_BUFFER */
373, /* GL_ELEMENT_ARRAY_BUFFER */
50, /* GL_ARRAY_BUFFER_BINDING */
375, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 1554, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 865, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 1558, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 869, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
130, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 500, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 1432, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 504, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 1436, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
369, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1217, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 1221, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
410, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 1597, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 1576, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1071, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 746, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1077, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 755, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1089, /* GL_PROGRAM_TEMPORARIES_ARB */
- 761, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1079, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 757, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1083, /* GL_PROGRAM_PARAMETERS_ARB */
- 760, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1078, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 756, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1064, /* GL_PROGRAM_ATTRIBS_ARB */
- 741, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1076, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 754, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1062, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 739, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1074, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 752, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 747, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 743, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1092, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 1508, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1126, /* GL_READ_ONLY */
- 1605, /* GL_WRITE_ONLY */
- 1128, /* GL_READ_WRITE */
+ 1601, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 1580, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1075, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 750, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1081, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 759, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1093, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 765, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1083, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 761, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1087, /* GL_PROGRAM_PARAMETERS_ARB */
+ 764, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1082, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 760, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1068, /* GL_PROGRAM_ATTRIBS_ARB */
+ 745, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1080, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 758, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1066, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 743, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1078, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 756, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 751, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 747, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1096, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 1512, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1130, /* GL_READ_ONLY */
+ 1609, /* GL_WRITE_ONLY */
+ 1132, /* GL_READ_WRITE */
91, /* GL_BUFFER_ACCESS */
93, /* GL_BUFFER_MAPPED */
95, /* GL_BUFFER_MAP_POINTER */
- 467, /* GL_GL_TIME_ELAPSED_EXT */
- 661, /* GL_MATRIX0_ARB */
- 673, /* GL_MATRIX1_ARB */
- 685, /* GL_MATRIX2_ARB */
- 689, /* GL_MATRIX3_ARB */
- 691, /* GL_MATRIX4_ARB */
- 693, /* GL_MATRIX5_ARB */
- 695, /* GL_MATRIX6_ARB */
- 697, /* GL_MATRIX7_ARB */
- 699, /* GL_MATRIX8_ARB */
- 700, /* GL_MATRIX9_ARB */
- 663, /* GL_MATRIX10_ARB */
- 664, /* GL_MATRIX11_ARB */
- 665, /* GL_MATRIX12_ARB */
- 666, /* GL_MATRIX13_ARB */
- 667, /* GL_MATRIX14_ARB */
- 668, /* GL_MATRIX15_ARB */
- 669, /* GL_MATRIX16_ARB */
- 670, /* GL_MATRIX17_ARB */
- 671, /* GL_MATRIX18_ARB */
- 672, /* GL_MATRIX19_ARB */
- 675, /* GL_MATRIX20_ARB */
- 676, /* GL_MATRIX21_ARB */
- 677, /* GL_MATRIX22_ARB */
- 678, /* GL_MATRIX23_ARB */
- 679, /* GL_MATRIX24_ARB */
- 680, /* GL_MATRIX25_ARB */
- 681, /* GL_MATRIX26_ARB */
- 682, /* GL_MATRIX27_ARB */
- 683, /* GL_MATRIX28_ARB */
- 684, /* GL_MATRIX29_ARB */
- 687, /* GL_MATRIX30_ARB */
- 688, /* GL_MATRIX31_ARB */
- 1309, /* GL_STREAM_DRAW */
- 1311, /* GL_STREAM_READ */
- 1307, /* GL_STREAM_COPY */
- 1282, /* GL_STATIC_DRAW */
- 1284, /* GL_STATIC_READ */
- 1280, /* GL_STATIC_COPY */
+ 471, /* GL_GL_TIME_ELAPSED_EXT */
+ 665, /* GL_MATRIX0_ARB */
+ 677, /* GL_MATRIX1_ARB */
+ 689, /* GL_MATRIX2_ARB */
+ 693, /* GL_MATRIX3_ARB */
+ 695, /* GL_MATRIX4_ARB */
+ 697, /* GL_MATRIX5_ARB */
+ 699, /* GL_MATRIX6_ARB */
+ 701, /* GL_MATRIX7_ARB */
+ 703, /* GL_MATRIX8_ARB */
+ 704, /* GL_MATRIX9_ARB */
+ 667, /* GL_MATRIX10_ARB */
+ 668, /* GL_MATRIX11_ARB */
+ 669, /* GL_MATRIX12_ARB */
+ 670, /* GL_MATRIX13_ARB */
+ 671, /* GL_MATRIX14_ARB */
+ 672, /* GL_MATRIX15_ARB */
+ 673, /* GL_MATRIX16_ARB */
+ 674, /* GL_MATRIX17_ARB */
+ 675, /* GL_MATRIX18_ARB */
+ 676, /* GL_MATRIX19_ARB */
+ 679, /* GL_MATRIX20_ARB */
+ 680, /* GL_MATRIX21_ARB */
+ 681, /* GL_MATRIX22_ARB */
+ 682, /* GL_MATRIX23_ARB */
+ 683, /* GL_MATRIX24_ARB */
+ 684, /* GL_MATRIX25_ARB */
+ 685, /* GL_MATRIX26_ARB */
+ 686, /* GL_MATRIX27_ARB */
+ 687, /* GL_MATRIX28_ARB */
+ 688, /* GL_MATRIX29_ARB */
+ 691, /* GL_MATRIX30_ARB */
+ 692, /* GL_MATRIX31_ARB */
+ 1313, /* GL_STREAM_DRAW */
+ 1315, /* GL_STREAM_READ */
+ 1311, /* GL_STREAM_COPY */
+ 1286, /* GL_STATIC_DRAW */
+ 1288, /* GL_STATIC_READ */
+ 1284, /* GL_STATIC_COPY */
363, /* GL_DYNAMIC_DRAW */
365, /* GL_DYNAMIC_READ */
361, /* GL_DYNAMIC_COPY */
- 971, /* GL_PIXEL_PACK_BUFFER_EXT */
- 973, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- 970, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- 972, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- 744, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- 742, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 745, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 749, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 748, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 1303, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 975, /* GL_PIXEL_PACK_BUFFER_EXT */
+ 977, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ 974, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ 976, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ 748, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ 746, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 749, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 753, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 752, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 1307, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
15, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 799, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1198, /* GL_SAMPLES_PASSED */
+ 803, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1202, /* GL_SAMPLES_PASSED */
433, /* GL_FRAGMENT_SHADER_ARB */
- 1592, /* GL_VERTEX_SHADER_ARB */
- 1082, /* GL_PROGRAM_OBJECT_ARB */
- 1230, /* GL_SHADER_OBJECT_ARB */
- 731, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- 783, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- 780, /* GL_MAX_VARYING_FLOATS_ARB */
- 782, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- 718, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- 890, /* GL_OBJECT_TYPE_ARB */
- 889, /* GL_OBJECT_SUBTYPE_ARB */
+ 1596, /* GL_VERTEX_SHADER_ARB */
+ 1086, /* GL_PROGRAM_OBJECT_ARB */
+ 1234, /* GL_SHADER_OBJECT_ARB */
+ 735, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ 787, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ 784, /* GL_MAX_VARYING_FLOATS_ARB */
+ 786, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ 722, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ 894, /* GL_OBJECT_TYPE_ARB */
+ 893, /* GL_OBJECT_SUBTYPE_ARB */
401, /* GL_FLOAT_VEC2_ARB */
402, /* GL_FLOAT_VEC3_ARB */
403, /* GL_FLOAT_VEC4_ARB */
- 526, /* GL_INT_VEC2_ARB */
- 527, /* GL_INT_VEC3_ARB */
- 528, /* GL_INT_VEC4_ARB */
+ 530, /* GL_INT_VEC2_ARB */
+ 531, /* GL_INT_VEC3_ARB */
+ 532, /* GL_INT_VEC4_ARB */
87, /* GL_BOOL_ARB */
88, /* GL_BOOL_VEC2_ARB */
89, /* GL_BOOL_VEC3_ARB */
@@ -4425,32 +4433,35 @@ static const unsigned reduced_enums[1233] =
398, /* GL_FLOAT_MAT2_ARB */
399, /* GL_FLOAT_MAT3_ARB */
400, /* GL_FLOAT_MAT4_ARB */
- 883, /* GL_OBJECT_DELETE_STATUS_ARB */
- 882, /* GL_OBJECT_COMPILE_STATUS_ARB */
- 886, /* GL_OBJECT_LINK_STATUS_ARB */
- 891, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- 884, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- 881, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- 879, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- 880, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- 888, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- 877, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- 878, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- 939, /* GL_PALETTE4_RGB8_OES */
- 941, /* GL_PALETTE4_RGBA8_OES */
- 937, /* GL_PALETTE4_R5_G6_B5_OES */
- 940, /* GL_PALETTE4_RGBA4_OES */
- 938, /* GL_PALETTE4_RGB5_A1_OES */
- 944, /* GL_PALETTE8_RGB8_OES */
- 946, /* GL_PALETTE8_RGBA8_OES */
- 942, /* GL_PALETTE8_R5_G6_B5_OES */
- 945, /* GL_PALETTE8_RGBA4_OES */
- 943, /* GL_PALETTE8_RGB5_A1_OES */
- 495, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- 494, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- 999, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 887, /* GL_OBJECT_DELETE_STATUS_ARB */
+ 886, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ 890, /* GL_OBJECT_LINK_STATUS_ARB */
+ 895, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ 888, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ 885, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ 883, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ 884, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ 892, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ 881, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ 882, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ 943, /* GL_PALETTE4_RGB8_OES */
+ 945, /* GL_PALETTE4_RGBA8_OES */
+ 941, /* GL_PALETTE4_R5_G6_B5_OES */
+ 944, /* GL_PALETTE4_RGBA4_OES */
+ 942, /* GL_PALETTE4_RGB5_A1_OES */
+ 948, /* GL_PALETTE8_RGB8_OES */
+ 950, /* GL_PALETTE8_RGBA8_OES */
+ 946, /* GL_PALETTE8_R5_G6_B5_OES */
+ 949, /* GL_PALETTE8_RGBA4_OES */
+ 947, /* GL_PALETTE8_RGB5_A1_OES */
+ 499, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ 498, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ 1003, /* GL_POINT_SPRITE_COORD_ORIGIN */
439, /* GL_FRAMEBUFFER_BINDING_EXT */
- 1140, /* GL_RENDERBUFFER_BINDING_EXT */
+ 1144, /* GL_RENDERBUFFER_BINDING_EXT */
+ 470, /* GL_GL_READ_FRAMEBUFFER_EXT */
+ 468, /* GL_GL_DRAW_FRAMEBUFFER_EXT */
+ 469, /* GL_GL_READ_FRAMEBUFFER_BINDING_EXT */
435, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
434, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
438, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
@@ -4466,7 +4477,7 @@ static const unsigned reduced_enums[1233] =
448, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
450, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
449, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 715, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ 719, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
136, /* GL_COLOR_ATTACHMENT0_EXT */
143, /* GL_COLOR_ATTACHMENT1_EXT */
144, /* GL_COLOR_ATTACHMENT2_EXT */
@@ -4484,24 +4495,24 @@ static const unsigned reduced_enums[1233] =
141, /* GL_COLOR_ATTACHMENT14_EXT */
142, /* GL_COLOR_ATTACHMENT15_EXT */
285, /* GL_DEPTH_ATTACHMENT_EXT */
- 1287, /* GL_STENCIL_ATTACHMENT_EXT */
+ 1291, /* GL_STENCIL_ATTACHMENT_EXT */
441, /* GL_FRAMEBUFFER_EXT */
- 1141, /* GL_RENDERBUFFER_EXT */
- 1144, /* GL_RENDERBUFFER_WIDTH_EXT */
- 1142, /* GL_RENDERBUFFER_HEIGHT_EXT */
- 1143, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- 1298, /* GL_STENCIL_INDEX_EXT */
- 1295, /* GL_STENCIL_INDEX1_EXT */
- 1296, /* GL_STENCIL_INDEX4_EXT */
- 1297, /* GL_STENCIL_INDEX8_EXT */
- 1294, /* GL_STENCIL_INDEX16_EXT */
+ 1145, /* GL_RENDERBUFFER_EXT */
+ 1148, /* GL_RENDERBUFFER_WIDTH_EXT */
+ 1146, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ 1147, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ 1302, /* GL_STENCIL_INDEX_EXT */
+ 1299, /* GL_STENCIL_INDEX1_EXT */
+ 1300, /* GL_STENCIL_INDEX4_EXT */
+ 1301, /* GL_STENCIL_INDEX8_EXT */
+ 1298, /* GL_STENCIL_INDEX16_EXT */
381, /* GL_EVAL_BIT */
- 1124, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 577, /* GL_LIST_BIT */
- 1403, /* GL_TEXTURE_BIT */
- 1213, /* GL_SCISSOR_BIT */
+ 1128, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 581, /* GL_LIST_BIT */
+ 1407, /* GL_TEXTURE_BIT */
+ 1217, /* GL_SCISSOR_BIT */
25, /* GL_ALL_ATTRIB_BITS */
- 846, /* GL_MULTISAMPLE_BIT */
+ 850, /* GL_MULTISAMPLE_BIT */
};
#define Elements(x) sizeof(x)/sizeof(*x)
diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c
index 1655fd66e6..7d498a8279 100644
--- a/src/mesa/main/execmem.c
+++ b/src/mesa/main/execmem.c
@@ -36,14 +36,13 @@
-#ifdef __linux__
+#if defined(__linux__) && !defined(XFree86Server)
/*
* Allocate a large block of memory which can hold code then dole it out
* in pieces by means of the generic memory manager code.
*/
-
#include <unistd.h>
#include <sys/mman.h>
#include "mm.h"
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 850fff6ff1..448a7c5a12 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -179,7 +179,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
#if FEATURE_ARB_fragment_program
ctx->Extensions.ARB_fragment_program = GL_TRUE;
#endif
-#if 0 && FEATURE_ARB_fragment_shader
+#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
/*ctx->Extensions.ARB_half_float_pixel = GL_TRUE;*/
@@ -189,10 +189,10 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
#endif
ctx->Extensions.ARB_point_sprite = GL_TRUE;
-#if 0 && FEATURE_ARB_shader_objects
+#if FEATURE_ARB_shader_objects
ctx->Extensions.ARB_shader_objects = GL_TRUE;
#endif
-#if 0 && FEATURE_ARB_shading_language_100
+#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
ctx->Extensions.ARB_shadow = GL_TRUE;
@@ -207,7 +207,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
#if FEATURE_ARB_vertex_program
ctx->Extensions.ARB_vertex_program = GL_TRUE;
#endif
-#if 0 && FEATURE_ARB_vertex_shader
+#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#endif
#if FEATURE_ARB_vertex_buffer_object
@@ -229,6 +229,8 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.EXT_fog_coord = GL_TRUE;
#if FEATURE_EXT_framebuffer_object
ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
+#endif
+#if FEATURE_EXT_framebuffer_blit
ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
#endif
ctx->Extensions.EXT_histogram = GL_TRUE;
@@ -365,19 +367,19 @@ void
_mesa_enable_2_0_extensions(GLcontext *ctx)
{
ctx->Extensions.ARB_draw_buffers = GL_TRUE;
-#if 0 && FEATURE_ARB_fragment_shader
+#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
ctx->Extensions.ARB_point_sprite = GL_TRUE;
ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
-#if 0 && FEATURE_ARB_shader_objects
+#if FEATURE_ARB_shader_objects
ctx->Extensions.ARB_shader_objects = GL_TRUE;
#endif
-#if 0 && FEATURE_ARB_shading_language_100
+#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* yes, turn it off */
-#if 0 && FEATURE_ARB_vertex_shader
+#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#endif
}
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index fdc1ad300b..8c5bde6edd 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -937,13 +937,14 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb)
static void
check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb)
{
- GLuint i;
- ASSERT(ctx->Driver.FinishRenderTexture);
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = fb->Attachment + i;
- struct gl_texture_object *texObj = att->Texture;
- if (texObj) {
- ctx->Driver.FinishRenderTexture(ctx, att);
+ if (ctx->Driver.FinishRenderTexture) {
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ struct gl_texture_object *texObj = att->Texture;
+ if (texObj) {
+ ctx->Driver.FinishRenderTexture(ctx, att);
+ }
}
}
}
@@ -1067,6 +1068,10 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
if (ctx->Driver.BindFramebuffer) {
ctx->Driver.BindFramebuffer(ctx, target, newFb);
}
+
+ if (ctx->Driver.BindFramebuffer) {
+ ctx->Driver.BindFramebuffer(ctx, target, newFb);
+ }
}
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index d3b8a923aa..df99c6519f 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -70,7 +70,15 @@ _mesa_Fogiv(GLenum pname, const GLint *params )
;
}
_mesa_Fogfv(pname, p);
-}
+}
+
+
+#define UPDATE_FOG_SCALE(ctx) do {\
+ if (ctx->Fog.End == ctx->Fog.Start)\
+ ctx->Fog._Scale = 1.0f;\
+ else\
+ ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);\
+ } while(0)
void GLAPIENTRY
@@ -108,17 +116,19 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
ctx->Fog.Density = *params;
break;
case GL_FOG_START:
- if (ctx->Fog.Start == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Start = *params;
- break;
+ if (ctx->Fog.Start == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Start = *params;
+ UPDATE_FOG_SCALE(ctx);
+ break;
case GL_FOG_END:
- if (ctx->Fog.End == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.End = *params;
- break;
+ if (ctx->Fog.End == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.End = *params;
+ UPDATE_FOG_SCALE(ctx);
+ break;
case GL_FOG_INDEX:
if (ctx->Fog.Index == *params)
return;
@@ -173,5 +183,6 @@ void _mesa_init_fog( GLcontext * ctx )
ctx->Fog.Start = 0.0;
ctx->Fog.End = 1.0;
ctx->Fog.ColorSumEnabled = GL_FALSE;
- ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
+ ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
+ ctx->Fog._Scale = 1.0f;
}
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 316a008ae3..0ebadaa9fa 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -46,8 +46,11 @@
#ifndef GLHEADER_H
#define GLHEADER_H
+#ifdef HAVE_DIX_CONFIG_H
+#include "dix-config.h"
+#endif
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#include "xf86_ansic.h"
#else
#include <assert.h>
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index bf1556fe6f..afa5fc1c7f 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -33,7 +33,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -71,6 +71,14 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
#endif
#endif
+/* If we don't actually want to use the libcwrapper junk (even though we're
+ * building an Xorg server module), then just undef IN_MODULE to signal that to
+ * the following code. It's left around for now to allow compiling of newish
+ * Mesa with older servers, but this whole mess should go away at some point.
+ */
+#ifdef NO_LIBCWRAPPER
+#undef IN_MODULE
+#endif
/**********************************************************************/
/** \name Memory */
@@ -287,6 +295,17 @@ _mesa_sin(double a)
#else
return sin(a);
#endif
+}
+
+/** Single precision wrapper around either sin() or xf86sin() */
+float
+_mesa_sinf(float a)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return (float) xf86sin((double) a);
+#else
+ return (float) sin((double) a);
+#endif
}
/** Wrapper around either cos() or xf86cos() */
@@ -300,6 +319,28 @@ _mesa_cos(double a)
#endif
}
+/** Single precision wrapper around either asin() or xf86asin() */
+float
+_mesa_asinf(float x)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return (float) xf86asin((double) x);
+#else
+ return (float) asin((double) x);
+#endif
+}
+
+/** Single precision wrapper around either atan() or xf86atan() */
+float
+_mesa_atanf(float x)
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return (float) xf86atan((double) x);
+#else
+ return (float) atan((double) x);
+#endif
+}
+
/** Wrapper around either sqrt() or xf86sqrt() */
double
_mesa_sqrtd(double x)
@@ -960,9 +1001,9 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... )
#endif
if (debug) {
#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86fprintf(stderr, "Mesa warning: %s", str);
+ xf86fprintf(stderr, "Mesa warning: %s\n", str);
#else
- fprintf(stderr, "Mesa warning: %s", str);
+ fprintf(stderr, "Mesa warning: %s\n", str);
#endif
}
}
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 7ee127400a..2827264a3a 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -161,7 +161,7 @@ typedef union { GLfloat f; GLint i; } fi_type;
***/
#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
# define SQRTF(X) _mesa_sqrtf(X)
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
+#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
# define SQRTF(X) (float) xf86sqrt((float) (X))
#else
# define SQRTF(X) (float) sqrt((float) (X))
@@ -209,7 +209,7 @@ static INLINE GLfloat LOG2(GLfloat val)
num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
return num.f + log_2;
}
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
+#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695))
#else
/*
@@ -281,7 +281,7 @@ static INLINE int GET_FLOAT_BITS( float x )
*** LDEXPF: multiply value by an integral power of two
*** FREXPF: extract mantissa and exponent from value
***/
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#define CEILF(x) ((GLfloat) xf86ceil(x))
#define FLOORF(x) ((GLfloat) xf86floor(x))
#define FABSF(x) ((GLfloat) xf86fabs(x))
@@ -573,6 +573,28 @@ do { \
} while (0)
#endif
#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
+
+#elif defined(_MSC_VER) && defined(_M_IX86)
+#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
+#define FAST_X86_FPU 0x003f /* See GCC comments above */
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = DEFAULT_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#else
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = FAST_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#endif
+#define END_FAST_MATH(x) do {\
+ __asm fnclex\
+ __asm fldcw word ptr [x]\
+} while(0)
+
#else
#define START_FAST_MATH(x) x = 0
#define END_FAST_MATH(x) (void)(x)
@@ -629,9 +651,18 @@ _mesa_memcmp( const void *s1, const void *s2, size_t n );
extern double
_mesa_sin(double a);
+extern float
+_mesa_sinf(float a);
+
extern double
_mesa_cos(double a);
+extern float
+_mesa_asinf(float x);
+
+extern float
+_mesa_atanf(float x);
+
extern double
_mesa_sqrtd(double x);
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 8fa62eb873..35ec1547e9 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -123,16 +123,18 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params)
case GL_SPOT_CUTOFF:
ASSERT(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0));
if (light->SpotCutoff == params[0])
- return;
+ return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
- light->SpotCutoff = params[0];
- light->_CosCutoff = (GLfloat) _mesa_cos(params[0]*DEG2RAD);
- if (light->_CosCutoff < 0)
- light->_CosCutoff = 0;
+ light->SpotCutoff = params[0];
+ light->_CosCutoffNeg = (GLfloat) (_mesa_cos(light->SpotCutoff * DEG2RAD));
+ if (light->_CosCutoffNeg < 0)
+ light->_CosCutoff = 0;
+ else
+ light->_CosCutoff = light->_CosCutoffNeg;
if (light->SpotCutoff != 180.0F)
- light->_Flags |= LIGHT_SPOT;
+ light->_Flags |= LIGHT_SPOT;
else
- light->_Flags &= ~LIGHT_SPOT;
+ light->_Flags &= ~LIGHT_SPOT;
break;
case GL_CONSTANT_ATTENUATION:
ASSERT(params[0] >= 0.0);
@@ -1263,7 +1265,8 @@ init_light( struct gl_light *l, GLuint n )
ASSIGN_3V( l->EyeDirection, 0.0, 0.0, -1.0 );
l->SpotExponent = 0.0;
_mesa_invalidate_spot_exp_table( l );
- l->SpotCutoff = 180.0;
+ l->SpotCutoff = 180.0;
+ l->_CosCutoffNeg = -1.0f;
l->_CosCutoff = 0.0; /* KW: -ve values not admitted */
l->ConstantAttenuation = 1.0;
l->LinearAttenuation = 0.0;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5854e0b8f5..d2a0af1121 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -451,7 +451,8 @@ struct gl_light
GLfloat EyePosition[4]; /**< position in eye coordinates */
GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */
GLfloat SpotExponent;
- GLfloat SpotCutoff; /**< in degrees */
+ GLfloat SpotCutoff; /**< in degrees */
+ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */
GLfloat _CosCutoff; /**< = MAX(0, cos(SpotCutoff)) */
GLfloat ConstantAttenuation;
GLfloat LinearAttenuation;
@@ -681,7 +682,7 @@ struct gl_enable_attrib
GLuint TexGen[MAX_TEXTURE_COORD_UNITS];
/* SGI_texture_color_table */
GLboolean TextureColorTable[MAX_TEXTURE_IMAGE_UNITS];
- /* GL_NV_vertex_program */
+ /* GL_ARB_vertex_program / GL_NV_vertex_program */
GLboolean VertexProgram;
GLboolean VertexProgramPointSize;
GLboolean VertexProgramTwoSide;
@@ -749,7 +750,8 @@ struct gl_fog_attrib
GLfloat Index; /**< Fog index */
GLenum Mode; /**< Fog mode */
GLboolean ColorSumEnabled;
- GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
+ GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
+ GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
};
@@ -1801,7 +1803,7 @@ struct vertex_program
{
struct program Base; /* base class */
GLboolean IsNVProgram; /* GL_NV_vertex_program ? */
- GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
+ GLboolean IsPositionInvariant; /* GL_ARB_vertex_program / GL_NV_vertex_program1_1 */
void *TnlData; /* should probably use Base.DriverData */
};
@@ -1827,8 +1829,8 @@ struct fragment_program
*/
struct gl_program_state
{
- GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_NV */
- const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_NV */
+ GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */
+ const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */
};
@@ -1837,10 +1839,10 @@ struct gl_program_state
*/
struct gl_vertex_program_state
{
- GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */
+ GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */
GLboolean _Enabled; /**< Enabled and valid program? */
- GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
+ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
struct vertex_program *Current; /**< ptr to currently bound program */
struct vertex_program *_Current; /**< ptr to currently bound
program, including internal
@@ -1972,7 +1974,9 @@ struct gl_query_state
*/
struct gl_shader_objects_state
{
- struct gl2_program_intf **current_program;
+ struct gl2_program_intf **CurrentProgram;
+ GLboolean _VertexShaderPresent;
+ GLboolean _FragmentShaderPresent;
};
@@ -2817,8 +2821,8 @@ struct __GLcontextRec
struct gl_color_table ProxyPostColorMatrixColorTable;
struct gl_program_state Program; /**< for vertex or fragment progs */
- struct gl_vertex_program_state VertexProgram; /**< GL_NV_vertex_program */
- struct gl_fragment_program_state FragmentProgram; /**< GL_NV_fragment_program */
+ struct gl_vertex_program_state VertexProgram; /**< GL_ARB/NV_vertex_program */
+ struct gl_fragment_program_state FragmentProgram; /**< GL_ARB/NV_vertex_program */
struct gl_ati_fragment_shader_state ATIFragmentShader; /**< GL_ATI_fragment_shader */
struct fragment_program *_TexEnvProgram; /**< Texture state as fragment program */
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index 42f41a289f..aa14bf8634 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -1198,7 +1198,9 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
if (rb->Data == NULL) {
rb->Width = 0;
rb->Height = 0;
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "software renderbuffer allocation");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "software renderbuffer allocation (%d x %d x %d)",
+ width, height, pixelSize);
return GL_FALSE;
}
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 9c59ac301f..994aaff7b0 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -786,6 +786,10 @@ _mesa_init_exec_table(struct _glapi_table *exec)
/* GL_EXT_timer_query */
SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT);
SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT);
+
+#if FEATURE_EXT_framebuffer_blit
+ SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
+#endif
}
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 04738b019b..e5263916b8 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -593,14 +593,14 @@ static struct ureg get_one( struct texenv_fragment_program *p )
static struct ureg get_half( struct texenv_fragment_program *p )
{
if (is_undef(p->half))
- p->one = register_scalar_const(p, 0.5);
+ p->half = register_scalar_const(p, 0.5);
return p->half;
}
static struct ureg get_zero( struct texenv_fragment_program *p )
{
if (is_undef(p->zero))
- p->one = register_scalar_const(p, 0.0);
+ p->zero = register_scalar_const(p, 0.0);
return p->zero;
}
@@ -757,6 +757,7 @@ static struct ureg emit_combine( struct texenv_fragment_program *p,
* result = tmp - .5
*/
half = get_half(p);
+ tmp = get_temp( p );
emit_arith( p, OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef );
emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp, half, undef );
return dest;
@@ -937,7 +938,7 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p,
GLuint src, GLuint unit )
{
switch (src) {
- case SRC_TEXTURE:
+ case SRC_TEXTURE:
load_texture(p, unit);
break;
@@ -949,7 +950,7 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p,
case SRC_TEXTURE5:
case SRC_TEXTURE6:
case SRC_TEXTURE7:
- if (!p->state->unit[src - SRC_TEXTURE0].enabled)
+ if (!p->state->unit[src - SRC_TEXTURE0].enabled)
return GL_FALSE;
load_texture(p, src - SRC_TEXTURE0);
break;
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index b01e63b781..c79f47182c 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -259,3 +259,5 @@ _mesa_finish_render_texture(GLcontext *ctx,
}
#endif
}
+
+
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 125f34e796..daf579a7bf 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -2801,6 +2801,8 @@ static void
update_texture_state( GLcontext *ctx )
{
GLuint unit;
+ struct gl2_program_intf **prog = ctx->ShaderObjects.CurrentProgram;
+ GLbitfield progteximageusage[MAX_TEXTURE_IMAGE_UNITS];
ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are
* actual changes.
@@ -2812,6 +2814,15 @@ update_texture_state( GLcontext *ctx )
ctx->Texture._TexGenEnabled = 0;
/*
+ * Grab texture image usage state from shader program. It must be
+ * grabbed every time uniform sampler changes, so maybe there is a
+ * better place to perform these rather expensive computations.
+ */
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ (**prog).GetTextureImageUsage (prog, progteximageusage);
+ }
+
+ /*
* Update texture unit state.
*/
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
@@ -2823,7 +2834,10 @@ update_texture_state( GLcontext *ctx )
texUnit->_GenFlags = 0;
/* Get the bitmask of texture enables */
- if (ctx->FragmentProgram._Enabled) {
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ enableBits = progteximageusage[unit];
+ }
+ else if (ctx->FragmentProgram._Enabled) {
enableBits = ctx->FragmentProgram.Current->TexturesUsed[unit];
}
else {
@@ -2945,7 +2959,10 @@ update_texture_state( GLcontext *ctx )
/* Fragment programs may need texture coordinates but not the
* corresponding texture images.
*/
- if (ctx->FragmentProgram._Enabled) {
+ if (ctx->ShaderObjects.CurrentProgram != NULL) {
+ ctx->Texture._EnabledCoordUnits |= (1 << ctx->Const.MaxTextureCoordUnits) - 1;
+ }
+ else if (ctx->FragmentProgram._Enabled) {
ctx->Texture._EnabledCoordUnits |=
(ctx->FragmentProgram.Current->Base.InputsRead >> FRAG_ATTRIB_TEX0);
}
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 416a65f2da..f5d23db650 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1985,6 +1985,7 @@ _mesa_texstore_z24_s8(STORE_PARAMS)
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes) {
+ /* simple path */
memcpy_texture(ctx, dims,
dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
dstRowStride, dstImageStride,
@@ -1992,7 +1993,44 @@ _mesa_texstore_z24_s8(STORE_PARAMS)
srcAddr, srcPacking);
}
else {
- _mesa_problem(ctx, "_mesa_texstore_z24_s8 not finished");
+ /* general path */
+ const GLint srcRowStride
+ = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
+ / sizeof(GLuint);
+ GLuint *dstImage = (GLuint *) dstAddr;
+ GLint img, row;
+
+ for (img = 0; img < srcDepth; img++) {
+ GLuint *dst = dstImage;
+ const GLuint *src
+ = (const GLuint *) _mesa_image_address(dims, srcPacking, srcAddr,
+ srcWidth, srcHeight,
+ srcFormat, srcType,
+ img, 0, 0);
+ for (row = 0; row < srcHeight; row++) {
+ GLubyte stencil[MAX_WIDTH];
+ GLint i;
+ /* the 24 depth bits will be in the high position: */
+ _mesa_unpack_depth_span(ctx, srcWidth,
+ GL_UNSIGNED_INT, /* dst type */
+ dst, /* dst addr */
+ (GLfloat) 0xffffff, /* depthScale */
+ srcType, src, srcPacking);
+ /* get the 8-bit stencil values */
+ _mesa_unpack_stencil_span(ctx, srcWidth,
+ GL_UNSIGNED_BYTE, /* dst type */
+ stencil, /* dst addr */
+ srcType, src, srcPacking,
+ ctx->_ImageTransferState);
+ /* merge stencil values into depth values */
+ for (i = 0; i < srcWidth; i++)
+ dst[i] |= stencil[i];
+
+ src += srcRowStride;
+ dst += dstRowStride / sizeof(GLuint);
+ }
+ dstImage += dstImageStride / sizeof(GLuint);
+ }
}
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index a64360adbe..a3c433b0c3 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -2296,7 +2296,8 @@ parse_address_reg (GLcontext * ctx, GLubyte ** inst,
{
struct var_cache *dst;
GLuint result;
- (void) Index;
+
+ *Index = 0; /* XXX */
dst = parse_string (inst, vc_head, Program, &result);
Program->Position = parse_position (inst);
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 95d3e42ef7..c359cf3560 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -1540,6 +1540,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
_mesa_free(program->Base.Instructions);
}
program->Base.Instructions = newInst;
+ program->Base.NumInstructions = parseState.numInst;
program->Base.InputsRead = parseState.inputsRead;
program->Base.OutputsWritten = parseState.outputsWritten;
for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++)
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index 7aac631934..71d5116b3e 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -978,6 +978,11 @@ Parse_AddressInstruction(struct parse_state *parseState, struct prog_instruction
inst->Opcode = OPCODE_ARL;
inst->StringPos = parseState->curLine - parseState->start;
+ /* Make ARB_vp backends happy */
+ inst->DstReg.File = PROGRAM_ADDRESS;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->DstReg.Index = 0;
+
/* dest A0 reg */
if (!Parse_AddrReg(parseState))
RETURN_ERROR;
@@ -1388,6 +1393,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
}
program->Base.Instructions = newInst;
program->Base.InputsRead = parseState.inputsRead;
+ program->Base.NumInstructions = parseState.numInst;
program->Base.OutputsWritten = parseState.outputsWritten;
program->IsPositionInvariant = parseState.isPositionInvariant;
program->IsNVProgram = GL_TRUE;
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 4e8dacea7e..d9c24c345c 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -107,14 +107,14 @@ _mesa_init_program(GLcontext *ctx)
void
_mesa_free_program_data(GLcontext *ctx)
{
-#if FEATURE_NV_vertex_program
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
if (ctx->VertexProgram.Current) {
ctx->VertexProgram.Current->Base.RefCount--;
if (ctx->VertexProgram.Current->Base.RefCount <= 0)
ctx->Driver.DeleteProgram(ctx, &(ctx->VertexProgram.Current->Base));
}
#endif
-#if FEATURE_NV_fragment_program
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
if (ctx->FragmentProgram.Current) {
ctx->FragmentProgram.Current->Base.RefCount--;
if (ctx->FragmentProgram.Current->Base.RefCount <= 0)
@@ -1699,10 +1699,9 @@ _mesa_BindProgram(GLenum target, GLuint id)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if ((target == GL_VERTEX_PROGRAM_NV
- && ctx->Extensions.NV_vertex_program) ||
- (target == GL_VERTEX_PROGRAM_ARB
- && ctx->Extensions.ARB_vertex_program)) {
+ if ((target == GL_VERTEX_PROGRAM_ARB) && /* == GL_VERTEX_PROGRAM_NV */
+ (ctx->Extensions.NV_vertex_program ||
+ ctx->Extensions.ARB_vertex_program)) {
/*** Vertex program binding ***/
struct vertex_program *curProg = ctx->VertexProgram.Current;
if (curProg->Base.Id == id) {
@@ -1750,7 +1749,7 @@ _mesa_BindProgram(GLenum target, GLuint id)
if (id == 0) {
/* Bind default program */
prog = NULL;
- if (target == GL_VERTEX_PROGRAM_NV || target == GL_VERTEX_PROGRAM_ARB)
+ if (target == GL_VERTEX_PROGRAM_ARB) /* == GL_VERTEX_PROGRAM_NV */
prog = ctx->Shared->DefaultVertexProgram;
else
prog = ctx->Shared->DefaultFragmentProgram;
@@ -1775,7 +1774,7 @@ _mesa_BindProgram(GLenum target, GLuint id)
}
/* bind now */
- if (target == GL_VERTEX_PROGRAM_NV || target == GL_VERTEX_PROGRAM_ARB) {
+ if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */
ctx->VertexProgram.Current = (struct vertex_program *) prog;
}
else if (target == GL_FRAGMENT_PROGRAM_NV || target == GL_FRAGMENT_PROGRAM_ARB) {
@@ -1820,7 +1819,7 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids)
}
else if (prog) {
/* Unbind program if necessary */
- if (prog->Target == GL_VERTEX_PROGRAM_NV ||
+ if (prog->Target == GL_VERTEX_PROGRAM_ARB || /* == GL_VERTEX_PROGRAM_NV */
prog->Target == GL_VERTEX_STATE_PROGRAM_NV) {
if (ctx->VertexProgram.Current &&
ctx->VertexProgram.Current->Base.Id == ids[i]) {
@@ -1996,7 +1995,7 @@ _mesa_GetProgramRegisterfvMESA(GLenum target,
reg[len] = 0;
switch (target) {
- case GL_VERTEX_PROGRAM_NV:
+ case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
if (!ctx->Extensions.ARB_vertex_program &&
!ctx->Extensions.NV_vertex_program) {
_mesa_error(ctx, GL_INVALID_ENUM,
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index ac8ff1af48..998d4e455e 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2004-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -30,39 +30,116 @@
#include "glheader.h"
-#include "shaderobjects.h"
-#include "shaderobjects_3dlabs.h"
#include "context.h"
-#include "macros.h"
#include "hash.h"
+#include "shaderobjects.h"
+#include "shaderobjects_3dlabs.h"
-void GLAPIENTRY
+#define I_UNKNOWN struct gl2_unknown_intf **
+#define I_GENERIC struct gl2_generic_intf **
+#define I_CONTAINER struct gl2_container_intf **
+#define I_PROGRAM struct gl2_program_intf **
+#define I_SHADER struct gl2_shader_intf **
+
+#define RELEASE_GENERIC(x)\
+ (**x)._unknown.Release ((I_UNKNOWN) x)
+
+#define RELEASE_CONTAINER(x)\
+ (**x)._generic._unknown.Release ((I_UNKNOWN) x)
+
+#define RELEASE_PROGRAM(x)\
+ (**x)._container._generic._unknown.Release ((I_UNKNOWN) x)
+
+#define RELEASE_SHADER(x)\
+ (**x)._generic._unknown.Release ((I_UNKNOWN) x);
+
+#define _LOOKUP_HANDLE(handle, function)\
+ I_UNKNOWN unk;\
+ _glthread_LOCK_MUTEX (ctx->Shared->Mutex);\
+ unk = (I_UNKNOWN) _mesa_HashLookup (ctx->Shared->GL2Objects, handle);\
+ _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);\
+ if (unk == NULL) {\
+ _mesa_error (ctx, GL_INVALID_VALUE, function);\
+ break;\
+ }
+
+#define _QUERY_INTERFACE(x, type, uuid, function)\
+ x = (type) (**unk).QueryInterface (unk, uuid);\
+ if (x == NULL) {\
+ _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+ break;\
+ }
+
+#define GET_GENERIC(x, handle, function)\
+ I_GENERIC x = NULL;\
+ do {\
+ _LOOKUP_HANDLE(handle, function);\
+ _QUERY_INTERFACE(x, I_GENERIC, UIID_GENERIC, function);\
+ } while (0)
+
+#define GET_CONTAINER(x, handle, function)\
+ I_CONTAINER x = NULL;\
+ do {\
+ _LOOKUP_HANDLE(handle, function);\
+ _QUERY_INTERFACE(x, I_CONTAINER, UIID_CONTAINER, function);\
+ } while (0)
+
+#define GET_PROGRAM(x, handle, function)\
+ I_PROGRAM x = NULL;\
+ do {\
+ _LOOKUP_HANDLE(handle, function);\
+ _QUERY_INTERFACE(x, I_PROGRAM, UIID_PROGRAM, function);\
+ } while (0)
+
+#define GET_SHADER(x, handle, function)\
+ I_SHADER x = NULL;\
+ do {\
+ _LOOKUP_HANDLE(handle, function);\
+ _QUERY_INTERFACE(x, I_SHADER, UIID_SHADER, function);\
+ } while (0)
+
+#define _LINKED_PROGRAM(x, function)\
+ if ((**x).GetLinkStatus (x) == GL_FALSE) {\
+ RELEASE_PROGRAM(x);\
+ _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+ break;\
+ }
+
+#define GET_LINKED_PROGRAM(x, handle, function)\
+ I_PROGRAM x = NULL;\
+ do {\
+ _LOOKUP_HANDLE(handle, function);\
+ _QUERY_INTERFACE(x, I_PROGRAM, UIID_PROGRAM, function);\
+ _LINKED_PROGRAM(x, function);\
+ } while (0)
+
+#define _CURRENT_PROGRAM(x, function)\
+ if (ctx->ShaderObjects.CurrentProgram == NULL) {\
+ _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+ break;\
+ }\
+ x = ctx->ShaderObjects.CurrentProgram;
+
+#define GET_CURRENT_LINKED_PROGRAM(x, function)\
+ I_PROGRAM x = NULL;\
+ do {\
+ _CURRENT_PROGRAM(x, function);\
+ _LINKED_PROGRAM(x, function);\
+ } while (0)
+
+
+GLvoid GLAPIENTRY
_mesa_DeleteObjectARB (GLhandleARB obj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_generic_intf **gen;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, obj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ GET_GENERIC(gen, obj, "glDeleteObjectARB");
- if (unk == NULL)
+ if (gen != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glDeleteObjectARB");
- return;
+ (**gen).Delete (gen);
+ RELEASE_GENERIC(gen);
}
-
- gen = (struct gl2_generic_intf **) (**unk).QueryInterface (unk, UIID_GENERIC);
- if (gen == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glDeleteObjectARB");
- return;
- }
-
- (**gen).Delete (gen);
- (**gen)._unknown.Release ((struct gl2_unknown_intf **) gen);
}
GLhandleARB GLAPIENTRY
@@ -73,58 +150,37 @@ _mesa_GetHandleARB (GLenum pname)
switch (pname)
{
case GL_PROGRAM_OBJECT_ARB:
- if (ctx->ShaderObjects.current_program != NULL)
- return (**ctx->ShaderObjects.current_program)._container._generic.GetName (
- (struct gl2_generic_intf **) ctx->ShaderObjects.current_program);
+ {
+ I_PROGRAM pro = ctx->ShaderObjects.CurrentProgram;
+
+ if (pro != NULL)
+ return (**pro)._container._generic.GetName ((I_GENERIC) pro);
+ }
break;
+ default:
+ _mesa_error (ctx, GL_INVALID_ENUM, "glGetHandleARB");
}
return 0;
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_DetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unkc, **unka;
- struct gl2_container_intf **con;
- struct gl2_generic_intf **att;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unkc = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, containerObj);
- unka = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, attachedObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unkc == NULL || unka == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glDetachObjectARB");
- return;
- }
-
- con = (struct gl2_container_intf **) (**unkc).QueryInterface (unkc, UIID_CONTAINER);
- if (con == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glDetachObjectARB");
- return;
- }
+ GET_CONTAINER(con, containerObj, "glDetachObjectARB");
- att = (struct gl2_generic_intf **) (**unka).QueryInterface (unka, UIID_GENERIC);
- if (att == NULL)
+ if (con != NULL)
{
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- _mesa_error (ctx, GL_INVALID_VALUE, "glDetachObjectARB");
- return;
- }
+ GET_GENERIC(att, attachedObj, "glDetachObjectARB");
- if ((**con).Detach (con, att) == GL_FALSE)
- {
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
- return;
+ if (att != NULL)
+ {
+ (**con).Detach (con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
}
-
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
}
GLhandleARB GLAPIENTRY
@@ -133,46 +189,47 @@ _mesa_CreateShaderObjectARB (GLenum shaderType)
return _mesa_3dlabs_create_shader_object (shaderType);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string,
const GLint *length)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_shader_intf **sha;
GLint *offsets;
GLsizei i;
GLcharARB *source;
+ GET_SHADER(sha, shaderObj, "glShaderSourceARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, shaderObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
-
- sha = (struct gl2_shader_intf **) (**unk).QueryInterface (unk, UIID_SHADER);
if (sha == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glShaderSourceARB");
- return;
- }
-
- /* this array holds offsets of where the appropriate string ends, thus the last
- element will be set to the total length of the source code */
+ return;
+
+ if (string == NULL)
+ {
+ RELEASE_SHADER(sha);
+ _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+
+ /*
+ * This array holds offsets of where the appropriate string ends, thus the last
+ * element will be set to the total length of the source code.
+ */
offsets = (GLint *) _mesa_malloc (count * sizeof (GLint));
if (offsets == NULL)
{
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
+ RELEASE_SHADER(sha);
_mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
return;
}
for (i = 0; i < count; i++)
- {
+ {
+ if (string[i] == NULL)
+ {
+ _mesa_free ((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
+ _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
if (length == NULL || length[i] < 0)
offsets[i] = _mesa_strlen (string[i]);
else
@@ -185,8 +242,8 @@ _mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **s
source = (GLcharARB *) _mesa_malloc ((offsets[count - 1] + 1) * sizeof (GLcharARB));
if (source == NULL)
{
- _mesa_free ((void *) offsets);
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
+ _mesa_free ((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
_mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
return;
}
@@ -199,445 +256,490 @@ _mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **s
source[offsets[count - 1]] = '\0';
(**sha).SetSource (sha, source, offsets, count);
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
+ RELEASE_SHADER(sha);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_CompileShaderARB (GLhandleARB shaderObj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_shader_intf **sha;
+ GET_SHADER(sha, shaderObj, "glCompileShaderARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, shaderObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glCompileShaderARB");
- return;
- }
-
- sha = (struct gl2_shader_intf **) (**unk).QueryInterface (unk, UIID_SHADER);
- if (sha == NULL)
+ if (sha != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glCompileShaderARB");
- return;
+ (**sha).Compile (sha);
+ RELEASE_SHADER(sha);
}
-
- (**sha).Compile (sha);
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
}
GLhandleARB GLAPIENTRY
-_mesa_CreateProgramObjectARB (void)
+_mesa_CreateProgramObjectARB (GLvoid)
{
return _mesa_3dlabs_create_program_object ();
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_AttachObjectARB (GLhandleARB containerObj, GLhandleARB obj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unkc, **unka;
- struct gl2_container_intf **con;
- struct gl2_generic_intf **att;
+ GET_CONTAINER(con, containerObj, "glAttachObjectARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unkc = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, containerObj);
- unka = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, obj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unkc == NULL || unka == NULL)
+ if (con != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glAttachObjectARB");
- return;
- }
-
- con = (struct gl2_container_intf **) (**unkc).QueryInterface (unkc, UIID_CONTAINER);
- if (con == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glAttachObjectARB");
- return;
- }
+ GET_GENERIC(att, obj, "glAttachObjectARB");
- att = (struct gl2_generic_intf **) (**unka).QueryInterface (unka, UIID_GENERIC);
- if (att == NULL)
- {
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- _mesa_error (ctx, GL_INVALID_VALUE, "glAttachObjectARB");
- return;
- }
-
- if (!(**con).Attach (con, att))
- {
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
- return;
+ if (att != NULL)
+ {
+ (**con).Attach (con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
}
-
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_LinkProgramARB (GLhandleARB programObj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ GET_PROGRAM(pro, programObj, "glLinkProgramARB");
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glLinkProgramARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glLinkProgramARB");
- return;
- }
-
- if (pro == ctx->ShaderObjects.current_program)
+ if (pro != NULL)
{
- /* TODO re-install executable program */
+ (**pro).Link (pro);
+ if (pro == ctx->ShaderObjects.CurrentProgram)
+ {
+ if ((**pro).GetLinkStatus (pro))
+ _mesa_UseProgramObjectARB (programObj);
+ else
+ _mesa_UseProgramObjectARB (0);
+ }
+ RELEASE_PROGRAM(pro);
}
-
- (**pro).Link (pro);
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_UseProgramObjectARB (GLhandleARB programObj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_intf **pro;
+ I_PROGRAM program = NULL;
- if (programObj == 0)
- {
- pro = NULL;
- }
- else
- {
- struct gl2_unknown_intf **unk;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUseProgramObjectARB");
- return;
- }
+ if (programObj != 0)
+ {
+ GET_PROGRAM(pro, programObj, "glUseProgramObjectARB");
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
if (pro == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB");
return;
- }
if ((**pro).GetLinkStatus (pro) == GL_FALSE)
{
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
+ RELEASE_PROGRAM(pro);
_mesa_error (ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB");
return;
}
- }
- if (ctx->ShaderObjects.current_program != NULL)
- {
- (**ctx->ShaderObjects.current_program)._container._generic._unknown.Release (
- (struct gl2_unknown_intf **) ctx->ShaderObjects.current_program);
- }
-
- ctx->ShaderObjects.current_program = pro;
+ program = pro;
+
+ ctx->ShaderObjects._VertexShaderPresent = (**pro).IsShaderPresent (pro, GL_VERTEX_SHADER_ARB);
+ ctx->ShaderObjects._FragmentShaderPresent = (**pro).IsShaderPresent (pro,
+ GL_FRAGMENT_SHADER_ARB);
+ }
+ else
+ {
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ }
+
+ if (ctx->ShaderObjects.CurrentProgram != NULL)
+ RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram);
+ ctx->ShaderObjects.CurrentProgram = program;
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_ValidateProgramARB (GLhandleARB programObj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
+ GET_PROGRAM(pro, programObj, "glValidateProgramARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glValidateProgramARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glValidateProgramARB");
- return;
+ (**pro).Validate (pro);
+ RELEASE_PROGRAM(pro);
}
-
- (**pro).Validate (pro);
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-/*
-Errors TODO
-
- The error INVALID_OPERATION is generated by the Uniform*ARB if the
- number of values loaded results in exceeding the declared extent of a
- uniform.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- the size does not match the size of the uniform declared in the shader.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- the type does not match the type of the uniform declared in the shader,
- if the uniform is not of type Boolean.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- <location> does not exist for the program object currently in use.
-
- The error INVALID_OPERATION is generated if a uniform command other than
- Uniform1i{v}ARB is used to load a sampler value.
-
-
-*/
-
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform1fARB (GLint location, GLfloat v0)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fARB");
- return;
+ if (!_slang_write_uniform (pro, location, 1, &v0, GL_FLOAT))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform2fARB (GLint location, GLfloat v0, GLfloat v1)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fARB");
- return;
+ GLfloat v[2] = { v0, v1 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_FLOAT_VEC2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fARB");
- return;
+ GLfloat v[3] = { v0, v1, v2 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_FLOAT_VEC3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fARB");
- return;
+ GLfloat v[4] = { v0, v1, v2, v3 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_FLOAT_VEC4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform1iARB (GLint location, GLint v0)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1iARB");
- return;
+ if (!_slang_write_uniform (pro, location, 1, &v0, GL_INT))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1iARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform2iARB (GLint location, GLint v0, GLint v1)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2iARB");
- return;
+ GLint v[2] = { v0, v1 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_INT_VEC2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2iARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform3iARB (GLint location, GLint v0, GLint v1, GLint v2)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3iARB");
- return;
+ GLint v[3] = { v0, v1, v2 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_INT_VEC3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3iARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4iARB");
- return;
+ GLint v[4] = { v0, v1, v2, v3 };
+
+ if (!_slang_write_uniform (pro, location, 1, v, GL_INT_VEC4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4iARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform1fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fvARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fvARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform2fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fvARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_VEC2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fvARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform3fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fvARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_VEC3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fvARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform4fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fvARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_VEC4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fvARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform1ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1ivARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_INT))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1ivARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform2ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2ivARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_INT_VEC2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2ivARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform3ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3ivARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_INT_VEC3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3ivARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_Uniform4ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4ivARB");
- return;
+ if (!_slang_write_uniform (pro, location, count, value, GL_INT_VEC4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4ivARB");
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_UniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
- return;
+ if (transpose)
+ {
+ GLfloat *trans, *pt;
+ const GLfloat *pv;
+
+ trans = (GLfloat *) _mesa_malloc (count * 4 * sizeof (GLfloat));
+ if (trans == NULL)
+ {
+ _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix2fvARB");
+ return;
+ }
+ for (pt = trans, pv = value; pt != trans + count * 4; pt += 4, pv += 4)
+ {
+ pt[0] = pv[0];
+ pt[1] = pv[2];
+ pt[2] = pv[1];
+ pt[3] = pv[3];
+ }
+ if (!_slang_write_uniform (pro, location, count, trans, GL_FLOAT_MAT2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
+ _mesa_free (trans);
+ }
+ else
+ {
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_MAT2))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
+ }
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_UniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
- return;
+ if (transpose)
+ {
+ GLfloat *trans, *pt;
+ const GLfloat *pv;
+
+ trans = (GLfloat *) _mesa_malloc (count * 9 * sizeof (GLfloat));
+ if (trans == NULL)
+ {
+ _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix3fvARB");
+ return;
+ }
+ for (pt = trans, pv = value; pt != trans + count * 9; pt += 9, pv += 9)
+ {
+ pt[0] = pv[0];
+ pt[1] = pv[3];
+ pt[2] = pv[6];
+ pt[3] = pv[1];
+ pt[4] = pv[4];
+ pt[5] = pv[7];
+ pt[6] = pv[2];
+ pt[7] = pv[5];
+ pt[8] = pv[8];
+ }
+ if (!_slang_write_uniform (pro, location, count, trans, GL_FLOAT_MAT3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
+ _mesa_free (trans);
+ }
+ else
+ {
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_MAT3))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
+ }
}
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_UniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB");
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (ctx->ShaderObjects.current_program == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
- return;
+ if (transpose)
+ {
+ GLfloat *trans, *pt;
+ const GLfloat *pv;
+
+ trans = (GLfloat *) _mesa_malloc (count * 16 * sizeof (GLfloat));
+ if (trans == NULL)
+ {
+ _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix4fvARB");
+ return;
+ }
+ for (pt = trans, pv = value; pt != trans + count * 16; pt += 16, pv += 16)
+ {
+ _math_transposef (pt, pv);
+ }
+ if (!_slang_write_uniform (pro, location, count, trans, GL_FLOAT_MAT4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
+ _mesa_free (trans);
+ }
+ else
+ {
+ if (!_slang_write_uniform (pro, location, count, value, GL_FLOAT_MAT4))
+ _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
+ }
}
}
@@ -646,536 +748,347 @@ _mesa_get_object_parameter (GLhandleARB obj, GLenum pname, GLvoid *params, GLboo
GLint *size)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_generic_intf **gen;
- struct gl2_shader_intf **sha;
- struct gl2_program_intf **pro;
GLint *ipar = (GLint *) params;
- /*GLfloat *fpar = (GLfloat *) params;*/
- GLboolean success = GL_TRUE;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, obj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
- return GL_FALSE;
- }
-
- gen = (struct gl2_generic_intf **) (**unk).QueryInterface (unk, UIID_GENERIC);
- if (gen == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- return GL_FALSE;
- }
-
- sha = (struct gl2_shader_intf **) (**unk).QueryInterface (unk, UIID_SHADER);
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
/* set default values */
*integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */
- *size = 1; /* param array size */
+ *size = 1; /* param array size */
switch (pname)
{
case GL_OBJECT_TYPE_ARB:
- *ipar = (**gen).GetType (gen);
- break;
- case GL_OBJECT_SUBTYPE_ARB:
- if (sha != NULL)
- *ipar = (**sha).GetSubType (sha);
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
case GL_OBJECT_DELETE_STATUS_ARB:
- *ipar = (**gen).GetDeleteStatus (gen);
+ case GL_OBJECT_INFO_LOG_LENGTH_ARB:
+ {
+ GET_GENERIC(gen, obj, "glGetObjectParameterivARB");
+
+ if (gen == NULL)
+ return GL_FALSE;
+
+ switch (pname)
+ {
+ case GL_OBJECT_TYPE_ARB:
+ *ipar = (**gen).GetType (gen);
+ break;
+ case GL_OBJECT_DELETE_STATUS_ARB:
+ *ipar = (**gen).GetDeleteStatus (gen);
+ break;
+ case GL_OBJECT_INFO_LOG_LENGTH_ARB:
+ {
+ const GLcharARB *info = (**gen).GetInfoLog (gen);
+
+ if (info == NULL)
+ *ipar = 0;
+ else
+ *ipar = _mesa_strlen (info) + 1;
+ }
+ break;
+ }
+
+ RELEASE_GENERIC(gen);
+ }
break;
+ case GL_OBJECT_SUBTYPE_ARB:
case GL_OBJECT_COMPILE_STATUS_ARB:
- if (sha != NULL)
- *ipar = (**sha).GetCompileStatus (sha);
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ GET_SHADER(sha, obj, "glGetObjectParameterivARB");
+
+ if (sha == NULL)
+ return GL_FALSE;
+
+ switch (pname)
+ {
+ case GL_OBJECT_SUBTYPE_ARB:
+ *ipar = (**sha).GetSubType (sha);
+ break;
+ case GL_OBJECT_COMPILE_STATUS_ARB:
+ *ipar = (**sha).GetCompileStatus (sha);
+ break;
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ const GLcharARB *src = (**sha).GetSource (sha);
+
+ if (src == NULL)
+ *ipar = 0;
+ else
+ *ipar = _mesa_strlen (src) + 1;
+ }
+ break;
+ }
+
+ RELEASE_SHADER(sha);
}
break;
case GL_OBJECT_LINK_STATUS_ARB:
- if (pro != NULL)
- *ipar = (**pro).GetLinkStatus (pro);
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
case GL_OBJECT_VALIDATE_STATUS_ARB:
- if (pro != NULL)
- *ipar = (**pro).GetValidateStatus (pro);
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
- case GL_OBJECT_INFO_LOG_LENGTH_ARB:
- {
- const GLcharARB *info = (**gen).GetInfoLog (gen);
- if (info == NULL)
- *ipar = 0;
- else
- *ipar = _mesa_strlen (info) + 1;
- }
- break;
case GL_OBJECT_ATTACHED_OBJECTS_ARB:
- if (pro != NULL)
- *ipar = (**pro)._container.GetAttachedCount ((struct gl2_container_intf **) pro);
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
- if (pro != NULL)
- *ipar = 0; /* TODO */
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
- if (pro != NULL)
- *ipar = 0; /* TODO */
- else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
- }
- break;
- case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
- if (sha != NULL) {
- const GLcharARB *src = (**sha).GetSource (sha);
- if (src == NULL)
- *ipar = 0;
- else
- *ipar = _mesa_strlen (src) + 1;
- } else {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB");
- success = GL_FALSE;
+ {
+ GET_PROGRAM(pro, obj, "glGetObjectParameterivARB");
+
+ if (pro == NULL)
+ return GL_FALSE;
+
+ switch (pname)
+ {
+ case GL_OBJECT_LINK_STATUS_ARB:
+ *ipar = (**pro).GetLinkStatus (pro);
+ break;
+ case GL_OBJECT_VALIDATE_STATUS_ARB:
+ *ipar = (**pro).GetValidateStatus (pro);
+ break;
+ case GL_OBJECT_ATTACHED_OBJECTS_ARB:
+ *ipar = (**pro)._container.GetAttachedCount ((I_CONTAINER) pro);
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
+ *ipar = _slang_get_active_uniform_count (pro);
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
+ *ipar = _slang_get_active_uniform_max_length (pro);
+ break;
+ }
+
+ RELEASE_PROGRAM(pro);
}
break;
default:
_mesa_error (ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB");
- success = GL_FALSE;
- break;
+ return GL_FALSE;
}
- (**gen)._unknown.Release ((struct gl2_unknown_intf **) gen);
- if (sha != NULL)
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
- if (pro != NULL)
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
-
- return success;
+ return GL_TRUE;
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params)
{
GLboolean integral;
- GLint size, i;
+ GLint size;
assert (sizeof (GLfloat) == sizeof (GLint));
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size) != GL_FALSE)
- if (integral != GL_FALSE)
+ if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
+ if (integral)
+ {
+ GLint i;
+
for (i = 0; i < size; i++)
params[i] = (GLfloat) ((GLint *) params)[i];
+ }
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
{
GLboolean integral;
- GLint size, i;
+ GLint size;
assert (sizeof (GLfloat) == sizeof (GLint));
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size) != GL_FALSE)
- if (integral == GL_FALSE)
+ if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
+ if (!integral)
+ {
+ GLint i;
+
for (i = 0; i < size; i++)
params[i] = (GLint) ((GLfloat *) params)[i];
+ }
}
-static void
+static GLvoid
_mesa_get_string (const GLcharARB *src, GLsizei maxLength, GLsizei *length, GLcharARB *str)
{
GLsizei len;
+ if (maxLength == 0)
+ {
+ if (length != NULL)
+ *length = 0;
+ return;
+ }
+
if (src == NULL)
src = "";
len = _mesa_strlen (src);
- if (len > maxLength)
- {
- len = maxLength;
- /* allocate space for null termination */
- if (len > 0)
- len--;
- }
+ if (len >= maxLength)
+ len = maxLength - 1;
_mesa_memcpy (str, src, len * sizeof (GLcharARB));
- if (maxLength > 0)
- str[len] = '\0';
-
+ str[len] = '\0';
if (length != NULL)
*length = len;
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_generic_intf **gen;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, obj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetInfoLogARB");
- return;
- }
+ GET_GENERIC(gen, obj, "glGetInfoLogARB");
- gen = (struct gl2_generic_intf **) (**unk).QueryInterface (unk, UIID_GENERIC);
- if (gen == NULL)
+ if (gen != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetInfoLogARB");
- return;
+ _mesa_get_string ((**gen).GetInfoLog (gen), maxLength, length, infoLog);
+ RELEASE_GENERIC(gen);
}
-
- _mesa_get_string ((**gen).GetInfoLog (gen), maxLength, length, infoLog);
-
- (**gen)._unknown.Release ((struct gl2_unknown_intf **) gen);
}
-void GLAPIENTRY
-_mesa_GetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj)
+GLvoid GLAPIENTRY
+_mesa_GetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count,
+ GLhandleARB *obj)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_container_intf **con;
GLsizei cnt, i;
+ GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, containerObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
+ if (con != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB");
- return;
- }
+ cnt = (**con).GetAttachedCount (con);
+ if (cnt > maxCount)
+ cnt = maxCount;
+ if (count != NULL)
+ *count = cnt;
- con = (struct gl2_container_intf **) (**unk).QueryInterface (unk, UIID_CONTAINER);
- if (con == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetAttachedObjectsARB");
- return;
- }
-
- cnt = (**con).GetAttachedCount (con);
- if (cnt > maxCount)
- cnt = maxCount;
-
- for (i = 0; i < cnt; i++)
- {
- struct gl2_generic_intf **x = (**con).GetAttached (con, i);
- obj[i] = (**x).GetName (x);
- (**x)._unknown.Release ((struct gl2_unknown_intf **) x);
+ for (i = 0; i < cnt; i++)
+ {
+ I_GENERIC x = (**con).GetAttached (con, i);
+ obj[i] = (**x).GetName (x);
+ RELEASE_GENERIC(x);
+ }
+ RELEASE_CONTAINER(con);
}
-
- (**con)._generic._unknown.Release ((struct gl2_unknown_intf **) con);
-
- if (count != NULL)
- *count = cnt;
}
GLint GLAPIENTRY
_mesa_GetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
GLint loc = -1;
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformLocationARB");
- return -1;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformLocationARB");
- return -1;
- }
-
- if ((**pro).GetLinkStatus (pro) == GL_FALSE)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformLocationARB");
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
- return -1;
+ if (name != NULL && (name[0] != 'g' || name[1] != 'l' || name[2] != '_'))
+ loc = _slang_get_uniform_location (pro, name);
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
return loc;
}
-void GLAPIENTRY
-_mesa_GetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
+GLvoid GLAPIENTRY
+_mesa_GetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
+ GLint *size, GLenum *type, GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ GET_PROGRAM(pro, programObj, "glGetActiveUniformARB");
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetActiveUniformARB");
- return;
+ if (index < _slang_get_active_uniform_count (pro))
+ _slang_get_active_uniform (pro, index, maxLength, length, size, type, name);
+ else
+ _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
+ RELEASE_PROGRAM(pro);
}
-
-/* if (index >= val (OBJECT_ACTIVE_ATTRIBUTES_ARB))
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
- return;
- }*/
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformfvARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
- return;
- }
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
- if ((**pro).GetLinkStatus (pro) == GL_FALSE)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
- return;
+ /* TODO */
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO validate location (OPERATION) */
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetUniformivARB (GLhandleARB programObj, GLint location, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformivARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
- return;
- }
-
- if ((**pro).GetLinkStatus (pro) == GL_FALSE)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
- return;
+ /* TODO */
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO validate location (GL_INVALID_OPERATION) */
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_GetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_shader_intf **sha;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, obj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetShaderSourceARB");
- return;
- }
+ GET_SHADER(sha, obj, "glGetShaderSourceARB");
- sha = (struct gl2_shader_intf **) (**unk).QueryInterface (unk, UIID_SHADER);
- if (sha == NULL)
+ if (sha != NULL)
{
- _mesa_error (ctx, GL_INVALID_OPERATION, "glGetShaderSourceARB");
- return;
+ _mesa_get_string ((**sha).GetSource (sha), maxLength, length, source);
+ RELEASE_SHADER(sha);
}
-
- _mesa_get_string ((**sha).GetSource (sha), maxLength, length, source);
-
- (**sha)._generic._unknown.Release ((struct gl2_unknown_intf **) sha);
}
/* GL_ARB_vertex_shader */
-void GLAPIENTRY
+GLvoid GLAPIENTRY
_mesa_BindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
+ GET_PROGRAM(pro, programObj, "glBindAttribLocationARB");
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
- return;
- }
-
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
- return;
+ if (name != NULL && (name[0] != 'g' || name[1] != 'l' || name[2] != '_'))
+ {
+ /* TODO */
+ }
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
-void GLAPIENTRY
-_mesa_GetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
+GLvoid GLAPIENTRY
+_mesa_GetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
+ GLint *size, GLenum *type, GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
- return;
- }
+ GET_PROGRAM(pro, programObj, "glGetActiveAttribARB");
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
- return;
+ /* TODO */
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
}
GLint GLAPIENTRY
_mesa_GetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **unk;
- struct gl2_program_intf **pro;
- GLint loc = 0;
-
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) _mesa_HashLookup (ctx->Shared->GL2Objects, programObj);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
-
- if (unk == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
- return 0;
- }
+ GLint loc = -1;
+ GET_PROGRAM(pro, programObj, "glGetAttribLocationARB");
- pro = (struct gl2_program_intf **) (**unk).QueryInterface (unk, UIID_PROGRAM);
- if (pro == NULL)
+ if (pro != NULL)
{
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
- return 0;
+ if (name != NULL && (name[0] != 'g' || name[1] != 'l' || name[2] != '_'))
+ {
+ /* TODO */
+ }
+ RELEASE_PROGRAM(pro);
}
-
- /* TODO */
-
- (**pro)._container._generic._unknown.Release ((struct gl2_unknown_intf **) pro);
return loc;
}
-void
+GLvoid
_mesa_init_shaderobjects (GLcontext *ctx)
{
- ctx->ShaderObjects.current_program = NULL;
+ ctx->ShaderObjects.CurrentProgram = NULL;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
_mesa_init_shaderobjects_3dlabs (ctx);
}
diff --git a/src/mesa/shader/shaderobjects.h b/src/mesa/shader/shaderobjects.h
index 7cea462aee..060328163b 100644
--- a/src/mesa/shader/shaderobjects.h
+++ b/src/mesa/shader/shaderobjects.h
@@ -25,7 +25,7 @@
#ifndef SHADEROBJECTS_H
#define SHADEROBJECTS_H
-#include "mtypes.h"
+#include "context.h"
/**
* gl2 unique interface identifier.
@@ -85,7 +85,14 @@ struct gl2_program_intf
GLboolean (* GetLinkStatus) (struct gl2_program_intf **);
GLboolean (* GetValidateStatus) (struct gl2_program_intf **);
GLvoid (* Link) (struct gl2_program_intf **);
- GLvoid (* Validate) (struct gl2_program_intf **);
+ GLvoid (* Validate) (struct gl2_program_intf **);
+ GLvoid (* UpdateFixedUniforms) (struct gl2_program_intf **);
+ GLvoid (* UpdateFixedAttribute) (struct gl2_program_intf **, GLuint, GLvoid *, GLuint, GLuint,
+ GLboolean);
+ GLvoid (* UpdateFixedVarying) (struct gl2_program_intf **, GLuint, GLvoid *, GLuint, GLuint,
+ GLboolean);
+ GLvoid (* GetTextureImageUsage) (struct gl2_program_intf **, GLbitfield *);
+ GLboolean (* IsShaderPresent) (struct gl2_program_intf **, GLenum);
};
struct gl2_fragment_shader_intf
diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c
index f03f65d701..0b0ae414fd 100755
--- a/src/mesa/shader/shaderobjects_3dlabs.c
+++ b/src/mesa/shader/shaderobjects_3dlabs.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,18 +31,17 @@
/* Set this to 1 when we are ready to use 3dlabs' front-end */
#define USE_3DLABS_FRONTEND 0
-#include "glheader.h"
+#include "imports.h"
+#include "hash.h"
+#include "macros.h"
#include "shaderobjects.h"
#include "shaderobjects_3dlabs.h"
-#include "context.h"
-#include "macros.h"
-#include "hash.h"
#if USE_3DLABS_FRONTEND
#include "slang_mesa.h"
#include "Public/ShaderLang.h"
#else
-#include "slang_compile.h"
+#include "slang_link.h"
#endif
struct gl2_unknown_obj
@@ -465,6 +464,7 @@ struct gl2_shader_obj
GLcharARB *source;
GLint *offsets;
GLsizei offset_count;
+ slang_translation_unit unit;
};
struct gl2_shader_impl
@@ -548,7 +548,6 @@ _shader_Compile (struct gl2_shader_intf **intf)
char **strings;
TBuiltInResource res;
#else
- slang_translation_unit unit;
slang_unit_type type;
slang_info_log info_log;
#endif
@@ -627,7 +626,7 @@ _shader_Compile (struct gl2_shader_intf **intf)
else
type = slang_unit_vertex_shader;
slang_info_log_construct (&info_log);
- if (_slang_compile (impl->_obj.source, &unit, type, &info_log))
+ if (_slang_compile (impl->_obj.source, &impl->_obj.unit, type, &info_log))
{
impl->_obj.compile_status = GL_TRUE;
}
@@ -682,6 +681,7 @@ struct gl2_program_obj
ShHandle linker;
ShHandle uniforms;
#endif
+ slang_program prog;
};
struct gl2_program_impl
@@ -693,13 +693,13 @@ struct gl2_program_impl
static void
_program_destructor (struct gl2_unknown_intf **intf)
{
-#if USE_3DLABS_FRONTEND
struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
-
+#if USE_3DLABS_FRONTEND
ShDestruct (impl->_obj.linker);
ShDestruct (impl->_obj.uniforms);
#endif
_container_destructor (intf);
+ slang_program_dtr (&impl->_obj.prog);
}
static struct gl2_unknown_intf **
@@ -758,12 +758,15 @@ _program_Link (struct gl2_program_intf **intf)
struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
#if USE_3DLABS_FRONTEND
ShHandle *handles;
- GLuint i;
#endif
+ GLuint i, count;
+ slang_translation_unit *units[2];
impl->_obj.link_status = GL_FALSE;
_mesa_free ((void *) impl->_obj._container._generic.info_log);
impl->_obj._container._generic.info_log = NULL;
+ slang_program_dtr (&impl->_obj.prog);
+ slang_program_ctr (&impl->_obj.prog);
#if USE_3DLABS_FRONTEND
handles = (ShHandle *) _mesa_malloc (impl->_obj._container.attached_count * sizeof (ShHandle));
@@ -794,6 +797,31 @@ _program_Link (struct gl2_program_intf **intf)
impl->_obj.link_status = GL_TRUE;
impl->_obj._container._generic.info_log = _mesa_strdup (ShGetInfoLog (impl->_obj.linker));
+#else
+ count = impl->_obj._container.attached_count;
+ if (count == 0 || count > 2)
+ return;
+ for (i = 0; i < count; i++)
+ {
+ struct gl2_generic_intf **obj;
+ struct gl2_unknown_intf **unk;
+ struct gl2_shader_impl *sha;
+
+ obj = impl->_obj._container.attached[i];
+ unk = (**obj)._unknown.QueryInterface ((struct gl2_unknown_intf **) obj, UIID_SHADER);
+ (**obj)._unknown.Release ((struct gl2_unknown_intf **) obj);
+ if (unk == NULL)
+ return;
+ sha = (struct gl2_shader_impl *) unk;
+ units[i] = &sha->_obj.unit;
+ (**unk).Release (unk);
+ }
+
+ impl->_obj.link_status = _slang_link (&impl->_obj.prog, units, count);
+ if (impl->_obj.link_status)
+ impl->_obj._container._generic.info_log = _mesa_strdup ("Link OK.\n");
+ else
+ impl->_obj._container._generic.info_log = _mesa_strdup ("Link failed.\n");
#endif
}
@@ -809,6 +837,373 @@ _program_Validate (struct gl2_program_intf **intf)
/* TODO validate */
}
+static GLvoid
+write_common_fixed (slang_program *pro, GLuint index, const GLvoid *src, GLuint off, GLuint size)
+{
+ GLuint i;
+
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ {
+ GLuint addr;
+
+ addr = pro->common_fixed_entries[i][index];
+ if (addr != ~0)
+ {
+ GLubyte *dst;
+
+ dst = (GLubyte *) pro->machines[i]->mem + addr + off * size;
+ _mesa_memcpy (dst, src, size);
+ }
+ }
+}
+
+static GLvoid
+write_common_fixed_mat4 (slang_program *pro, GLmatrix *matrix, GLuint off, GLuint i, GLuint ii,
+ GLuint it, GLuint iit)
+{
+ GLfloat mat[16];
+
+ /* we want inverse matrix */
+ if (!matrix->inv)
+ {
+ /* allocate inverse matrix and make it dirty */
+ _math_matrix_alloc_inv (matrix);
+ _math_matrix_loadf (matrix, matrix->m);
+ }
+ _math_matrix_analyse (matrix);
+
+ write_common_fixed (pro, i, matrix->m, off, 16 * sizeof (GLfloat));
+
+ /* inverse */
+ write_common_fixed (pro, ii, matrix->inv, off, 16 * sizeof (GLfloat));
+
+ /* transpose */
+ _math_transposef (mat, matrix->m);
+ write_common_fixed (pro, it, mat, off, 16 * sizeof (GLfloat));
+
+ /* inverse transpose */
+ _math_transposef (mat, matrix->inv);
+ write_common_fixed (pro, iit, mat, off, 16 * sizeof (GLfloat));
+}
+
+static GLvoid
+write_common_fixed_material (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e, GLuint a,
+ GLuint d, GLuint sp, GLuint sh)
+{
+ GLfloat v[17];
+
+ COPY_4FV(v, ctx->Light.Material.Attrib[e]);
+ COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]);
+ COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]);
+ COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]);
+ v[16] = ctx->Light.Material.Attrib[sh][0];
+ write_common_fixed (pro, i, v, 0, 17 * sizeof (GLfloat));
+}
+
+static GLvoid
+write_common_fixed_light_model_product (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e,
+ GLuint a)
+{
+ GLfloat v[4];
+
+ SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient);
+ ACC_4V(v, ctx->Light.Material.Attrib[e]);
+ write_common_fixed (pro, i, v, 0, 4 * sizeof (GLfloat));
+}
+
+static GLvoid
+write_common_fixed_light_product (GLcontext *ctx, slang_program *pro, GLuint off, GLuint i, GLuint a,
+ GLuint d, GLuint s)
+{
+ GLfloat v[12];
+
+ SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]);
+ SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse, ctx->Light.Material.Attrib[d]);
+ SCALE_4V((v + 8), ctx->Light.Light[off].Specular, ctx->Light.Material.Attrib[s]);
+ write_common_fixed (pro, i, v, off, 12 * sizeof (GLfloat));
+}
+
+static GLvoid
+_program_UpdateFixedUniforms (struct gl2_program_intf **intf)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+ GLfloat v[29];
+ GLfloat *p;
+
+ /* MODELVIEW matrix */
+ write_common_fixed_mat4 (pro, ctx->ModelviewMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE);
+
+ /* PROJECTION matrix */
+ write_common_fixed_mat4 (pro, ctx->ProjectionMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE);
+
+ /* MVP matrix */
+ write_common_fixed_mat4 (pro, &ctx->_ModelProjectMatrix, 0,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE);
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
+ {
+ /* TEXTURE matrix */
+ write_common_fixed_mat4 (pro, ctx->TextureMatrixStack[i].Top, i,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE);
+
+ /* EYE_PLANE texture-coordinate generation */
+ write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANES, ctx->Texture.Unit[i].EyePlaneS,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANET, ctx->Texture.Unit[i].EyePlaneT,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANER, ctx->Texture.Unit[i].EyePlaneR,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANEQ, ctx->Texture.Unit[i].EyePlaneQ,
+ i, 4 * sizeof (GLfloat));
+
+ /* OBJECT_PLANE texture-coordinate generation */
+ write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANES, ctx->Texture.Unit[i].ObjectPlaneS,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANET, ctx->Texture.Unit[i].ObjectPlaneT,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANER, ctx->Texture.Unit[i].ObjectPlaneR,
+ i, 4 * sizeof (GLfloat));
+ write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANEQ, ctx->Texture.Unit[i].ObjectPlaneQ,
+ i, 4 * sizeof (GLfloat));
+ }
+
+ /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */
+ p = ctx->ModelviewMatrixStack.Top->inv;
+ v[0] = p[0];
+ v[1] = p[4];
+ v[2] = p[8];
+ v[3] = p[1];
+ v[4] = p[5];
+ v[5] = p[9];
+ v[6] = p[2];
+ v[7] = p[6];
+ v[8] = p[10];
+ write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0, 9 * sizeof (GLfloat));
+
+ /* normal scale */
+ write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALSCALE, &ctx->_ModelViewInvScale, 0, sizeof (GLfloat));
+
+ /* depth range parameters */
+ v[0] = ctx->Viewport.Near;
+ v[1] = ctx->Viewport.Far;
+ v[2] = ctx->Viewport.Far - ctx->Viewport.Near;
+ write_common_fixed (pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0, 3 * sizeof (GLfloat));
+
+ /* CLIP_PLANEi */
+ for (i = 0; i < ctx->Const.MaxClipPlanes; i++)
+ {
+ write_common_fixed (pro, SLANG_COMMON_FIXED_CLIPPLANE, ctx->Transform.EyeUserPlane[i], i,
+ 4 * sizeof (GLfloat));
+ }
+
+ /* point parameters */
+ v[0] = ctx->Point.Size;
+ v[1] = ctx->Point.MinSize;
+ v[2] = ctx->Point.MaxSize;
+ v[3] = ctx->Point.Threshold;
+ COPY_3FV((v + 4), ctx->Point.Params);
+ write_common_fixed (pro, SLANG_COMMON_FIXED_POINT, v, 0, 7 * sizeof (GLfloat));
+
+ /* material parameters */
+ write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR,
+ MAT_ATTRIB_FRONT_SHININESS);
+ write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR,
+ MAT_ATTRIB_BACK_SHININESS);
+
+ for (i = 0; i < ctx->Const.MaxLights; i++)
+ {
+ /* light source parameters */
+ COPY_4FV(v, ctx->Light.Light[i].Ambient);
+ COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse);
+ COPY_4FV((v + 8), ctx->Light.Light[i].Specular);
+ COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition);
+ COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition);
+ v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f;
+ NORMALIZE_3FV((v + 16));
+ v[19] = 0.0f;
+ COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection);
+ v[23] = ctx->Light.Light[i].SpotExponent;
+ v[24] = ctx->Light.Light[i].SpotCutoff;
+ v[25] = ctx->Light.Light[i]._CosCutoffNeg;
+ v[26] = ctx->Light.Light[i].ConstantAttenuation;
+ v[27] = ctx->Light.Light[i].LinearAttenuation;
+ v[28] = ctx->Light.Light[i].QuadraticAttenuation;
+ write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i, 29 * sizeof (GLfloat));
+
+ /* light product */
+ write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR);
+ write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR);
+ }
+
+ /* light model parameters */
+ write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTMODEL, ctx->Light.Model.Ambient, 0, 4 * sizeof (GLfloat));
+
+ /* light model product */
+ write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT);
+ write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT);
+
+ /* TEXTURE_ENV_COLOR */
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
+ {
+ write_common_fixed (pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR, ctx->Texture.Unit[i].EnvColor,
+ i, 4 * sizeof (GLfloat));
+ }
+
+ /* fog parameters */
+ COPY_4FV(v, ctx->Fog.Color);
+ v[4] = ctx->Fog.Density;
+ v[5] = ctx->Fog.Start;
+ v[6] = ctx->Fog.End;
+ v[7] = ctx->Fog._Scale;
+ write_common_fixed (pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof (GLfloat));
+}
+
+static GLvoid
+_program_UpdateFixedAttribute (struct gl2_program_intf **intf, GLuint index, GLvoid *data,
+ GLuint offset, GLuint size, GLboolean write)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->vertex_fixed_entries[index];
+ if (addr != ~0)
+ {
+ GLubyte *mem;
+
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + offset * size;
+ if (write)
+ _mesa_memcpy (mem, data, size);
+ else
+ _mesa_memcpy (data, mem, size);
+ }
+}
+
+static GLvoid
+_program_UpdateFixedVarying (struct gl2_program_intf **intf, GLuint index, GLvoid *data,
+ GLuint offset, GLuint size, GLboolean write)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->fragment_fixed_entries[index];
+ if (addr != ~0)
+ {
+ GLubyte *mem;
+
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + offset * size;
+ if (write)
+ _mesa_memcpy (mem, data, size);
+ else
+ _mesa_memcpy (data, mem, size);
+ }
+}
+
+static GLvoid
+_program_GetTextureImageUsage (struct gl2_program_intf **intf, GLbitfield *teximageusage)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
+ teximageusage[i] = 0;
+
+ for (i = 0; i < pro->texture_usage.count; i++)
+ {
+ GLuint n, addr, j;
+
+ n = pro->texture_usage.table[i].quant->array_len;
+ if (n == 0)
+ n = 1;
+ addr = pro->texture_usage.table[i].frag_address;
+ for (j = 0; j < n; j++)
+ {
+ GLubyte *mem;
+ GLuint image;
+
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + j * 4;
+ image = (GLuint) *((GLfloat *) mem);
+ if (image >= 0 && image < ctx->Const.MaxTextureImageUnits)
+ {
+ switch (pro->texture_usage.table[i].quant->u.basic_type)
+ {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_1D_BIT;
+ break;
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_2D_BIT;
+ break;
+ case GL_SAMPLER_3D_ARB:
+ teximageusage[image] |= TEXTURE_3D_BIT;
+ break;
+ case GL_SAMPLER_CUBE_ARB:
+ teximageusage[image] |= TEXTURE_CUBE_BIT;
+ break;
+ }
+ }
+ }
+ }
+
+ /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */
+}
+
+static GLboolean
+_program_IsShaderPresent (struct gl2_program_intf **intf, GLenum subtype)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+
+ switch (subtype)
+ {
+ case GL_VERTEX_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_VERTEX] != NULL;
+ case GL_FRAGMENT_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_FRAGMENT] != NULL;
+ default:
+ return GL_FALSE;
+ }
+}
+
static struct gl2_program_intf _program_vftbl = {
{
{
@@ -831,7 +1226,12 @@ static struct gl2_program_intf _program_vftbl = {
_program_GetLinkStatus,
_program_GetValidateStatus,
_program_Link,
- _program_Validate
+ _program_Validate,
+ _program_UpdateFixedUniforms,
+ _program_UpdateFixedAttribute,
+ _program_UpdateFixedVarying,
+ _program_GetTextureImageUsage,
+ _program_IsShaderPresent
};
static void
@@ -846,6 +1246,7 @@ _program_constructor (struct gl2_program_impl *impl)
impl->_obj.linker = ShConstructLinker (EShExVertexFragment, 0);
impl->_obj.uniforms = ShConstructUniformMap ();
#endif
+ slang_program_ctr (&impl->_obj.prog);
}
struct gl2_fragment_shader_obj
@@ -1041,6 +1442,235 @@ _mesa_3dlabs_create_program_object (void)
return 0;
}
+#include "slang_assemble.h"
+#include "slang_execute.h"
+
+int _slang_fetch_discard (struct gl2_program_intf **pro, GLboolean *val)
+{
+ struct gl2_program_impl *impl;
+
+ impl = (struct gl2_program_impl *) pro;
+ *val = impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->kill ? GL_TRUE : GL_FALSE;
+ return 1;
+}
+
+static GLvoid exec_shader (struct gl2_program_intf **pro, GLuint i)
+{
+ struct gl2_program_impl *impl;
+ slang_program *p;
+
+ impl = (struct gl2_program_impl *) pro;
+ p = &impl->_obj.prog;
+
+ slang_machine_init (p->machines[i]);
+ p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];
+
+ _slang_execute2 (p->assemblies[i], p->machines[i]);
+}
+
+GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro)
+{
+ exec_shader (pro, SLANG_SHADER_FRAGMENT);
+}
+
+GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro)
+{
+ exec_shader (pro, SLANG_SHADER_VERTEX);
+}
+
+GLint _slang_get_uniform_location (struct gl2_program_intf **pro, const char *name)
+{
+ struct gl2_program_impl *impl;
+ slang_uniform_bindings *bind;
+ GLuint i;
+
+ impl = (struct gl2_program_impl *) pro;
+ bind = &impl->_obj.prog.uniforms;
+ for (i = 0; i < bind->count; i++)
+ if (_mesa_strcmp (bind->table[i].name, name) == 0)
+ return i;
+ return -1;
+}
+
+GLboolean _slang_write_uniform (struct gl2_program_intf **pro, GLint loc, GLsizei count,
+ const GLvoid *data, GLenum type)
+{
+ struct gl2_program_impl *impl;
+ slang_uniform_bindings *bind;
+ slang_uniform_binding *b;
+ GLuint i;
+ GLboolean convert_float_to_bool = GL_FALSE;
+ GLboolean convert_int_to_bool = GL_FALSE;
+ GLboolean convert_int_to_float = GL_FALSE;
+ GLboolean types_match = GL_FALSE;
+
+ if (loc == -1)
+ return GL_TRUE;
+
+ impl = (struct gl2_program_impl *) pro;
+ bind = &impl->_obj.prog.uniforms;
+ if (loc >= bind->count)
+ return GL_FALSE;
+
+ b = &bind->table[loc];
+ /* TODO: check sizes */
+ if (b->quant->structure != NULL)
+ return GL_FALSE;
+
+ switch (b->quant->u.basic_type)
+ {
+ case GL_BOOL_ARB:
+ types_match = (type == GL_FLOAT) || (type == GL_INT);
+ if (type == GL_FLOAT)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC2_ARB:
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
+ if (type == GL_FLOAT_VEC2_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC3_ARB:
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
+ if (type == GL_FLOAT_VEC3_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC4_ARB:
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
+ if (type == GL_FLOAT_VEC4_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ types_match = (type == GL_INT);
+ break;
+ default:
+ types_match = (type == b->quant->u.basic_type);
+ break;
+ }
+
+ if (!types_match)
+ return GL_FALSE;
+
+ switch (type)
+ {
+ case GL_INT:
+ case GL_INT_VEC2_ARB:
+ case GL_INT_VEC3_ARB:
+ case GL_INT_VEC4_ARB:
+ convert_int_to_float = GL_TRUE;
+ break;
+ }
+
+ if (convert_float_to_bool)
+ {
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ if (b->address[i] != ~0)
+ {
+ const GLfloat *src = (GLfloat *) (data);
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);
+ GLuint j;
+
+ for (j = 0; j < count * b->quant->size / 4; j++)
+ dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;
+ }
+ }
+ else if (convert_int_to_bool)
+ {
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ if (b->address[i] != ~0)
+ {
+ const GLuint *src = (GLuint *) (data);
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);
+ GLuint j;
+
+ for (j = 0; j < count * b->quant->size / 4; j++)
+ dst[j] = src[j] ? 1.0f : 0.0f;
+ }
+ }
+ else if (convert_int_to_float)
+ {
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ if (b->address[i] != ~0)
+ {
+ const GLuint *src = (GLuint *) (data);
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);
+ GLuint j;
+
+ for (j = 0; j < count * b->quant->size / 4; j++)
+ dst[j] = (GLfloat) src[j];
+ }
+ }
+ else
+ {
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ if (b->address[i] != ~0)
+ {
+ _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4], data,
+ count * b->quant->size);
+ }
+ }
+ return GL_TRUE;
+}
+
+GLuint _slang_get_active_uniform_count (struct gl2_program_intf **pro)
+{
+ struct gl2_program_impl *impl;
+
+ impl = (struct gl2_program_impl *) pro;
+ return impl->_obj.prog.active_uniforms.count;
+}
+
+GLuint _slang_get_active_uniform_max_length (struct gl2_program_intf **pro)
+{
+ struct gl2_program_impl *impl;
+ GLuint i, len = 0;
+
+ impl = (struct gl2_program_impl *) pro;
+ for (i = 0; i < impl->_obj.prog.active_uniforms.count; i++)
+ {
+ GLuint n = _mesa_strlen (impl->_obj.prog.active_uniforms.table[i].name);
+ if (n > len)
+ len = n;
+ }
+ return len;
+}
+
+GLvoid _slang_get_active_uniform (struct gl2_program_intf **pro, GLuint index, GLsizei maxLength,
+ GLsizei *length, GLint *size, GLenum *type, char *name)
+{
+ struct gl2_program_impl *impl;
+ slang_active_uniform *u;
+ GLsizei len;
+
+ impl = (struct gl2_program_impl *) pro;
+ u = &impl->_obj.prog.active_uniforms.table[index];
+
+ len = _mesa_strlen (u->name);
+ if (len >= maxLength)
+ len = maxLength - 1;
+ _mesa_memcpy (name, u->name, len);
+ name[len] = '\0';
+ if (length != NULL)
+ *length = len;
+ *type = u->quant->u.basic_type;
+ if (u->quant->array_len == 0)
+ *size = 1;
+ else
+ *size = u->quant->array_len;
+}
+
void
_mesa_init_shaderobjects_3dlabs (GLcontext *ctx)
{
diff --git a/src/mesa/shader/shaderobjects_3dlabs.h b/src/mesa/shader/shaderobjects_3dlabs.h
index 4cb8cf4540..d82079d8f3 100755
--- a/src/mesa/shader/shaderobjects_3dlabs.h
+++ b/src/mesa/shader/shaderobjects_3dlabs.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,13 +25,29 @@
#ifndef SHADEROBJECTS_3DLABS_H
#define SHADEROBJECTS_3DLABS_H
-#include "mtypes.h"
+extern int _slang_fetch_discard (struct gl2_program_intf **pro, GLboolean *val);
+
+extern GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro);
+
+extern GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro);
+
+extern GLint _slang_get_uniform_location (struct gl2_program_intf **pro, const char *name);
+
+extern GLboolean _slang_write_uniform (struct gl2_program_intf **pro, GLint loc, GLsizei count,
+ const GLvoid *data, GLenum type);
+
+extern GLuint _slang_get_active_uniform_count (struct gl2_program_intf **pro);
+
+extern GLuint _slang_get_active_uniform_max_length (struct gl2_program_intf **pro);
+
+extern GLvoid _slang_get_active_uniform (struct gl2_program_intf **pro, GLuint index, GLsizei maxLength,
+ GLsizei *length, GLint *size, GLenum *type, char *name);
extern GLhandleARB
_mesa_3dlabs_create_shader_object (GLenum);
extern GLhandleARB
-_mesa_3dlabs_create_program_object (void);
+_mesa_3dlabs_create_program_object (GLvoid);
extern void
_mesa_init_shaderobjects_3dlabs (GLcontext *ctx);
diff --git a/src/mesa/shader/slang/descrip.mms b/src/mesa/shader/slang/descrip.mms
index eddf39cada..c86763718a 100644
--- a/src/mesa/shader/slang/descrip.mms
+++ b/src/mesa/shader/slang/descrip.mms
@@ -1,6 +1,6 @@
# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 1 June 2005
+# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
+# Last revision : 17 March 2006
.first
define gl [----.include.gl]
@@ -25,7 +25,11 @@ OBJECTS = \
slang_compile.obj,slang_preprocess.obj,slang_utility.obj,\
slang_execute.obj,slang_assemble.obj,slang_assemble_conditional.obj,\
slang_assemble_constructor.obj,slang_assemble_typeinfo.obj,\
- slang_storage.obj,slang_assemble_assignment.obj
+ slang_storage.obj,slang_assemble_assignment.obj,\
+ slang_compile_function.obj,slang_compile_struct.obj,\
+ slang_compile_variable.obj,slang_compile_operation.obj,\
+ slang_library_noise.obj,slang_link.obj,slang_export.obj,\
+ slang_analyse.obj,slang_library_texsample.obj
##### RULES #####
@@ -50,3 +54,12 @@ slang_assemble_constructor.obj : slang_assemble_constructor.c
slang_assemble_typeinfo.obj : slang_assemble_typeinfo.c
slang_storage.obj : slang_storage.c
slang_assemble_assignment.obj : slang_assemble_assignment.c
+slang_compile_function.obj : slang_compile_function.c
+slang_compile_struct.obj : slang_compile_struct.c
+slang_compile_variable.obj : slang_compile_variable.c
+slang_compile_operation.obj : slang_compile_operation.c
+slang_library_noise.obj : slang_library_noise.c
+slang_link.obj : slang_link.c
+slang_export.obj : slang_export.c
+slang_analyse.obj : slang_analyse.c
+slang_library_texsample.obj : slang_library_texsample.c
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index 0b3ed0e880..58728377a3 100755
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -1,58 +1,50 @@
-
-//
-// TODO:
-// - implement sin, asin, acos, atan, pow, log2, floor, ceil,
-// - implement texture1D, texture2D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
-// - implement noise1, noise2, noise3, noise4,
-//
-
-//
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+//
// From Shader Spec, ver. 1.10, rev. 59
-//
-// The following built-in constants are provided to vertex and fragment shaders.
-//
-
-//
-// Implementation dependent constants. The example values below
-// are the minimum values allowed for these maximums.
-//
-
-const int gl_MaxLights = 8; // GL 1.0
-const int gl_MaxClipPlanes = 6; // GL 1.0
-const int gl_MaxTextureUnits = 2; // GL 1.3
-const int gl_MaxTextureCoords = 2; // ARB_fragment_program
-const int gl_MaxVertexAttribs = 16; // ARB_vertex_shader
-const int gl_MaxVertexUniformComponents = 512; // ARB_vertex_shader
-const int gl_MaxVaryingFloats = 32; // ARB_vertex_shader
-const int gl_MaxVertexTextureImageUnits = 0; // ARB_vertex_shader
-const int gl_MaxCombinedTextureImageUnits = 2; // ARB_vertex_shader
-const int gl_MaxTextureImageUnits = 2; // ARB_fragment_shader
-const int gl_MaxFragmentUniformComponents = 64; // ARB_fragment_shader
-const int gl_MaxDrawBuffers = 1; // proposed ARB_draw_buffers
-
-//
-// As an aid to accessing OpenGL processing state, the following uniform variables are built into
-// the OpenGL Shading Language. All page numbers and notations are references to the 1.4
-// specification.
-//
-
-//
-// Matrix state. p. 31, 32, 37, 39, 40.
-//
+//
+
+const int gl_MaxLights = 8;
+const int gl_MaxClipPlanes = 6;
+const int gl_MaxTextureUnits = 8;
+const int gl_MaxTextureCoords = 8;
+const int gl_MaxVertexAttribs = 16;
+const int gl_MaxVertexUniformComponents = 512;
+const int gl_MaxVaryingFloats = 32;
+const int gl_MaxVertexTextureImageUnits = 0;
+const int gl_MaxCombinedTextureImageUnits = 2;
+const int gl_MaxTextureImageUnits = 2;
+const int gl_MaxFragmentUniformComponents = 64;
+const int gl_MaxDrawBuffers = 1;
uniform mat4 gl_ModelViewMatrix;
uniform mat4 gl_ProjectionMatrix;
uniform mat4 gl_ModelViewProjectionMatrix;
uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];
-//
-// Derived matrix state that provides inverse and transposed versions
-// of the matrices above. Poorly conditioned matrices may result
-// in unpredictable values in their inverse forms.
-//
-uniform mat3 gl_NormalMatrix; // transpose of the inverse of the
- // upper leftmost 3x3 of gl_ModelViewMatrix
+uniform mat3 gl_NormalMatrix;
uniform mat4 gl_ModelViewMatrixInverse;
uniform mat4 gl_ProjectionMatrixInverse;
@@ -69,34 +61,18 @@ uniform mat4 gl_ProjectionMatrixInverseTranspose;
uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;
uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];
-//
-// Normal scaling p. 39.
-//
-
uniform float gl_NormalScale;
-//
-// Depth range in window coordinates, p. 33
-//
-
struct gl_DepthRangeParameters {
- float near; // n
- float far; // f
- float diff; // f - n
+ float near;
+ float far;
+ float diff;
};
uniform gl_DepthRangeParameters gl_DepthRange;
-//
-// Clip planes p. 42.
-//
-
uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];
-//
-// Point Size, p. 66, 67.
-//
-
struct gl_PointParameters {
float size;
float sizeMin;
@@ -109,74 +85,56 @@ struct gl_PointParameters {
uniform gl_PointParameters gl_Point;
-//
-// Material State p. 50, 55.
-//
-
struct gl_MaterialParameters {
- vec4 emission; // Ecm
- vec4 ambient; // Acm
- vec4 diffuse; // Dcm
- vec4 specular; // Scm
- float shininess; // Srm
+ vec4 emission;
+ vec4 ambient;
+ vec4 diffuse;
+ vec4 specular;
+ float shininess;
};
uniform gl_MaterialParameters gl_FrontMaterial;
uniform gl_MaterialParameters gl_BackMaterial;
-//
-// Light State p 50, 53, 55.
-//
-
struct gl_LightSourceParameters {
- vec4 ambient; // Acli
- vec4 diffuse; // Dcli
- vec4 specular; // Scli
- vec4 position; // Ppli
- vec4 halfVector; // Derived: Hi
- vec3 spotDirection; // Sdli
- float spotExponent; // Srli
- float spotCutoff; // Crli
- // (range: [0.0,90.0], 180.0)
- float spotCosCutoff; // Derived: cos(Crli)
- // (range: [1.0,0.0],-1.0)
- float constantAttenuation; // K0
- float linearAttenuation; // K1
- float quadraticAttenuation; // K2
+ vec4 ambient;
+ vec4 diffuse;
+ vec4 specular;
+ vec4 position;
+ vec4 halfVector;
+ vec3 spotDirection;
+ float spotExponent;
+ float spotCutoff;
+ float spotCosCutoff;
+ float constantAttenuation;
+ float linearAttenuation;
+ float quadraticAttenuation;
};
uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];
struct gl_LightModelParameters {
- vec4 ambient; // Acs
+ vec4 ambient;
};
uniform gl_LightModelParameters gl_LightModel;
-//
-// Derived state from products of light and material.
-//
-
struct gl_LightModelProducts {
- vec4 sceneColor; // Derived. Ecm + Acm * Acs
+ vec4 sceneColor;
};
uniform gl_LightModelProducts gl_FrontLightModelProduct;
uniform gl_LightModelProducts gl_BackLightModelProduct;
struct gl_LightProducts {
- vec4 ambient; // Acm * Acli
- vec4 diffuse; // Dcm * Dcli
- vec4 specular; // Scm * Scli
+ vec4 ambient;
+ vec4 diffuse;
+ vec4 specular;
};
uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];
uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];
-//
-// Texture Environment and Generation, p. 152, p. 40-42.
-//
-
uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];
uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];
uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];
@@ -187,1224 +145,1325 @@ uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];
uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];
uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];
-//
-// Fog p. 161
-//
-
struct gl_FogParameters {
vec4 color;
float density;
float start;
float end;
- float scale; // Derived: 1.0 / (end - start)
+ float scale;
};
uniform gl_FogParameters gl_Fog;
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
+//
// 8.1 Angle and Trigonometry Functions
-//
-// Function parameters specified as angle are assumed to be in units of radians. In no case will
-// any of these functions result in a divide by zero error. If the divisor of a ratio is 0, then
-// results will be undefined.
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Converts degrees to radians and returns the result, i.e., result = PI*deg/180.
-//
+//
float radians (float deg) {
return 3.141593 * deg / 180.0;
-}
+}
+
vec2 radians (vec2 deg) {
- return vec2 (radians (deg.x), radians (deg.y));
-}
+ return vec2 (3.141593) * deg / vec2 (180.0);
+}
+
vec3 radians (vec3 deg) {
- return vec3 (radians (deg.x), radians (deg.y), radians (deg.z));
-}
+ return vec3 (3.141593) * deg / vec3 (180.0);
+}
+
vec4 radians (vec4 deg) {
- return vec4 (radians (deg.x), radians (deg.y), radians (deg.z), radians (deg.w));
+ return vec4 (3.141593) * deg / vec4 (180.0);
}
-//
-// Converts radians to degrees and returns the result, i.e., result = 180*rad/PI.
-//
-
float degrees (float rad) {
return 180.0 * rad / 3.141593;
-}
+}
+
vec2 degrees (vec2 rad) {
- return vec2 (degrees (rad.x), degrees (rad.y));
-}
+ return vec2 (180.0) * rad / vec2 (3.141593);
+}
+
vec3 degrees (vec3 rad) {
- return vec3 (degrees (rad.x), degrees (rad.y), degrees (rad.z));
-}
+ return vec3 (180.0) * rad / vec3 (3.141593);
+}
+
vec4 degrees (vec4 rad) {
- return vec4 (degrees (rad.x), degrees (rad.y), degrees (rad.z), degrees (rad.w));
+ return vec4 (180.0) * rad / vec4 (3.141593);
}
-//
-// The standard trigonometric sine function.
-//
-// XXX
-float sin (float angle) {
- return 0.0;
-}
+float sin (float angle) {
+ float x;
+ __asm float_sine x, angle;
+ return x;
+}
+
vec2 sin (vec2 angle) {
- return vec2 (sin (angle.x), sin (angle.y));
-}
+ return vec2 (
+ sin (angle.x),
+ sin (angle.y)
+ );
+}
+
vec3 sin (vec3 angle) {
- return vec3 (sin (angle.x), sin (angle.y), sin (angle.z));
-}
+ return vec3 (
+ sin (angle.x),
+ sin (angle.y),
+ sin (angle.z)
+ );
+}
+
vec4 sin (vec4 angle) {
- return vec4 (sin (angle.x), sin (angle.y), sin (angle.z), sin (angle.w));
+ return vec4 (
+ sin (angle.x),
+ sin (angle.y),
+ sin (angle.z),
+ sin (angle.w)
+ );
}
-//
-// The standard trigonometric cosine function.
-//
-
float cos (float angle) {
return sin (angle + 1.5708);
-}
+}
+
vec2 cos (vec2 angle) {
- return vec2 (cos (angle.x), cos (angle.y));
-}
+ return vec2 (
+ cos (angle.x),
+ cos (angle.y)
+ );
+}
+
vec3 cos (vec3 angle) {
- return vec3 (cos (angle.x), cos (angle.y), cos (angle.z));
-}
+ return vec3 (
+ cos (angle.x),
+ cos (angle.y),
+ cos (angle.z)
+ );
+}
+
vec4 cos (vec4 angle) {
- return vec4 (cos (angle.x), cos (angle.y), cos (angle.z), cos (angle.w));
+ return vec4 (
+ cos (angle.x),
+ cos (angle.y),
+ cos (angle.z),
+ cos (angle.w)
+ );
}
-//
-// The standard trigonometric tangent.
-//
-
float tan (float angle) {
return sin (angle) / cos (angle);
-}
+}
+
vec2 tan (vec2 angle) {
- return vec2 (tan (angle.x), tan (angle.y));
-}
+ return vec2 (
+ tan (angle.x),
+ tan (angle.y)
+ );
+}
+
vec3 tan (vec3 angle) {
- return vec3 (tan (angle.x), tan (angle.y), tan (angle.z));
-}
+ return vec3 (
+ tan (angle.x),
+ tan (angle.y),
+ tan (angle.z)
+ );
+}
+
vec4 tan (vec4 angle) {
- return vec4 (tan (angle.x), tan (angle.y), tan (angle.z), tan (angle.w));
+ return vec4 (
+ tan (angle.x),
+ tan (angle.y),
+ tan (angle.z),
+ tan (angle.w)
+ );
}
-//
-// Arc sine. Returns an angle whose sine is x. The range of values returned by this function is
-// [–PI/2, PI/2]. Results are undefined if |x| > 1.
-//
-// XXX
float asin (float x) {
- return 0.0;
-}
-vec2 asin (vec2 x) {
- return vec2 (asin (x.x), asin (x.y));
-}
-vec3 asin (vec3 x) {
- return vec3 (asin (x.x), asin (x.y), asin (x.z));
-}
-vec4 asin (vec4 x) {
- return vec4 (asin (x.x), asin (x.y), asin (x.z), asin (x.w));
+ float y;
+ __asm float_arcsine y, x;
+ return y;
+}
+
+vec2 asin (vec2 v) {
+ return vec2 (
+ asin (v.x),
+ asin (v.y)
+ );
+}
+
+vec3 asin (vec3 v) {
+ return vec3 (
+ asin (v.x),
+ asin (v.y),
+ asin (v.z)
+ );
+}
+
+vec4 asin (vec4 v) {
+ return vec4 (
+ asin (v.x),
+ asin (v.y),
+ asin (v.z),
+ asin (v.w)
+ );
}
-//
-// Arc cosine. Returns an angle whose cosine is x. The range of values returned by this function is
-// [0, PI]. Results are undefined if |x| > 1.
-//
-// XXX
float acos (float x) {
- return 0.0;
-}
-vec2 acos (vec2 x) {
- return vec2 (acos (x.x), acos (x.y));
-}
-vec3 acos (vec3 x) {
- return vec3 (acos (x.x), acos (x.y), acos (x.z));
-}
-vec4 acos (vec4 x) {
- return vec4 (acos (x.x), acos (x.y), acos (x.z), acos (x.w));
-}
+ return 1.5708 - asin (x);
+}
-//
-// Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine
-// what quadrant the angle is in. The range of values returned by this function is [–PI, PI].
-// Results are undefined if x and y are both 0.
-//
-// XXX
-float atan (float x, float y) {
- return 0.0;
-}
-vec2 atan (vec2 x, vec2 y) {
- return vec2 (atan (x.x, y.x), atan (x.y, y.y));
-}
-vec3 atan (vec3 x, vec3 y) {
- return vec3 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z));
-}
-vec4 atan (vec4 x, vec4 y) {
- return vec4 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z), atan (x.w, y.w));
-}
+vec2 acos (vec2 v) {
+ return vec2 (
+ acos (v.x),
+ acos (v.y)
+ );
+}
-//
-// Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this
-// function is [–PI/2, PI/2].
-//
-// XXX
-float atan (float y_over_x) {
- return 0.0;
-}
-vec2 atan (vec2 y_over_x) {
- return vec2 (atan (y_over_x.x), atan (y_over_x.y));
-}
-vec3 atan (vec3 y_over_x) {
- return vec3 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z));
+vec3 acos (vec3 v) {
+ return vec3 (
+ acos (v.x),
+ acos (v.y),
+ acos (v.z)
+ );
+}
+
+vec4 acos (vec4 v) {
+ return vec4 (
+ acos (v.x),
+ acos (v.y),
+ acos (v.z),
+ acos (v.w)
+ );
}
-vec4 atan (vec4 y_over_x) {
- return vec4 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z), atan (y_over_x.w));
+
+float atan (float y_over_x) {
+ float z;
+ __asm float_arctan z, y_over_x;
+ return z;
+}
+
+vec2 atan (vec2 y_over_x) {
+ return vec2 (
+ atan (y_over_x.x),
+ atan (y_over_x.y)
+ );
+}
+
+vec3 atan (vec3 y_over_x) {
+ return vec3 (
+ atan (y_over_x.x),
+ atan (y_over_x.y),
+ atan (y_over_x.z)
+ );
+}
+
+vec4 atan (vec4 y_over_x) {
+ return vec4 (
+ atan (y_over_x.x),
+ atan (y_over_x.y),
+ atan (y_over_x.z),
+ atan (y_over_x.w)
+ );
+}
+
+float atan (float y, float x) {
+ float z = atan (y / x);
+ if (x < 0.0)
+ {
+ if (y < 0.0)
+ return z - 3.141593;
+ return z + 3.141593;
+ }
+ return z;
+}
+
+vec2 atan (vec2 u, vec2 v) {
+ return vec2 (
+ atan (u.x, v.x),
+ atan (u.y, v.y)
+ );
+}
+
+vec3 atan (vec3 u, vec3 v) {
+ return vec3 (
+ atan (u.x, v.x),
+ atan (u.y, v.y),
+ atan (u.z, v.z)
+ );
+}
+
+vec4 atan (vec4 u, vec4 v) {
+ return vec4 (
+ atan (u.x, v.x),
+ atan (u.y, v.y),
+ atan (u.z, v.z),
+ atan (u.w, v.w)
+ );
}
-//
+//
// 8.2 Exponential Functions
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Returns x raised to the y power, i.e., x^y.
-// Results are undefined if x < 0.
-// Results are undefined if x = 0 and y <= 0.
-//
-// XXX
-float pow (float x, float y) {
- return 0.0;
-}
-vec2 pow (vec2 x, vec2 y) {
- return vec2 (pow (x.x, y.x), pow (x.y, y.y));
-}
-vec3 pow (vec3 x, vec3 y) {
- return vec3 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z));
-}
-vec4 pow (vec4 x, vec4 y) {
- return vec4 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z), pow (x.w, y.w));
-}
+//
-//
-// Returns the natural exponentiation of x, i.e., e^x.
-//
+float pow (float x, float y) {
+ float p;
+ __asm float_power p, x, y;
+ return p;
+}
-float exp (float x) {
- return pow (2.71828183, x);
-}
-vec2 exp (vec2 x) {
- return vec2 (exp (x.x), exp (x.y));
-}
-vec3 exp (vec3 x) {
- return vec3 (exp (x.x), exp (x.y), exp (x.z));
-}
-vec4 exp (vec4 x) {
- return vec4 (exp (x.x), exp (x.y), exp (x.z), exp (x.w));
-}
+vec2 pow (vec2 v, vec2 u) {
+ return vec2 (
+ pow (v.x, u.x),
+ pow (v.y, u.y)
+ );
+}
-//
-// Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation
-// x = e^y.
-// Results are undefined if x <= 0.
-//
+vec3 pow (vec3 v, vec3 u) {
+ return vec3 (
+ pow (v.x, u.x),
+ pow (v.y, u.y),
+ pow (v.z, u.z)
+ );
+}
+
+vec4 pow (vec4 v, vec4 u) {
+ return vec4 (
+ pow (v.x, u.x),
+ pow (v.y, u.y),
+ pow (v.z, u.z),
+ pow (v.w, u.w)
+ );
+}
+float exp (float x) {
+ return pow (2.71828183, x);
+}
+
+vec2 exp (vec2 v) {
+ return pow (vec2 (2.71828183), v);
+}
+
+vec3 exp (vec3 v) {
+ return pow (vec3 (2.71828183), v);
+}
+
+vec4 exp (vec4 v) {
+ return pow (vec4 (2.71828183), v);
+}
+
+float log2 (float x) {
+ float y;
+ __asm float_log2 y, x;
+ return y;
+}
+
+vec2 log2 (vec2 v) {
+ return vec2 (
+ log2 (v.x),
+ log2 (v.y)
+ );
+}
+
+vec3 log2 (vec3 v) {
+ return vec3 (
+ log2 (v.x),
+ log2 (v.y),
+ log2 (v.z)
+ );
+}
+
+vec4 log2 (vec4 v) {
+ return vec4 (
+ log2 (v.x),
+ log2 (v.y),
+ log2 (v.z),
+ log2 (v.w)
+ );
+}
+
float log (float x) {
return log2 (x) / log2 (2.71828183);
-}
-vec2 log (vec2 x) {
- return vec2 (log (x.x), log (x.y));
-}
-vec3 log (vec3 x) {
- return vec3 (log (x.x), log (x.y), log (x.z));
-}
-vec4 log (vec4 x) {
- return vec4 (log (x.x), log (x.y), log (x.z), log (x.w));
-}
+}
+
+vec2 log (vec2 v) {
+ return log2 (v) / log2 (vec2 (2.71828183));
+}
-//
-// Returns 2 raised to the x power, i.e., 2^x
-//
+vec3 log (vec3 v) {
+ return log2 (v) / log2 (vec3 (2.71828183));
+}
+
+vec4 log (vec4 v) {
+ return log2 (v) / log2 (vec4 (2.71828183));
+}
float exp2 (float x) {
return pow (2.0, x);
-}
-vec2 exp2 (vec2 x) {
- return vec2 (exp2 (x.x), exp2 (x.y));
-}
-vec3 exp2 (vec3 x) {
- return vec3 (exp2 (x.x), exp2 (x.y), exp2 (x.z));
-}
-vec4 exp2 (vec4 x) {
- return vec4 (exp2 (x.x), exp2 (x.y), exp2 (x.z), exp2 (x.w));
-}
+}
-//
-// Returns the base 2 logarithm of x, i.e., returns the value y which satisfies the equation
-// x = 2^y.
-// Results are undefined if x <= 0.
-//
-// XXX
-float log2 (float x) {
- return 0.0;
-}
-vec2 log2 (vec2 x) {
- return vec2 (log2 (x.x), log2 (x.y));
-}
-vec3 log2 (vec3 x) {
- return vec3 (log2 (x.x), log2 (x.y), log2 (x.z));
-}
-vec4 log2 (vec4 x) {
- return vec4 (log2 (x.x), log2 (x.y), log2 (x.z), log2 (x.w));
-}
+vec2 exp2 (vec2 v) {
+ return pow (vec2 (2.0), v);
+}
-//
-// Returns the positive square root of x.
-// Results are undefined if x < 0.
-//
+vec3 exp2 (vec3 v) {
+ return pow (vec3 (2.0), v);
+}
+
+vec4 exp2 (vec4 v) {
+ return pow (vec4 (2.0), v);
+}
float sqrt (float x) {
return pow (x, 0.5);
-}
-vec2 sqrt (vec2 x) {
- return vec2 (sqrt (x.x), sqrt (x.y));
-}
-vec3 sqrt (vec3 x) {
- return vec3 (sqrt (x.x), sqrt (x.y), sqrt (x.z));
-}
-vec4 sqrt (vec4 x) {
- return vec4 (sqrt (x.x), sqrt (x.y), sqrt (x.z), sqrt (x.w));
-}
+}
-//
-// Returns the reciprocal of the positive square root of x.
-// Results are undefined if x <= 0.
-//
+vec2 sqrt (vec2 v) {
+ return pow (v, vec2 (0.5));
+}
+
+vec3 sqrt (vec3 v) {
+ return pow (v, vec3 (0.5));
+}
+
+vec4 sqrt (vec4 v) {
+ return pow (v, vec4 (0.5));
+}
float inversesqrt (float x) {
return 1.0 / sqrt (x);
-}
-vec2 inversesqrt (vec2 x) {
- return vec2 (inversesqrt (x.x), inversesqrt (x.y));
-}
-vec3 inversesqrt (vec3 x) {
- return vec3 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z));
-}
-vec4 inversesqrt (vec4 x) {
- return vec4 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z), inversesqrt (x.w));
+}
+
+vec2 inversesqrt (vec2 v) {
+ return vec2 (1.0) / sqrt (v);
+}
+
+vec3 inversesqrt (vec3 v) {
+ return vec3 (1.0) / sqrt (v);
+}
+
+vec4 inversesqrt (vec4 v) {
+ return vec4 (1.0) / sqrt (v);
}
-//
+//
// 8.3 Common Functions
-//
-// These all operate component-wise. The description is per component.
-//
-
-//
-// Returns x if x >= 0, otherwise it returns –x
-//
+//
float abs (float x) {
return x >= 0.0 ? x : -x;
-}
-vec2 abs (vec2 x) {
- return vec2 (abs (x.x), abs (x.y));
-}
-vec3 abs (vec3 x) {
- return vec3 (abs (x.x), abs (x.y), abs (x.z));
-}
-vec4 abs (vec4 x) {
- return vec4 (abs (x.x), abs (x.y), abs (x.z), abs (x.w));
-}
-
-//
-// Returns 1.0 if x > 0, 0.0 if x = 0, or –1.0 if x < 0
-//
+}
-float sign (float x) {
- return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
-}
-vec2 sign (vec2 x) {
- return vec2 (sign (x.x), sign (x.y));
-}
-vec3 sign (vec3 x) {
- return vec3 (sign (x.x), sign (x.y), sign (x.z));
-}
-vec4 sign (vec4 x) {
- return vec4 (sign (x.x), sign (x.y), sign (x.z), sign (x.w));
-}
+vec2 abs (vec2 v) {
+ return vec2 (
+ abs (v.x),
+ abs (v.y)
+ );
+}
-//
-// Returns a value equal to the nearest integer that is less than or equal to x
-//
-// XXX
-float floor (float x) {
- return 0.0;
-}
-vec2 floor (vec2 x) {
- return vec2 (floor (x.x), floor (x.y));
-}
-vec3 floor (vec3 x) {
- return vec3 (floor (x.x), floor (x.y), floor (x.z));
-}
-vec4 floor (vec4 x) {
- return vec4 (floor (x.x), floor (x.y), floor (x.z), floor (x.w));
+vec3 abs (vec3 v) {
+ return vec3 (
+ abs (v.x),
+ abs (v.y),
+ abs (v.z)
+ );
+}
+
+vec4 abs (vec4 v) {
+ return vec4 (
+ abs (v.x),
+ abs (v.y),
+ abs (v.z),
+ abs (v.w)
+ );
}
-//
-// Returns a value equal to the nearest integer that is greater than or equal to x
-//
-// XXX
-float ceil (float x) {
- return 0.0;
-}
-vec2 ceil (vec2 x) {
- return vec2 (ceil (x.x), ceil (x.y));
-}
-vec3 ceil (vec3 x) {
- return vec3 (ceil (x.x), ceil (x.y), ceil (x.z));
-}
-vec4 ceil (vec4 x) {
- return vec4 (ceil (x.x), ceil (x.y), ceil (x.z), ceil (x.w));
-}
+float sign (float x) {
+ return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;
+}
-//
-// Returns x – floor (x)
-//
+vec2 sign (vec2 v) {
+ return vec2 (
+ sign (v.x),
+ sign (v.y)
+ );
+}
-float fract (float x) {
- return x - floor (x);
-}
-vec2 fract (vec2 x) {
- return vec2 (fract (x.x), fract (x.y));
-}
-vec3 fract (vec3 x) {
- return vec3 (fract (x.x), fract (x.y), fract (x.z));
-}
-vec4 fract (vec4 x) {
- return vec4 (fract (x.x), fract (x.y), fract (x.z), fract (x.w));
+vec3 sign (vec3 v) {
+ return vec3 (
+ sign (v.x),
+ sign (v.y),
+ sign (v.z)
+ );
+}
+
+vec4 sign (vec4 v) {
+ return vec4 (
+ sign (v.x),
+ sign (v.y),
+ sign (v.z),
+ sign (v.w)
+ );
}
-//
-// Modulus. Returns x – y * floor (x/y)
-//
+float floor (float x) {
+ float y;
+ __asm float_floor y, x;
+ return y;
+}
+
+vec2 floor (vec2 v) {
+ return vec2 (
+ floor (v.x),
+ floor (v.y)
+ );
+}
+
+vec3 floor (vec3 v) {
+ return vec3 (
+ floor (v.x),
+ floor (v.y),
+ floor (v.z)
+ );
+}
+
+vec4 floor (vec4 v) {
+ return vec4 (
+ floor (v.x),
+ floor (v.y),
+ floor (v.z),
+ floor (v.w)
+ );
+}
+
+float ceil (float x) {
+ float y;
+ __asm float_ceil y, x;
+ return y;
+}
+
+vec2 ceil (vec2 v) {
+ return vec2 (
+ ceil (v.x),
+ ceil (v.y)
+ );
+}
+
+vec3 ceil (vec3 v) {
+ return vec3 (
+ ceil (v.x),
+ ceil (v.y),
+ ceil (v.z)
+ );
+}
+
+vec4 ceil (vec4 v) {
+ return vec4 (
+ ceil (v.x),
+ ceil (v.y),
+ ceil (v.z),
+ ceil (v.w)
+ );
+}
+
+float fract (float x) {
+ return x - floor (x);
+}
+
+vec2 fract (vec2 v) {
+ return v - floor (v);
+}
+
+vec3 fract (vec3 v) {
+ return v - floor (v);
+}
+
+vec4 fract (vec4 v) {
+ return v - floor (v);
+}
float mod (float x, float y) {
return x - y * floor (x / y);
-}
-vec2 mod (vec2 x, float y) {
- return vec2 (mod (x.x, y), mod (x.y, y));
-}
-vec3 mod (vec3 x, float y) {
- return vec3 (mod (x.x, y), mod (x.y, y), mod (x.z, y));
-}
-vec4 mod (vec4 x, float y) {
- return vec4 (mod (x.x, y), mod (x.y, y), mod (x.z, y), mod (x.w, y));
-}
-vec2 mod (vec2 x, vec2 y) {
- return vec2 (mod (x.x, y.x), mod (x.y, y.y));
-}
-vec3 mod (vec3 x, vec3 y) {
- return vec3 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z));
-}
-vec4 mod (vec4 x, vec4 y) {
- return vec4 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z), mod (x.w, y.w));
-}
+}
-//
-// Returns y if y < x, otherwise it returns x
-//
+vec2 mod (vec2 v, float u) {
+ return v - u * floor (v / u);
+}
-float min (float x, float y) {
- return y < x ? y : x;
-}
-vec2 min (vec2 x, float y) {
- return vec2 (min (x.x, y), min (x.y, y));
-}
-vec3 min (vec3 x, float y) {
- return vec3 (min (x.x, y), min (x.y, y), min (x.z, y));
-}
-vec4 min (vec4 x, float y) {
- return vec4 (min (x.x, y), min (x.y, y), min (x.z, y), min (x.w, y));
-}
-vec2 min (vec2 x, vec2 y) {
- return vec2 (min (x.x, y.x), min (x.y, y.y));
-}
-vec3 min (vec3 x, vec3 y) {
- return vec3 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z));
-}
-vec4 min (vec4 x, vec4 y) {
- return vec4 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z), min (x.w, y.w));
-}
+vec3 mod (vec3 v, float u) {
+ return v - u * floor (v / u);
+}
-//
-// Returns y if x < y, otherwise it returns x
-//
+vec4 mod (vec4 v, float u) {
+ return v - u * floor (v / u);
+}
-float max (float x, float y) {
- return min (y, x);
-}
-vec2 max (vec2 x, float y) {
- return vec2 (max (x.x, y), max (x.y, y));
-}
-vec3 max (vec3 x, float y) {
- return vec3 (max (x.x, y), max (x.y, y), max (x.z, y));
-}
-vec4 max (vec4 x, float y) {
- return vec4 (max (x.x, y), max (x.y, y), max (x.z, y), max (x.w, y));
-}
-vec2 max (vec2 x, vec2 y) {
- return vec2 (max (x.x, y.x), max (x.y, y.y));
-}
-vec3 max (vec3 x, vec3 y) {
- return vec3 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z));
-}
-vec4 max (vec4 x, vec4 y) {
- return vec4 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z), max (x.w, y.w));
+vec2 mod (vec2 v, vec2 u) {
+ return v - u * floor (v / u);
+}
+
+vec3 mod (vec3 v, vec3 u) {
+ return v - u * floor (v / u);
+}
+
+vec4 mod (vec4 v, vec4 u) {
+ return v - u * floor (v / u);
}
-//
-// Returns min (max (x, minVal), maxVal)
-//
-// Note that colors and depths written by fragment shaders will be clamped by the implementation
-// after the fragment shader runs.
-//
+float min (float x, float y) {
+ return x < y ? x : y;
+}
+
+vec2 min (vec2 v, vec2 u) {
+ return vec2 (
+ min (v.x, u.x),
+ min (v.y, u.y)
+ );
+}
+
+vec3 min (vec3 v, vec3 u) {
+ return vec3 (
+ min (v.x, u.x),
+ min (v.y, u.y),
+ min (v.z, u.z)
+ );
+}
+
+vec4 min (vec4 v, vec4 u) {
+ return vec4 (
+ min (v.x, u.x),
+ min (v.y, u.y),
+ min (v.z, u.z),
+ min (v.w, u.w)
+ );
+}
+
+vec2 min (vec2 v, float y) {
+ return min (v, vec2 (y));
+}
+
+vec3 min (vec3 v, float y) {
+ return min (v, vec3 (y));
+}
+
+vec4 min (vec4 v, float y) {
+ return min (v, vec4 (y));
+}
+
+float max (float x, float y) {
+ return x < y ? y : x;
+}
+
+vec2 max (vec2 v, vec2 u) {
+ return vec2 (
+ max (v.x, u.x),
+ max (v.y, u.y)
+ );
+}
+
+vec3 max (vec3 v, vec3 u) {
+ return vec3 (
+ max (v.x, u.x),
+ max (v.y, u.y),
+ max (v.z, u.z)
+ );
+}
+
+vec4 max (vec4 v, vec4 u) {
+ return vec4 (
+ max (v.x, u.x),
+ max (v.y, u.y),
+ max (v.z, u.z),
+ max (v.w, u.w)
+ );
+}
+
+vec2 max (vec2 v, float y) {
+ return max (v, vec2 (y));
+}
+
+vec3 max (vec3 v, float y) {
+ return max (v, vec3 (y));
+}
+
+vec4 max (vec4 v, float y) {
+ return max (v, vec4 (y));
+}
float clamp (float x, float minVal, float maxVal) {
return min (max (x, minVal), maxVal);
-}
+}
+
vec2 clamp (vec2 x, float minVal, float maxVal) {
- return vec2 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal));
-}
+ return min (max (x, minVal), maxVal);
+}
+
vec3 clamp (vec3 x, float minVal, float maxVal) {
- return vec3 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),
- clamp (x.z, minVal, maxVal));
-}
+ return min (max (x, minVal), maxVal);
+}
+
vec4 clamp (vec4 x, float minVal, float maxVal) {
- return vec4 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),
- clamp (x.z, minVal, maxVal), clamp (x.w, minVal, maxVal));
-}
+ return min (max (x, minVal), maxVal);
+}
+
vec2 clamp (vec2 x, vec2 minVal, vec2 maxVal) {
- return vec2 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y));
-}
+ return min (max (x, minVal), maxVal);
+}
+
vec3 clamp (vec3 x, vec3 minVal, vec3 maxVal) {
- return vec3 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y),
- clamp (x.z, minVal.z, maxVal.z));
-}
+ return min (max (x, minVal), maxVal);
+}
+
vec4 clamp (vec4 x, vec4 minVal, vec4 maxVal) {
- return vec4 (clamp (x.x, minVal.x, maxVal.y), clamp (x.y, minVal.y, maxVal.y),
- clamp (x.z, minVal.z, maxVal.z), clamp (x.w, minVal.w, maxVal.w));
+ return min (max (x, minVal), maxVal);
}
-//
-// Returns x * (1 – a) + y * a, i.e., the linear blend of x and y
-//
-
float mix (float x, float y, float a) {
return x * (1.0 - a) + y * a;
-}
+}
+
vec2 mix (vec2 x, vec2 y, float a) {
- return vec2 (mix (x.x, y.x, a), mix (x.y, y.y, a));
-}
+ return x * (1.0 - a) + y * a;
+}
+
vec3 mix (vec3 x, vec3 y, float a) {
- return vec3 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a));
-}
+ return x * (1.0 - a) + y * a;
+}
+
vec4 mix (vec4 x, vec4 y, float a) {
- return vec4 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a), mix (x.w, y.w, a));
-}
+ return x * (1.0 - a) + y * a;
+}
+
vec2 mix (vec2 x, vec2 y, vec2 a) {
- return vec2 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y));
-}
+ return x * (1.0 - a) + y * a;
+}
+
vec3 mix (vec3 x, vec3 y, vec3 a) {
- return vec3 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z));
-}
+ return x * (1.0 - a) + y * a;
+}
+
vec4 mix (vec4 x, vec4 y, vec4 a) {
- return vec4 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z),
- mix (x.w, y.w, a.w));
+ return x * (1.0 - a) + y * a;
}
-//
-// Returns 0.0 if x < edge, otherwise it returns 1.0
-//
-
float step (float edge, float x) {
return x < edge ? 0.0 : 1.0;
-}
-vec2 step (float edge, vec2 x) {
- return vec2 (step (edge, x.x), step (edge, x.y));
-}
-vec3 step (float edge, vec3 x) {
- return vec3 (step (edge, x.x), step (edge, x.y), step (edge, x.z));
-}
-vec4 step (float edge, vec4 x) {
- return vec4 (step (edge, x.x), step (edge, x.y), step (edge, x.z), step (edge, x.w));
-}
-vec2 step (vec2 edge, vec2 x) {
- return vec2 (step (edge.x, x.x), step (edge.y, x.y));
-}
-vec3 step (vec3 edge, vec3 x) {
- return vec3 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z));
-}
-vec4 step (vec4 edge, vec4 x) {
- return vec4 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z), step (edge.w, x.w));
-}
-
-//
-// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation
-// between 0 and 1 when edge0 < x < edge1. This is useful in cases where you would want a threshold
-// function with a smooth transition. This is equivalent to:
-// <type> t;
-// t = clamp ((x – edge0) / (edge1 – edge0), 0, 1);
-// return t * t * (3 – 2 * t);
-//
+}
+
+vec2 step (vec2 edge, vec2 v) {
+ return vec2 (
+ step (edge.x, v.x),
+ step (edge.y, v.y)
+ );
+}
+
+vec3 step (vec3 edge, vec3 v) {
+ return vec3 (
+ step (edge.x, v.x),
+ step (edge.y, v.y),
+ step (edge.z, v.z)
+ );
+}
+
+vec4 step (vec4 edge, vec4 v) {
+ return vec4 (
+ step (edge.x, v.x),
+ step (edge.y, v.y),
+ step (edge.z, v.z),
+ step (edge.w, v.w)
+ );
+}
+
+vec2 step (float edge, vec2 v) {
+ return step (vec2 (edge), v);
+}
+
+vec3 step (float edge, vec3 v) {
+ return step (vec3 (edge), v);
+}
+
+vec4 step (float edge, vec4 v) {
+ return step (vec4 (edge), v);
+}
float smoothstep (float edge0, float edge1, float x) {
- const float t = clamp ((x - edge0) / (edge1 - edge0), 0.0, 1.0);
+ float t = clamp ((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
-}
-vec2 smoothstep (float edge0, float edge1, vec2 x) {
- return vec2 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y));
-}
-vec3 smoothstep (float edge0, float edge1, vec3 x) {
- return vec3 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),
- smoothstep (edge0, edge1, x.z));
-}
-vec4 smoothstep (float edge0, float edge1, vec4 x) {
- return vec4 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),
- smoothstep (edge0, edge1, x.z), smoothstep (edge0, edge1, x.w));
-}
-vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 x) {
- return vec2 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y));
-}
-vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 x) {
- return vec3 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),
- smoothstep (edge0.z, edge1.z, x.z));
-}
-vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 x) {
- return vec4 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),
- smoothstep (edge0.z, edge1.z, x.z), smoothstep (edge0.w, edge1.w, x.w));
-}
+}
+
+vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 v) {
+ return vec2 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y)
+ );
+}
+
+vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 v) {
+ return vec3 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y),
+ smoothstep (edge0.z, edge1.z, v.z)
+ );
+}
+
+vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 v) {
+ return vec4 (
+ smoothstep (edge0.x, edge1.x, v.x),
+ smoothstep (edge0.y, edge1.y, v.y),
+ smoothstep (edge0.z, edge1.z, v.z),
+ smoothstep (edge0.w, edge1.w, v.w)
+ );
+}
+
+vec2 smoothstep (float edge0, float edge1, vec2 v) {
+ return vec2 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y)
+ );
+}
+
+vec3 smoothstep (float edge0, float edge1, vec3 v) {
+ return vec3 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y),
+ smoothstep (edge0, edge1, v.z)
+ );
+}
+
+vec4 smoothstep (float edge0, float edge1, vec4 v) {
+ return vec4 (
+ smoothstep (edge0, edge1, v.x),
+ smoothstep (edge0, edge1, v.y),
+ smoothstep (edge0, edge1, v.z),
+ smoothstep (edge0, edge1, v.w)
+ );
+}
-//
+//
// 8.4 Geometric Functions
-//
-// These operate on vectors as vectors, not component-wise.
-//
-
-//
-// Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1] + ...
-//
+//
float dot (float x, float y) {
return x * y;
-}
-float dot (vec2 x, vec2 y) {
- return dot (x.x, y.x) + dot (x.y, y.y);
-}
-float dot (vec3 x, vec3 y) {
- return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z);
-}
-float dot (vec4 x, vec4 y) {
- return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z) + dot (x.w, y.w);
-}
+}
-//
-// Returns the length of vector x, i.e., sqrt (x[0] * x[0] + x[1] * x[1] + ...)
-//
+float dot (vec2 v, vec2 u) {
+ return v.x * u.x + v.y * u.y;
+}
-float length (float x) {
- return sqrt (dot (x, x));
-}
-float length (vec2 x) {
- return sqrt (dot (x, x));
-}
-float length (vec3 x) {
- return sqrt (dot (x, x));
+float dot (vec3 v, vec3 u) {
+ return v.x * u.x + v.y * u.y + v.z * u.z;
+}
+
+float dot (vec4 v, vec4 u) {
+ return v.x * u.x + v.y * u.y + v.z * u.z + v.w * u.w;
}
-float length (vec4 x) {
+
+float length (float x) {
return sqrt (dot (x, x));
-}
+}
-//
-// Returns the distance between p0 and p1, i.e. length (p0 – p1)
-//
+float length (vec2 v) {
+ return sqrt (dot (v, v));
+}
-float distance (float x, float y) {
- return length (x - y);
-}
-float distance (vec2 x, vec2 y) {
- return length (x - y);
-}
-float distance (vec3 x, vec3 y) {
- return length (x - y);
+float length (vec3 v) {
+ return sqrt (dot (v, v));
+}
+
+float length (vec4 v) {
+ return sqrt (dot (v, v));
}
-float distance (vec4 x, vec4 y) {
+
+float distance (float x, float y) {
return length (x - y);
-}
+}
-//
-// Returns the cross product of x and y, i.e.
-// result.0 = x[1] * y[2] - y[1] * x[2]
-// result.1 = x[2] * y[0] - y[2] * x[0]
-// result.2 = x[0] * y[1] - y[0] * x[1]
-//
+float distance (vec2 v, vec2 u) {
+ return length (v - u);
+}
-vec3 cross (vec3 x, vec3 y) {
- return vec3 (x.y * y.z - y.y * x.z, x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y);
+float distance (vec3 v, vec3 u) {
+ return length (v - u);
+}
+
+float distance (vec4 v, vec4 u) {
+ return length (v - u);
}
-//
-// Returns a vector in the same direction as x but with a length of 1.
-//
+vec3 cross (vec3 v, vec3 u) {
+ return vec3 (
+ v.y * u.z - u.y * v.z,
+ v.z * u.x - u.z * v.x,
+ v.x * u.y - u.x * v.y
+ );
+}
float normalize (float x) {
return 1.0;
-}
-vec2 normalize (vec2 x) {
- return x / length (x);
-}
-vec3 normalize (vec3 x) {
- return x / length (x);
-}
-vec4 normalize (vec4 x) {
- return x / length (x);
-}
+}
+
+vec2 normalize (vec2 v) {
+ return v / length (v);
+}
-//
-// If dot (Nref, I) < 0 return N otherwise return –N
-//
+vec3 normalize (vec3 v) {
+ return v / length (v);
+}
+
+vec4 normalize (vec4 v) {
+ return v / length (v);
+}
float faceforward (float N, float I, float Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}
+}
+
vec2 faceforward (vec2 N, vec2 I, vec2 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}
+}
+
vec3 faceforward (vec3 N, vec3 I, vec3 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
-}
+}
+
vec4 faceforward (vec4 N, vec4 I, vec4 Nref) {
return dot (Nref, I) < 0.0 ? N : -N;
}
-//
-// For the incident vector I and surface orientation N, returns the reflection direction:
-// result = I - 2 * dot (N, I) * N
-// N must already be normalized in order to achieve the desired result.
-//
-
float reflect (float I, float N) {
return I - 2.0 * dot (N, I) * N;
-}
+}
+
vec2 reflect (vec2 I, vec2 N) {
return I - 2.0 * dot (N, I) * N;
-}
+}
+
vec3 reflect (vec3 I, vec3 N) {
return I - 2.0 * dot (N, I) * N;
-}
+}
+
vec4 reflect (vec4 I, vec4 N) {
return I - 2.0 * dot (N, I) * N;
}
-//
-// For the incident vector I and surface normal N, and the ratio of inidices of refraction eta,
-// return the refraction vector. The returned result is computed by
-//
-// k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I))
-// if (k < 0.0)
-// result = genType (0.0)
-// else
-// result = eta * I - (eta * dot (N, I) + sqrt (k)) * N
-//
-// The input parameters for the incident vector I and the surface normal N must already be
-// normalized to get the desired results.
-//
-
float refract (float I, float N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
if (k < 0.0)
- return 0.0;
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
+}
+
vec2 refract (vec2 I, vec2 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec2 (0.0);
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
+}
+
vec3 refract (vec3 I, vec3 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec3 (0.0);
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
-}
+}
+
vec4 refract (vec4 I, vec4 N, float eta) {
- const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
- if (k < 0.0)
- return vec4 (0.0);
+ float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));
+ if (k < 0.0)
+ return 0.0;
return eta * I - (eta * dot (N, I) + sqrt (k)) * N;
}
-//
+//
// 8.5 Matrix Functions
-//
-
-//
-// Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product
-// of x[i][j] and y[i][j].
-// Note: to get linear algebraic matrix multiplication, use the multiply operator (*).
-//
-
-mat2 matrixCompMult (mat2 x, mat2 y) {
- return mat2 (
- x[0].x * y[0].x, x[0].y * y[0].y,
- x[1].x * y[1].x, x[1].y * y[1].y
- );
-}
-mat3 matrixCompMult (mat3 x, mat3 y) {
- return mat4 (
- x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z,
- x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z,
- x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z
- );
-}
-mat4 matrixCompMult (mat4 x, mat4 y) {
- return mat4 (
- x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z + x[0].w * y[0].w,
- x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z + x[1].w * y[1].w,
- x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z + x[2].w * y[2].w,
- x[3].x * y[3].x, x[3].y * y[3].y, x[3].z * y[3].z + x[3].w * y[3].w
- );
+//
+
+mat2 matrixCompMult (mat2 m, mat2 n) {
+ return mat2 (m[0] * n[0], m[1] * n[1]);
+}
+
+mat3 matrixCompMult (mat3 m, mat3 n) {
+ return mat3 (m[0] * n[0], m[1] * n[1], m[2] * n[2]);
+}
+
+mat4 matrixCompMult (mat4 m, mat4 n) {
+ return mat4 (m[0] * n[0], m[1] * n[1], m[2] * n[2], m[3] * n[3]);
}
-//
+//
// 8.6 Vector Relational Functions
-//
-// Relational and equality operators (<, <=, >, >=, ==, !=) are defined (or reserved) to produce
-// scalar Boolean results.
-//
+//
-//
-// Returns the component-wise compare of x < y.
-//
+bvec2 lessThan (vec2 v, vec2 u) {
+ return bvec2 (v.x < u.x, v.y < u.y);
+}
-bvec2 lessThan (vec2 x, vec2 y) {
- return bvec2 (x.x < y.x, x.y < y.y);
-}
-bvec3 lessThan (vec3 x, vec3 y) {
- return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);
-}
-bvec4 lessThan (vec4 x, vec4 y) {
- return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);
-}
-bvec2 lessThan (ivec2 x, ivec2 y) {
- return bvec2 (x.x < y.x, x.y < y.y);
-}
-bvec3 lessThan (ivec3 x, ivec3 y) {
- return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);
-}
-bvec4 lessThan (ivec4 x, ivec4 y) {
- return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);
-}
+bvec3 lessThan (vec3 v, vec3 u) {
+ return bvec3 (v.x < u.x, v.y < u.y, v.z < u.z);
+}
-//
-// Returns the component-wise compare of x <= y.
-//
+bvec4 lessThan (vec4 v, vec4 u) {
+ return bvec4 (v.x < u.x, v.y < u.y, v.z < u.z, v.w < u.w);
+}
-bvec2 lessThanEqual (vec2 x, vec2 y) {
- return bvec2 (x.x <= y.x, x.y <= y.y);
-}
-bvec3 lessThanEqual (vec3 x, vec3 y) {
- return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);
-}
-bvec4 lessThanEqual (vec4 x, vec4 y) {
- return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);
-}
-bvec2 lessThanEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x <= y.x, x.y <= y.y);
-}
-bvec3 lessThanEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);
-}
-bvec4 lessThanEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);
-}
+bvec2 lessThan (ivec2 v, ivec2 u) {
+ return bvec2 (v.x < u.x, v.y < u.y);
+}
-//
-// Returns the component-wise compare of x > y.
-//
+bvec3 lessThan (ivec3 v, ivec3 u) {
+ return bvec3 (v.x < u.x, v.y < u.y, v.z < u.z);
+}
-bvec2 greaterThan (vec2 x, vec2 y) {
- return bvec2 (x.x > y.x, x.y > y.y);
-}
-bvec3 greaterThan (vec3 x, vec3 y) {
- return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);
-}
-bvec4 greaterThan (vec4 x, vec4 y) {
- return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);
-}
-bvec2 greaterThan (ivec2 x, ivec2 y) {
- return bvec2 (x.x > y.x, x.y > y.y);
-}
-bvec3 greaterThan (ivec3 x, ivec3 y) {
- return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);
-}
-bvec4 greaterThan (ivec4 x, ivec4 y) {
- return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);
+bvec4 lessThan (ivec4 v, ivec4 u) {
+ return bvec4 (v.x < u.x, v.y < u.y, v.z < u.z, v.w < u.w);
}
-//
-// Returns the component-wise compare of x >= y.
-//
+bvec2 lessThanEqual (vec2 v, vec2 u) {
+ return bvec2 (v.x <= u.x, v.y <= u.y);
+}
-bvec2 greaterThanEqual (vec2 x, vec2 y) {
- return bvec2 (x.x >= y.x, x.y >= y.y);
-}
-bvec3 greaterThanEqual (vec3 x, vec3 y) {
- return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);
-}
-bvec4 greaterThanEqual (vec4 x, vec4 y) {
- return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);
-}
-bvec2 greaterThanEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x >= y.x, x.y >= y.y);
-}
-bvec3 greaterThanEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);
-}
-bvec4 greaterThanEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);
-}
+bvec3 lessThanEqual (vec3 v, vec3 u) {
+ return bvec3 (v.x <= u.x, v.y <= u.y, v.z <= u.z);
+}
-//
-// Returns the component-wise compare of x == y.
-//
+bvec4 lessThanEqual (vec4 v, vec4 u) {
+ return bvec4 (v.x <= u.x, v.y <= u.y, v.z <= u.z, v.w <= u.w);
+}
-bvec2 equal (vec2 x, vec2 y) {
- return bvec2 (x.x == y.x, x.y == y.y);
-}
-bvec3 equal (vec3 x, vec3 y) {
- return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);
-}
-bvec4 equal (vec4 x, vec4 y) {
- return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);
-}
-bvec2 equal (ivec2 x, ivec2 y) {
- return bvec2 (x.x == y.x, x.y == y.y);
-}
-bvec3 equal (ivec3 x, ivec3 y) {
- return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);
-}
-bvec4 equal (ivec4 x, ivec4 y) {
- return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);
-}
+bvec2 lessThanEqual (ivec2 v, ivec2 u) {
+ return bvec2 (v.x <= u.x, v.y <= u.y);
+}
-//
-// Returns the component-wise compare of x != y.
-//
+bvec3 lessThanEqual (ivec3 v, ivec3 u) {
+ return bvec3 (v.x <= u.x, v.y <= u.y, v.z <= u.z);
+}
-bvec2 notEqual (vec2 x, vec2 y) {
- return bvec2 (x.x != y.x, x.y != y.y);
-}
-bvec3 notEqual (vec3 x, vec3 y) {
- return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);
-}
-bvec4 notEqual (vec4 x, vec4 y) {
- return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);
-}
-bvec2 notEqual (ivec2 x, ivec2 y) {
- return bvec2 (x.x != y.x, x.y != y.y);
-}
-bvec3 notEqual (ivec3 x, ivec3 y) {
- return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);
-}
-bvec4 notEqual (ivec4 x, ivec4 y) {
- return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);
+bvec4 lessThanEqual (ivec4 v, ivec4 u) {
+ return bvec4 (v.x <= u.x, v.y <= u.y, v.z <= u.z, v.w <= u.w);
}
-//
-// Returns true if any component of x is true.
-//
+bvec2 greaterThan (vec2 v, vec2 u) {
+ return bvec2 (v.x > u.x, v.y > u.y);
+}
-bool any (bvec2 x) {
- return x.x || x.y;
-}
-bool any (bvec3 x) {
- return x.x || x.y || x.z;
-}
-bool any (bvec4 x) {
- return x.x || x.y || x.z || x.w;
+bvec3 greaterThan (vec3 v, vec3 u) {
+ return bvec3 (v.x > u.x, v.y > u.y, v.z > u.z);
+}
+
+bvec4 greaterThan (vec4 v, vec4 u) {
+ return bvec4 (v.x > u.x, v.y > u.y, v.z > u.z, v.w > u.w);
+}
+
+bvec2 greaterThan (ivec2 v, ivec2 u) {
+ return bvec2 (v.x > u.x, v.y > u.y);
+}
+
+bvec3 greaterThan (ivec3 v, ivec3 u) {
+ return bvec3 (v.x > u.x, v.y > u.y, v.z > u.z);
+}
+
+bvec4 greaterThan (ivec4 v, ivec4 u) {
+ return bvec4 (v.x > u.x, v.y > u.y, v.z > u.z, v.w > u.w);
}
-//
-// Returns true only if all components of x are true.
-//
+bvec2 greaterThanEqual (vec2 v, vec2 u) {
+ return bvec2 (v.x >= u.x, v.y >= u.y);
+}
+
+bvec3 greaterThanEqual (vec3 v, vec3 u) {
+ return bvec3 (v.x >= u.x, v.y >= u.y, v.z >= u.z);
+}
+
+bvec4 greaterThanEqual (vec4 v, vec4 u) {
+ return bvec4 (v.x >= u.x, v.y >= u.y, v.z >= u.z, v.w >= u.w);
+}
+
+bvec2 greaterThanEqual (ivec2 v, ivec2 u) {
+ return bvec2 (v.x >= u.x, v.y >= u.y);
+}
-bool all (bvec2 x) {
- return x.x && x.y;
+bvec3 greaterThanEqual (ivec3 v, ivec3 u) {
+ return bvec3 (v.x >= u.x, v.y >= u.y, v.z >= u.z);
+}
+
+bvec4 greaterThanEqual (ivec4 v, ivec4 u) {
+ return bvec4 (v.x >= u.x, v.y >= u.y, v.z >= u.z, v.w >= u.w);
}
-bool all (bvec3 x) {
- return x.x && x.y && x.z;
+
+bvec2 equal (vec2 v, vec2 u) {
+ return bvec2 (v.x == u.x, v.y == u.y);
+}
+
+bvec3 equal (vec3 v, vec3 u) {
+ return bvec3 (v.x == u.x, v.y == u.y, v.z == u.z);
+}
+
+bvec4 equal (vec4 v, vec4 u) {
+ return bvec4 (v.x == u.x, v.y == u.y, v.z == u.z, v.w == u.w);
+}
+
+bvec2 equal (ivec2 v, ivec2 u) {
+ return bvec2 (v.x == u.x, v.y == u.y);
+}
+
+bvec3 equal (ivec3 v, ivec3 u) {
+ return bvec3 (v.x == u.x, v.y == u.y, v.z == u.z);
+}
+
+bvec4 equal (ivec4 v, ivec4 u) {
+ return bvec4 (v.x == u.x, v.y == u.y, v.z == u.z, v.w == u.w);
}
-bool all (bvec4 x) {
- return x.x && x.y && x.z && x.w;
+
+bvec2 notEqual (vec2 v, vec2 u) {
+ return bvec2 (v.x != u.x, v.y != u.y);
+}
+
+bvec3 notEqual (vec3 v, vec3 u) {
+ return bvec3 (v.x != u.x, v.y != u.y, v.z != u.z);
+}
+
+bvec4 notEqual (vec4 v, vec4 u) {
+ return bvec4 (v.x != u.x, v.y != u.y, v.z != u.z, v.w != u.w);
+}
+
+bvec2 notEqual (ivec2 v, ivec2 u) {
+ return bvec2 (v.x != u.x, v.y != u.y);
+}
+
+bvec3 notEqual (ivec3 v, ivec3 u) {
+ return bvec3 (v.x != u.x, v.y != u.y, v.z != u.z);
+}
+
+bvec4 notEqual (ivec4 v, ivec4 u) {
+ return bvec4 (v.x != u.x, v.y != u.y, v.z != u.z, v.w != u.w);
}
-//
-// Returns the component-wise logical complement of x.
-//
+bool any (bvec2 v) {
+ return v.x || v.y;
+}
-bvec2 not (bvec2 x) {
- return bvec2 (!x.x, !x.y);
+bool any (bvec3 v) {
+ return v.x || v.y || v.z;
+}
+
+bool any (bvec4 v) {
+ return v.x || v.y || v.z || v.w;
}
-bvec3 not (bvec3 x) {
- return bvec3 (!x.x, !x.y, !x.z);
+
+bool all (bvec2 v) {
+ return v.x && v.y;
+}
+
+bool all (bvec3 v) {
+ return v.x && v.y && v.z;
+}
+
+bool all (bvec4 v) {
+ return v.x && v.y && v.z && v.w;
}
-bvec4 not (bvec4 x) {
- return bvec4 (!x.x, !x.y, !x.z, !x.w);
+
+bvec2 not (bvec2 v) {
+ return bvec2 (!v.x, !v.y);
+}
+
+bvec3 not (bvec3 v) {
+ return bvec3 (!v.x, !v.y, !v.z);
+}
+
+bvec4 not (bvec4 v) {
+ return bvec4 (!v.x, !v.y, !v.z, !v.w);
}
-//
+//
// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
-
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1D (sampler1D sampler, float coord) {
- return vec4 (0.0);
-}
+//
+
+vec4 texture1D (sampler1D sampler, float coord) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, 0.0;
+ return texel;
+}
+
vec4 texture1DProj (sampler1D sampler, vec2 coord) {
return texture1D (sampler, coord.s / coord.t);
-}
+}
+
vec4 texture1DProj (sampler1D sampler, vec4 coord) {
return texture1D (sampler, coord.s / coord.q);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2D (sampler2D sampler, vec2 coord) {
- return vec4 (0.0);
-}
-vec4 texture2DProj (sampler2D sampler, vec3 coord) {
+vec4 texture2D (sampler2D sampler, vec2 coord) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, 0.0;
+ return texel;
+}
+
+vec4 texture2DProj (sampler2D sampler, vec3 coord) {
return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p));
-}
-vec4 texture2DProj (sampler2D sampler, vec4 coord) {
+}
+
+vec4 texture2DProj (sampler2D sampler, vec4 coord) {
return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q));
}
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3D (sampler3D sampler, vec3 coord) {
- return vec4 (0.0);
-}
-vec4 texture3DProj (sampler3D sampler, vec4 coord) {
+vec4 texture3D (sampler3D sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, 0.0;
+ return texel;
+}
+
+vec4 texture3DProj (sampler3D sampler, vec4 coord) {
return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
}
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCube (samplerCube sampler, vec3 coord) {
- return vec4 (0.0);
+vec4 textureCube (samplerCube sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, 0.0;
+ return texel;
}
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {
- return vec4 (0.0);
+vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, 0.0;
+ return texel;
}
-// XXX
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {
- return vec4 (0.0);
-}
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));
-}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {
+
+vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));
+}
+
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, 0.0;
+ return texel;
+}
+
+vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {
return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));
}
-//
-// 8.9 Noise Functions
-//
-// Noise functions are available to both fragment and vertex shaders. They are stochastic functions
-// that can be used to increase visual complexity. Values returned by the following noise functions
-// give the appearance of randomness, but are not truly random. The noise functions below are
-// defined to have the following characteristics:
-//
-// - The return value(s) are always in the range [-1,1], and cover at least the range [-0.6, 0.6],
-// with a gaussian-like distribution.
-// * The return value(s) have an overall average of 0.0
-// * They are repeatable, in that a particular input value will always produce the same return value
-// * They are statistically invariant under rotation (i.e., no matter how the domain is rotated, it
-// has the same statistical character)
-// * They have a statistical invariance under translation (i.e., no matter how the domain is
-// translated, it has the same statistical character)
-// * They typically give different results under translation.
-// - The spatial frequency is narrowly concentrated, centered somewhere between 0.5 to 1.0.
-//
-
-//
-// Returns a 1D noise value based on the input value x.
-//
-// XXX
-float noise1 (float x) {
- return 0.0;
-}
-// XXX
-float noise1 (vec2 x) {
- return 0.0;
+//
+// 8.9 Noise Functions
+//
+// AUTHOR: Stefan Gustavson (stegu@itn.liu.se), Nov 26, 2005
+//
+
+float noise1 (float x) {
+ float a;
+ __asm float_noise1 a, x;
+ return a;
}
-// XXX
-float noise1 (vec3 x) {
- return 0.0;
+
+float noise1 (vec2 x) {
+ float a;
+ __asm float_noise2 a, x;
+ return a;
}
-// XXX
-float noise1 (vec4 x) {
- return 0.0;
+
+float noise1 (vec3 x) {
+ float a;
+ __asm float_noise3 a, x;
+ return a;
}
-//
-// Returns a 2D noise value based on the input value x.
-//
-// XXX
-vec2 noise2 (float x) {
- return vec2 (0.0);
+float noise1 (vec4 x) {
+ float a;
+ __asm float_noise4 a, x;
+ return a;
}
-// XXX
-vec2 noise2 (vec2 x) {
- return vec2 (0.0);
+
+vec2 noise2 (float x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + 19.34)
+ );
}
-// XXX
-vec2 noise2 (vec3 x) {
- return vec2 (0.0);
+
+vec2 noise2 (vec2 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66))
+ );
}
-// XXX
-vec2 noise2 (vec4 x) {
- return vec2 (0.0);
+
+vec2 noise2 (vec3 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23))
+ );
}
-//
-// Returns a 3D noise value based on the input value x.
-//
-// XXX
-vec3 noise3 (float x) {
- return vec3 (0.0);
+vec2 noise2 (vec4 x) {
+ return vec2 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77))
+ );
}
-// XXX
-vec3 noise3 (vec2 x) {
- return vec3 (0.0);
+
+vec3 noise3 (float x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + 19.34),
+ noise1 (x + 5.47)
+ );
}
-// XXX
-vec3 noise3 (vec3 x) {
- return vec3 (0.0);
+
+vec3 noise3 (vec2 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66)),
+ noise1 (x + vec2 (5.47, 17.85))
+ );
}
-// XXX
-vec3 noise3 (vec4 x) {
- return vec3 (0.0);
+
+vec3 noise3 (vec3 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23)),
+ noise1 (x + vec3 (5.47, 17.85, 11.04))
+ );
}
-//
-// Returns a 4D noise value based on the input value x.
-//
-// XXX
-vec4 noise4 (float x) {
- return vec4 (0.0);
+vec3 noise3 (vec4 x) {
+ return vec3 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),
+ noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19))
+ );
}
-// XXX
-vec4 noise4 (vec2 x) {
- return vec4 (0.0);
+
+vec4 noise4 (float x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + 19.34),
+ noise1 (x + 5.47),
+ noise1 (x + 23.54)
+ );
}
-// XXX
-vec4 noise4 (vec3 x) {
- return vec4 (0.0);
+
+vec4 noise4 (vec2 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec2 (19.34, 7.66)),
+ noise1 (x + vec2 (5.47, 17.85)),
+ noise1 (x + vec2 (23.54, 29.11))
+ );
}
-// XXX
-vec4 noise4 (vec4 x) {
- return vec4 (0.0);
+
+vec4 noise4 (vec3 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec3 (19.34, 7.66, 3.23)),
+ noise1 (x + vec3 (5.47, 17.85, 11.04)),
+ noise1 (x + vec3 (23.54, 29.11, 31.91))
+ );
}
+vec4 noise4 (vec4 x) {
+ return vec4 (
+ noise1 (x),
+ noise1 (x + vec4 (19.34, 7.66, 3.23, 2.77)),
+ noise1 (x + vec4 (5.47, 17.85, 11.04, 13.19)),
+ noise1 (x + vec4 (23.54, 29.11, 31.91, 37.48))
+ );
+}
+
diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h
index e1f22527ce..836b8d4c2f 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h
+++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h
@@ -1,677 +1,647 @@
-
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
-/* slang_common_builtin.gc */
-
-2,2,2,1,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,
-97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
-101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
-101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,
-86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,5,1,103,108,95,77,97,
-120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,
-16,10,53,49,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,
-115,0,2,16,10,51,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,
-114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,5,1,103,108,95,77,97,120,67,
-111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,
-10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,
-116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105,
-102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,1,5,1,103,108,95,
-77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,4,15,1,103,108,95,77,111,
-100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,
-116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,
-119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,84,101,
-120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,
-67,111,111,114,100,115,0,0,0,2,2,4,14,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,
-0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,
-115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
-110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,
-106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,
-108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108,
-95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,
-100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,
-1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,
-115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,
-105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,
-101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,
-77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
-101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,
-115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
-110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
-101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,
-114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,101,120,116,117,114,
-101,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,
-108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,9,1,103,108,95,78,
-111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,0,22,103,108,95,68,101,112,116,104,82,97,110,103,101,
-80,97,114,97,109,101,116,101,114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0,1,9,100,105,102,
-102,0,0,0,0,0,0,2,2,4,23,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,
-101,114,115,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,12,1,103,108,95,67,108,
-105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,0,0,2,
-2,0,22,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9,115,105,122,101,0,0,
-0,1,9,115,105,122,101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9,102,97,100,101,84,
-104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110,99,101,67,111,110,
-115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,
-101,76,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,
-110,99,101,81,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,
-2,4,23,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,80,111,
-105,110,116,0,0,0,2,2,0,22,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,
-114,115,0,12,101,109,105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110,116,0,0,0,1,12,100,
-105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115,104,105,110,105,110,
-101,115,115,0,0,0,0,0,0,2,2,4,23,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,
-101,114,115,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,4,23,103,108,
-95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,66,97,99,107,
-77,97,116,101,114,105,97,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
-97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,
-115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105,116,105,111,110,0,0,0,
-1,12,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105,114,101,99,116,105,111,
-110,0,0,0,1,9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115,112,111,116,67,117,116,
-111,102,102,0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,99,111,110,115,
-116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105,110,101,97,114,65,116,
-116,101,110,117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105,99,65,116,116,101,110,
-117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,23,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
-97,114,97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,
-103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
-100,101,108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,0,0,0,2,2,4,
-23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,1,103,
-108,95,76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
-100,101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,2,
-2,4,23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,
-95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,4,
-23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95,
-66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,0,22,103,
-108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,
-100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0,0,2,2,4,23,103,108,
-95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111,110,116,76,105,103,
-104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,4,
-23,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,66,97,99,107,76,105,
-103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,
-4,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,
-120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2,2,4,12,1,103,108,95,69,
-121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,
-100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,
-101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,
-110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,
-4,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,
-114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,
-83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,
-103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,
-117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,
-101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,
-12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,
-116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,22,103,108,95,70,111,103,80,97,114,97,109,101,
-116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116,121,0,0,0,1,9,115,116,97,
-114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2,4,23,103,108,95,70,111,
-103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0,1,0,9,0,114,97,100,105,97,
-110,115,0,1,0,0,9,100,101,103,0,0,0,1,8,17,51,0,49,52,49,53,57,51,0,0,18,100,101,103,0,48,17,49,56,
-48,0,48,0,0,49,0,0,1,0,10,0,114,97,100,105,97,110,115,0,1,0,0,10,100,101,103,0,0,0,1,8,58,118,101,
-99,50,0,58,114,97,100,105,97,110,115,0,18,100,101,103,0,59,120,0,0,0,0,58,114,97,100,105,97,110,
-115,0,18,100,101,103,0,59,121,0,0,0,0,0,0,0,1,0,11,0,114,97,100,105,97,110,115,0,1,0,0,11,100,101,
-103,0,0,0,1,8,58,118,101,99,51,0,58,114,97,100,105,97,110,115,0,18,100,101,103,0,59,120,0,0,0,0,58,
-114,97,100,105,97,110,115,0,18,100,101,103,0,59,121,0,0,0,0,58,114,97,100,105,97,110,115,0,18,100,
-101,103,0,59,122,0,0,0,0,0,0,0,1,0,12,0,114,97,100,105,97,110,115,0,1,0,0,12,100,101,103,0,0,0,1,8,
-58,118,101,99,52,0,58,114,97,100,105,97,110,115,0,18,100,101,103,0,59,120,0,0,0,0,58,114,97,100,
-105,97,110,115,0,18,100,101,103,0,59,121,0,0,0,0,58,114,97,100,105,97,110,115,0,18,100,101,103,0,
-59,122,0,0,0,0,58,114,97,100,105,97,110,115,0,18,100,101,103,0,59,119,0,0,0,0,0,0,0,1,0,9,0,100,
-101,103,114,101,101,115,0,1,0,0,9,114,97,100,0,0,0,1,8,17,49,56,48,0,48,0,0,18,114,97,100,0,48,17,
-51,0,49,52,49,53,57,51,0,0,49,0,0,1,0,10,0,100,101,103,114,101,101,115,0,1,0,0,10,114,97,100,0,0,0,
-1,8,58,118,101,99,50,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,59,120,0,0,0,0,58,100,101,
-103,114,101,101,115,0,18,114,97,100,0,59,121,0,0,0,0,0,0,0,1,0,11,0,100,101,103,114,101,101,115,0,
-1,0,0,11,114,97,100,0,0,0,1,8,58,118,101,99,51,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,
-59,120,0,0,0,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,59,121,0,0,0,0,58,100,101,103,114,
-101,101,115,0,18,114,97,100,0,59,122,0,0,0,0,0,0,0,1,0,12,0,100,101,103,114,101,101,115,0,1,0,0,12,
-114,97,100,0,0,0,1,8,58,118,101,99,52,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,59,120,0,
-0,0,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,59,121,0,0,0,0,58,100,101,103,114,101,101,
-115,0,18,114,97,100,0,59,122,0,0,0,0,58,100,101,103,114,101,101,115,0,18,114,97,100,0,59,119,0,0,0,
-0,0,0,0,1,0,9,0,115,105,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,115,
-105,110,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,101,99,50,0,58,115,105,110,0,18,97,110,103,
-108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
-115,105,110,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,101,99,51,0,58,115,105,110,0,18,97,110,
-103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,115,105,
-110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,110,0,1,0,0,12,97,110,103,108,
-101,0,0,0,1,8,58,118,101,99,52,0,58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,
-105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,122,0,
-0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,111,115,0,1,0,0,9,
-97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,17,49,0,53,55,48,56,0,0,46,0,
-0,0,0,1,0,10,0,99,111,115,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,101,99,50,0,58,99,111,115,
-0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,0,
-0,0,1,0,11,0,99,111,115,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,101,99,51,0,58,99,111,115,0,
-18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,
-99,111,115,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,111,115,0,1,0,0,12,97,110,
-103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,
-99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,122,
-0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,0,9,0,116,97,110,0,1,0,0,9,
-97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,0,0,58,99,111,115,0,18,97,
-110,103,108,101,0,0,0,49,0,0,1,0,10,0,116,97,110,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,
-101,99,50,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,
-108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,116,97,110,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,
-101,99,51,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,
-108,101,0,59,121,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,116,
-97,110,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,116,97,110,0,18,97,110,103,
-108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,116,97,110,0,18,
-97,110,103,108,101,0,59,122,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,
-0,9,0,97,115,105,110,0,1,0,0,9,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,97,115,105,110,0,1,0,0,10,
-120,0,0,0,1,8,58,118,101,99,50,0,58,97,115,105,110,0,18,120,0,59,120,0,0,0,0,58,97,115,105,110,0,
-18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,115,105,110,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,
-58,97,115,105,110,0,18,120,0,59,120,0,0,0,0,58,97,115,105,110,0,18,120,0,59,121,0,0,0,0,58,97,115,
-105,110,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,115,105,110,0,1,0,0,12,120,0,0,0,1,8,58,118,
-101,99,52,0,58,97,115,105,110,0,18,120,0,59,120,0,0,0,0,58,97,115,105,110,0,18,120,0,59,121,0,0,0,
-0,58,97,115,105,110,0,18,120,0,59,122,0,0,0,0,58,97,115,105,110,0,18,120,0,59,119,0,0,0,0,0,0,0,1,
-0,9,0,97,99,111,115,0,1,0,0,9,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,97,99,111,115,0,1,0,0,10,
-120,0,0,0,1,8,58,118,101,99,50,0,58,97,99,111,115,0,18,120,0,59,120,0,0,0,0,58,97,99,111,115,0,18,
-120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,99,111,115,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,
-97,99,111,115,0,18,120,0,59,120,0,0,0,0,58,97,99,111,115,0,18,120,0,59,121,0,0,0,0,58,97,99,111,
-115,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,99,111,115,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,
-52,0,58,97,99,111,115,0,18,120,0,59,120,0,0,0,0,58,97,99,111,115,0,18,120,0,59,121,0,0,0,0,58,97,
-99,111,115,0,18,120,0,59,122,0,0,0,0,58,97,99,111,115,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,
-116,97,110,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,97,116,97,110,0,1,0,
-0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,118,101,99,50,0,58,97,116,97,110,0,18,120,0,59,120,0,0,18,
-121,0,59,120,0,0,0,0,58,97,116,97,110,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
-97,116,97,110,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,110,0,18,
-120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,97,116,97,110,0,18,120,0,59,121,0,0,18,121,0,59,121,0,
-0,0,0,58,97,116,97,110,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,
-0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,118,101,99,52,0,58,97,116,97,110,0,18,120,0,59,120,0,
-0,18,121,0,59,120,0,0,0,0,58,97,116,97,110,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,58,97,116,
-97,110,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,58,97,116,97,110,0,18,120,0,59,119,0,0,18,121,
-0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9,121,95,111,118,101,114,95,120,0,0,0,1,8,17,
-48,0,48,0,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,
-101,99,50,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,
-0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,121,95,
-111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,110,0,18,121,95,111,118,101,114,
-95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,
-116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,
-0,12,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,52,0,58,97,116,97,110,0,18,121,95,111,
-118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,
-0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,0,58,97,116,97,110,0,18,
-121,95,111,118,101,114,95,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,112,111,119,0,1,0,0,9,120,0,0,1,0,0,9,
-121,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,112,111,119,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,
-118,101,99,50,0,58,112,111,119,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,112,111,119,0,18,
-120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,0,0,0,1,0,11,0,112,111,119,0,1,0,0,11,120,0,0,1,0,0,11,
-121,0,0,0,1,8,58,118,101,99,51,0,58,112,111,119,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,
-112,111,119,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,58,112,111,119,0,18,120,0,59,122,0,0,18,
-121,0,59,122,0,0,0,0,0,0,0,1,0,12,0,112,111,119,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,118,
-101,99,52,0,58,112,111,119,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,112,111,119,0,18,120,0,
-59,121,0,0,18,121,0,59,121,0,0,0,0,58,112,111,119,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,58,
-112,111,119,0,18,120,0,59,119,0,0,18,121,0,59,119,0,0,0,0,0,0,0,1,0,9,0,101,120,112,0,1,0,0,9,120,
-0,0,0,1,8,58,112,111,119,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,18,120,0,0,0,0,0,1,0,10,0,101,120,
-112,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,101,120,112,0,18,120,0,59,120,0,0,0,0,58,101,
-120,112,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,101,120,112,0,1,0,0,11,120,0,0,0,1,8,58,118,101,
-99,51,0,58,101,120,112,0,18,120,0,59,120,0,0,0,0,58,101,120,112,0,18,120,0,59,121,0,0,0,0,58,101,
-120,112,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,101,120,112,0,1,0,0,12,120,0,0,0,1,8,58,118,101,
-99,52,0,58,101,120,112,0,18,120,0,59,120,0,0,0,0,58,101,120,112,0,18,120,0,59,121,0,0,0,0,58,101,
-120,112,0,18,120,0,59,122,0,0,0,0,58,101,120,112,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,108,111,
-103,0,1,0,0,9,120,0,0,0,1,8,58,108,111,103,50,0,18,120,0,0,0,58,108,111,103,50,0,17,50,0,55,49,56,
-50,56,49,56,51,0,0,0,0,49,0,0,1,0,10,0,108,111,103,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,
-108,111,103,0,18,120,0,59,120,0,0,0,0,58,108,111,103,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,108,
-111,103,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,108,111,103,0,18,120,0,59,120,0,0,0,0,58,
-108,111,103,0,18,120,0,59,121,0,0,0,0,58,108,111,103,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,108,
-111,103,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,108,111,103,0,18,120,0,59,120,0,0,0,0,58,
-108,111,103,0,18,120,0,59,121,0,0,0,0,58,108,111,103,0,18,120,0,59,122,0,0,0,0,58,108,111,103,0,18,
-120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,101,120,112,50,0,1,0,0,9,120,0,0,0,1,8,58,112,111,119,0,17,50,0,
-48,0,0,0,18,120,0,0,0,0,0,1,0,10,0,101,120,112,50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,
-101,120,112,50,0,18,120,0,59,120,0,0,0,0,58,101,120,112,50,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,
-0,101,120,112,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,101,120,112,50,0,18,120,0,59,120,0,
-0,0,0,58,101,120,112,50,0,18,120,0,59,121,0,0,0,0,58,101,120,112,50,0,18,120,0,59,122,0,0,0,0,0,0,
-0,1,0,12,0,101,120,112,50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,101,120,112,50,0,18,120,0,
-59,120,0,0,0,0,58,101,120,112,50,0,18,120,0,59,121,0,0,0,0,58,101,120,112,50,0,18,120,0,59,122,0,0,
-0,0,58,101,120,112,50,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,108,111,103,50,0,1,0,0,9,120,0,0,0,1,
-8,17,48,0,48,0,0,0,0,1,0,10,0,108,111,103,50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,108,
-111,103,50,0,18,120,0,59,120,0,0,0,0,58,108,111,103,50,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
-108,111,103,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,108,111,103,50,0,18,120,0,59,120,0,0,
-0,0,58,108,111,103,50,0,18,120,0,59,121,0,0,0,0,58,108,111,103,50,0,18,120,0,59,122,0,0,0,0,0,0,0,
-1,0,12,0,108,111,103,50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,108,111,103,50,0,18,120,0,
-59,120,0,0,0,0,58,108,111,103,50,0,18,120,0,59,121,0,0,0,0,58,108,111,103,50,0,18,120,0,59,122,0,0,
-0,0,58,108,111,103,50,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,115,113,114,116,0,1,0,0,9,120,0,0,0,
-1,8,58,112,111,119,0,18,120,0,0,17,48,0,53,0,0,0,0,0,0,1,0,10,0,115,113,114,116,0,1,0,0,10,120,0,0,
-0,1,8,58,118,101,99,50,0,58,115,113,114,116,0,18,120,0,59,120,0,0,0,0,58,115,113,114,116,0,18,120,
-0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,113,114,116,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,115,
-113,114,116,0,18,120,0,59,120,0,0,0,0,58,115,113,114,116,0,18,120,0,59,121,0,0,0,0,58,115,113,114,
-116,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,113,114,116,0,1,0,0,12,120,0,0,0,1,8,58,118,101,
-99,52,0,58,115,113,114,116,0,18,120,0,59,120,0,0,0,0,58,115,113,114,116,0,18,120,0,59,121,0,0,0,0,
-58,115,113,114,116,0,18,120,0,59,122,0,0,0,0,58,115,113,114,116,0,18,120,0,59,119,0,0,0,0,0,0,0,1,
-0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,9,120,0,0,0,1,8,17,49,0,48,0,0,58,115,
-113,114,116,0,18,120,0,0,0,49,0,0,1,0,10,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,10,
-120,0,0,0,1,8,58,118,101,99,50,0,58,105,110,118,101,114,115,101,115,113,114,116,0,18,120,0,59,120,
-0,0,0,0,58,105,110,118,101,114,115,101,115,113,114,116,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
-105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,105,110,
-118,101,114,115,101,115,113,114,116,0,18,120,0,59,120,0,0,0,0,58,105,110,118,101,114,115,101,115,
-113,114,116,0,18,120,0,59,121,0,0,0,0,58,105,110,118,101,114,115,101,115,113,114,116,0,18,120,0,59,
-122,0,0,0,0,0,0,0,1,0,12,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,12,120,0,0,0,1,8,58,
-118,101,99,52,0,58,105,110,118,101,114,115,101,115,113,114,116,0,18,120,0,59,120,0,0,0,0,58,105,
-110,118,101,114,115,101,115,113,114,116,0,18,120,0,59,121,0,0,0,0,58,105,110,118,101,114,115,101,
-115,113,114,116,0,18,120,0,59,122,0,0,0,0,58,105,110,118,101,114,115,101,115,113,114,116,0,18,120,
-0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,98,115,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,48,0,0,43,18,120,
-0,18,120,0,54,31,0,0,1,0,10,0,97,98,115,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,97,98,115,0,
-18,120,0,59,120,0,0,0,0,58,97,98,115,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,98,115,0,1,0,0,11,
-120,0,0,0,1,8,58,118,101,99,51,0,58,97,98,115,0,18,120,0,59,120,0,0,0,0,58,97,98,115,0,18,120,0,59,
-121,0,0,0,0,58,97,98,115,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,98,115,0,1,0,0,12,120,0,0,0,1,
-8,58,118,101,99,52,0,58,97,98,115,0,18,120,0,59,120,0,0,0,0,58,97,98,115,0,18,120,0,59,121,0,0,0,0,
-58,97,98,115,0,18,120,0,59,122,0,0,0,0,58,97,98,115,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,115,
-105,103,110,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,48,0,0,41,17,49,0,48,0,0,18,120,0,17,48,0,48,
-0,0,40,17,49,0,48,0,0,54,17,48,0,48,0,0,31,31,0,0,1,0,10,0,115,105,103,110,0,1,0,0,10,120,0,0,0,1,
-8,58,118,101,99,50,0,58,115,105,103,110,0,18,120,0,59,120,0,0,0,0,58,115,105,103,110,0,18,120,0,59,
-121,0,0,0,0,0,0,0,1,0,11,0,115,105,103,110,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,115,105,
-103,110,0,18,120,0,59,120,0,0,0,0,58,115,105,103,110,0,18,120,0,59,121,0,0,0,0,58,115,105,103,110,
-0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,103,110,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,
-0,58,115,105,103,110,0,18,120,0,59,120,0,0,0,0,58,115,105,103,110,0,18,120,0,59,121,0,0,0,0,58,115,
-105,103,110,0,18,120,0,59,122,0,0,0,0,58,115,105,103,110,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,
-102,108,111,111,114,0,1,0,0,9,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,102,108,111,111,114,0,1,0,
-0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,102,108,111,111,114,0,18,120,0,59,120,0,0,0,0,58,102,108,
-111,111,114,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,0,0,11,120,0,0,0,1,8,
-58,118,101,99,51,0,58,102,108,111,111,114,0,18,120,0,59,120,0,0,0,0,58,102,108,111,111,114,0,18,
-120,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,102,108,111,
-111,114,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,102,108,111,111,114,0,18,120,0,59,120,0,0,0,
-0,58,102,108,111,111,114,0,18,120,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,120,0,59,122,0,0,0,
-0,58,102,108,111,111,114,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,101,105,108,0,1,0,0,9,120,0,0,
-0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,99,101,105,108,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,99,
-101,105,108,0,18,120,0,59,120,0,0,0,0,58,99,101,105,108,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
-99,101,105,108,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,99,101,105,108,0,18,120,0,59,120,0,0,
-0,0,58,99,101,105,108,0,18,120,0,59,121,0,0,0,0,58,99,101,105,108,0,18,120,0,59,122,0,0,0,0,0,0,0,
-1,0,12,0,99,101,105,108,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,99,101,105,108,0,18,120,0,
-59,120,0,0,0,0,58,99,101,105,108,0,18,120,0,59,121,0,0,0,0,58,99,101,105,108,0,18,120,0,59,122,0,0,
-0,0,58,99,101,105,108,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,102,114,97,99,116,0,1,0,0,9,120,0,0,
-0,1,8,18,120,0,58,102,108,111,111,114,0,18,120,0,0,0,47,0,0,1,0,10,0,102,114,97,99,116,0,1,0,0,10,
-120,0,0,0,1,8,58,118,101,99,50,0,58,102,114,97,99,116,0,18,120,0,59,120,0,0,0,0,58,102,114,97,99,
-116,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,102,114,97,99,116,0,1,0,0,11,120,0,0,0,1,8,58,118,101,
-99,51,0,58,102,114,97,99,116,0,18,120,0,59,120,0,0,0,0,58,102,114,97,99,116,0,18,120,0,59,121,0,0,
-0,0,58,102,114,97,99,116,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,102,114,97,99,116,0,1,0,0,12,120,
-0,0,0,1,8,58,118,101,99,52,0,58,102,114,97,99,116,0,18,120,0,59,120,0,0,0,0,58,102,114,97,99,116,0,
-18,120,0,59,121,0,0,0,0,58,102,114,97,99,116,0,18,120,0,59,122,0,0,0,0,58,102,114,97,99,116,0,18,
-120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,109,111,100,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,
-121,0,58,102,108,111,111,114,0,18,120,0,18,121,0,49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,
-120,0,0,1,0,0,9,121,0,0,0,1,8,58,118,101,99,50,0,58,109,111,100,0,18,120,0,59,120,0,0,18,121,0,0,0,
-0,58,109,111,100,0,18,120,0,59,121,0,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,111,100,0,1,0,0,11,120,0,
-0,1,0,0,9,121,0,0,0,1,8,58,118,101,99,51,0,58,109,111,100,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,
-109,111,100,0,18,120,0,59,121,0,0,18,121,0,0,0,0,58,109,111,100,0,18,120,0,59,122,0,0,18,121,0,0,0,
-0,0,0,0,1,0,12,0,109,111,100,0,1,0,0,12,120,0,0,1,0,0,9,121,0,0,0,1,8,58,118,101,99,52,0,58,109,
-111,100,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,109,111,100,0,18,120,0,59,121,0,0,18,121,0,0,0,0,
-58,109,111,100,0,18,120,0,59,122,0,0,18,121,0,0,0,0,58,109,111,100,0,18,120,0,59,119,0,0,18,121,0,
-0,0,0,0,0,0,1,0,10,0,109,111,100,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,118,101,99,50,0,58,
-109,111,100,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,109,111,100,0,18,120,0,59,121,0,0,18,
-121,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,111,100,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,118,
-101,99,51,0,58,109,111,100,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,109,111,100,0,18,120,0,
-59,121,0,0,18,121,0,59,121,0,0,0,0,58,109,111,100,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,0,
-0,0,1,0,12,0,109,111,100,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,118,101,99,52,0,58,109,111,
-100,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,109,111,100,0,18,120,0,59,121,0,0,18,121,0,59,
-121,0,0,0,0,58,109,111,100,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,58,109,111,100,0,18,120,0,
-59,119,0,0,18,121,0,59,119,0,0,0,0,0,0,0,1,0,9,0,109,105,110,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,
-8,18,121,0,18,120,0,40,18,121,0,18,120,0,31,0,0,1,0,10,0,109,105,110,0,1,0,0,10,120,0,0,1,0,0,9,
-121,0,0,0,1,8,58,118,101,99,50,0,58,109,105,110,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,109,105,
-110,0,18,120,0,59,121,0,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,105,110,0,1,0,0,11,120,0,0,1,0,0,9,121,
-0,0,0,1,8,58,118,101,99,51,0,58,109,105,110,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,109,105,110,0,
-18,120,0,59,121,0,0,18,121,0,0,0,0,58,109,105,110,0,18,120,0,59,122,0,0,18,121,0,0,0,0,0,0,0,1,0,
-12,0,109,105,110,0,1,0,0,12,120,0,0,1,0,0,9,121,0,0,0,1,8,58,118,101,99,52,0,58,109,105,110,0,18,
-120,0,59,120,0,0,18,121,0,0,0,0,58,109,105,110,0,18,120,0,59,121,0,0,18,121,0,0,0,0,58,109,105,110,
-0,18,120,0,59,122,0,0,18,121,0,0,0,0,58,109,105,110,0,18,120,0,59,119,0,0,18,121,0,0,0,0,0,0,0,1,0,
-10,0,109,105,110,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,118,101,99,50,0,58,109,105,110,0,18,
-120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,109,105,110,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,
-0,0,0,0,0,1,0,11,0,109,105,110,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,118,101,99,51,0,58,109,
-105,110,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,109,105,110,0,18,120,0,59,121,0,0,18,121,
-0,59,121,0,0,0,0,58,109,105,110,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,
-105,110,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,118,101,99,52,0,58,109,105,110,0,18,120,0,59,
-120,0,0,18,121,0,59,120,0,0,0,0,58,109,105,110,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,58,
-109,105,110,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,58,109,105,110,0,18,120,0,59,119,0,0,18,
-121,0,59,119,0,0,0,0,0,0,0,1,0,9,0,109,97,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,
-110,0,18,121,0,0,18,120,0,0,0,0,0,1,0,10,0,109,97,120,0,1,0,0,10,120,0,0,1,0,0,9,121,0,0,0,1,8,58,
-118,101,99,50,0,58,109,97,120,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,109,97,120,0,18,120,0,59,121,
-0,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,120,0,0,1,0,0,9,121,0,0,0,1,8,58,118,101,
-99,51,0,58,109,97,120,0,18,120,0,59,120,0,0,18,121,0,0,0,0,58,109,97,120,0,18,120,0,59,121,0,0,18,
-121,0,0,0,0,58,109,97,120,0,18,120,0,59,122,0,0,18,121,0,0,0,0,0,0,0,1,0,12,0,109,97,120,0,1,0,0,
-12,120,0,0,1,0,0,9,121,0,0,0,1,8,58,118,101,99,52,0,58,109,97,120,0,18,120,0,59,120,0,0,18,121,0,0,
-0,0,58,109,97,120,0,18,120,0,59,121,0,0,18,121,0,0,0,0,58,109,97,120,0,18,120,0,59,122,0,0,18,121,
-0,0,0,0,58,109,97,120,0,18,120,0,59,119,0,0,18,121,0,0,0,0,0,0,0,1,0,10,0,109,97,120,0,1,0,0,10,
-120,0,0,1,0,0,10,121,0,0,0,1,8,58,118,101,99,50,0,58,109,97,120,0,18,120,0,59,120,0,0,18,121,0,59,
-120,0,0,0,0,58,109,97,120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,
-0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,118,101,99,51,0,58,109,97,120,0,18,120,0,59,120,0,0,
-18,121,0,59,120,0,0,0,0,58,109,97,120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,58,109,97,120,
-0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,97,120,0,1,0,0,12,120,0,0,1,0,0,
-12,121,0,0,0,1,8,58,118,101,99,52,0,58,109,97,120,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,0,58,
-109,97,120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,0,58,109,97,120,0,18,120,0,59,122,0,0,18,
-121,0,59,122,0,0,0,0,58,109,97,120,0,18,120,0,59,119,0,0,18,121,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,
-108,97,109,112,0,1,0,0,9,120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,
-0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,
-86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,0,0,10,120,0,0,1,0,0,9,109,105,110,86,97,108,0,
-0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,118,101,99,50,0,58,99,108,97,109,112,0,18,120,0,59,120,
-0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,58,99,108,97,109,112,0,18,120,0,
-59,121,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,0,0,0,1,0,11,0,99,108,97,
-109,112,0,1,0,0,11,120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,
-8,58,118,101,99,51,0,58,99,108,97,109,112,0,18,120,0,59,120,0,0,18,109,105,110,86,97,108,0,0,18,
-109,97,120,86,97,108,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,121,0,0,18,109,105,110,86,97,108,0,
-0,18,109,97,120,86,97,108,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,122,0,0,18,109,105,110,86,97,
-108,0,0,18,109,97,120,86,97,108,0,0,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,
-9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,118,101,99,52,0,58,99,108,97,
-109,112,0,18,120,0,59,120,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,58,99,
-108,97,109,112,0,18,120,0,59,121,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,
-58,99,108,97,109,112,0,18,120,0,59,122,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,
-0,0,0,58,99,108,97,109,112,0,18,120,0,59,119,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,
-108,0,0,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,0,0,10,120,0,0,1,0,0,10,109,105,110,86,97,108,0,0,
-1,0,0,10,109,97,120,86,97,108,0,0,0,1,8,58,118,101,99,50,0,58,99,108,97,109,112,0,18,120,0,59,120,
-0,0,18,109,105,110,86,97,108,0,59,120,0,0,18,109,97,120,86,97,108,0,59,120,0,0,0,0,58,99,108,97,
-109,112,0,18,120,0,59,121,0,0,18,109,105,110,86,97,108,0,59,121,0,0,18,109,97,120,86,97,108,0,59,
-121,0,0,0,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,11,109,105,110,86,97,108,0,0,
-1,0,0,11,109,97,120,86,97,108,0,0,0,1,8,58,118,101,99,51,0,58,99,108,97,109,112,0,18,120,0,59,120,
-0,0,18,109,105,110,86,97,108,0,59,120,0,0,18,109,97,120,86,97,108,0,59,120,0,0,0,0,58,99,108,97,
-109,112,0,18,120,0,59,121,0,0,18,109,105,110,86,97,108,0,59,121,0,0,18,109,97,120,86,97,108,0,59,
-121,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,122,0,0,18,109,105,110,86,97,108,0,59,122,0,0,18,
-109,97,120,86,97,108,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,12,
-109,105,110,86,97,108,0,0,1,0,0,12,109,97,120,86,97,108,0,0,0,1,8,58,118,101,99,52,0,58,99,108,97,
-109,112,0,18,120,0,59,120,0,0,18,109,105,110,86,97,108,0,59,120,0,0,18,109,97,120,86,97,108,0,59,
-121,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,121,0,0,18,109,105,110,86,97,108,0,59,121,0,0,18,
-109,97,120,86,97,108,0,59,121,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,122,0,0,18,109,105,110,86,
-97,108,0,59,122,0,0,18,109,97,120,86,97,108,0,59,122,0,0,0,0,58,99,108,97,109,112,0,18,120,0,59,
-119,0,0,18,109,105,110,86,97,108,0,59,119,0,0,18,109,97,120,86,97,108,0,59,119,0,0,0,0,0,0,0,1,0,9,
-0,109,105,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,
-0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,1,0,0,
-9,97,0,0,0,1,8,58,118,101,99,50,0,58,109,105,120,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,
-0,0,0,58,109,105,120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,18,97,0,0,0,0,0,0,0,1,0,11,0,109,
-105,120,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,9,97,0,0,0,1,8,58,118,101,99,51,0,58,109,105,120,
-0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,0,0,0,58,109,105,120,0,18,120,0,59,121,0,0,18,
-121,0,59,121,0,0,18,97,0,0,0,0,58,109,105,120,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,18,97,0,0,
-0,0,0,0,0,1,0,12,0,109,105,120,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,1,0,0,9,97,0,0,0,1,8,58,118,101,
-99,52,0,58,109,105,120,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,0,0,0,58,109,105,120,0,18,
-120,0,59,121,0,0,18,121,0,59,121,0,0,18,97,0,0,0,0,58,109,105,120,0,18,120,0,59,122,0,0,18,121,0,
-59,122,0,0,18,97,0,0,0,0,58,109,105,120,0,18,120,0,59,119,0,0,18,121,0,59,119,0,0,18,97,0,0,0,0,0,
-0,0,1,0,10,0,109,105,120,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,1,0,0,10,97,0,0,0,1,8,58,118,101,99,
-50,0,58,109,105,120,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,59,120,0,0,0,0,58,109,105,
-120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,18,97,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,105,120,0,
-1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,11,97,0,0,0,1,8,58,118,101,99,51,0,58,109,105,120,0,18,120,
-0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,59,120,0,0,0,0,58,109,105,120,0,18,120,0,59,121,0,0,18,
-121,0,59,121,0,0,18,97,0,59,121,0,0,0,0,58,109,105,120,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,
-18,97,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,105,120,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,1,0,0,12,97,
-0,0,0,1,8,58,118,101,99,52,0,58,109,105,120,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,18,97,0,59,
-120,0,0,0,0,58,109,105,120,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,18,97,0,59,121,0,0,0,0,58,109,
-105,120,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,18,97,0,59,122,0,0,0,0,58,109,105,120,0,18,120,0,
-59,119,0,0,18,121,0,59,119,0,0,18,97,0,59,119,0,0,0,0,0,0,0,1,0,9,0,115,116,101,112,0,1,0,0,9,101,
-100,103,101,0,0,1,0,0,9,120,0,0,0,1,8,18,120,0,18,101,100,103,101,0,40,17,48,0,48,0,0,17,49,0,48,0,
-0,31,0,0,1,0,10,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,10,120,0,0,0,1,8,58,118,101,
-99,50,0,58,115,116,101,112,0,18,101,100,103,101,0,0,18,120,0,59,120,0,0,0,0,58,115,116,101,112,0,
-18,101,100,103,101,0,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,9,101,100,
-103,101,0,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,115,116,101,112,0,18,101,100,103,101,0,0,
-18,120,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,0,18,120,0,59,121,0,0,0,0,58,115,
-116,101,112,0,18,101,100,103,101,0,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,
-0,9,101,100,103,101,0,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,115,116,101,112,0,18,101,100,
-103,101,0,0,18,120,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,0,18,120,0,59,121,0,
-0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,0,18,120,0,59,122,0,0,0,0,58,115,116,101,112,0,18,
-101,100,103,101,0,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,116,101,112,0,1,0,0,10,101,100,103,
-101,0,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,115,116,101,112,0,18,101,100,103,101,0,59,120,
-0,0,18,120,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,120,0,59,121,0,
-0,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,11,101,100,103,101,0,0,1,0,0,11,120,0,0,0,1,8,58,118,
-101,99,51,0,58,115,116,101,112,0,18,101,100,103,101,0,59,120,0,0,18,120,0,59,120,0,0,0,0,58,115,
-116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,120,0,59,121,0,0,0,0,58,115,116,101,112,0,18,101,
-100,103,101,0,59,122,0,0,18,120,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,0,12,101,100,
-103,101,0,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,115,116,101,112,0,18,101,100,103,101,0,59,
-120,0,0,18,120,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,120,0,59,
-121,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,122,0,0,18,120,0,59,122,0,0,0,0,58,115,
-116,101,112,0,18,101,100,103,101,0,59,119,0,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,115,109,111,
-111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,
-9,120,0,0,0,1,3,2,1,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,101,
-100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,
-0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,
-115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,10,120,0,0,0,
-1,8,58,118,101,99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,
-101,100,103,101,49,0,0,18,120,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,
-100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,
-111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,
-11,120,0,0,0,1,8,58,118,101,99,51,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,
-101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,
-101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,121,0,0,0,0,58,115,109,
-111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,
-122,0,0,0,0,0,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,
-0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,
-104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,120,0,0,0,0,
-58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,
-18,120,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,
-101,100,103,101,49,0,0,18,120,0,59,122,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,
-100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,109,111,
-111,116,104,115,116,101,112,0,1,0,0,10,101,100,103,101,48,0,0,1,0,0,10,101,100,103,101,49,0,0,1,0,
-0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,
-101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,120,0,59,120,0,0,0,0,58,115,109,111,111,
-116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,
-120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,11,101,100,103,
-101,48,0,0,1,0,0,11,101,100,103,101,49,0,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,115,109,
-111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,
-120,0,0,18,120,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,
-0,59,121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,120,0,59,121,0,0,0,0,58,115,109,111,111,116,104,
-115,116,101,112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,120,0,
-59,122,0,0,0,0,0,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,12,101,100,103,101,
-48,0,0,1,0,0,12,101,100,103,101,49,0,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,
-111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,
-0,18,120,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,
-121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,120,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,
-116,101,112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,120,0,59,
-122,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,119,0,0,18,101,
-100,103,101,49,0,59,119,0,0,18,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,100,111,116,0,1,0,0,9,120,0,0,1,
-0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,48,0,0,1,0,9,0,100,111,116,0,1,0,0,10,120,0,0,1,0,0,10,121,0,
-0,0,1,8,58,100,111,116,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,58,100,111,116,0,18,120,0,59,
-121,0,0,18,121,0,59,121,0,0,0,46,0,0,1,0,9,0,100,111,116,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,
-58,100,111,116,0,18,120,0,59,120,0,0,18,121,0,59,120,0,0,0,58,100,111,116,0,18,120,0,59,121,0,0,18,
-121,0,59,121,0,0,0,46,58,100,111,116,0,18,120,0,59,122,0,0,18,121,0,59,122,0,0,0,46,0,0,1,0,9,0,
-100,111,116,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,100,111,116,0,18,120,0,59,120,0,0,18,121,
-0,59,120,0,0,0,58,100,111,116,0,18,120,0,59,121,0,0,18,121,0,59,121,0,0,0,46,58,100,111,116,0,18,
-120,0,59,122,0,0,18,121,0,59,122,0,0,0,46,58,100,111,116,0,18,120,0,59,119,0,0,18,121,0,59,119,0,0,
-0,46,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,9,120,0,0,0,1,8,58,115,113,114,116,0,58,100,111,
-116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,10,120,0,0,0,1,8,58,
-115,113,114,116,0,58,100,111,116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,
-0,1,0,0,11,120,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,
-9,0,108,101,110,103,116,104,0,1,0,0,12,120,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,120,
-0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,
-1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,
-101,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,
-0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,108,101,
-110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,12,
-120,0,0,1,0,0,12,121,0,0,0,1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,11,0,
-99,114,111,115,115,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,118,101,99,51,0,18,120,0,59,121,0,
-18,121,0,59,122,0,48,18,121,0,59,121,0,18,120,0,59,122,0,48,47,0,18,120,0,59,122,0,18,121,0,59,120,
-0,48,18,121,0,59,122,0,18,120,0,59,120,0,48,47,0,18,120,0,59,120,0,18,121,0,59,121,0,48,18,121,0,
-59,120,0,18,120,0,59,121,0,48,47,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,101,0,1,0,0,9,120,
-0,0,0,1,8,17,49,0,48,0,0,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,0,0,10,120,0,0,0,1,8,
-18,120,0,58,108,101,110,103,116,104,0,18,120,0,0,0,49,0,0,1,0,11,0,110,111,114,109,97,108,105,122,
-101,0,1,0,0,11,120,0,0,0,1,8,18,120,0,58,108,101,110,103,116,104,0,18,120,0,0,0,49,0,0,1,0,12,0,
-110,111,114,109,97,108,105,122,101,0,1,0,0,12,120,0,0,0,1,8,18,120,0,58,108,101,110,103,116,104,0,
-18,120,0,0,0,49,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,0,0,9,78,0,0,1,0,0,9,73,0,
-0,1,0,0,9,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,
-0,40,18,78,0,18,78,0,54,31,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,100,0,1,0,0,10,78,0,0,
-1,0,0,10,73,0,0,1,0,0,10,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,
-0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,11,0,102,97,99,101,102,111,114,119,97,114,100,0,
-1,0,0,11,78,0,0,1,0,0,11,73,0,0,1,0,0,11,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,
-102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,12,0,102,97,99,101,102,111,114,
-119,97,114,100,0,1,0,0,12,78,0,0,1,0,0,12,73,0,0,1,0,0,12,78,114,101,102,0,0,0,1,8,58,100,111,116,
-0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,9,0,114,101,
-102,108,101,99,116,0,1,0,0,9,73,0,0,1,0,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,
-18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0,1,0,0,10,73,0,0,1,
-0,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,
-0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48,
-0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,101,102,108,101,99,
-116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,
-73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,0,0,9,73,0,0,1,0,0,9,78,0,0,1,
-0,0,9,101,116,97,0,0,0,1,3,2,1,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,
-0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,
-0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,
-116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,
-47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,0,0,10,73,0,0,1,0,0,10,78,0,0,1,0,0,9,101,116,97,0,0,
-0,1,3,2,1,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,
-116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,
-48,0,48,0,0,40,0,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,
-101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,
-0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,1,0,0,9,101,116,
-97,0,0,0,1,3,2,1,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,
-100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,
-107,0,17,48,0,48,0,0,40,0,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,9,14,0,8,18,101,116,97,0,18,73,
-0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,
-46,18,78,0,48,47,0,0,1,0,12,0,114,101,102,114,97,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,1,0,0,9,
-101,116,97,0,0,0,1,3,2,1,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,
-0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,
-10,18,107,0,17,48,0,48,0,0,40,0,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,9,14,0,8,18,101,116,97,0,
-18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,
-0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,
-120,0,0,1,0,0,13,121,0,0,0,1,8,58,109,97,116,50,0,18,120,0,16,8,48,0,57,59,120,0,18,121,0,16,8,48,
-0,57,59,120,0,48,0,18,120,0,16,8,48,0,57,59,121,0,18,121,0,16,8,48,0,57,59,121,0,48,0,18,120,0,16,
-10,49,0,57,59,120,0,18,121,0,16,10,49,0,57,59,120,0,48,0,18,120,0,16,10,49,0,57,59,121,0,18,121,0,
-16,10,49,0,57,59,121,0,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,
-1,0,0,14,120,0,0,1,0,0,14,121,0,0,0,1,8,58,109,97,116,52,0,18,120,0,16,8,48,0,57,59,120,0,18,121,0,
-16,8,48,0,57,59,120,0,48,0,18,120,0,16,8,48,0,57,59,121,0,18,121,0,16,8,48,0,57,59,121,0,48,0,18,
-120,0,16,8,48,0,57,59,122,0,18,121,0,16,8,48,0,57,59,122,0,48,0,18,120,0,16,10,49,0,57,59,120,0,18,
-121,0,16,10,49,0,57,59,120,0,48,0,18,120,0,16,10,49,0,57,59,121,0,18,121,0,16,10,49,0,57,59,121,0,
-48,0,18,120,0,16,10,49,0,57,59,122,0,18,121,0,16,10,49,0,57,59,122,0,48,0,18,120,0,16,10,50,0,57,
-59,120,0,18,121,0,16,10,50,0,57,59,120,0,48,0,18,120,0,16,10,50,0,57,59,121,0,18,121,0,16,10,50,0,
-57,59,121,0,48,0,18,120,0,16,10,50,0,57,59,122,0,18,121,0,16,10,50,0,57,59,122,0,48,0,0,0,0,1,0,15,
-0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,120,0,0,1,0,0,15,121,0,0,0,1,8,
-58,109,97,116,52,0,18,120,0,16,8,48,0,57,59,120,0,18,121,0,16,8,48,0,57,59,120,0,48,0,18,120,0,16,
-8,48,0,57,59,121,0,18,121,0,16,8,48,0,57,59,121,0,48,0,18,120,0,16,8,48,0,57,59,122,0,18,121,0,16,
-8,48,0,57,59,122,0,48,18,120,0,16,8,48,0,57,59,119,0,18,121,0,16,8,48,0,57,59,119,0,48,46,0,18,120,
-0,16,10,49,0,57,59,120,0,18,121,0,16,10,49,0,57,59,120,0,48,0,18,120,0,16,10,49,0,57,59,121,0,18,
-121,0,16,10,49,0,57,59,121,0,48,0,18,120,0,16,10,49,0,57,59,122,0,18,121,0,16,10,49,0,57,59,122,0,
-48,18,120,0,16,10,49,0,57,59,119,0,18,121,0,16,10,49,0,57,59,119,0,48,46,0,18,120,0,16,10,50,0,57,
-59,120,0,18,121,0,16,10,50,0,57,59,120,0,48,0,18,120,0,16,10,50,0,57,59,121,0,18,121,0,16,10,50,0,
-57,59,121,0,48,0,18,120,0,16,10,50,0,57,59,122,0,18,121,0,16,10,50,0,57,59,122,0,48,18,120,0,16,10,
-50,0,57,59,119,0,18,121,0,16,10,50,0,57,59,119,0,48,46,0,18,120,0,16,10,51,0,57,59,120,0,18,121,0,
-16,10,51,0,57,59,120,0,48,0,18,120,0,16,10,51,0,57,59,121,0,18,121,0,16,10,51,0,57,59,121,0,48,0,
-18,120,0,16,10,51,0,57,59,122,0,18,121,0,16,10,51,0,57,59,122,0,48,18,120,0,16,10,51,0,57,59,119,0,
-18,121,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,10,120,
-0,0,1,0,0,10,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,121,0,59,120,0,40,0,18,120,0,
-59,121,0,18,121,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,11,120,0,0,1,0,
-0,11,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,18,121,0,59,120,0,40,0,18,120,0,59,121,
-0,18,121,0,59,121,0,40,0,18,120,0,59,122,0,18,121,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,
-104,97,110,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,
-121,0,59,120,0,40,0,18,120,0,59,121,0,18,121,0,59,121,0,40,0,18,120,0,59,122,0,18,121,0,59,122,0,
-40,0,18,120,0,59,119,0,18,121,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,
-6,120,0,0,1,0,0,6,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,121,0,59,120,0,40,0,18,
-120,0,59,121,0,18,121,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,7,120,0,
-0,1,0,0,7,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,18,121,0,59,120,0,40,0,18,120,0,59,
-121,0,18,121,0,59,121,0,40,0,18,120,0,59,122,0,18,121,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,
-115,84,104,97,110,0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,
-18,121,0,59,120,0,40,0,18,120,0,59,121,0,18,121,0,59,121,0,40,0,18,120,0,59,122,0,18,121,0,59,122,
-0,40,0,18,120,0,59,119,0,18,121,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,
-117,97,108,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,
-121,0,59,120,0,42,0,18,120,0,59,121,0,18,121,0,59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,
-97,110,69,113,117,97,108,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,
-59,120,0,18,121,0,59,120,0,42,0,18,120,0,59,121,0,18,121,0,59,121,0,42,0,18,120,0,59,122,0,18,121,
-0,59,122,0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,12,120,0,0,1,
-0,0,12,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,42,0,18,120,0,59,
-121,0,18,121,0,59,121,0,42,0,18,120,0,59,122,0,18,121,0,59,122,0,42,0,18,120,0,59,119,0,18,121,0,
-59,119,0,42,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,6,120,0,0,1,0,
-0,6,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,121,0,59,120,0,42,0,18,120,0,59,121,0,
-18,121,0,59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,7,120,
-0,0,1,0,0,7,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,18,121,0,59,120,0,42,0,18,120,0,
-59,121,0,18,121,0,59,121,0,42,0,18,120,0,59,122,0,18,121,0,59,122,0,42,0,0,0,0,1,0,4,0,108,101,115,
-115,84,104,97,110,69,113,117,97,108,0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,58,98,118,101,99,52,0,
-18,120,0,59,120,0,18,121,0,59,120,0,42,0,18,120,0,59,121,0,18,121,0,59,121,0,42,0,18,120,0,59,122,
-0,18,121,0,59,122,0,42,0,18,120,0,59,119,0,18,121,0,59,119,0,42,0,0,0,0,1,0,2,0,103,114,101,97,116,
-101,114,84,104,97,110,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,
-120,0,18,121,0,59,120,0,41,0,18,120,0,59,121,0,18,121,0,59,121,0,41,0,0,0,0,1,0,3,0,103,114,101,97,
-116,101,114,84,104,97,110,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,
-59,120,0,18,121,0,59,120,0,41,0,18,120,0,59,121,0,18,121,0,59,121,0,41,0,18,120,0,59,122,0,18,121,
-0,59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,12,120,0,0,1,0,0,12,
-121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,41,0,18,120,0,59,121,0,18,
-121,0,59,121,0,41,0,18,120,0,59,122,0,18,121,0,59,122,0,41,0,18,120,0,59,119,0,18,121,0,59,119,0,
-41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,6,120,0,0,1,0,0,6,121,0,0,0,1,
-8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,121,0,59,120,0,41,0,18,120,0,59,121,0,18,121,0,59,121,
-0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,7,120,0,0,1,0,0,7,121,0,0,0,
-1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,18,121,0,59,120,0,41,0,18,120,0,59,121,0,18,121,0,59,
-121,0,41,0,18,120,0,59,122,0,18,121,0,59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,
-104,97,110,0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,
-0,59,120,0,41,0,18,120,0,59,121,0,18,121,0,59,121,0,41,0,18,120,0,59,122,0,18,121,0,59,122,0,41,0,
-18,120,0,59,119,0,18,121,0,59,119,0,41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
-113,117,97,108,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,
-18,121,0,59,120,0,43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,
-101,114,84,104,97,110,69,113,117,97,108,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,98,118,101,99,
-51,0,18,120,0,59,120,0,18,121,0,59,120,0,43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,18,120,0,59,
-122,0,18,121,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,
-108,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,
-120,0,43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,18,120,0,59,122,0,18,121,0,59,122,0,43,0,18,
-120,0,59,119,0,18,121,0,59,119,0,43,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
-113,117,97,108,0,1,0,0,6,120,0,0,1,0,0,6,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,
-121,0,59,120,0,43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,101,
-114,84,104,97,110,69,113,117,97,108,0,1,0,0,7,120,0,0,1,0,0,7,121,0,0,0,1,8,58,98,118,101,99,51,0,
-18,120,0,59,120,0,18,121,0,59,120,0,43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,18,120,0,59,122,
-0,18,121,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,
-0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,
-43,0,18,120,0,59,121,0,18,121,0,59,121,0,43,0,18,120,0,59,122,0,18,121,0,59,122,0,43,0,18,120,0,59,
-119,0,18,121,0,59,119,0,43,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,
-0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,121,0,59,
-121,0,38,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,98,118,
-101,99,51,0,18,120,0,59,120,0,18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,121,0,59,121,0,38,0,18,
-120,0,59,122,0,18,121,0,59,122,0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,12,120,0,0,1,0,0,12,
-121,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,
-121,0,59,121,0,38,0,18,120,0,59,122,0,18,121,0,59,122,0,38,0,18,120,0,59,119,0,18,121,0,59,119,0,
-38,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,6,120,0,0,1,0,0,6,121,0,0,0,1,8,58,98,118,101,99,50,
-0,18,120,0,59,120,0,18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,121,0,59,121,0,38,0,0,0,0,1,0,3,0,
-101,113,117,97,108,0,1,0,0,7,120,0,0,1,0,0,7,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,
-18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,121,0,59,121,0,38,0,18,120,0,59,122,0,18,121,0,59,122,
-0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,58,98,118,101,99,
-52,0,18,120,0,59,120,0,18,121,0,59,120,0,38,0,18,120,0,59,121,0,18,121,0,59,121,0,38,0,18,120,0,59,
-122,0,18,121,0,59,122,0,38,0,18,120,0,59,119,0,18,121,0,59,119,0,38,0,0,0,0,1,0,2,0,110,111,116,69,
-113,117,97,108,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,0,59,120,0,
-18,121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,116,69,113,
-117,97,108,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,18,
-121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,39,0,18,120,0,59,122,0,18,121,0,59,122,0,
-39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,0,1,8,58,98,
-118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,39,0,
-18,120,0,59,122,0,18,121,0,59,122,0,39,0,18,120,0,59,119,0,18,121,0,59,119,0,39,0,0,0,0,1,0,2,0,
-110,111,116,69,113,117,97,108,0,1,0,0,6,120,0,0,1,0,0,6,121,0,0,0,1,8,58,98,118,101,99,50,0,18,120,
-0,59,120,0,18,121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,
-116,69,113,117,97,108,0,1,0,0,7,120,0,0,1,0,0,7,121,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,
-120,0,18,121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,39,0,18,120,0,59,122,0,18,121,0,
-59,122,0,39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,8,120,0,0,1,0,0,8,121,0,0,0,1,8,
-58,98,118,101,99,52,0,18,120,0,59,120,0,18,121,0,59,120,0,39,0,18,120,0,59,121,0,18,121,0,59,121,0,
-39,0,18,120,0,59,122,0,18,121,0,59,122,0,39,0,18,120,0,59,119,0,18,121,0,59,119,0,39,0,0,0,0,1,0,1,
-0,97,110,121,0,1,0,0,2,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,32,0,0,1,0,1,0,97,110,121,
-0,1,0,0,3,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,32,18,120,0,59,122,0,32,0,0,1,0,1,0,97,
-110,121,0,1,0,0,4,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,32,18,120,0,59,122,0,32,18,120,
-0,59,119,0,32,0,0,1,0,1,0,97,108,108,0,1,0,0,2,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,
-34,0,0,1,0,1,0,97,108,108,0,1,0,0,3,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,34,18,120,0,
-59,122,0,34,0,0,1,0,1,0,97,108,108,0,1,0,0,4,120,0,0,0,1,8,18,120,0,59,120,0,18,120,0,59,121,0,34,
-18,120,0,59,122,0,34,18,120,0,59,119,0,34,0,0,1,0,2,0,110,111,116,0,1,0,0,2,120,0,0,0,1,8,58,98,
-118,101,99,50,0,18,120,0,59,120,0,56,0,18,120,0,59,121,0,56,0,0,0,0,1,0,3,0,110,111,116,0,1,0,0,3,
-120,0,0,0,1,8,58,98,118,101,99,51,0,18,120,0,59,120,0,56,0,18,120,0,59,121,0,56,0,18,120,0,59,122,
-0,56,0,0,0,0,1,0,4,0,110,111,116,0,1,0,0,4,120,0,0,0,1,8,58,98,118,101,99,52,0,18,120,0,59,120,0,
-56,0,18,120,0,59,121,0,56,0,18,120,0,59,122,0,56,0,18,120,0,59,119,0,56,0,0,0,0,1,0,12,0,116,101,
-120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,
-0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,
-111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,8,58,116,101,
-120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,
-99,111,111,114,100,0,59,116,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,
-0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,
-117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,
-111,114,100,0,59,113,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,
-112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,
-0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,
-0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,
-108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,
-0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,
-116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,
-12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,
-114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,
-18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,
-120,116,117,114,101,51,68,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,
-0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,
-114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,
-101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,
-114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,
-111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
-49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,112,108,
-101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,
-0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,
-100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,
-0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,
-48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,
-108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,
-109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,
-0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
-49,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,
-101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,
-112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
-113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,
-114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,101,49,
-0,1,0,0,9,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,8,
-17,48,0,48,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,11,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,
-9,0,110,111,105,115,101,49,0,1,0,0,12,120,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,110,111,105,115,
-101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,10,0,110,111,105,115,
-101,50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,10,0,110,111,105,115,
-101,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,10,0,110,111,105,115,
-101,50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,110,111,105,115,
-101,51,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,110,111,105,115,
-101,51,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,110,111,105,115,
-101,51,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,110,111,105,115,
-101,51,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,110,111,105,115,
-101,52,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,110,111,105,115,
-101,52,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,110,111,105,115,
-101,52,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,110,111,105,115,
-101,52,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,0
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_common_builtin.gc */
+
+3,2,2,1,5,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,
+97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
+101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0,0,0,2,2,1,5,1,103,108,95,77,97,120,
+86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,10,49,54,0,0,0,2,2,1,5,1,103,108,95,77,97,
+120,86,101,114,116,101,120,85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,
+16,10,53,49,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,
+115,0,2,16,10,51,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,
+114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,1,5,1,103,108,95,77,97,120,67,
+111,109,98,105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,
+10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,
+116,115,0,2,16,10,50,0,0,0,2,2,1,5,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105,
+102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,1,5,1,103,108,95,
+77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,4,15,1,103,108,95,77,111,
+100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,
+116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,
+119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,4,15,1,103,108,95,84,101,
+120,116,117,114,101,77,97,116,114,105,120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,
+67,111,111,114,100,115,0,0,0,2,2,4,14,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,
+0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,
+115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
+110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,
+106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,4,15,1,103,
+108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108,
+95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,
+100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,
+1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,
+115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,
+105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,
+101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,
+77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
+101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,
+115,101,0,0,0,2,2,4,15,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,
+110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,77,111,100,
+101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,
+114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,4,15,1,103,108,95,84,101,120,116,117,114,
+101,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,
+108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,9,1,103,108,95,78,
+111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,0,22,103,108,95,68,101,112,116,104,82,97,110,103,101,
+80,97,114,97,109,101,116,101,114,115,0,9,110,101,97,114,0,0,0,1,9,102,97,114,0,0,0,1,9,100,105,102,
+102,0,0,0,0,0,0,2,2,4,23,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114,97,109,101,116,
+101,114,115,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,4,12,1,103,108,95,67,108,
+105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,0,0,2,
+2,0,22,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,9,115,105,122,101,0,0,
+0,1,9,115,105,122,101,77,105,110,0,0,0,1,9,115,105,122,101,77,97,120,0,0,0,1,9,102,97,100,101,84,
+104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1,9,100,105,115,116,97,110,99,101,67,111,110,
+115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,110,99,
+101,76,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,100,105,115,116,97,
+110,99,101,81,117,97,100,114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,2,
+2,4,23,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,80,111,
+105,110,116,0,0,0,2,2,0,22,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,
+114,115,0,12,101,109,105,115,115,105,111,110,0,0,0,1,12,97,109,98,105,101,110,116,0,0,0,1,12,100,
+105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,9,115,104,105,110,105,110,
+101,115,115,0,0,0,0,0,0,2,2,4,23,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,
+101,114,115,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,4,23,103,108,
+95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,66,97,99,107,
+77,97,116,101,114,105,97,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
+97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,100,105,102,102,117,
+115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,1,12,112,111,115,105,116,105,111,110,0,0,0,
+1,12,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,115,112,111,116,68,105,114,101,99,116,105,111,
+110,0,0,0,1,9,115,112,111,116,69,120,112,111,110,101,110,116,0,0,0,1,9,115,112,111,116,67,117,116,
+111,102,102,0,0,0,1,9,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,99,111,110,115,
+116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,108,105,110,101,97,114,65,116,
+116,101,110,117,97,116,105,111,110,0,0,0,1,9,113,117,97,100,114,97,116,105,99,65,116,116,101,110,
+117,97,116,105,111,110,0,0,0,0,0,0,2,2,4,23,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,
+97,114,97,109,101,116,101,114,115,0,1,103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,
+103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
+100,101,108,80,97,114,97,109,101,116,101,114,115,0,12,97,109,98,105,101,110,116,0,0,0,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,1,103,
+108,95,76,105,103,104,116,77,111,100,101,108,0,0,0,2,2,0,22,103,108,95,76,105,103,104,116,77,111,
+100,101,108,80,114,111,100,117,99,116,115,0,12,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,2,
+2,4,23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,
+95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,1,103,108,95,
+66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,0,22,103,
+108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,97,109,98,105,101,110,116,0,0,0,1,12,
+100,105,102,102,117,115,101,0,0,0,1,12,115,112,101,99,117,108,97,114,0,0,0,0,0,0,2,2,4,23,103,108,
+95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,70,114,111,110,116,76,105,103,
+104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,4,
+23,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,1,103,108,95,66,97,99,107,76,105,
+103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,
+4,12,1,103,108,95,84,101,120,116,117,114,101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,
+120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,0,0,2,2,4,12,1,103,108,95,69,
+121,101,80,108,97,110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,
+100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,69,121,101,80,108,97,
+110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,
+4,12,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,
+114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,
+83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,
+103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,
+117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,
+101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,4,
+12,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,
+116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,0,22,103,108,95,70,111,103,80,97,114,97,109,101,
+116,101,114,115,0,12,99,111,108,111,114,0,0,0,1,9,100,101,110,115,105,116,121,0,0,0,1,9,115,116,97,
+114,116,0,0,0,1,9,101,110,100,0,0,0,1,9,115,99,97,108,101,0,0,0,0,0,0,2,2,4,23,103,108,95,70,111,
+103,80,97,114,97,109,101,116,101,114,115,0,1,103,108,95,70,111,103,0,0,0,1,0,9,0,114,97,100,105,97,
+110,115,0,1,0,0,9,100,101,103,0,0,0,1,8,17,51,0,49,52,49,53,57,51,0,0,18,100,101,103,0,48,17,49,56,
+48,0,48,0,0,49,0,0,1,0,10,0,114,97,100,105,97,110,115,0,1,0,0,10,100,101,103,0,0,0,1,8,58,118,101,
+99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,50,0,17,49,56,48,0,48,
+0,0,0,0,49,0,0,1,0,11,0,114,97,100,105,97,110,115,0,1,0,0,11,100,101,103,0,0,0,1,8,58,118,101,99,
+51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,51,0,17,49,56,48,0,48,0,0,
+0,0,49,0,0,1,0,12,0,114,97,100,105,97,110,115,0,1,0,0,12,100,101,103,0,0,0,1,8,58,118,101,99,52,0,
+17,51,0,49,52,49,53,57,51,0,0,0,0,18,100,101,103,0,48,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,
+49,0,0,1,0,9,0,100,101,103,114,101,101,115,0,1,0,0,9,114,97,100,0,0,0,1,8,17,49,56,48,0,48,0,0,18,
+114,97,100,0,48,17,51,0,49,52,49,53,57,51,0,0,49,0,0,1,0,10,0,100,101,103,114,101,101,115,0,1,0,0,
+10,114,97,100,0,0,0,1,8,58,118,101,99,50,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,
+99,50,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,11,0,100,101,103,114,101,101,115,0,1,0,0,11,
+114,97,100,0,0,0,1,8,58,118,101,99,51,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,
+51,0,17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,12,0,100,101,103,114,101,101,115,0,1,0,0,12,114,
+97,100,0,0,0,1,8,58,118,101,99,52,0,17,49,56,48,0,48,0,0,0,0,18,114,97,100,0,48,58,118,101,99,52,0,
+17,51,0,49,52,49,53,57,51,0,0,0,0,49,0,0,1,0,9,0,115,105,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,
+3,2,0,9,1,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,120,0,0,18,97,110,103,108,101,0,0,
+0,8,18,120,0,0,0,1,0,10,0,115,105,110,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,101,99,50,0,
+58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,
+59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,110,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,101,99,51,
+0,58,115,105,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,
+59,121,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,110,
+0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,115,105,110,0,18,97,110,103,108,101,
+0,59,120,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,115,105,110,0,18,97,
+110,103,108,101,0,59,122,0,0,0,0,58,115,105,110,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,0,
+9,0,99,111,115,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,17,
+49,0,53,55,48,56,0,0,46,0,0,0,0,1,0,10,0,99,111,115,0,1,0,0,10,97,110,103,108,101,0,0,0,1,8,58,118,
+101,99,50,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,111,115,0,1,0,0,11,97,110,103,108,101,0,0,0,1,8,58,118,
+101,99,51,0,58,99,111,115,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,
+111,115,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,99,111,115,0,18,97,110,103,
+108,101,0,59,120,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,99,111,115,0,18,
+97,110,103,108,101,0,59,122,0,0,0,0,58,99,111,115,0,18,97,110,103,108,101,0,59,119,0,0,0,0,0,0,0,1,
+0,9,0,116,97,110,0,1,0,0,9,97,110,103,108,101,0,0,0,1,8,58,115,105,110,0,18,97,110,103,108,101,0,0,
+0,58,99,111,115,0,18,97,110,103,108,101,0,0,0,49,0,0,1,0,10,0,116,97,110,0,1,0,0,10,97,110,103,108,
+101,0,0,0,1,8,58,118,101,99,50,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,0,0,0,1,0,11,0,116,97,110,0,1,0,0,11,97,110,103,108,
+101,0,0,0,1,8,58,118,101,99,51,0,58,116,97,110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,121,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,
+0,0,0,0,1,0,12,0,116,97,110,0,1,0,0,12,97,110,103,108,101,0,0,0,1,8,58,118,101,99,52,0,58,116,97,
+110,0,18,97,110,103,108,101,0,59,120,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,59,121,0,0,0,
+0,58,116,97,110,0,18,97,110,103,108,101,0,59,122,0,0,0,0,58,116,97,110,0,18,97,110,103,108,101,0,
+59,119,0,0,0,0,0,0,0,1,0,9,0,97,115,105,110,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,
+111,97,116,95,97,114,99,115,105,110,101,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,97,115,
+105,110,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,
+97,115,105,110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,115,105,110,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,59,121,0,
+0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,115,105,110,0,1,0,0,12,118,0,0,
+0,1,8,58,118,101,99,52,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,
+59,121,0,0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,58,97,115,105,110,0,18,118,0,59,119,0,0,
+0,0,0,0,0,1,0,9,0,97,99,111,115,0,1,0,0,9,120,0,0,0,1,8,17,49,0,53,55,48,56,0,0,58,97,115,105,110,
+0,18,120,0,0,0,47,0,0,1,0,10,0,97,99,111,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,99,
+111,115,0,18,118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,99,
+111,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,0,58,
+97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,
+97,99,111,115,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,
+0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,0,58,97,99,
+111,115,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9,121,95,111,118,101,114,95,
+120,0,0,0,1,3,2,0,9,1,122,0,0,0,4,102,108,111,97,116,95,97,114,99,116,97,110,0,18,122,0,0,18,121,
+95,111,118,101,114,95,120,0,0,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,121,95,111,118,
+101,114,95,120,0,0,0,1,8,58,118,101,99,50,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,
+59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,0,0,0,1,0,11,0,
+97,116,97,110,0,1,0,0,11,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,
+110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,
+114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,0,0,
+0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,52,0,
+58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,
+111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,
+122,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,
+116,97,110,0,1,0,0,9,121,0,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,122,0,2,58,97,116,97,110,0,18,121,0,18,
+120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0,40,0,8,18,122,0,17,
+51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,46,0,0,9,14,0,8,18,
+122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,117,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,
+97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,0,0,
+18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,117,0,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,
+18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,
+0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,117,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,
+58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18,117,0,59,121,
+0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,0,58,97,
+116,97,110,0,18,117,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,112,111,119,0,1,0,0,9,120,0,
+0,1,0,0,9,121,0,0,0,1,3,2,0,9,1,112,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,112,0,0,
+18,120,0,0,18,121,0,0,0,8,18,112,0,0,0,1,0,10,0,112,111,119,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,
+1,8,58,118,101,99,50,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,
+0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,112,111,119,0,1,0,0,11,118,0,0,1,0,0,
+11,117,0,0,0,1,8,58,118,101,99,51,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,
+58,112,111,119,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,
+18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,112,111,119,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,
+118,101,99,52,0,58,112,111,119,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,112,111,119,0,18,
+118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,112,111,119,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,
+0,0,58,112,111,119,0,18,118,0,59,119,0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,9,0,101,120,112,0,1,0,0,
+9,120,0,0,0,1,8,58,112,111,119,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,18,120,0,0,0,0,0,1,0,10,0,
+101,120,112,0,1,0,0,10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,
+56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,101,120,112,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,
+118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,18,118,0,0,0,0,0,1,0,12,0,101,120,112,0,
+1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,
+0,18,118,0,0,0,0,0,1,0,9,0,108,111,103,50,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,
+97,116,95,108,111,103,50,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,108,111,103,50,0,1,0,0,
+10,118,0,0,0,1,8,58,118,101,99,50,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,
+0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,108,111,103,50,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,
+0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,0,58,108,
+111,103,50,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,108,111,103,50,0,1,0,0,12,118,0,0,0,1,8,58,118,
+101,99,52,0,58,108,111,103,50,0,18,118,0,59,120,0,0,0,0,58,108,111,103,50,0,18,118,0,59,121,0,0,0,
+0,58,108,111,103,50,0,18,118,0,59,122,0,0,0,0,58,108,111,103,50,0,18,118,0,59,119,0,0,0,0,0,0,0,1,
+0,9,0,108,111,103,0,1,0,0,9,120,0,0,0,1,8,58,108,111,103,50,0,18,120,0,0,0,58,108,111,103,50,0,17,
+50,0,55,49,56,50,56,49,56,51,0,0,0,0,49,0,0,1,0,10,0,108,111,103,0,1,0,0,10,118,0,0,0,1,8,58,108,
+111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,101,99,50,0,17,50,0,55,49,56,50,56,49,56,51,0,
+0,0,0,0,0,49,0,0,1,0,11,0,108,111,103,0,1,0,0,11,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,
+108,111,103,50,0,58,118,101,99,51,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,12,0,
+108,111,103,0,1,0,0,12,118,0,0,0,1,8,58,108,111,103,50,0,18,118,0,0,0,58,108,111,103,50,0,58,118,
+101,99,52,0,17,50,0,55,49,56,50,56,49,56,51,0,0,0,0,0,0,49,0,0,1,0,9,0,101,120,112,50,0,1,0,0,9,
+120,0,0,0,1,8,58,112,111,119,0,17,50,0,48,0,0,0,18,120,0,0,0,0,0,1,0,10,0,101,120,112,50,0,1,0,0,
+10,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,50,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,11,
+0,101,120,112,50,0,1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,51,0,17,50,0,48,0,0,0,0,0,
+18,118,0,0,0,0,0,1,0,12,0,101,120,112,50,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,58,118,101,99,
+52,0,17,50,0,48,0,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,113,114,116,0,1,0,0,9,120,0,0,0,1,8,58,112,
+111,119,0,18,120,0,0,17,48,0,53,0,0,0,0,0,0,1,0,10,0,115,113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,
+112,111,119,0,18,118,0,0,58,118,101,99,50,0,17,48,0,53,0,0,0,0,0,0,0,0,1,0,11,0,115,113,114,116,0,
+1,0,0,11,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,51,0,17,48,0,53,0,0,0,0,0,0,0,0,1,
+0,12,0,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,112,111,119,0,18,118,0,0,58,118,101,99,52,0,17,
+48,0,53,0,0,0,0,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,9,120,0,0,0,1,
+8,17,49,0,48,0,0,58,115,113,114,116,0,18,120,0,0,0,49,0,0,1,0,10,0,105,110,118,101,114,115,101,115,
+113,114,116,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,
+118,0,0,0,49,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,0,0,11,118,0,0,0,1,8,58,
+118,101,99,51,0,17,49,0,48,0,0,0,0,58,115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,12,0,105,110,118,
+101,114,115,101,115,113,114,116,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,17,49,0,48,0,0,0,0,58,
+115,113,114,116,0,18,118,0,0,0,49,0,0,1,0,9,0,97,98,115,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,
+48,0,0,43,18,120,0,18,120,0,54,31,0,0,1,0,10,0,97,98,115,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,
+0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,
+98,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,
+115,0,18,118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,98,115,0,1,
+0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,98,115,0,18,118,0,59,120,0,0,0,0,58,97,98,115,0,18,
+118,0,59,121,0,0,0,0,58,97,98,115,0,18,118,0,59,122,0,0,0,0,58,97,98,115,0,18,118,0,59,119,0,0,0,0,
+0,0,0,1,0,9,0,115,105,103,110,0,1,0,0,9,120,0,0,0,1,8,18,120,0,17,48,0,48,0,0,41,17,49,0,48,0,0,18,
+120,0,17,48,0,48,0,0,40,17,49,0,48,0,0,54,17,48,0,48,0,0,31,31,0,0,1,0,10,0,115,105,103,110,0,1,0,
+0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,
+110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,105,103,110,0,1,0,0,11,118,0,0,0,1,8,58,118,101,
+99,51,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,121,0,0,0,0,
+58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,105,103,110,0,1,0,0,12,118,0,0,0,1,
+8,58,118,101,99,52,0,58,115,105,103,110,0,18,118,0,59,120,0,0,0,0,58,115,105,103,110,0,18,118,0,59,
+121,0,0,0,0,58,115,105,103,110,0,18,118,0,59,122,0,0,0,0,58,115,105,103,110,0,18,118,0,59,119,0,0,
+0,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,
+116,95,102,108,111,111,114,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0,0,1,0,10,0,102,108,111,111,114,0,
+1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,
+108,111,111,114,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,0,0,11,118,0,0,0,
+1,8,58,118,101,99,51,0,58,102,108,111,111,114,0,18,118,0,59,120,0,0,0,0,58,102,108,111,111,114,0,
+18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,102,108,
+111,111,114,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,102,108,111,111,114,0,18,118,0,59,120,0,
+0,0,0,58,102,108,111,111,114,0,18,118,0,59,121,0,0,0,0,58,102,108,111,111,114,0,18,118,0,59,122,0,
+0,0,0,58,102,108,111,111,114,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,99,101,105,108,0,1,0,0,9,120,
+0,0,0,1,3,2,0,9,1,121,0,0,0,4,102,108,111,97,116,95,99,101,105,108,0,18,121,0,0,18,120,0,0,0,8,18,
+121,0,0,0,1,0,10,0,99,101,105,108,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,99,101,105,108,0,
+18,118,0,59,120,0,0,0,0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,99,101,105,108,
+0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,0,58,99,101,
+105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,99,
+101,105,108,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,99,101,105,108,0,18,118,0,59,120,0,0,0,
+0,58,99,101,105,108,0,18,118,0,59,121,0,0,0,0,58,99,101,105,108,0,18,118,0,59,122,0,0,0,0,58,99,
+101,105,108,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,102,114,97,99,116,0,1,0,0,9,120,0,0,0,1,8,18,
+120,0,58,102,108,111,111,114,0,18,120,0,0,0,47,0,0,1,0,10,0,102,114,97,99,116,0,1,0,0,10,118,0,0,0,
+1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,11,0,102,114,97,99,116,0,1,0,0,11,
+118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,12,0,102,114,97,99,116,0,1,
+0,0,12,118,0,0,0,1,8,18,118,0,58,102,108,111,111,114,0,18,118,0,0,0,47,0,0,1,0,9,0,109,111,100,0,1,
+0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,58,102,108,111,111,114,0,18,120,0,18,121,0,
+49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,
+58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,109,111,100,0,1,0,0,11,118,0,
+0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,
+0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,9,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,
+111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,10,0,109,111,100,0,1,0,0,10,118,0,0,1,0,0,10,117,
+0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,11,0,
+109,111,100,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,18,117,0,58,102,108,111,111,114,0,
+18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,12,0,109,111,100,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,
+18,118,0,18,117,0,58,102,108,111,111,114,0,18,118,0,18,117,0,49,0,0,48,47,0,0,1,0,9,0,109,105,110,
+0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,120,0,18,121,0,31,0,0,1,0,10,0,109,
+105,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,58,109,105,110,0,18,118,0,59,
+120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,0,0,0,
+1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,58,109,105,110,0,
+18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,
+0,0,0,58,109,105,110,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,1,
+0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,105,110,0,18,118,0,59,120,0,0,18,
+117,0,59,120,0,0,0,0,58,109,105,110,0,18,118,0,59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,105,110,0,
+18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,105,110,0,18,118,0,59,119,0,0,18,117,0,59,119,0,
+0,0,0,0,0,0,1,0,10,0,109,105,110,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,
+0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,105,110,0,1,0,0,11,118,0,0,1,0,0,9,121,0,
+0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,12,0,109,105,110,0,
+1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,105,110,0,18,118,0,0,58,118,101,99,52,0,18,121,0,0,0,
+0,0,0,0,1,0,9,0,109,97,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,40,18,121,0,
+18,120,0,31,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,118,101,99,50,0,
+58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,
+117,0,59,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,
+101,99,51,0,58,109,97,120,0,18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,
+59,121,0,0,18,117,0,59,121,0,0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,0,0,
+0,1,0,12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,118,101,99,52,0,58,109,97,120,0,
+18,118,0,59,120,0,0,18,117,0,59,120,0,0,0,0,58,109,97,120,0,18,118,0,59,121,0,0,18,117,0,59,121,0,
+0,0,0,58,109,97,120,0,18,118,0,59,122,0,0,18,117,0,59,122,0,0,0,0,58,109,97,120,0,18,118,0,59,119,
+0,0,18,117,0,59,119,0,0,0,0,0,0,0,1,0,10,0,109,97,120,0,1,0,0,10,118,0,0,1,0,0,9,121,0,0,0,1,8,58,
+109,97,120,0,18,118,0,0,58,118,101,99,50,0,18,121,0,0,0,0,0,0,0,1,0,11,0,109,97,120,0,1,0,0,11,118,
+0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,51,0,18,121,0,0,0,0,0,0,0,1,0,
+12,0,109,97,120,0,1,0,0,12,118,0,0,1,0,0,9,121,0,0,0,1,8,58,109,97,120,0,18,118,0,0,58,118,101,99,
+52,0,18,121,0,0,0,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,0,0,9,120,0,0,1,0,0,9,109,105,110,86,97,
+108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,
+105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,0,0,10,
+120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,
+58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,
+11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,9,109,105,110,86,97,108,0,0,1,0,0,9,109,97,120,86,
+97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,
+109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,9,109,105,110,
+86,97,108,0,0,1,0,0,9,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,
+18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,
+0,0,10,120,0,0,1,0,0,10,109,105,110,86,97,108,0,0,1,0,0,10,109,97,120,86,97,108,0,0,0,1,8,58,109,
+105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,
+0,0,0,1,0,11,0,99,108,97,109,112,0,1,0,0,11,120,0,0,1,0,0,11,109,105,110,86,97,108,0,0,1,0,0,11,
+109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,120,0,18,120,0,0,18,109,105,110,86,97,
+108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,0,0,12,120,0,0,1,0,0,
+12,109,105,110,86,97,108,0,0,1,0,0,12,109,97,120,86,97,108,0,0,0,1,8,58,109,105,110,0,58,109,97,
+120,0,18,120,0,0,18,109,105,110,86,97,108,0,0,0,0,18,109,97,120,86,97,108,0,0,0,0,0,1,0,9,0,109,
+105,120,0,1,0,0,9,120,0,0,1,0,0,9,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,
+48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,10,120,0,0,1,0,0,10,121,0,0,1,0,0,9,97,
+0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,
+1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,9,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,
+121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,120,0,0,1,0,0,12,121,0,0,1,0,0,9,97,0,0,0,
+1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,10,0,109,105,120,0,1,0,0,
+10,120,0,0,1,0,0,10,121,0,0,1,0,0,10,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,
+18,97,0,48,46,0,0,1,0,11,0,109,105,120,0,1,0,0,11,120,0,0,1,0,0,11,121,0,0,1,0,0,11,97,0,0,0,1,8,
+18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,97,0,48,46,0,0,1,0,12,0,109,105,120,0,1,0,0,12,
+120,0,0,1,0,0,12,121,0,0,1,0,0,12,97,0,0,0,1,8,18,120,0,17,49,0,48,0,0,18,97,0,47,48,18,121,0,18,
+97,0,48,46,0,0,1,0,9,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,9,120,0,0,0,1,8,18,120,
+0,18,101,100,103,101,0,40,17,48,0,48,0,0,17,49,0,48,0,0,31,0,0,1,0,10,0,115,116,101,112,0,1,0,0,10,
+101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,115,116,101,112,0,18,101,100,103,
+101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,
+118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,11,101,100,103,101,0,0,1,0,0,11,118,0,
+0,0,1,8,58,118,101,99,51,0,58,115,116,101,112,0,18,101,100,103,101,0,59,120,0,0,18,118,0,59,120,0,
+0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,116,101,
+112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,
+0,12,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,116,101,112,0,18,101,100,
+103,101,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,121,0,0,
+18,118,0,59,121,0,0,0,0,58,115,116,101,112,0,18,101,100,103,101,0,59,122,0,0,18,118,0,59,122,0,0,0,
+0,58,115,116,101,112,0,18,101,100,103,101,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,
+116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,10,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,
+99,50,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,11,0,115,116,101,112,0,1,0,0,9,101,100,103,
+101,0,0,1,0,0,11,118,0,0,0,1,8,58,115,116,101,112,0,58,118,101,99,51,0,18,101,100,103,101,0,0,0,0,
+18,118,0,0,0,0,0,1,0,12,0,115,116,101,112,0,1,0,0,9,101,100,103,101,0,0,1,0,0,12,118,0,0,0,1,8,58,
+115,116,101,112,0,58,118,101,99,52,0,18,101,100,103,101,0,0,0,0,18,118,0,0,0,0,0,1,0,9,0,115,109,
+111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,
+0,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,
+101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,
+116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,
+104,115,116,101,112,0,1,0,0,10,101,100,103,101,48,0,0,1,0,0,10,101,100,103,101,49,0,0,1,0,0,10,118,
+0,0,0,1,8,58,118,101,99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,
+59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,
+115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,
+59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,11,101,100,103,101,
+48,0,0,1,0,0,11,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,115,109,111,
+111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,
+0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,
+121,0,0,18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,
+116,101,112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,
+122,0,0,0,0,0,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,12,101,100,103,101,48,0,
+0,1,0,0,12,101,100,103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,
+104,115,116,101,112,0,18,101,100,103,101,48,0,59,120,0,0,18,101,100,103,101,49,0,59,120,0,0,18,118,
+0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,121,0,0,
+18,101,100,103,101,49,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,116,101,
+112,0,18,101,100,103,101,48,0,59,122,0,0,18,101,100,103,101,49,0,59,122,0,0,18,118,0,59,122,0,0,0,
+0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,59,119,0,0,18,101,100,103,
+101,49,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,
+0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,10,118,0,0,0,1,8,58,118,101,
+99,50,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,
+49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,
+0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,115,109,111,111,116,104,115,
+116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,103,101,49,0,0,1,0,0,11,118,0,0,0,1,8,
+58,118,101,99,51,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,
+100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,
+103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,0,0,0,0,58,115,109,111,111,116,104,115,
+116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,122,0,0,0,0,0,0,0,1,
+0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,0,0,9,101,100,103,101,48,0,0,1,0,0,9,101,100,
+103,101,49,0,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,115,109,111,111,116,104,115,116,101,
+112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,120,0,0,0,0,58,115,109,111,
+111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,49,0,0,18,118,0,59,121,
+0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,0,0,18,101,100,103,101,
+49,0,0,18,118,0,59,122,0,0,0,0,58,115,109,111,111,116,104,115,116,101,112,0,18,101,100,103,101,48,
+0,0,18,101,100,103,101,49,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,100,111,116,0,1,0,0,9,120,0,0,
+1,0,0,9,121,0,0,0,1,8,18,120,0,18,121,0,48,0,0,1,0,9,0,100,111,116,0,1,0,0,10,118,0,0,1,0,0,10,117,
+0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,118,0,59,121,0,18,117,0,59,121,0,48,46,0,0,1,0,
+9,0,100,111,116,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,
+18,118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,0,0,1,0,9,0,
+100,111,116,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,18,118,0,59,120,0,18,117,0,59,120,0,48,18,
+118,0,59,121,0,18,117,0,59,121,0,48,46,18,118,0,59,122,0,18,117,0,59,122,0,48,46,18,118,0,59,119,0,
+18,117,0,59,119,0,48,46,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,9,120,0,0,0,1,8,58,115,113,114,
+116,0,58,100,111,116,0,18,120,0,0,18,120,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,10,
+118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,108,
+101,110,103,116,104,0,1,0,0,11,118,0,0,0,1,8,58,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,
+118,0,0,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,0,0,12,118,0,0,0,1,8,58,115,113,114,116,0,58,
+100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,9,120,
+0,0,1,0,0,9,121,0,0,0,1,8,58,108,101,110,103,116,104,0,18,120,0,18,121,0,47,0,0,0,0,1,0,9,0,100,
+105,115,116,97,110,99,101,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,108,101,110,103,116,104,0,
+18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,0,0,11,118,0,0,1,0,0,11,117,
+0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,0,0,0,0,1,0,9,0,100,105,115,116,97,110,
+99,101,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,108,101,110,103,116,104,0,18,118,0,18,117,0,47,
+0,0,0,0,1,0,11,0,99,114,111,115,115,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,118,101,99,51,0,
+18,118,0,59,121,0,18,117,0,59,122,0,48,18,117,0,59,121,0,18,118,0,59,122,0,48,47,0,18,118,0,59,122,
+0,18,117,0,59,120,0,48,18,117,0,59,122,0,18,118,0,59,120,0,48,47,0,18,118,0,59,120,0,18,117,0,59,
+121,0,48,18,117,0,59,120,0,18,118,0,59,121,0,48,47,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,
+101,0,1,0,0,9,120,0,0,0,1,8,17,49,0,48,0,0,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,0,0,
+10,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,11,0,110,111,114,
+109,97,108,105,122,101,0,1,0,0,11,118,0,0,0,1,8,18,118,0,58,108,101,110,103,116,104,0,18,118,0,0,0,
+49,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,0,0,12,118,0,0,0,1,8,18,118,0,58,108,101,
+110,103,116,104,0,18,118,0,0,0,49,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,0,0,9,
+78,0,0,1,0,0,9,73,0,0,1,0,0,9,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,
+73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,
+100,0,1,0,0,10,78,0,0,1,0,0,10,73,0,0,1,0,0,10,78,114,101,102,0,0,0,1,8,58,100,111,116,0,18,78,114,
+101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,11,0,102,97,99,101,102,111,
+114,119,97,114,100,0,1,0,0,11,78,0,0,1,0,0,11,73,0,0,1,0,0,11,78,114,101,102,0,0,0,1,8,58,100,111,
+116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,0,1,0,12,0,102,
+97,99,101,102,111,114,119,97,114,100,0,1,0,0,12,78,0,0,1,0,0,12,73,0,0,1,0,0,12,78,114,101,102,0,0,
+0,1,8,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,17,48,0,48,0,0,40,18,78,0,18,78,0,54,31,0,
+0,1,0,9,0,114,101,102,108,101,99,116,0,1,0,0,9,73,0,0,1,0,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,
+58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0,
+1,0,0,10,73,0,0,1,0,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,
+0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,0,1,8,
+18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,
+101,102,108,101,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,
+116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,0,0,9,73,0,
+0,1,0,0,9,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,
+101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,
+18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,
+97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,
+107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,0,0,10,73,0,0,1,0,0,10,78,0,
+0,1,0,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,
+17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,
+48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,
+18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,
+78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,0,0,11,73,0,0,1,0,0,11,78,0,0,1,0,0,9,101,
+116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,
+58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,
+18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,
+0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,
+1,0,12,0,114,101,102,114,97,99,116,0,1,0,0,12,73,0,0,1,0,0,12,78,0,0,1,0,0,9,101,116,97,0,0,0,1,3,
+2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,
+18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,
+48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,
+0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97,
+116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97,
+116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1,
+0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,
+16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,
+1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0,
+0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,
+18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,
+57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,10,118,0,0,1,0,
+0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,
+0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,
+117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,
+117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,
+97,110,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,
+59,120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,
+118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,0,0,6,118,0,
+0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,
+121,0,18,117,0,59,121,0,40,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,
+117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,40,0,18,118,0,59,121,0,18,
+117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,0,0,0,1,0,4,0,108,101,115,115,84,104,
+97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,
+120,0,40,0,18,118,0,59,121,0,18,117,0,59,121,0,40,0,18,118,0,59,122,0,18,117,0,59,122,0,40,0,18,
+118,0,59,119,0,18,117,0,59,119,0,40,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,
+108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,
+120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,
+113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,
+18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,
+0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,
+117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,
+42,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,
+0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,
+59,121,0,42,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,
+0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,
+18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,117,0,59,122,0,42,0,0,0,0,1,0,4,0,108,101,115,115,84,
+104,97,110,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,
+0,59,120,0,18,117,0,59,120,0,42,0,18,118,0,59,121,0,18,117,0,59,121,0,42,0,18,118,0,59,122,0,18,
+117,0,59,122,0,42,0,18,118,0,59,119,0,18,117,0,59,119,0,42,0,0,0,0,1,0,2,0,103,114,101,97,116,101,
+114,84,104,97,110,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,
+0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,
+101,114,84,104,97,110,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,
+120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,
+59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,
+117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,18,118,0,59,119,0,18,117,0,59,119,0,
+41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,
+8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,
+0,41,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,
+1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,
+121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,
+104,97,110,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,
+0,59,120,0,41,0,18,118,0,59,121,0,18,117,0,59,121,0,41,0,18,118,0,59,122,0,18,117,0,59,122,0,41,0,
+18,118,0,59,119,0,18,117,0,59,119,0,41,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
+113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,
+101,114,84,104,97,110,69,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,
+51,0,18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,
+122,0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,
+108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,
+120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,
+118,0,59,119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,
+113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,
+117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,0,0,0,1,0,3,0,103,114,101,97,116,101,
+114,84,104,97,110,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,
+18,118,0,59,120,0,18,117,0,59,120,0,43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,
+0,18,117,0,59,122,0,43,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,
+0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,
+43,0,18,118,0,59,121,0,18,117,0,59,121,0,43,0,18,118,0,59,122,0,18,117,0,59,122,0,43,0,18,118,0,59,
+119,0,18,117,0,59,119,0,43,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,
+0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,
+121,0,38,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,
+101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,
+118,0,59,122,0,18,117,0,59,122,0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,
+117,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,
+117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,
+38,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,
+0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,0,0,0,1,0,3,0,
+101,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,
+18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,122,0,18,117,0,59,122,
+0,38,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,58,98,118,101,99,
+52,0,18,118,0,59,120,0,18,117,0,59,120,0,38,0,18,118,0,59,121,0,18,117,0,59,121,0,38,0,18,118,0,59,
+122,0,18,117,0,59,122,0,38,0,18,118,0,59,119,0,18,117,0,59,119,0,38,0,0,0,0,1,0,2,0,110,111,116,69,
+113,117,97,108,0,1,0,0,10,118,0,0,1,0,0,10,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,116,69,113,
+117,97,108,0,1,0,0,11,118,0,0,1,0,0,11,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,18,
+117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,59,122,0,
+39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,12,118,0,0,1,0,0,12,117,0,0,0,1,8,58,98,
+118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,
+18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,2,0,
+110,111,116,69,113,117,97,108,0,1,0,0,6,118,0,0,1,0,0,6,117,0,0,0,1,8,58,98,118,101,99,50,0,18,118,
+0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,0,0,0,1,0,3,0,110,111,
+116,69,113,117,97,108,0,1,0,0,7,118,0,0,1,0,0,7,117,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,
+120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,39,0,18,118,0,59,122,0,18,117,0,
+59,122,0,39,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,0,0,8,118,0,0,1,0,0,8,117,0,0,0,1,8,
+58,98,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,39,0,18,118,0,59,121,0,18,117,0,59,121,0,
+39,0,18,118,0,59,122,0,18,117,0,59,122,0,39,0,18,118,0,59,119,0,18,117,0,59,119,0,39,0,0,0,0,1,0,1,
+0,97,110,121,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,0,0,1,0,1,0,97,110,121,
+0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,0,0,1,0,1,0,97,
+110,121,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,32,18,118,0,59,122,0,32,18,118,
+0,59,119,0,32,0,0,1,0,1,0,97,108,108,0,1,0,0,2,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,
+34,0,0,1,0,1,0,97,108,108,0,1,0,0,3,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,18,118,0,
+59,122,0,34,0,0,1,0,1,0,97,108,108,0,1,0,0,4,118,0,0,0,1,8,18,118,0,59,120,0,18,118,0,59,121,0,34,
+18,118,0,59,122,0,34,18,118,0,59,119,0,34,0,0,1,0,2,0,110,111,116,0,1,0,0,2,118,0,0,0,1,8,58,98,
+118,101,99,50,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,0,0,0,1,0,3,0,110,111,116,0,1,0,0,3,
+118,0,0,0,1,8,58,98,118,101,99,51,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,
+0,56,0,0,0,0,1,0,4,0,110,111,116,0,1,0,0,4,118,0,0,0,1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,
+56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,0,56,0,18,118,0,59,119,0,56,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,
+0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,
+101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,
+116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,
+97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,
+68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+116,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,
+18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,
+0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,
+1,0,0,10,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,
+101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
+100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,
+68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,
+58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,
+111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,
+18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,
+111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,
+120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,
+100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,
+111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,
+118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,
+18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,
+116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,
+101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,
+114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,
+111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,
+0,19,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,
+108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,
+112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,
+0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,
+114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,49,100,0,18,
+116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,
+0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,
+115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,
+68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,
+111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,
+114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,
+108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,
+99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,
+99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,
+111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,
+0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,
+18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,
+116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,
+0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,97,0,0,0,
+4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,
+111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,
+115,101,50,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,11,120,0,
+0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,97,0,0,18,120,0,0,0,8,
+18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,12,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,
+97,116,95,110,111,105,115,101,52,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,10,0,110,111,105,115,
+101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,
+110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,
+50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,
+111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,
+0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,
+105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,
+51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,
+50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,
+111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,
+0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,9,120,0,
+0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,
+18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,
+0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,
+105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,
+51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,
+17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,
+0,11,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,
+115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,
+0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,
+55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,
+12,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,
+101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,
+0,17,50,0,55,55,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,
+52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,0,0,0,
+1,0,12,0,110,111,105,115,101,52,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,
+49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,
+105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,
+0,53,52,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,
+52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,
+50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,
+118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,
+18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,
+0,110,111,105,115,101,52,0,1,0,0,11,120,0,0,0,1,8,58,118,101,99,52,0,58,110,111,105,115,101,49,0,
+18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,
+55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,
+51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,0,58,110,111,105,
+115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,
+57,49,0,0,0,0,46,0,0,0,0,0,0,1,0,12,0,110,111,105,115,101,52,0,1,0,0,12,120,0,0,0,1,8,58,118,101,
+99,52,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,
+99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,
+0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,
+0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,0,58,110,111,105,115,101,49,0,18,120,0,
+58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,
+52,56,0,0,0,0,46,0,0,0,0,0,0,0
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc
index d1d2cb10fd..c96fc0a318 100755
--- a/src/mesa/shader/slang/library/slang_core.gc
+++ b/src/mesa/shader/slang/library/slang_core.gc
@@ -1,17 +1,40 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
-//
+//
// This file defines nearly all constructors and operators for built-in data types, using
// extended language syntax. In general, compiler treats constructors and operators as
// ordinary functions with some exceptions. For example, the language does not allow
// functions to be called in constant expressions - here the exception is made to allow it.
-//
+//
// Each implementation provides its own version of this file. Each implementation can define
// the required set of operators and constructors in its own fashion.
-//
+//
// The extended language syntax is only present when compiling this file. It is implicitly
// included at the very beginning of the compiled shader, so no built-in functions can be
// used.
-//
+//
// To communicate with the implementation, a special extended "__asm" keyword is used, followed
// by an instruction name (any valid identifier), a destination variable identifier and a
// a list of zero or more source variable identifiers. A variable identifier is a variable name
@@ -19,19 +42,19 @@
// An instruction name designates an instruction that must be exported by the implementation.
// Each instruction receives data from source variable identifiers and returns data in the
// destination variable identifier.
-//
+//
// It is up to the implementation how to define a particular operator or constructor. If it is
// expected to being used rarely, it can be defined in terms of other operators and constructors,
// for example:
-//
+//
// ivec2 __operator + (const ivec2 x, const ivec2 y) {
// return ivec2 (x[0] + y[0], x[1] + y[1]);
// }
-//
+//
// If a particular operator or constructor is expected to be used very often or is an atomic
// operation (that is, an operation that cannot be expressed in terms of other operations or
// would create a dependency cycle) it must be defined using one or more __asm constructs.
-//
+//
// Each implementation must define constructors for all scalar types (bool, float, int).
// There are 9 scalar-to-scalar constructors (including identity constructors). However,
// since the language introduces special constructors (like matrix constructor with a single
@@ -44,7 +67,7 @@
// our constructor's type, raise an error,
// - for each parameter in the list do a recursive constructor matching for appropriate
// scalar fields in the constructed variable,
-//
+//
// Each implementation must also define a set of operators that deal with built-in data types.
// There are four kinds of operators:
// 1) Operators that are implemented only by the compiler: "()" (function call), "," (sequence)
@@ -61,300 +84,218 @@
// 4) All other operators not mentioned above. If no required prototype is found, an error is
// raised. An implementation must follow the language specification to provide all valid
// operator prototypes.
-//
+//
-int __constructor (const float _f) {
- int _i;
- __asm float_to_int _i, _f;
- return _i;
+int __constructor (const float f) {
+ int i;
+ __asm float_to_int i, f;
+ return i;
}
-bool __constructor (const int _i) {
- return _i != 0;
+bool __constructor (const int i) {
+ return i != 0;
}
-bool __constructor (const float _f) {
- return _f != 0.0;
+bool __constructor (const float f) {
+ return f != 0.0;
}
-int __constructor (const bool _b) {
- return _b ? 1 : 0;
+int __constructor (const bool b) {
+ return b ? 1 : 0;
}
-float __constructor (const bool _b) {
- return _b ? 1.0 : 0.0;
+float __constructor (const bool b) {
+ return b ? 1.0 : 0.0;
}
-float __constructor (const int _i) {
- float _f;
- __asm int_to_float _f, _i;
- return _f;
+float __constructor (const int i) {
+ float f;
+ __asm int_to_float f, i;
+ return f;
}
-bool __constructor (const bool _b) {
- return _b;
+bool __constructor (const bool b) {
+ return b;
}
-int __constructor (const int _i) {
- return _i;
+int __constructor (const int i) {
+ return i;
}
-float __constructor (const float _f) {
- return _f;
+float __constructor (const float f) {
+ return f;
}
-vec2 __constructor (const float _f) {
- return vec2 (_f, _f);
+vec2 __constructor (const float f) {
+ return vec2 (f, f);
}
-vec2 __constructor (const int _i) {
- return vec2 (_i, _i);
+vec2 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec2 (x);
}
-vec2 __constructor (const bool _b) {
- return vec2 (_b, _b);
+vec2 __constructor (const bool b) {
+ return vec2 (b ? 1.0 : 0.0);
}
-vec3 __constructor (const float _f) {
- return vec3 (_f, _f, _f);
+vec3 __constructor (const float f) {
+ return vec3 (f, f, f);
}
-vec3 __constructor (const int _i) {
- return vec3 (_i, _i, _i);
+vec3 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec3 (x);
}
-vec3 __constructor (const bool _b) {
- return vec3 (_b, _b, _b);
+vec3 __constructor (const bool b) {
+ return vec3 (b ? 1.0 : 0.0);
}
-vec4 __constructor (const float _f) {
- return vec4 (_f, _f, _f, _f);
+vec4 __constructor (const float f) {
+ return vec4 (f, f, f, f);
}
-vec4 __constructor (const int _i) {
- return vec4 (_i, _i, _i, _i);
+vec4 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return vec4 (x);
}
-vec4 __constructor (const bool _b) {
- return vec4 (_b, _b, _b, _b);
+vec4 __constructor (const bool b) {
+ return vec4 (b ? 1.0 : 0.0);
}
-ivec2 __constructor (const int _i) {
- return ivec2 (_i, _i);
+ivec2 __constructor (const int i) {
+ return ivec2 (i, i);
}
-ivec2 __constructor (const float _f) {
- return ivec2 (_f, _f);
+ivec2 __constructor (const float f) {
+ return ivec2 (int (f));
}
-ivec2 __constructor (const bool _b) {
- return ivec2 (_b, _b);
+ivec2 __constructor (const bool b) {
+ return ivec2 (int (b));
}
-ivec3 __constructor (const int _i) {
- return ivec3 (_i, _i, _i);
+ivec3 __constructor (const int i) {
+ return ivec3 (i, i, i);
}
-ivec3 __constructor (const float _f) {
- return ivec3 (_f, _f, _f);
+ivec3 __constructor (const float f) {
+ return ivec3 (int (f));
}
-ivec3 __constructor (const bool _b) {
- return ivec3 (_b, _b, _b);
+ivec3 __constructor (const bool b) {
+ return ivec3 (int (b));
}
-ivec4 __constructor (const int _i) {
- return ivec4 (_i, _i, _i, _i);
+ivec4 __constructor (const int i) {
+ return ivec4 (i, i, i, i);
}
-ivec4 __constructor (const float _f) {
- return ivec4 (_f, _f, _f, _f);
+ivec4 __constructor (const float f) {
+ return ivec4 (int (f));
}
-ivec4 __constructor (const bool _b) {
- return ivec4 (_b, _b, _b, _b);
+ivec4 __constructor (const bool b) {
+ return ivec4 (int (b));
}
-bvec2 __constructor (const bool _b) {
- return bvec2 (_b, _b);
+bvec2 __constructor (const bool b) {
+ return bvec2 (b, b);
}
-bvec2 __constructor (const float _f) {
- return bvec2 (_f, _f);
+bvec2 __constructor (const float f) {
+ return bvec2 (bool (f));
}
-bvec2 __constructor (const int _i) {
- return bvec2 (_i, _i);
+bvec2 __constructor (const int i) {
+ return bvec2 (bool (i));
}
-bvec3 __constructor (const bool _b) {
- return bvec3 (_b, _b, _b);
+bvec3 __constructor (const bool b) {
+ return bvec3 (b, b, b);
}
-bvec3 __constructor (const float _f) {
- return bvec3 (_f, _f, _f);
+bvec3 __constructor (const float f) {
+ return bvec3 (bool (f));
}
-bvec3 __constructor (const int _i) {
- return bvec3 (_i, _i, _i);
+bvec3 __constructor (const int i) {
+ return bvec3 (bool (i));
}
-bvec4 __constructor (const bool _b) {
- return bvec4 (_b, _b, _b, _b);
+bvec4 __constructor (const bool b) {
+ return bvec4 (b, b, b, b);
}
-bvec4 __constructor (const float _f) {
- return bvec4 (_f, _f, _f, _f);
+bvec4 __constructor (const float f) {
+ return bvec4 (bool (f));
}
-bvec4 __constructor (const int _i) {
- return bvec4 (_i, _i, _i, _i);
+bvec4 __constructor (const int i) {
+ return bvec4 (bool (i));
}
-mat2 __constructor (const float _f) {
- return mat2 (
- _f, .0,
- .0, _f
- );
+mat2 __constructor (const float f) {
+ return mat2 (f, 0.0, 0.0, f);
}
-mat2 __constructor (const int _i) {
- return mat2 (
- _i, .0,
- .0, _i
- );
+mat2 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat2 (x);
}
-mat2 __constructor (const bool _b) {
- return mat2 (
- _b, .0,
- .0, _b
- );
+mat2 __constructor (const bool b) {
+ return mat2 (b ? 1.0 : 0.0);
}
-mat3 __constructor (const float _f) {
- return mat3 (
- _f, .0, .0,
- .0, _f, .0,
- .0, .0, _f
- );
+mat3 __constructor (const float f) {
+ return mat3 (f, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, f);
}
-mat3 __constructor (const int _i) {
- return mat3 (
- _i, .0, .0,
- .0, _i, .0,
- .0, .0, _i
- );
+mat3 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat3 (x);
}
-mat3 __constructor (const bool _b) {
- return mat3 (
- _b, .0, .0,
- .0, _b, .0,
- .0, .0, _b
- );
+mat3 __constructor (const bool b) {
+ return mat3 (b ? 1.0 : 0.0);
}
-mat4 __constructor (const float _f) {
- return mat4 (
- _f, .0, .0, .0,
- .0, _f, .0, .0,
- .0, .0, _f, .0,
- .0, .0, .0, _f
- );
+mat4 __constructor (const float f) {
+ return mat4 (f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f);
}
-mat4 __constructor (const int _i) {
- return mat4 (
- _i, .0, .0, .0,
- .0, _i, .0, .0,
- .0, .0, _i, .0,
- .0, .0, .0, _i
- );
+mat4 __constructor (const int i) {
+ float x;
+ __asm int_to_float x, i;
+ return mat4 (x);
}
-mat4 __constructor (const bool _b) {
- return mat4 (
- _b, .0, .0, .0,
- .0, _b, .0, .0,
- .0, .0, _b, .0,
- .0, .0, .0, _b
- );
+mat4 __constructor (const bool b) {
+ return mat4 (b ? 1.0 : 0.0);
}
-//void __operator = (out float a, const float b) {
-// __asm float_copy a, b;
-//}
-//
-//void __operator = (out int a, const int b) {
-// __asm int_copy a, b;
-//}
-//
-//void __operator = (out bool a, const bool b) {
-// __asm bool_copy a, b;
-//}
-//
-//void __operator = (out vec2 v, const vec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out vec3 v, const vec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out vec4 v, const vec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out ivec2 v, const ivec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out ivec3 v, const ivec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out ivec4 v, const ivec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out bvec2 v, const bvec2 u) {
-// v.x = u.x, v.y = u.y;
-//}
-//
-//void __operator = (out bvec3 v, const bvec3 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z;
-//}
-//
-//void __operator = (out bvec4 v, const bvec4 u) {
-// v.x = u.x, v.y = u.y, v.z = u.z, v.w = u.w;
-//}
-//
-//void __operator = (out mat2 m, const mat2 n) {
-// m[0] = n[0], m[1] = n[1];
-//}
-//
-//void __operator = (out mat3 m, const mat3 n) {
-// m[0] = n[0], m[1] = n[1], m[2] = n[2];
-//}
-//
-//void __operator = (out mat4 m, const mat4 n) {
-// m[0] = n[0], m[1] = n[1], m[2] = n[2], m[3] = n[3];
-//}
-
void __operator += (inout float a, const float b) {
__asm float_add a, a, b;
}
float __operator - (const float a) {
- float c;
- __asm float_negate c, a;
- return c;
+ float b;
+ __asm float_negate b, a;
+ return b;
}
void __operator -= (inout float a, const float b) {
- a += -b;
+ float c;
+ __asm float_negate c, b;
+ __asm float_add a, a, c;
}
void __operator *= (inout float a, const float b) {
@@ -367,8 +308,8 @@ void __operator /= (inout float a, const float b) {
float __operator + (const float a, const float b) {
float c;
- c = a;
- return c += b;
+ __asm float_add c, a, b;
+ return c;
}
void __operator += (inout int a, const int b) {
@@ -376,7 +317,12 @@ void __operator += (inout int a, const int b) {
}
int __operator - (const int a) {
- return int (-float (a));
+ float x;
+ int b;
+ __asm int_to_float x, a;
+ __asm float_negate x, x;
+ __asm float_to_int b, x;
+ return b;
}
void __operator -= (inout int a, const int b) {
@@ -385,8 +331,8 @@ void __operator -= (inout int a, const int b) {
float __operator * (const float a, const float b) {
float c;
- c = a;
- return c *= b;
+ __asm float_multiply c, a, b;
+ return c;
}
void __operator *= (inout int a, const int b) {
@@ -395,8 +341,8 @@ void __operator *= (inout int a, const int b) {
float __operator / (const float a, const float b) {
float c;
- c = a;
- return c /= b;
+ __asm float_divide c, a, b;
+ return c;
}
void __operator /= (inout int a, const int b) {
@@ -404,107 +350,157 @@ void __operator /= (inout int a, const int b) {
}
void __operator += (inout vec2 v, const vec2 u) {
- v.x += u.x, v.y += u.y;
+ v.x += u.x;
+ v.y += u.y;
}
void __operator -= (inout vec2 v, const vec2 u) {
- v.x -= u.x, v.y -= u.y;
+ v.x -= u.x;
+ v.y -= u.y;
}
void __operator *= (inout vec2 v, const vec2 u) {
- v.x *= u.x, v.y *= u.y;
+ v.x *= u.x;
+ v.y *= u.y;
}
void __operator /= (inout vec2 v, const vec2 u) {
- v.x /= u.x, v.y /= u.y;
+ v.x /= u.x;
+ v.y /= u.y;
}
void __operator += (inout vec3 v, const vec3 u) {
- v.x += u.x, v.y += u.y, v.z += u.z;
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
}
void __operator -= (inout vec3 v, const vec3 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z;
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
}
void __operator *= (inout vec3 v, const vec3 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z;
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
}
void __operator /= (inout vec3 v, const vec3 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z;
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
}
void __operator += (inout vec4 v, const vec4 u) {
- v.x += u.x, v.y += u.y, v.z += u.z, v.w += u.w;
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+ v.w += u.w;
}
void __operator -= (inout vec4 v, const vec4 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z, v.w -= u.w;
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+ v.w -= u.w;
}
void __operator *= (inout vec4 v, const vec4 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z, v.w *= u.w;
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+ v.w *= u.w;
}
void __operator /= (inout vec4 v, const vec4 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z, v.w /= u.w;
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+ v.w /= u.w;
}
void __operator += (inout ivec2 v, const ivec2 u) {
- v.x += u.x, v.y += u.y;
+ v.x += u.x;
+ v.y += u.y;
}
void __operator -= (inout ivec2 v, const ivec2 u) {
- v.x -= u.x, v.y -= u.y;
+ v.x -= u.x;
+ v.y -= u.y;
}
void __operator *= (inout ivec2 v, const ivec2 u) {
- v.x *= u.x, v.y *= u.y;
+ v.x *= u.x;
+ v.y *= u.y;
}
void __operator /= (inout ivec2 v, const ivec2 u) {
- v.x /= u.x, v.y /= u.y;
+ v.x /= u.x;
+ v.y /= u.y;
}
void __operator += (inout ivec3 v, const ivec3 u) {
- v.x += u.x, v.y += u.y, v.z += u.z;
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
}
void __operator -= (inout ivec3 v, const ivec3 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z;
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
}
void __operator *= (inout ivec3 v, const ivec3 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z;
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
}
void __operator /= (inout ivec3 v, const ivec3 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z;
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
}
void __operator += (inout ivec4 v, const ivec4 u) {
- v.x += u.x, v.y += u.y, v.z += u.z, v.w += u.w;
+ v.x += u.x;
+ v.y += u.y;
+ v.z += u.z;
+ v.w += u.w;
}
void __operator -= (inout ivec4 v, const ivec4 u) {
- v.x -= u.x, v.y -= u.y, v.z -= u.z, v.w -= u.w;
+ v.x -= u.x;
+ v.y -= u.y;
+ v.z -= u.z;
+ v.w -= u.w;
}
void __operator *= (inout ivec4 v, const ivec4 u) {
- v.x *= u.x, v.y *= u.y, v.z *= u.z, v.w *= u.w;
+ v.x *= u.x;
+ v.y *= u.y;
+ v.z *= u.z;
+ v.w *= u.w;
}
void __operator /= (inout ivec4 v, const ivec4 u) {
- v.x /= u.x, v.y /= u.y, v.z /= u.z, v.w /= u.w;
+ v.x /= u.x;
+ v.y /= u.y;
+ v.z /= u.z;
+ v.w /= u.w;
}
void __operator += (inout mat2 m, const mat2 n) {
- m[0] += n[0], m[1] += n[1];
+ m[0] += n[0];
+ m[1] += n[1];
}
void __operator -= (inout mat2 m, const mat2 n) {
- m[0] -= n[0], m[1] -= n[1];
+ m[0] -= n[0];
+ m[1] -= n[1];
}
vec2 __operator * (const mat2 m, const vec2 v) {
@@ -523,15 +519,20 @@ void __operator *= (inout mat2 m, const mat2 n) {
}
void __operator /= (inout mat2 m, const mat2 n) {
- m[0] /= n[0], m[1] /= n[1];
+ m[0] /= n[0];
+ m[1] /= n[1];
}
void __operator += (inout mat3 m, const mat3 n) {
- m[0] += n[0], m[1] += n[1], m[2] += n[2];
+ m[0] += n[0];
+ m[1] += n[1];
+ m[2] += n[2];
}
void __operator -= (inout mat3 m, const mat3 n) {
- m[0] -= n[0], m[1] -= n[1], m[2] -= n[2];
+ m[0] -= n[0];
+ m[1] -= n[1];
+ m[2] -= n[2];
}
vec3 __operator * (const mat3 m, const vec3 v) {
@@ -551,15 +552,23 @@ void __operator *= (inout mat3 m, const mat3 n) {
}
void __operator /= (inout mat3 m, const mat3 n) {
- m[0] /= n[0], m[1] /= n[1], m[2] /= n[2];
+ m[0] /= n[0];
+ m[1] /= n[1];
+ m[2] /= n[2];
}
void __operator += (inout mat4 m, const mat4 n) {
- m[0] += n[0], m[1] += n[1], m[2] += n[2], m[3] += n[3];
+ m[0] += n[0];
+ m[1] += n[1];
+ m[2] += n[2];
+ m[3] += n[3];
}
void __operator -= (inout mat4 m, const mat4 n) {
- m[0] -= n[0], m[1] -= n[1], m[2] -= n[2], m[3] -= n[3];
+ m[0] -= n[0];
+ m[1] -= n[1];
+ m[2] -= n[2];
+ m[3] -= n[3];
}
vec4 __operator * (const mat4 m, const vec4 v) {
@@ -580,103 +589,154 @@ void __operator *= (inout mat4 m, const mat4 n) {
}
void __operator /= (inout mat4 m, const mat4 n) {
- m[0] /= n[0], m[1] /= n[1], m[2] /= n[2], m[3] /= n[3];
+ m[0] /= n[0];
+ m[1] /= n[1];
+ m[2] /= n[2];
+ m[3] /= n[3];
}
void __operator += (inout vec2 v, const float a) {
- v.x += a, v.y += a;
+ v.x += a;
+ v.y += a;
}
void __operator -= (inout vec2 v, const float a) {
- v.x -= a, v.y -= a;
+ v.x -= a;
+ v.y -= a;
}
void __operator *= (inout vec2 v, const float a) {
- v.x *= a, v.y *= a;
+ v.x *= a;
+ v.y *= a;
}
void __operator /= (inout vec2 v, const float a) {
- v.x /= a, v.y /= a;
+ v.x /= a;
+ v.y /= a;
}
void __operator += (inout vec3 v, const float a) {
- v.x += a, v.y += a, v.z += a;
+ v.x += a;
+ v.y += a;
+ v.z += a;
}
void __operator -= (inout vec3 v, const float a) {
- v.x -= a, v.y -= a, v.z -= a;
+ v.x -= a;
+ v.y -= a;
+ v.z -= a;
}
void __operator *= (inout vec3 v, const float a) {
- v.x *= a, v.y *= a, v.z *= a;
+ v.x *= a;
+ v.y *= a;
+ v.z *= a;
}
void __operator /= (inout vec3 v, const float a) {
- v.x /= a, v.y /= a, v.z /= a;
+ v.x /= a;
+ v.y /= a;
+ v.z /= a;
}
void __operator += (inout vec4 v, const float a) {
- v.x += a, v.y += a, v.z += a, v.w += a;
+ v.x += a;
+ v.y += a;
+ v.z += a;
+ v.w += a;
}
void __operator -= (inout vec4 v, const float a) {
- v.x -= a, v.y -= a, v.z -= a, v.w -= a;
+ v.x -= a;
+ v.y -= a;
+ v.z -= a;
+ v.w -= a;
}
void __operator *= (inout vec4 v, const float a) {
- v.x *= a, v.y *= a, v.z *= a, v.w *= a;
+ v.x *= a;
+ v.y *= a;
+ v.z *= a;
+ v.w *= a;
}
void __operator /= (inout vec4 v, const float a) {
- v.x /= a, v.y /= a, v.z /= a, v.w /= a;
+ v.x /= a;
+ v.y /= a;
+ v.z /= a;
+ v.w /= a;
}
void __operator += (inout mat2 m, const float a) {
- m[0] += a, m[1] += a;
+ m[0] += a;
+ m[1] += a;
}
void __operator -= (inout mat2 m, const float a) {
- m[0] -= a, m[1] -= a;
+ m[0] -= a;
+ m[1] -= a;
}
void __operator *= (inout mat2 m, const float a) {
- m[0] *= a, m[1] *= a;
+ m[0] *= a;
+ m[1] *= a;
}
void __operator /= (inout mat2 m, const float a) {
- m[0] /= a, m[1] /= a;
+ m[0] /= a;
+ m[1] /= a;
}
void __operator += (inout mat3 m, const float a) {
- m[0] += a, m[1] += a, m[2] += a;
+ m[0] += a;
+ m[1] += a;
+ m[2] += a;
}
void __operator -= (inout mat3 m, const float a) {
- m[0] -= a, m[1] -= a, m[2] -= a;
+ m[0] -= a;
+ m[1] -= a;
+ m[2] -= a;
}
void __operator *= (inout mat3 m, const float a) {
- m[0] *= a, m[1] *= a, m[2] *= a;
+ m[0] *= a;
+ m[1] *= a;
+ m[2] *= a;
}
void __operator /= (inout mat3 m, const float a) {
- m[0] /= a, m[1] /= a, m[2] /= a;
+ m[0] /= a;
+ m[1] /= a;
+ m[2] /= a;
}
void __operator += (inout mat4 m, const float a) {
- m[0] += a, m[1] += a, m[2] += a, m[3] += a;
+ m[0] += a;
+ m[1] += a;
+ m[2] += a;
+ m[3] += a;
}
void __operator -= (inout mat4 m, const float a) {
- m[0] -= a, m[1] -= a, m[2] -= a, m[3] -= a;
+ m[0] -= a;
+ m[1] -= a;
+ m[2] -= a;
+ m[3] -= a;
}
void __operator *= (inout mat4 m, const float a) {
- m[0] *= a, m[1] *= a, m[2] *= a, m[3] *= a;
+ m[0] *= a;
+ m[1] *= a;
+ m[2] *= a;
+ m[3] *= a;
}
void __operator /= (inout mat4 m, const float a) {
- m[0] /= a, m[1] /= a, m[2] /= a, m[3] /= a;
+ m[0] /= a;
+ m[1] /= a;
+ m[2] /= a;
+ m[3] /= a;
}
vec2 __operator * (const vec2 v, const mat2 m) {
@@ -716,27 +776,51 @@ void __operator *= (inout vec4 v, const mat4 m) {
}
float __operator - (const float a, const float b) {
- return a + -b;
+ float c;
+ __asm float_negate c, b;
+ __asm float_add c, a, c;
+ return c;
}
int __operator + (const int a, const int b) {
+ float x, y;
int c;
- c = a;
- return c += b;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_add x, x, y;
+ __asm float_to_int c, x;
+ return c;
}
int __operator - (const int a, const int b) {
- return a + -b;
+ float x, y;
+ int c;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_negate y, y;
+ __asm float_add x, x, y;
+ __asm float_to_int c, x;
+ return c;
}
int __operator * (const int a, const int b) {
+ float x, y;
int c;
- return (c = a) *= b;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_multiply x, x, y;
+ __asm float_to_int c, x;
+ return c;
}
int __operator / (const int a, const int b) {
+ float x, y;
int c;
- return (c = a) /= b;
+ __asm int_to_float x, a;
+ __asm int_to_float y, b;
+ __asm float_divide x, x, y;
+ __asm float_to_int c, x;
+ return c;
}
vec2 __operator + (const vec2 v, const vec2 u) {
@@ -747,6 +831,14 @@ vec2 __operator - (const vec2 v, const vec2 u) {
return vec2 (v.x - u.x, v.y - u.y);
}
+vec2 __operator * (const vec2 v, const vec2 u) {
+ return vec2 (v.x * u.x, v.y * u.y);
+}
+
+vec2 __operator / (const vec2 v, const vec2 u) {
+ return vec2 (v.x / u.x, v.y / u.y);
+}
+
vec3 __operator + (const vec3 v, const vec3 u) {
return vec3 (v.x + u.x, v.y + u.y, v.z + u.z);
}
@@ -755,6 +847,14 @@ vec3 __operator - (const vec3 v, const vec3 u) {
return vec3 (v.x - u.x, v.y - u.y, v.z - u.z);
}
+vec3 __operator * (const vec3 v, const vec3 u) {
+ return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);
+}
+
+vec3 __operator / (const vec3 v, const vec3 u) {
+ return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);
+}
+
vec4 __operator + (const vec4 v, const vec4 u) {
return vec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
}
@@ -763,6 +863,14 @@ vec4 __operator - (const vec4 v, const vec4 u) {
return vec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
}
+vec4 __operator * (const vec4 v, const vec4 u) {
+ return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
+}
+
+vec4 __operator / (const vec4 v, const vec4 u) {
+ return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
+}
+
ivec2 __operator + (const ivec2 v, const ivec2 u) {
return ivec2 (v.x + u.x, v.y + u.y);
}
@@ -771,6 +879,14 @@ ivec2 __operator - (const ivec2 v, const ivec2 u) {
return ivec2 (v.x - u.x, v.y - u.y);
}
+ivec2 __operator * (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x * u.x, v.y * u.y);
+}
+
+ivec2 __operator / (const ivec2 v, const ivec2 u) {
+ return ivec2 (v.x / u.x, v.y / u.y);
+}
+
ivec3 __operator + (const ivec3 v, const ivec3 u) {
return ivec3 (v.x + u.x, v.y + u.y, v.z + u.z);
}
@@ -779,6 +895,14 @@ ivec3 __operator - (const ivec3 v, const ivec3 u) {
return ivec3 (v.x - u.x, v.y - u.y, v.z - u.z);
}
+ivec3 __operator * (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);
+}
+
+ivec3 __operator / (const ivec3 v, const ivec3 u) {
+ return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);
+}
+
ivec4 __operator + (const ivec4 v, const ivec4 u) {
return ivec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
}
@@ -787,6 +911,14 @@ ivec4 __operator - (const ivec4 v, const ivec4 u) {
return ivec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
}
+ivec4 __operator * (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
+}
+
+ivec4 __operator / (const ivec4 v, const ivec4 u) {
+ return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
+}
+
mat2 __operator + (const mat2 m, const mat2 n) {
return mat2 (m[0] + n[0], m[1] + n[1]);
}
@@ -795,6 +927,10 @@ mat2 __operator - (const mat2 m, const mat2 n) {
return mat2 (m[0] - n[0], m[1] - n[1]);
}
+mat2 __operator / (const mat2 m, const mat2 n) {
+ return mat2 (m[0] / n[0], m[1] / n[1]);
+}
+
mat3 __operator + (const mat3 m, const mat3 n) {
return mat3 (m[0] + n[0], m[1] + n[1], m[2] + n[2]);
}
@@ -803,6 +939,10 @@ mat3 __operator - (const mat3 m, const mat3 n) {
return mat3 (m[0] - n[0], m[1] - n[1], m[2] - n[2]);
}
+mat3 __operator / (const mat3 m, const mat3 n) {
+ return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);
+}
+
mat4 __operator + (const mat4 m, const mat4 n) {
return mat4 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]);
}
@@ -811,6 +951,10 @@ mat4 __operator - (const mat4 m, const mat4 n) {
return mat4 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]);
}
+mat4 __operator / (const mat4 m, const mat4 n) {
+ return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);
+}
+
vec2 __operator + (const float a, const vec2 u) {
return vec2 (a + u.x, a + u.y);
}
@@ -1004,159 +1148,99 @@ mat4 __operator / (const mat4 m, const float b) {
}
ivec2 __operator + (const int a, const ivec2 u) {
- return ivec2 (a + u.x, a + u.y);
+ return ivec2 (a) + u;
}
ivec2 __operator + (const ivec2 v, const int b) {
- return ivec2 (v.x + b, v.y + b);
+ return v + ivec2 (b);
}
ivec2 __operator - (const int a, const ivec2 u) {
- return ivec2 (a - u.x, a - u.y);
+ return ivec2 (a) - u;
}
ivec2 __operator - (const ivec2 v, const int b) {
- return ivec2 (v.x - b, v.y - b);
+ return v - ivec2 (b);
}
ivec2 __operator * (const int a, const ivec2 u) {
- return ivec2 (a * u.x, a * u.y);
+ return ivec2 (a) * u;
}
ivec2 __operator * (const ivec2 v, const int b) {
- return ivec2 (v.x * b, v.y * b);
+ return v * ivec2 (b);
}
ivec2 __operator / (const int a, const ivec2 u) {
- return ivec2 (a / u.x, a / u.y);
+ return ivec2 (a) / u;
}
ivec2 __operator / (const ivec2 v, const int b) {
- return ivec2 (v.x / b, v.y / b);
+ return v / ivec2 (b);
}
ivec3 __operator + (const int a, const ivec3 u) {
- return ivec3 (a + u.x, a + u.y, a + u.z);
+ return ivec3 (a) + u;
}
ivec3 __operator + (const ivec3 v, const int b) {
- return ivec3 (v.x + b, v.y + b, v.z + b);
+ return v + ivec3 (b);
}
ivec3 __operator - (const int a, const ivec3 u) {
- return ivec3 (a - u.x, a - u.y, a - u.z);
+ return ivec3 (a) - u;
}
ivec3 __operator - (const ivec3 v, const int b) {
- return ivec3 (v.x - b, v.y - b, v.z - b);
+ return v - ivec3 (b);
}
ivec3 __operator * (const int a, const ivec3 u) {
- return ivec3 (a * u.x, a * u.y, a * u.z);
+ return ivec3 (a) * u;
}
ivec3 __operator * (const ivec3 v, const int b) {
- return ivec3 (v.x * b, v.y * b, v.z * b);
+ return v * ivec3 (b);
}
ivec3 __operator / (const int a, const ivec3 u) {
- return ivec3 (a / u.x, a / u.y, a / u.z);
+ return ivec3 (a) / u;
}
ivec3 __operator / (const ivec3 v, const int b) {
- return ivec3 (v.x / b, v.y / b, v.z / b);
+ return v / ivec3 (b);
}
ivec4 __operator + (const int a, const ivec4 u) {
- return ivec4 (a + u.x, a + u.y, a + u.z, a + u.w);
+ return ivec4 (a) + u;
}
ivec4 __operator + (const ivec4 v, const int b) {
- return ivec4 (v.x + b, v.y + b, v.z + b, v.w + b);
+ return v + ivec4 (b);
}
ivec4 __operator - (const int a, const ivec4 u) {
- return ivec4 (a - u.x, a - u.y, a - u.z, a - u.w);
+ return ivec4 (a) - u;
}
ivec4 __operator - (const ivec4 v, const int b) {
- return ivec4 (v.x - b, v.y - b, v.z - b, v.w - b);
+ return v - ivec4 (b);
}
ivec4 __operator * (const int a, const ivec4 u) {
- return ivec4 (a * u.x, a * u.y, a * u.z, a * u.w);
+ return ivec4 (a) * u;
}
ivec4 __operator * (const ivec4 v, const int b) {
- return ivec4 (v.x * b, v.y * b, v.z * b, v.w * b);
+ return v * ivec4 (b);
}
ivec4 __operator / (const int a, const ivec4 u) {
- return ivec4 (a / u.x, a / u.y, a / u.z, a / u.w);
+ return ivec4 (a) / u;
}
ivec4 __operator / (const ivec4 v, const int b) {
- return ivec4 (v.x / b, v.y / b, v.z / b, v.w / b);
-}
-
-vec2 __operator * (const vec2 v, const vec2 u) {
- return vec2 (v.x * u.x, v.y * u.y);
-}
-
-vec3 __operator * (const vec3 v, const vec3 u) {
- return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);
-}
-
-vec4 __operator * (const vec4 v, const vec4 u) {
- return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
-}
-
-ivec2 __operator * (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x * u.x, v.y * u.y);
-}
-
-ivec3 __operator * (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);
-}
-
-ivec4 __operator * (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
-}
-
-vec2 __operator / (const vec2 v, const vec2 u) {
- return vec2 (v.x / u.x, v.y / u.y);
-}
-
-vec3 __operator / (const vec3 v, const vec3 u) {
- return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);
-}
-
-vec4 __operator / (const vec4 v, const vec4 u) {
- return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
-}
-
-ivec2 __operator / (const ivec2 v, const ivec2 u) {
- return ivec2 (v.x / u.x, v.y / u.y);
-}
-
-ivec3 __operator / (const ivec3 v, const ivec3 u) {
- return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);
-}
-
-ivec4 __operator / (const ivec4 v, const ivec4 u) {
- return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
-}
-
-mat2 __operator / (const mat2 m, const mat2 n) {
- return mat2 (m[0] / n[0], m[1] / n[1]);
-}
-
-mat3 __operator / (const mat3 m, const mat3 n) {
- return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);
-}
-
-mat4 __operator / (const mat4 m, const mat4 n) {
- return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);
+ return v / ivec4 (b);
}
vec2 __operator - (const vec2 v) {
@@ -1195,11 +1279,6 @@ mat4 __operator - (const mat4 m) {
return mat4 (-m[0], -m[1], -m[2], -m[3]);
}
-//
-// NOTE: postfix increment and decrement operators take additional dummy int parameter to
-// distinguish their prototypes from prefix ones.
-//
-
void __operator -- (inout float a) {
a -= 1.0;
}
@@ -1209,39 +1288,57 @@ void __operator -- (inout int a) {
}
void __operator -- (inout vec2 v) {
- --v.x, --v.y;
+ --v.x;
+ --v.y;
}
void __operator -- (inout vec3 v) {
- --v.x, --v.y, --v.z;
+ --v.x;
+ --v.y;
+ --v.z;
}
void __operator -- (inout vec4 v) {
- --v.x, --v.y, --v.z, --v.w;
+ --v.x;
+ --v.y;
+ --v.z;
+ --v.w;
}
void __operator -- (inout ivec2 v) {
- --v.x, --v.y;
+ --v.x;
+ --v.y;
}
void __operator -- (inout ivec3 v) {
- --v.x, --v.y, --v.z;
+ --v.x;
+ --v.y;
+ --v.z;
}
void __operator -- (inout ivec4 v) {
- --v.x, --v.y, --v.z, --v.w;
+ --v.x;
+ --v.y;
+ --v.z;
+ --v.w;
}
void __operator -- (inout mat2 m) {
- --m[0], --m[1];
+ --m[0];
+ --m[1];
}
void __operator -- (inout mat3 m) {
- --m[0], --m[1], --m[2];
+ --m[0];
+ --m[1];
+ --m[2];
}
void __operator -- (inout mat4 m) {
- --m[0], --m[1], --m[2], --m[3];
+ --m[0];
+ --m[1];
+ --m[2];
+ --m[3];
}
void __operator ++ (inout float a) {
@@ -1253,53 +1350,74 @@ void __operator ++ (inout int a) {
}
void __operator ++ (inout vec2 v) {
- ++v.x, ++v.y;
+ ++v.x;
+ ++v.y;
}
void __operator ++ (inout vec3 v) {
- ++v.x, ++v.y, ++v.z;
+ ++v.x;
+ ++v.y;
+ ++v.z;
}
void __operator ++ (inout vec4 v) {
- ++v.x, ++v.y, ++v.z, ++v.w;
+ ++v.x;
+ ++v.y;
+ ++v.z;
+ ++v.w;
}
void __operator ++ (inout ivec2 v) {
- ++v.x, ++v.y;
+ ++v.x;
+ ++v.y;
}
void __operator ++ (inout ivec3 v) {
- ++v.x, ++v.y, ++v.z;
+ ++v.x;
+ ++v.y;
+ ++v.z;
}
void __operator ++ (inout ivec4 v) {
- ++v.x, ++v.y, ++v.z, ++v.w;
+ ++v.x;
+ ++v.y;
+ ++v.z;
+ ++v.w;
}
void __operator ++ (inout mat2 m) {
- ++m[0], ++m[1];
+ ++m[0];
+ ++m[1];
}
void __operator ++ (inout mat3 m) {
- ++m[0], ++m[1], ++m[2];
+ ++m[0];
+ ++m[1];
+ ++m[2];
}
void __operator ++ (inout mat4 m) {
- ++m[0], ++m[1], ++m[2], ++m[3];
+ ++m[0];
+ ++m[1];
+ ++m[2];
+ ++m[3];
}
+//
+// NOTE: postfix increment and decrement operators take additional dummy int parameter to
+// distinguish their prototypes from prefix ones.
+//
+
float __operator -- (inout float a, const int) {
- float c;
- c = a;
+ float b = a;
--a;
- return c;
+ return b;
}
int __operator -- (inout int a, const int) {
- int c;
- c = a;
+ int b = a;
--a;
- return c;
+ return b;
}
vec2 __operator -- (inout vec2 v, const int) {
@@ -1339,17 +1457,15 @@ mat4 __operator -- (inout mat4 m, const int) {
}
float __operator ++ (inout float a, const int) {
- float c;
- c = a;
+ float b = a;
++a;
- return c;
+ return b;
}
int __operator ++ (inout int a, const int) {
- int c;
- c = a;
+ int b = a;
++a;
- return c;
+ return b;
}
vec2 __operator ++ (inout vec2 v, const int) {
@@ -1395,171 +1511,169 @@ bool __operator < (const float a, const float b) {
}
bool __operator < (const int a, const int b) {
- return float (a) < float (b);
+ return float (a) < float (b);
}
bool __operator > (const float a, const float b) {
- return b < a;
+ bool c;
+ __asm float_less c, b, a;
+ return c;
}
bool __operator > (const int a, const int b) {
- return b < a;
+ return float (a) > float (b);
}
bool __operator >= (const float a, const float b) {
- return a > b || a == b;
+ bool g, e;
+ __asm float_less g, b, a;
+ __asm float_equal e, a, b;
+ return g || e;
}
bool __operator >= (const int a, const int b) {
- return a > b || a == b;
+ return float (a) >= float (b);
}
bool __operator <= (const float a, const float b) {
- return a < b || a == b;
+ bool g, e;
+ __asm float_less g, a, b;
+ __asm float_equal e, a, b;
+ return g || e;
}
bool __operator <= (const int a, const int b) {
- return a < b || a == b;
+ return float (a) <= float (b);
}
-//bool __operator == (const float a, const float b) {
-// bool c;
-// __asm float_equal c, a, b;
-// return c;
-//}
-//
-//bool __operator == (const int a, const int b) {
-// return float (a) == float (b);
-//}
-//
-//bool __operator == (const bool a, const bool b) {
-// return float (a) == float (b);
-//}
-//
-//bool __operator == (const vec2 v, const vec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const vec3 v, const vec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const vec4 v, const vec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const ivec2 v, const ivec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const ivec3 v, const ivec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const ivec4 v, const ivec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const bvec2 v, const bvec2 u) {
-// return v.x == u.x && v.y == u.y;
-//}
-//
-//bool __operator == (const bvec3 v, const bvec3 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z;
-//}
-//
-//bool __operator == (const bvec4 v, const bvec4 u) {
-// return v.x == u.x && v.y == u.y && v.z == u.z && v.w == u.w;
-//}
-//
-//bool __operator == (const mat2 m, const mat2 n) {
-// return m[0] == n[0] && m[1] == n[1];
-//}
-//
-//bool __operator == (const mat3 m, const mat3 n) {
-// return m[0] == n[0] && m[1] == n[1] && m[2] == n[2];
-//}
-//
-//bool __operator == (const mat4 m, const mat4 n) {
-// return m[0] == n[0] && m[1] == n[1] && m[2] == n[2] && m[3] == n[3];
-//}
-//
-//bool __operator != (const float a, const float b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const int a, const int b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const bool a, const bool b) {
-// return !(a == b);
-//}
-//
-//bool __operator != (const vec2 v, const vec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const vec3 v, const vec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const vec4 v, const vec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const ivec2 v, const ivec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const ivec3 v, const ivec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const ivec4 v, const ivec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const bvec2 v, const bvec2 u) {
-// return v.x != u.x || v.y != u.y;
-//}
-//
-//bool __operator != (const bvec3 v, const bvec3 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z;
-//}
-//
-//bool __operator != (const bvec4 v, const bvec4 u) {
-// return v.x != u.x || v.y != u.y || v.z != u.z || v.w != u.w;
-//}
-//
-//bool __operator != (const mat2 m, const mat2 n) {
-// return m[0] != n[0] || m[1] != n[1];
-//}
-//
-//bool __operator != (const mat3 m, const mat3 n) {
-// return m[0] != n[0] || m[1] != n[1] || m[2] != n[2];
-//}
-//
-//bool __operator != (const mat4 m, const mat4 n) {
-// return m[0] != n[0] || m[1] != n[1] || m[2] != n[2] || m[3] != n[3];
-//}
-
bool __operator ^^ (const bool a, const bool b) {
return a != b;
}
-//
+//
// These operators are handled internally by the compiler:
-//
+//
// bool __operator && (bool a, bool b) {
// return a ? b : false;
// }
// bool __operator || (bool a, bool b) {
// return a ? true : b;
// }
-//
+//
bool __operator ! (const bool a) {
return a == false;
}
+//
+// mesa-specific extension functions.
+//
+
+void print (const float f) {
+ __asm float_print f;
+}
+
+void print (const int i) {
+ __asm int_print i;
+}
+
+void print (const bool b) {
+ __asm bool_print b;
+}
+
+void print (const vec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const vec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const vec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const ivec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const ivec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const ivec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const bvec2 v) {
+ print (v.x);
+ print (v.y);
+}
+
+void print (const bvec3 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+}
+
+void print (const bvec4 v) {
+ print (v.x);
+ print (v.y);
+ print (v.z);
+ print (v.w);
+}
+
+void print (const mat2 m) {
+ print (m[0]);
+ print (m[1]);
+}
+
+void print (const mat3 m) {
+ print (m[0]);
+ print (m[1]);
+ print (m[2]);
+}
+
+void print (const mat4 m) {
+ print (m[0]);
+ print (m[1]);
+ print (m[2]);
+ print (m[3]);
+}
+
+void print (const sampler1D e) {
+ __asm int_print e;
+}
+
+void print (const sampler2D e) {
+ __asm int_print e;
+}
+
+void print (const sampler3D e) {
+ __asm int_print e;
+}
+
+void print (const samplerCube e) {
+ __asm int_print e;
+}
+
+void print (const sampler1DShadow e) {
+ __asm int_print e;
+}
+
+void print (const sampler2DShadow e) {
+ __asm int_print e;
+}
+
diff --git a/src/mesa/shader/slang/library/slang_core_gc.h b/src/mesa/shader/slang/library/slang_core_gc.h
index 7a45c303a8..b3b7c8071c 100644
--- a/src/mesa/shader/slang/library/slang_core_gc.h
+++ b/src/mesa/shader/slang/library/slang_core_gc.h
@@ -1,499 +1,538 @@
-
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
-/* slang_core.gc */
-
-2,1,0,5,1,1,1,0,9,95,102,0,0,0,1,3,2,0,5,1,95,105,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,
-116,0,18,95,105,0,0,18,95,102,0,0,0,8,18,95,105,0,0,0,1,0,1,1,1,1,0,5,95,105,0,0,0,1,8,18,95,105,0,
-16,8,48,0,39,0,0,1,0,1,1,1,1,0,9,95,102,0,0,0,1,8,18,95,102,0,17,48,0,48,0,0,39,0,0,1,0,5,1,1,1,0,
-1,95,98,0,0,0,1,8,18,95,98,0,16,10,49,0,16,8,48,0,31,0,0,1,0,9,1,1,1,0,1,95,98,0,0,0,1,8,18,95,98,
-0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,1,0,9,1,1,1,0,5,95,105,0,0,0,1,3,2,0,9,1,95,102,0,0,0,4,105,
-110,116,95,116,111,95,102,108,111,97,116,0,18,95,102,0,0,18,95,105,0,0,0,8,18,95,102,0,0,0,1,0,1,1,
-1,1,0,1,95,98,0,0,0,1,8,18,95,98,0,0,0,1,0,5,1,1,1,0,5,95,105,0,0,0,1,8,18,95,105,0,0,0,1,0,9,1,1,
-1,0,9,95,102,0,0,0,1,8,18,95,102,0,0,0,1,0,10,1,1,1,0,9,95,102,0,0,0,1,8,58,118,101,99,50,0,18,95,
-102,0,0,18,95,102,0,0,0,0,0,1,0,10,1,1,1,0,5,95,105,0,0,0,1,8,58,118,101,99,50,0,18,95,105,0,0,18,
-95,105,0,0,0,0,0,1,0,10,1,1,1,0,1,95,98,0,0,0,1,8,58,118,101,99,50,0,18,95,98,0,0,18,95,98,0,0,0,0,
-0,1,0,11,1,1,1,0,9,95,102,0,0,0,1,8,58,118,101,99,51,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,0,
-0,0,1,0,11,1,1,1,0,5,95,105,0,0,0,1,8,58,118,101,99,51,0,18,95,105,0,0,18,95,105,0,0,18,95,105,0,0,
-0,0,0,1,0,11,1,1,1,0,1,95,98,0,0,0,1,8,58,118,101,99,51,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,0,
-0,0,1,0,12,1,1,1,0,9,95,102,0,0,0,1,8,58,118,101,99,52,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,
-18,95,102,0,0,0,0,0,1,0,12,1,1,1,0,5,95,105,0,0,0,1,8,58,118,101,99,52,0,18,95,105,0,0,18,95,105,0,
-0,18,95,105,0,0,18,95,105,0,0,0,0,0,1,0,12,1,1,1,0,1,95,98,0,0,0,1,8,58,118,101,99,52,0,18,95,98,0,
-0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,6,1,1,1,0,5,95,105,0,0,0,1,8,58,105,118,101,99,
-50,0,18,95,105,0,0,18,95,105,0,0,0,0,0,1,0,6,1,1,1,0,9,95,102,0,0,0,1,8,58,105,118,101,99,50,0,18,
-95,102,0,0,18,95,102,0,0,0,0,0,1,0,6,1,1,1,0,1,95,98,0,0,0,1,8,58,105,118,101,99,50,0,18,95,98,0,0,
-18,95,98,0,0,0,0,0,1,0,7,1,1,1,0,5,95,105,0,0,0,1,8,58,105,118,101,99,51,0,18,95,105,0,0,18,95,105,
-0,0,18,95,105,0,0,0,0,0,1,0,7,1,1,1,0,9,95,102,0,0,0,1,8,58,105,118,101,99,51,0,18,95,102,0,0,18,
-95,102,0,0,18,95,102,0,0,0,0,0,1,0,7,1,1,1,0,1,95,98,0,0,0,1,8,58,105,118,101,99,51,0,18,95,98,0,0,
-18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,8,1,1,1,0,5,95,105,0,0,0,1,8,58,105,118,101,99,52,0,18,95,105,
-0,0,18,95,105,0,0,18,95,105,0,0,18,95,105,0,0,0,0,0,1,0,8,1,1,1,0,9,95,102,0,0,0,1,8,58,105,118,
-101,99,52,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,0,0,0,1,0,8,1,1,1,0,1,95,98,0,
-0,0,1,8,58,105,118,101,99,52,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,2,1,1,
-1,0,1,95,98,0,0,0,1,8,58,98,118,101,99,50,0,18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,2,1,1,1,0,9,95,102,
-0,0,0,1,8,58,98,118,101,99,50,0,18,95,102,0,0,18,95,102,0,0,0,0,0,1,0,2,1,1,1,0,5,95,105,0,0,0,1,8,
-58,98,118,101,99,50,0,18,95,105,0,0,18,95,105,0,0,0,0,0,1,0,3,1,1,1,0,1,95,98,0,0,0,1,8,58,98,118,
-101,99,51,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,3,1,1,1,0,9,95,102,0,0,0,1,8,58,98,
-118,101,99,51,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,0,0,0,1,0,3,1,1,1,0,5,95,105,0,0,0,1,8,
-58,98,118,101,99,51,0,18,95,105,0,0,18,95,105,0,0,18,95,105,0,0,0,0,0,1,0,4,1,1,1,0,1,95,98,0,0,0,
-1,8,58,98,118,101,99,52,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,18,95,98,0,0,0,0,0,1,0,4,1,1,1,0,
-9,95,102,0,0,0,1,8,58,98,118,101,99,52,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,18,95,102,0,0,0,
-0,0,1,0,4,1,1,1,0,5,95,105,0,0,0,1,8,58,98,118,101,99,52,0,18,95,105,0,0,18,95,105,0,0,18,95,105,0,
-0,18,95,105,0,0,0,0,0,1,0,13,1,1,1,0,9,95,102,0,0,0,1,8,58,109,97,116,50,0,18,95,102,0,0,17,0,48,0,
-0,0,17,0,48,0,0,0,18,95,102,0,0,0,0,0,1,0,13,1,1,1,0,5,95,105,0,0,0,1,8,58,109,97,116,50,0,18,95,
-105,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,105,0,0,0,0,0,1,0,13,1,1,1,0,1,95,98,0,0,0,1,8,58,109,97,
-116,50,0,18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,98,0,0,0,0,0,1,0,14,1,1,1,0,9,95,102,0,0,0,
-1,8,58,109,97,116,51,0,18,95,102,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,102,0,0,17,0,
-48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,102,0,0,0,0,0,1,0,14,1,1,1,0,5,95,105,0,0,0,1,8,58,109,
-97,116,51,0,18,95,105,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,105,0,0,17,0,48,0,0,0,17,
-0,48,0,0,0,17,0,48,0,0,0,18,95,105,0,0,0,0,0,1,0,14,1,1,1,0,1,95,98,0,0,0,1,8,58,109,97,116,51,0,
-18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,
-0,48,0,0,0,18,95,98,0,0,0,0,0,1,0,15,1,1,1,0,9,95,102,0,0,0,1,8,58,109,97,116,52,0,18,95,102,0,0,
-17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,102,0,0,17,0,48,0,0,0,17,0,48,0,0,0,
-17,0,48,0,0,0,17,0,48,0,0,0,18,95,102,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,
-18,95,102,0,0,0,0,0,1,0,15,1,1,1,0,5,95,105,0,0,0,1,8,58,109,97,116,52,0,18,95,105,0,0,17,0,48,0,0,
-0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,105,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,
-0,17,0,48,0,0,0,18,95,105,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,105,0,
-0,0,0,0,1,0,15,1,1,1,0,1,95,98,0,0,0,1,8,58,109,97,116,52,0,18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,
-0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,
-18,95,98,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,17,0,48,0,0,0,18,95,98,0,0,0,0,0,1,0,0,2,2,
-1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,97,100,100,0,18,97,0,0,18,97,0,0,18,98,0,
-0,0,0,1,0,9,2,30,1,1,0,9,97,0,0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,
-101,0,18,99,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,0,2,3,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,9,18,97,0,18,
-98,0,54,21,0,0,1,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,109,117,108,116,
-105,112,108,121,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,0,2,5,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,
-102,108,111,97,116,95,100,105,118,105,100,101,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,29,1,1,0,
-9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,9,18,99,0,18,97,0,20,0,8,18,99,0,18,98,0,21,0,0,1,0,
-0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,97,0,
-0,0,58,102,108,111,97,116,0,18,98,0,0,0,46,0,0,20,0,0,1,0,5,2,30,1,1,0,5,97,0,0,0,1,8,58,105,110,
-116,0,58,102,108,111,97,116,0,18,97,0,0,0,54,0,0,0,0,1,0,0,2,3,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,
-18,97,0,18,98,0,54,21,0,0,1,0,9,2,24,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,9,18,99,
-0,18,97,0,20,0,8,18,99,0,18,98,0,23,0,0,1,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,
-105,110,116,0,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,48,0,0,20,0,
-0,1,0,9,2,25,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,9,18,99,0,18,97,0,20,0,8,18,99,0,
-18,98,0,24,0,0,1,0,0,2,5,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,
-111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,49,0,0,20,0,0,1,0,0,2,2,1,0,2,10,118,
-0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,18,118,0,59,121,0,18,117,0,59,
-121,0,21,19,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
-120,0,22,18,118,0,59,121,0,18,117,0,59,121,0,22,19,0,0,1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117,0,0,
-0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,18,118,0,59,121,0,18,117,0,59,121,0,23,19,0,0,1,0,0,2,
-5,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,18,118,0,59,121,0,
-18,117,0,59,121,0,24,19,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,
-117,0,59,120,0,21,18,118,0,59,121,0,18,117,0,59,121,0,21,19,18,118,0,59,122,0,18,117,0,59,122,0,21,
-19,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,18,
-118,0,59,121,0,18,117,0,59,121,0,22,19,18,118,0,59,122,0,18,117,0,59,122,0,22,19,0,0,1,0,0,2,4,1,0,
-2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,18,118,0,59,121,0,18,
-117,0,59,121,0,23,19,18,118,0,59,122,0,18,117,0,59,122,0,23,19,0,0,1,0,0,2,5,1,0,2,11,118,0,0,1,1,
-0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,18,118,0,59,121,0,18,117,0,59,121,0,24,
-19,18,118,0,59,122,0,18,117,0,59,122,0,24,19,0,0,1,0,0,2,2,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,
-18,118,0,59,120,0,18,117,0,59,120,0,21,18,118,0,59,121,0,18,117,0,59,121,0,21,19,18,118,0,59,122,0,
-18,117,0,59,122,0,21,19,18,118,0,59,119,0,18,117,0,59,119,0,21,19,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,
-1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,18,118,0,59,121,0,18,117,0,59,121,0,22,
-19,18,118,0,59,122,0,18,117,0,59,122,0,22,19,18,118,0,59,119,0,18,117,0,59,119,0,22,19,0,0,1,0,0,2,
-4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,18,118,0,59,121,0,
-18,117,0,59,121,0,23,19,18,118,0,59,122,0,18,117,0,59,122,0,23,19,18,118,0,59,119,0,18,117,0,59,
-119,0,23,19,0,0,1,0,0,2,5,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
-120,0,24,18,118,0,59,121,0,18,117,0,59,121,0,24,19,18,118,0,59,122,0,18,117,0,59,122,0,24,19,18,
-118,0,59,119,0,18,117,0,59,119,0,24,19,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,
-0,59,120,0,18,117,0,59,120,0,21,18,118,0,59,121,0,18,117,0,59,121,0,21,19,0,0,1,0,0,2,3,1,0,2,6,
-118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,18,118,0,59,121,0,18,117,0,59,
-121,0,22,19,0,0,1,0,0,2,4,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,
-0,23,18,118,0,59,121,0,18,117,0,59,121,0,23,19,0,0,1,0,0,2,5,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,
-18,118,0,59,120,0,18,117,0,59,120,0,24,18,118,0,59,121,0,18,117,0,59,121,0,24,19,0,0,1,0,0,2,2,1,0,
-2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,18,118,0,59,121,0,18,117,
-0,59,121,0,21,19,18,118,0,59,122,0,18,117,0,59,122,0,21,19,0,0,1,0,0,2,3,1,0,2,7,118,0,0,1,1,0,7,
-117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,18,118,0,59,121,0,18,117,0,59,121,0,22,19,18,
-118,0,59,122,0,18,117,0,59,122,0,22,19,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,
-0,59,120,0,18,117,0,59,120,0,23,18,118,0,59,121,0,18,117,0,59,121,0,23,19,18,118,0,59,122,0,18,117,
-0,59,122,0,23,19,0,0,1,0,0,2,5,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
-120,0,24,18,118,0,59,121,0,18,117,0,59,121,0,24,19,18,118,0,59,122,0,18,117,0,59,122,0,24,19,0,0,1,
-0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,18,118,0,59,
-121,0,18,117,0,59,121,0,21,19,18,118,0,59,122,0,18,117,0,59,122,0,21,19,18,118,0,59,119,0,18,117,0,
-59,119,0,21,19,0,0,1,0,0,2,3,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
-120,0,22,18,118,0,59,121,0,18,117,0,59,121,0,22,19,18,118,0,59,122,0,18,117,0,59,122,0,22,19,18,
-118,0,59,119,0,18,117,0,59,119,0,22,19,0,0,1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,
-0,59,120,0,18,117,0,59,120,0,23,18,118,0,59,121,0,18,117,0,59,121,0,23,19,18,118,0,59,122,0,18,117,
-0,59,122,0,23,19,18,118,0,59,119,0,18,117,0,59,119,0,23,19,0,0,1,0,0,2,5,1,0,2,8,118,0,0,1,1,0,8,
-117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,18,118,0,59,121,0,18,117,0,59,121,0,24,19,18,
-118,0,59,122,0,18,117,0,59,122,0,24,19,18,118,0,59,119,0,18,117,0,59,119,0,24,19,0,0,1,0,0,2,2,1,0,
-2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,18,109,0,16,10,
-49,0,57,18,110,0,16,10,49,0,57,21,19,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,
-0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,19,0,0,1,
-0,10,2,24,1,1,0,13,109,0,0,1,1,0,10,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,
-8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,
-18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,0,0,0,
-1,0,13,2,24,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,
-57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,
-9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,5,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,
-16,8,48,0,57,18,110,0,16,8,48,0,57,24,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,19,0,0,1,0,
-0,2,2,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,18,
-109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,19,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,
-19,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,
-57,22,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,19,18,109,0,16,10,50,0,57,18,110,0,16,10,50,
-0,57,22,19,0,0,1,0,11,2,24,1,1,0,14,109,0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,
-120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,
-118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
-121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,
-50,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,
-109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,
-1,0,14,2,24,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,
-57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,4,
-1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,5,1,0,2,14,
-109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,18,109,0,16,10,49,0,
-57,18,110,0,16,10,49,0,57,24,19,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,19,0,0,1,0,0,2,2,
-1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,18,109,0,16,
-10,49,0,57,18,110,0,16,10,49,0,57,21,19,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,19,18,109,
-0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,19,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,
-18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,19,
-18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,19,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,
-22,19,0,0,1,0,12,2,24,1,1,0,15,109,0,0,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,
-18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,
-59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,
-48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,
-57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,
-0,16,10,51,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,
-121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,
-46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,
-57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,
-16,10,50,0,57,59,119,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,
-15,2,24,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,
-48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,
-16,10,51,0,57,48,0,0,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,
-110,0,48,20,0,0,1,0,0,2,5,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,
-16,8,48,0,57,24,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,19,18,109,0,16,10,50,0,57,18,110,
-0,16,10,50,0,57,24,19,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,19,0,0,1,0,0,2,2,1,0,2,10,
-118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,18,118,0,59,121,0,18,97,0,21,19,0,0,1,0,
-0,2,3,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,18,118,0,59,121,0,18,97,0,
-22,19,0,0,1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,18,118,0,59,
-121,0,18,97,0,23,19,0,0,1,0,0,2,5,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,
-24,18,118,0,59,121,0,18,97,0,24,19,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,
-120,0,18,97,0,21,18,118,0,59,121,0,18,97,0,21,19,18,118,0,59,122,0,18,97,0,21,19,0,0,1,0,0,2,3,1,0,
-2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,18,118,0,59,121,0,18,97,0,22,19,18,
-118,0,59,122,0,18,97,0,22,19,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,
-18,97,0,23,18,118,0,59,121,0,18,97,0,23,19,18,118,0,59,122,0,18,97,0,23,19,0,0,1,0,0,2,5,1,0,2,11,
-118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,18,118,0,59,121,0,18,97,0,24,19,18,118,0,
-59,122,0,18,97,0,24,19,0,0,1,0,0,2,2,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,
-0,21,18,118,0,59,121,0,18,97,0,21,19,18,118,0,59,122,0,18,97,0,21,19,18,118,0,59,119,0,18,97,0,21,
-19,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,18,118,0,59,
-121,0,18,97,0,22,19,18,118,0,59,122,0,18,97,0,22,19,18,118,0,59,119,0,18,97,0,22,19,0,0,1,0,0,2,4,
-1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,18,118,0,59,121,0,18,97,0,23,19,
-18,118,0,59,122,0,18,97,0,23,19,18,118,0,59,119,0,18,97,0,23,19,0,0,1,0,0,2,5,1,0,2,12,118,0,0,1,1,
-0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,18,118,0,59,121,0,18,97,0,24,19,18,118,0,59,122,0,18,
-97,0,24,19,18,118,0,59,119,0,18,97,0,24,19,0,0,1,0,0,2,2,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
-109,0,16,8,48,0,57,18,97,0,21,18,109,0,16,10,49,0,57,18,97,0,21,19,0,0,1,0,0,2,3,1,0,2,13,109,0,0,
-1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,18,109,0,16,10,49,0,57,18,97,0,22,19,0,0,1,0,
-0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,18,109,0,16,10,49,0,
-57,18,97,0,23,19,0,0,1,0,0,2,5,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,
-24,18,109,0,16,10,49,0,57,18,97,0,24,19,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,
-0,16,8,48,0,57,18,97,0,21,18,109,0,16,10,49,0,57,18,97,0,21,19,18,109,0,16,10,50,0,57,18,97,0,21,
-19,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,18,109,0,
-16,10,49,0,57,18,97,0,22,19,18,109,0,16,10,50,0,57,18,97,0,22,19,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,
-1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,18,109,0,16,10,49,0,57,18,97,0,23,19,18,109,0,
-16,10,50,0,57,18,97,0,23,19,0,0,1,0,0,2,5,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,
-57,18,97,0,24,18,109,0,16,10,49,0,57,18,97,0,24,19,18,109,0,16,10,50,0,57,18,97,0,24,19,0,0,1,0,0,
-2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,18,109,0,16,10,49,0,57,
-18,97,0,21,19,18,109,0,16,10,50,0,57,18,97,0,21,19,18,109,0,16,10,51,0,57,18,97,0,21,19,0,0,1,0,0,
-2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,18,109,0,16,10,49,0,57,
-18,97,0,22,19,18,109,0,16,10,50,0,57,18,97,0,22,19,18,109,0,16,10,51,0,57,18,97,0,22,19,0,0,1,0,0,
-2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,18,109,0,16,10,49,0,57,
-18,97,0,23,19,18,109,0,16,10,50,0,57,18,97,0,23,19,18,109,0,16,10,51,0,57,18,97,0,23,19,0,0,1,0,0,
-2,5,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,18,109,0,16,10,49,0,57,
-18,97,0,24,19,18,109,0,16,10,50,0,57,18,97,0,24,19,18,109,0,16,10,51,0,57,18,97,0,24,19,0,0,1,0,10,
-2,24,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,
-0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,
-0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,0,0,0,1,0,0,
-2,4,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,11,2,24,1,1,0,
-11,118,0,0,1,1,0,14,109,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
-120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,
-0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,
-109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,0,18,
-118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,57,59,121,
-0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,0,2,4,1,0,2,11,118,0,0,
-1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,12,2,24,1,1,0,12,118,0,0,1,1,0,15,
-109,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,
-121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,
-18,118,0,59,119,0,18,109,0,16,8,48,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,
-59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,
-10,49,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,48,46,0,18,118,0,59,
-120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,57,59,121,0,48,46,
-18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,50,0,57,
-59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,
-16,10,51,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,51,0,57,59,122,0,48,46,18,118,0,59,
-119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,15,109,0,0,0,
-1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,9,2,30,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,8,18,97,0,18,
-98,0,54,46,0,0,1,0,5,2,29,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,5,1,99,0,0,0,9,18,99,0,18,97,0,
-20,0,8,18,99,0,18,98,0,21,0,0,1,0,5,2,30,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,18,97,0,18,98,0,54,46,
-0,0,1,0,5,2,24,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,5,1,99,0,0,0,8,18,99,0,18,97,0,20,18,98,0,
-23,0,0,1,0,5,2,25,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,5,1,99,0,0,0,8,18,99,0,18,97,0,20,18,98,
-0,24,0,0,1,0,10,2,29,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,
-18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,30,1,1,0,10,118,0,0,
-1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,
-0,18,117,0,59,121,0,47,0,0,0,0,1,0,11,2,29,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,
-51,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,118,0,59,
-122,0,18,117,0,59,122,0,46,0,0,0,0,1,0,11,2,30,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,
-99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,
-59,122,0,18,117,0,59,122,0,47,0,0,0,0,1,0,12,2,29,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,
-101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,
-118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,59,119,0,46,0,0,0,0,1,0,12,2,30,1,
-1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,
-18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,18,118,0,59,119,
-0,18,117,0,59,119,0,47,0,0,0,0,1,0,6,2,29,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,
-50,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,0,0,0,1,0,6,
-2,30,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,
-120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,0,0,0,1,0,7,2,29,1,1,0,7,118,0,0,1,1,0,7,117,0,
-0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,
-59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,0,0,0,1,0,7,2,30,1,1,0,7,118,0,0,1,1,0,7,
-117,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,
-117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,0,0,0,1,0,8,2,29,1,1,0,8,118,0,0,1,1,
-0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,
-0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,59,
-119,0,46,0,0,0,0,1,0,8,2,30,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,
-59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,
-0,59,122,0,47,0,18,118,0,59,119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,13,2,29,1,1,0,13,109,0,0,1,1,0,
-13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,
-10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,13,2,30,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,
-58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,
-0,16,10,49,0,57,47,0,0,0,0,1,0,14,2,29,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,
-18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,
-0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,14,2,30,1,1,0,14,109,0,0,1,1,0,14,
-110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,
-49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,
-15,2,29,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,
-16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,
-0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,30,1,1,0,15,
-109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,
-18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,
-47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,10,2,29,1,1,0,9,97,0,0,1,1,0,10,
-117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,0,0,
-0,1,0,10,2,29,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,
-46,0,18,118,0,59,121,0,18,98,0,46,0,0,0,0,1,0,10,2,30,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,
-101,99,50,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,30,1,1,0,
-10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,
-0,18,98,0,47,0,0,0,0,1,0,10,2,24,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,
-18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,0,0,0,1,0,10,2,24,1,1,0,10,118,0,0,1,1,0,9,
-98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,0,0,
-0,1,0,10,2,25,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,
-49,0,18,97,0,18,117,0,59,121,0,49,0,0,0,0,1,0,10,2,25,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,
-101,99,50,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,0,0,0,1,0,11,2,29,1,1,0,
-9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,
-59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,0,0,0,1,0,11,2,29,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,
-8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,
-0,18,98,0,46,0,0,0,0,1,0,11,2,30,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,
-18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,
-2,30,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,47,0,18,
-118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,18,98,0,47,0,0,0,0,1,0,11,2,24,1,1,0,9,97,0,0,1,1,0,
-11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,
-18,97,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,24,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,
-99,51,0,18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,
-0,0,0,0,1,0,11,2,25,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,
-120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,0,0,0,1,0,11,2,25,1,1,0,
-11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,
-0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,0,0,0,1,0,12,2,29,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,
-1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,
-117,0,59,122,0,46,0,18,97,0,18,117,0,59,119,0,46,0,0,0,0,1,0,12,2,29,1,1,0,12,118,0,0,1,1,0,9,98,0,
-0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,
-59,122,0,18,98,0,46,0,18,118,0,59,119,0,18,98,0,46,0,0,0,0,1,0,12,2,30,1,1,0,9,97,0,0,1,1,0,12,117,
-0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,
-18,117,0,59,122,0,47,0,18,97,0,18,117,0,59,119,0,47,0,0,0,0,1,0,12,2,30,1,1,0,12,118,0,0,1,1,0,9,
-98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,
-118,0,59,122,0,18,98,0,47,0,18,118,0,59,119,0,18,98,0,47,0,0,0,0,1,0,12,2,24,1,1,0,9,97,0,0,1,1,0,
-12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,
-18,97,0,18,117,0,59,122,0,48,0,18,97,0,18,117,0,59,119,0,48,0,0,0,0,1,0,12,2,24,1,1,0,12,118,0,0,1,
-1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,
-0,18,118,0,59,122,0,18,98,0,48,0,18,118,0,59,119,0,18,98,0,48,0,0,0,0,1,0,12,2,25,1,1,0,9,97,0,0,1,
-1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,
-49,0,18,97,0,18,117,0,59,122,0,49,0,18,97,0,18,117,0,59,119,0,49,0,0,0,0,1,0,12,2,25,1,1,0,12,118,
-0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,
-0,49,0,18,118,0,59,122,0,18,98,0,49,0,18,118,0,59,119,0,18,98,0,49,0,0,0,0,1,0,13,2,29,1,1,0,9,97,
-0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,
-16,10,49,0,57,46,0,0,0,0,1,0,13,2,29,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,
-109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,13,2,30,1,1,0,9,97,0,
-0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,
-10,49,0,57,47,0,0,0,0,1,0,13,2,30,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,
-0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,13,2,24,1,1,0,9,97,0,0,1,
-1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,
-49,0,57,48,0,0,0,0,1,0,13,2,24,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,
-16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,13,2,25,1,1,0,9,97,0,0,1,1,
-0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,
-0,57,49,0,0,0,0,1,0,13,2,25,1,1,0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,
-48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,14,2,29,1,1,0,9,97,0,0,1,1,0,14,
-110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,
-46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,14,2,29,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,
-58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,
-16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,14,2,30,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,
-51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,
-50,0,57,47,0,0,0,0,1,0,14,2,30,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,
-16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,
-0,0,0,1,0,14,2,24,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,
-48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,14,
-2,24,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,
-18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,14,2,25,1,1,0,9,
-97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,
-0,16,10,49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,14,2,25,1,1,0,14,109,0,0,1,1,0,
-9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,
-0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,15,2,29,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,
-58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,
-18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,29,1,1,0,15,109,0,0,
-1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,
-18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,15,
-2,30,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,
-18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,
-0,57,47,0,0,0,0,1,0,15,2,30,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,
-48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,
-109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,15,2,24,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,
-116,52,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,
-16,10,50,0,57,48,0,18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,15,2,24,1,1,0,15,109,0,0,1,1,0,9,
-98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,
-48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,15,2,25,1,1,
-0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,
-110,0,16,10,49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,
-0,0,1,0,15,2,25,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,
-98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,
-51,0,57,18,98,0,49,0,0,0,0,1,0,6,2,29,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,
-18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,0,0,0,1,0,6,2,29,1,1,0,6,118,0,0,1,1,
-0,5,98,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,
-46,0,0,0,0,1,0,6,2,30,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,18,117,0,
-59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,0,0,0,1,0,6,2,30,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,
-58,105,118,101,99,50,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,0,0,0,1,0,6,2,
-24,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,18,117,0,59,120,0,48,0,18,
-97,0,18,117,0,59,121,0,48,0,0,0,0,1,0,6,2,24,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,
-99,50,0,18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,0,0,0,1,0,6,2,25,1,1,0,5,97,
-0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,
-59,121,0,49,0,0,0,0,1,0,6,2,25,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,99,50,0,18,118,
-0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,0,0,0,1,0,7,2,29,1,1,0,5,97,0,0,1,1,0,7,117,
-0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,
-97,0,18,117,0,59,122,0,46,0,0,0,0,1,0,7,2,29,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,
-99,51,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,
-0,0,0,0,1,0,7,2,30,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,18,117,0,59,
-120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,0,0,0,1,0,7,2,30,1,1,0,7,
-118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,
-0,18,98,0,47,0,18,118,0,59,122,0,18,98,0,47,0,0,0,0,1,0,7,2,24,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,
-8,58,105,118,101,99,51,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,
-117,0,59,122,0,48,0,0,0,0,1,0,7,2,24,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,99,51,0,
-18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,0,0,0,
-1,0,7,2,25,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,18,117,0,59,120,0,
-49,0,18,97,0,18,117,0,59,121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,0,0,0,1,0,7,2,25,1,1,0,7,118,0,
-0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,
-98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,0,0,0,1,0,8,2,29,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,
-105,118,101,99,52,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,
-59,122,0,46,0,18,97,0,18,117,0,59,119,0,46,0,0,0,0,1,0,8,2,29,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,
-58,105,118,101,99,52,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,
-122,0,18,98,0,46,0,18,118,0,59,119,0,18,98,0,46,0,0,0,0,1,0,8,2,30,1,1,0,5,97,0,0,1,1,0,8,117,0,0,
-0,1,8,58,105,118,101,99,52,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,
-18,117,0,59,122,0,47,0,18,97,0,18,117,0,59,119,0,47,0,0,0,0,1,0,8,2,30,1,1,0,8,118,0,0,1,1,0,5,98,
-0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,
-118,0,59,122,0,18,98,0,47,0,18,118,0,59,119,0,18,98,0,47,0,0,0,0,1,0,8,2,24,1,1,0,5,97,0,0,1,1,0,8,
-117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,
-18,97,0,18,117,0,59,122,0,48,0,18,97,0,18,117,0,59,119,0,48,0,0,0,0,1,0,8,2,24,1,1,0,8,118,0,0,1,1,
-0,5,98,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,
-48,0,18,118,0,59,122,0,18,98,0,48,0,18,118,0,59,119,0,18,98,0,48,0,0,0,0,1,0,8,2,25,1,1,0,5,97,0,0,
-1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,
-121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,18,97,0,18,117,0,59,119,0,49,0,0,0,0,1,0,8,2,25,1,1,0,8,
-118,0,0,1,1,0,5,98,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,
-0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,18,118,0,59,119,0,18,98,0,49,0,0,0,0,1,0,10,2,24,1,1,
-0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,
-118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,11,2,24,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,8,58,
-118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,
-18,118,0,59,122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,12,2,24,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,
-58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,
-0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,0,48,0,0,0,0,1,0,6,2,
-24,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,
-0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,7,2,24,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,
-1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,
-121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,8,2,24,1,1,0,8,118,0,0,1,1,0,8,117,0,
-0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,
-59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,0,48,0,0,
-0,0,1,0,10,2,25,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,
-117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,0,0,0,1,0,11,2,25,1,1,0,11,118,0,0,1,
-1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,
-18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,12,2,25,1,1,0,12,118,0,0,
-1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,
-0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,18,118,0,59,119,0,18,117,0,59,
-119,0,49,0,0,0,0,1,0,6,2,25,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,
-59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,0,0,0,1,0,7,2,25,1,1,0,7,
-118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,
-118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,8,2,25,1,
-1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,49,
-0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,18,118,0,59,
-119,0,18,117,0,59,119,0,49,0,0,0,0,1,0,13,2,25,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,
-116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
-0,57,49,0,0,0,0,1,0,14,2,25,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,
-8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,
-16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,15,2,25,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,
-8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,
-110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,
-18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,10,2,30,1,1,0,10,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,
-59,120,0,54,0,18,118,0,59,121,0,54,0,0,0,0,1,0,11,2,30,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,
-18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,12,2,30,1,1,0,12,
-118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,
-54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,6,2,30,1,1,0,6,118,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,
-59,120,0,54,0,18,118,0,59,121,0,54,0,0,0,0,1,0,7,2,30,1,1,0,7,118,0,0,0,1,8,58,105,118,101,99,51,0,
-18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,8,2,30,1,1,0,8,118,
-0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,
-54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,13,2,30,1,1,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,
-16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,14,2,30,1,1,0,14,109,0,0,0,1,8,58,109,97,
-116,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,
-1,0,15,2,30,1,1,0,15,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,
-0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,28,1,0,2,9,97,0,0,
-0,1,9,18,97,0,17,49,0,48,0,0,22,0,0,1,0,0,2,28,1,0,2,5,97,0,0,0,1,9,18,97,0,16,10,49,0,22,0,0,1,0,
-0,2,28,1,0,2,10,118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,0,0,1,0,0,2,28,1,0,2,11,
-118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,18,118,0,59,122,0,52,19,0,0,1,0,0,2,28,
-1,0,2,12,118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,18,118,0,59,122,0,52,19,18,118,
-0,59,119,0,52,19,0,0,1,0,0,2,28,1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,
-0,0,1,0,0,2,28,1,0,2,7,118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,18,118,0,59,122,
-0,52,19,0,0,1,0,0,2,28,1,0,2,8,118,0,0,0,1,9,18,118,0,59,120,0,52,18,118,0,59,121,0,52,19,18,118,0,
-59,122,0,52,19,18,118,0,59,119,0,52,19,0,0,1,0,0,2,28,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,
-52,18,109,0,16,10,49,0,57,52,19,0,0,1,0,0,2,28,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,18,
-109,0,16,10,49,0,57,52,19,18,109,0,16,10,50,0,57,52,19,0,0,1,0,0,2,28,1,0,2,15,109,0,0,0,1,9,18,
-109,0,16,8,48,0,57,52,18,109,0,16,10,49,0,57,52,19,18,109,0,16,10,50,0,57,52,19,18,109,0,16,10,51,
-0,57,52,19,0,0,1,0,0,2,27,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,21,0,0,1,0,0,2,27,1,0,2,5,97,
-0,0,0,1,9,18,97,0,16,10,49,0,21,0,0,1,0,0,2,27,1,0,2,10,118,0,0,0,1,9,18,118,0,59,120,0,51,18,118,
-0,59,121,0,51,19,0,0,1,0,0,2,27,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,51,18,118,0,59,121,0,51,
-19,18,118,0,59,122,0,51,19,0,0,1,0,0,2,27,1,0,2,12,118,0,0,0,1,9,18,118,0,59,120,0,51,18,118,0,59,
-121,0,51,19,18,118,0,59,122,0,51,19,18,118,0,59,119,0,51,19,0,0,1,0,0,2,27,1,0,2,6,118,0,0,0,1,9,
-18,118,0,59,120,0,51,18,118,0,59,121,0,51,19,0,0,1,0,0,2,27,1,0,2,7,118,0,0,0,1,9,18,118,0,59,120,
-0,51,18,118,0,59,121,0,51,19,18,118,0,59,122,0,51,19,0,0,1,0,0,2,27,1,0,2,8,118,0,0,0,1,9,18,118,0,
-59,120,0,51,18,118,0,59,121,0,51,19,18,118,0,59,122,0,51,19,18,118,0,59,119,0,51,19,0,0,1,0,0,2,27,
-1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,18,109,0,16,10,49,0,57,51,19,0,0,1,0,0,2,27,1,0,2,
-14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,18,109,0,16,10,49,0,57,51,19,18,109,0,16,10,50,0,57,51,
-19,0,0,1,0,0,2,27,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,18,109,0,16,10,49,0,57,51,19,18,
-109,0,16,10,50,0,57,51,19,18,109,0,16,10,51,0,57,51,19,0,0,1,0,9,2,28,1,0,2,9,97,0,0,1,1,0,5,0,0,0,
-1,3,2,0,9,1,99,0,0,0,9,18,99,0,18,97,0,20,0,9,18,97,0,52,0,8,18,99,0,0,0,1,0,5,2,28,1,0,2,5,97,0,0,
-1,1,0,5,0,0,0,1,3,2,0,5,1,99,0,0,0,9,18,99,0,18,97,0,20,0,9,18,97,0,52,0,8,18,99,0,0,0,1,0,10,2,28,
-1,0,2,10,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,
-0,0,0,0,1,0,11,2,28,1,0,2,11,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,61,0,
-18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,0,0,0,1,0,12,2,28,1,0,2,12,118,0,0,1,1,0,5,0,0,0,1,8,
-58,118,101,99,52,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,118,0,
-59,119,0,61,0,0,0,0,1,0,6,2,28,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,
-59,120,0,61,0,18,118,0,59,121,0,61,0,0,0,0,1,0,7,2,28,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,
-101,99,51,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,0,0,0,1,0,8,2,28,
-1,0,2,8,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,
-61,0,18,118,0,59,122,0,61,0,18,118,0,59,119,0,61,0,0,0,0,1,0,13,2,28,1,0,2,13,109,0,0,1,1,0,5,0,0,
-0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,14,2,28,
-1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,
-0,57,61,0,18,109,0,16,10,50,0,57,61,0,0,0,0,1,0,15,2,28,1,0,2,15,109,0,0,1,1,0,5,0,0,0,1,8,58,109,
-97,116,52,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,18,
-109,0,16,10,51,0,57,61,0,0,0,0,1,0,9,2,27,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,0,9,1,99,0,0,0,9,18,
-99,0,18,97,0,20,0,9,18,97,0,51,0,8,18,99,0,0,0,1,0,5,2,27,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,2,0,5,1,
-99,0,0,0,9,18,99,0,18,97,0,20,0,9,18,97,0,51,0,8,18,99,0,0,0,1,0,10,2,27,1,0,2,10,118,0,0,1,1,0,5,
-0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,0,0,0,1,0,11,2,27,1,0,2,
-11,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,
-118,0,59,122,0,60,0,0,0,0,1,0,12,2,27,1,0,2,12,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,52,0,18,118,
-0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,18,118,0,59,119,0,60,0,0,0,0,1,0,6,2,
-27,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,60,0,18,118,0,59,121,
-0,60,0,0,0,0,1,0,7,2,27,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,
-60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,1,0,8,2,27,1,0,2,8,118,0,0,1,1,0,5,0,0,0,
-1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,18,
-118,0,59,119,0,60,0,0,0,0,1,0,13,2,27,1,0,2,13,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,
-0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,0,14,2,27,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,
-8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,
-60,0,0,0,0,1,0,15,2,27,1,0,2,15,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,
-60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,
-1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,111,97,116,95,108,101,115,
-115,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,0,1,2,18,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,
-58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,40,0,0,1,0,1,2,19,1,1,0,9,
-97,0,0,1,1,0,9,98,0,0,0,1,8,18,98,0,18,97,0,40,0,0,1,0,1,2,19,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,
-18,98,0,18,97,0,40,0,0,1,0,1,2,21,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,8,18,97,0,18,98,0,41,18,97,0,
-18,98,0,38,32,0,0,1,0,1,2,21,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,18,97,0,18,98,0,41,18,97,0,18,98,
-0,38,32,0,0,1,0,1,2,20,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,8,18,97,0,18,98,0,40,18,97,0,18,98,0,38,
-32,0,0,1,0,1,2,20,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,18,97,0,18,98,0,40,18,97,0,18,98,0,38,32,0,0,
-1,0,1,2,12,1,1,0,1,97,0,0,1,1,0,1,98,0,0,0,1,8,18,97,0,18,98,0,39,0,0,1,0,1,2,32,1,1,0,1,97,0,0,0,
-1,8,18,97,0,15,2,48,0,38,0,0,0
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_core.gc */
+
+3,1,0,5,1,1,1,0,9,102,0,0,0,1,3,2,0,5,1,105,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,
+18,105,0,0,18,102,0,0,0,8,18,105,0,0,0,1,0,1,1,1,1,0,5,105,0,0,0,1,8,18,105,0,16,8,48,0,39,0,0,1,0,
+1,1,1,1,0,9,102,0,0,0,1,8,18,102,0,17,48,0,48,0,0,39,0,0,1,0,5,1,1,1,0,1,98,0,0,0,1,8,18,98,0,16,
+10,49,0,16,8,48,0,31,0,0,1,0,9,1,1,1,0,1,98,0,0,0,1,8,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,
+1,0,9,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,
+18,102,0,0,18,105,0,0,0,8,18,102,0,0,0,1,0,1,1,1,1,0,1,98,0,0,0,1,8,18,98,0,0,0,1,0,5,1,1,1,0,5,
+105,0,0,0,1,8,18,105,0,0,0,1,0,9,1,1,1,0,9,102,0,0,0,1,8,18,102,0,0,0,1,0,10,1,1,1,0,9,102,0,0,0,1,
+8,58,118,101,99,50,0,18,102,0,0,18,102,0,0,0,0,0,1,0,10,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,
+4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,50,0,18,
+120,0,0,0,0,0,1,0,10,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,
+0,31,0,0,0,0,1,0,11,1,1,1,0,9,102,0,0,0,1,8,58,118,101,99,51,0,18,102,0,0,18,102,0,0,18,102,0,0,0,
+0,0,1,0,11,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,
+116,0,18,120,0,0,18,105,0,0,0,8,58,118,101,99,51,0,18,120,0,0,0,0,0,1,0,11,1,1,1,0,1,98,0,0,0,1,8,
+58,118,101,99,51,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,12,1,1,1,0,9,102,0,0,0,1,8,
+58,118,101,99,52,0,18,102,0,0,18,102,0,0,18,102,0,0,18,102,0,0,0,0,0,1,0,12,1,1,1,0,5,105,0,0,0,1,
+3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,
+118,101,99,52,0,18,120,0,0,0,0,0,1,0,12,1,1,1,0,1,98,0,0,0,1,8,58,118,101,99,52,0,18,98,0,17,49,0,
+48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,6,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,50,0,18,105,0,0,
+18,105,0,0,0,0,0,1,0,6,1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,102,0,0,
+0,0,0,0,0,1,0,6,1,1,1,0,1,98,0,0,0,1,8,58,105,118,101,99,50,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,
+1,0,7,1,1,1,0,5,105,0,0,0,1,8,58,105,118,101,99,51,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,7,
+1,1,1,0,9,102,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,7,1,1,1,0,
+1,98,0,0,0,1,8,58,105,118,101,99,51,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,8,1,1,1,0,5,105,0,0,
+0,1,8,58,105,118,101,99,52,0,18,105,0,0,18,105,0,0,18,105,0,0,18,105,0,0,0,0,0,1,0,8,1,1,1,0,9,102,
+0,0,0,1,8,58,105,118,101,99,52,0,58,105,110,116,0,18,102,0,0,0,0,0,0,0,1,0,8,1,1,1,0,1,98,0,0,0,1,
+8,58,105,118,101,99,52,0,58,105,110,116,0,18,98,0,0,0,0,0,0,0,1,0,2,1,1,1,0,1,98,0,0,0,1,8,58,98,
+118,101,99,50,0,18,98,0,0,18,98,0,0,0,0,0,1,0,2,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,50,0,58,
+98,111,111,108,0,18,102,0,0,0,0,0,0,0,1,0,2,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,50,0,58,98,
+111,111,108,0,18,105,0,0,0,0,0,0,0,1,0,3,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,51,0,18,98,0,0,18,
+98,0,0,18,98,0,0,0,0,0,1,0,3,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,
+102,0,0,0,0,0,0,0,1,0,3,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,51,0,58,98,111,111,108,0,18,105,0,
+0,0,0,0,0,0,1,0,4,1,1,1,0,1,98,0,0,0,1,8,58,98,118,101,99,52,0,18,98,0,0,18,98,0,0,18,98,0,0,18,98,
+0,0,0,0,0,1,0,4,1,1,1,0,9,102,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,102,0,0,0,0,0,
+0,0,1,0,4,1,1,1,0,5,105,0,0,0,1,8,58,98,118,101,99,52,0,58,98,111,111,108,0,18,105,0,0,0,0,0,0,0,1,
+0,13,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,
+102,0,0,0,0,0,1,0,13,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,
+111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,50,0,18,120,0,0,0,0,0,1,0,13,1,1,1,0,1,98,0,0,
+0,1,8,58,109,97,116,50,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,14,1,1,1,0,9,102,0,0,
+0,1,8,58,109,97,116,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,
+17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,14,1,1,1,0,5,105,0,0,0,1,3,
+2,0,9,1,120,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,
+109,97,116,51,0,18,120,0,0,0,0,0,1,0,14,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,51,0,18,98,0,17,49,0,
+48,0,0,17,48,0,48,0,0,31,0,0,0,0,1,0,15,1,1,1,0,9,102,0,0,0,1,8,58,109,97,116,52,0,18,102,0,0,17,
+48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,
+0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,
+48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,0,0,0,1,0,15,1,1,1,0,5,105,0,0,0,1,3,2,0,9,1,120,0,0,0,4,105,
+110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,105,0,0,0,8,58,109,97,116,52,0,18,120,0,0,
+0,0,0,1,0,15,1,1,1,0,1,98,0,0,0,1,8,58,109,97,116,52,0,18,98,0,17,49,0,48,0,0,17,48,0,48,0,0,31,0,
+0,0,0,1,0,0,2,1,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,97,100,100,0,18,97,0,0,
+18,97,0,0,18,98,0,0,0,0,1,0,9,2,27,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,0,0,4,102,108,111,97,116,95,
+110,101,103,97,116,101,0,18,98,0,0,18,97,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,9,97,0,0,1,1,0,9,98,0,
+0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,
+102,108,111,97,116,95,97,100,100,0,18,97,0,0,18,97,0,0,18,99,0,0,0,0,1,0,0,2,3,1,0,2,9,97,0,0,1,1,
+0,9,98,0,0,0,1,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,97,0,0,18,97,0,0,18,98,
+0,0,0,0,1,0,0,2,4,1,0,2,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,100,105,118,105,100,
+101,0,18,97,0,0,18,97,0,0,18,98,0,0,0,0,1,0,9,2,26,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,
+0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,0,0,2,1,
+1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,97,0,0,0,
+58,102,108,111,97,116,0,18,98,0,0,0,46,0,0,20,0,0,1,0,5,2,27,1,1,0,5,97,0,0,0,1,3,2,0,9,1,120,0,0,
+0,3,2,0,5,1,98,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,102,
+108,111,97,116,95,110,101,103,97,116,101,0,18,120,0,0,18,120,0,0,0,4,102,108,111,97,116,95,116,111,
+95,105,110,116,0,18,98,0,0,18,120,0,0,0,8,18,98,0,0,0,1,0,0,2,2,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,
+9,18,97,0,18,98,0,54,21,0,0,1,0,9,2,21,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,99,0,0,0,4,102,
+108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,
+1,0,0,2,3,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,102,108,111,97,116,0,18,
+97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,48,0,0,20,0,0,1,0,9,2,22,1,1,0,9,97,0,0,1,1,0,9,98,0,
+0,0,1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,99,0,0,18,97,0,0,18,
+98,0,0,0,8,18,99,0,0,0,1,0,0,2,4,1,0,2,5,97,0,0,1,1,0,5,98,0,0,0,1,9,18,97,0,58,105,110,116,0,58,
+102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,49,0,0,20,0,0,1,0,0,2,1,1,0,2,
+10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,
+117,0,59,121,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,
+59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,10,117,
+0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,
+0,0,2,4,1,0,2,10,118,0,0,1,1,0,10,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,
+0,59,121,0,18,117,0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,
+120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,
+0,59,122,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,
+1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,
+118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,
+11,118,0,0,1,1,0,11,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,
+117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,
+12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,
+0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,
+2,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,
+121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,
+0,59,119,0,22,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,
+18,118,0,59,119,0,18,117,0,59,119,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,12,117,0,0,0,1,9,18,
+118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,
+0,18,117,0,59,122,0,24,0,9,18,118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,6,118,0,0,1,
+1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,
+21,0,0,1,0,0,2,2,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,
+18,118,0,59,121,0,18,117,0,59,121,0,22,0,0,1,0,0,2,3,1,0,2,6,118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,
+0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,0,59,121,0,23,0,0,1,0,0,2,4,1,0,2,6,
+118,0,0,1,1,0,6,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,
+0,59,121,0,24,0,0,1,0,0,2,1,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,
+120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,117,0,59,122,0,21,0,0,
+1,0,0,2,2,1,0,2,7,118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,
+0,59,121,0,18,117,0,59,121,0,22,0,9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,0,1,0,0,2,3,1,0,2,7,
+118,0,0,1,1,0,7,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,18,117,
+0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,0,1,0,0,2,4,1,0,2,7,118,0,0,1,1,0,7,117,
+0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,
+118,0,59,122,0,18,117,0,59,122,0,24,0,0,1,0,0,2,1,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,
+59,120,0,18,117,0,59,120,0,21,0,9,18,118,0,59,121,0,18,117,0,59,121,0,21,0,9,18,118,0,59,122,0,18,
+117,0,59,122,0,21,0,9,18,118,0,59,119,0,18,117,0,59,119,0,21,0,0,1,0,0,2,2,1,0,2,8,118,0,0,1,1,0,8,
+117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,22,0,9,18,118,0,59,121,0,18,117,0,59,121,0,22,0,
+9,18,118,0,59,122,0,18,117,0,59,122,0,22,0,9,18,118,0,59,119,0,18,117,0,59,119,0,22,0,0,1,0,0,2,3,
+1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,23,0,9,18,118,0,59,121,0,
+18,117,0,59,121,0,23,0,9,18,118,0,59,122,0,18,117,0,59,122,0,23,0,9,18,118,0,59,119,0,18,117,0,59,
+119,0,23,0,0,1,0,0,2,4,1,0,2,8,118,0,0,1,1,0,8,117,0,0,0,1,9,18,118,0,59,120,0,18,117,0,59,120,0,
+24,0,9,18,118,0,59,121,0,18,117,0,59,121,0,24,0,9,18,118,0,59,122,0,18,117,0,59,122,0,24,0,9,18,
+118,0,59,119,0,18,117,0,59,119,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,
+0,2,2,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,
+18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,10,2,21,1,1,0,13,109,0,0,1,1,0,10,118,0,0,
+0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,
+109,0,16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,
+59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,0,0,0,1,0,13,2,21,1,1,0,13,109,0,0,1,1,0,13,110,0,
+0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,
+0,0,0,0,1,0,0,2,3,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,
+0,2,4,1,0,2,13,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,
+18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,
+1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,
+57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,14,
+110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,
+16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,11,2,21,1,1,0,14,109,
+0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,
+18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,
+59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,
+10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,0,18,118,0,59,
+120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,
+118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,14,
+110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,
+57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,
+9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,
+109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,
+9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
+21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,
+51,0,57,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,
+8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,
+110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,12,2,21,1,1,0,
+15,109,0,0,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
+120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,
+50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,0,18,118,0,59,120,0,
+18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,
+48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,
+57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,
+0,16,10,51,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,
+121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,
+46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,
+1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,
+10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,
+0,0,2,3,1,0,2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,4,1,0,
+2,15,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,
+10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,
+109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,1,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,
+18,118,0,59,120,0,18,97,0,21,0,9,18,118,0,59,121,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,10,118,0,0,1,1,0,
+9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,
+10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,0,
+1,0,0,2,4,1,0,2,10,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,
+18,97,0,24,0,0,1,0,0,2,1,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,
+118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,0,1,0,0,2,2,1,0,2,11,118,0,0,1,1,0,9,
+97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,18,97,0,22,0,9,18,118,0,59,122,0,
+18,97,0,22,0,0,1,0,0,2,3,1,0,2,11,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,
+118,0,59,121,0,18,97,0,23,0,9,18,118,0,59,122,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,11,118,0,0,1,1,0,9,
+97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,
+18,97,0,24,0,0,1,0,0,2,1,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,21,0,9,18,
+118,0,59,121,0,18,97,0,21,0,9,18,118,0,59,122,0,18,97,0,21,0,9,18,118,0,59,119,0,18,97,0,21,0,0,1,
+0,0,2,2,1,0,2,12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,22,0,9,18,118,0,59,121,0,
+18,97,0,22,0,9,18,118,0,59,122,0,18,97,0,22,0,9,18,118,0,59,119,0,18,97,0,22,0,0,1,0,0,2,3,1,0,2,
+12,118,0,0,1,1,0,9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,23,0,9,18,118,0,59,121,0,18,97,0,23,0,9,
+18,118,0,59,122,0,18,97,0,23,0,9,18,118,0,59,119,0,18,97,0,23,0,0,1,0,0,2,4,1,0,2,12,118,0,0,1,1,0,
+9,97,0,0,0,1,9,18,118,0,59,120,0,18,97,0,24,0,9,18,118,0,59,121,0,18,97,0,24,0,9,18,118,0,59,122,0,
+18,97,0,24,0,9,18,118,0,59,119,0,18,97,0,24,0,0,1,0,0,2,1,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
+109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,13,109,0,0,
+1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,
+0,0,2,3,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,
+49,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,13,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,
+0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,1,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,
+109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,
+97,0,21,0,0,1,0,0,2,2,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,
+18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,14,109,
+0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,
+9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,14,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,
+16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,
+24,0,0,1,0,0,2,1,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,
+0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,
+0,21,0,0,1,0,0,2,2,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,
+109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,
+97,0,22,0,0,1,0,0,2,3,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,
+18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,
+18,97,0,23,0,0,1,0,0,2,4,1,0,2,15,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,
+9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,
+57,18,97,0,24,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,13,109,0,0,0,1,8,58,118,101,99,50,0,18,118,0,
+59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,
+0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,
+121,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,10,118,0,0,1,1,0,13,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,
+48,20,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,1,0,14,109,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,
+18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,
+48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,
+57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,
+0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,0,0,0,1,0,
+0,2,3,1,0,2,11,118,0,0,1,1,0,14,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,12,2,21,1,1,
+0,12,118,0,0,1,1,0,15,109,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,
+120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,
+0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,8,48,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,
+109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,
+59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,
+48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,
+57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,
+0,16,10,50,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0,48,18,118,0,59,
+121,0,18,109,0,16,10,51,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,51,0,57,59,122,0,48,
+46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,119,0,48,46,0,0,0,0,1,0,0,2,3,1,0,2,12,118,0,0,1,1,
+0,15,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,0,1,0,9,2,27,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,
+1,3,2,0,9,1,99,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,99,0,0,18,98,0,0,0,4,102,
+108,111,97,116,95,97,100,100,0,18,99,0,0,18,97,0,0,18,99,0,0,0,8,18,99,0,0,0,1,0,5,2,26,1,1,0,5,97,
+0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,
+95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,
+121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,
+108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,27,1,1,0,5,
+97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,
+111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,
+0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,110,101,103,97,116,101,0,18,121,0,0,18,121,0,0,0,
+4,102,108,111,97,116,95,97,100,100,0,18,120,0,0,18,120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,
+116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,21,1,1,0,5,97,0,0,1,1,0,5,98,
+0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,95,116,111,95,102,108,111,
+97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,121,0,0,18,98,
+0,0,0,4,102,108,111,97,116,95,109,117,108,116,105,112,108,121,0,18,120,0,0,18,120,0,0,18,121,0,0,0,
+4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,99,0,0,0,1,0,5,2,22,1,
+1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,3,2,0,9,1,120,0,0,1,1,121,0,0,0,3,2,0,5,1,99,0,0,0,4,105,110,116,
+95,116,111,95,102,108,111,97,116,0,18,120,0,0,18,97,0,0,0,4,105,110,116,95,116,111,95,102,108,111,
+97,116,0,18,121,0,0,18,98,0,0,0,4,102,108,111,97,116,95,100,105,118,105,100,101,0,18,120,0,0,18,
+120,0,0,18,121,0,0,0,4,102,108,111,97,116,95,116,111,95,105,110,116,0,18,99,0,0,18,120,0,0,0,8,18,
+99,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,
+18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,
+1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,
+0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,
+50,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,
+10,2,22,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,
+120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,11,
+117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,
+0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,
+11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,
+117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,21,1,1,0,11,118,0,0,1,
+1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,
+18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,
+1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,
+0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,
+0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,
+121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,
+59,119,0,46,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,
+0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,
+117,0,59,122,0,47,0,18,118,0,59,119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,
+1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,
+18,117,0,59,121,0,48,0,18,118,0,59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,
+0,48,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,
+120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,
+59,122,0,49,0,18,118,0,59,119,0,18,117,0,59,119,0,49,0,0,0,0,1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,6,
+117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,
+117,0,59,121,0,46,0,0,0,0,1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,
+18,118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,0,0,0,1,0,6,2,21,
+1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,
+48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,0,0,0,1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,6,117,0,0,0,1,
+8,58,105,118,101,99,50,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,
+121,0,49,0,0,0,0,1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,
+59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,118,0,59,122,0,18,117,
+0,59,122,0,46,0,0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,
+118,0,59,120,0,18,117,0,59,120,0,47,0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,
+18,117,0,59,122,0,47,0,0,0,0,1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,
+0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,59,
+122,0,18,117,0,59,122,0,48,0,0,0,0,1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,
+99,51,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,
+59,122,0,18,117,0,59,122,0,49,0,0,0,0,1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,
+101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,46,0,18,118,0,59,121,0,18,117,0,59,121,0,46,0,18,
+118,0,59,122,0,18,117,0,59,122,0,46,0,18,118,0,59,119,0,18,117,0,59,119,0,46,0,0,0,0,1,0,8,2,27,1,
+1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,47,
+0,18,118,0,59,121,0,18,117,0,59,121,0,47,0,18,118,0,59,122,0,18,117,0,59,122,0,47,0,18,118,0,59,
+119,0,18,117,0,59,119,0,47,0,0,0,0,1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,
+99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,48,0,18,118,0,59,121,0,18,117,0,59,121,0,48,0,18,118,0,
+59,122,0,18,117,0,59,122,0,48,0,18,118,0,59,119,0,18,117,0,59,119,0,48,0,0,0,0,1,0,8,2,22,1,1,0,8,
+118,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,18,117,0,59,120,0,49,0,18,
+118,0,59,121,0,18,117,0,59,121,0,49,0,18,118,0,59,122,0,18,117,0,59,122,0,49,0,18,118,0,59,119,0,
+18,117,0,59,119,0,49,0,0,0,0,1,0,13,2,26,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,
+0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,
+46,0,0,0,0,1,0,13,2,27,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,
+0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,
+22,1,1,0,13,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,
+48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,
+1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,
+0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,
+0,1,0,14,2,27,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,
+110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,
+18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,
+116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,
+1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,
+16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,
+109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,1,1,0,15,110,0,
+0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,
+18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,
+57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,22,1,1,0,15,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,
+116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,
+0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,
+51,0,57,49,0,0,0,0,1,0,10,2,26,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,
+117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,0,0,0,1,0,10,2,26,1,1,0,10,118,0,0,1,1,0,9,98,0,
+0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,0,0,0,1,0,
+10,2,27,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,47,0,18,
+97,0,18,117,0,59,121,0,47,0,0,0,0,1,0,10,2,27,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,
+50,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,0,0,0,1,0,10,2,21,1,1,0,9,97,0,
+0,1,1,0,10,117,0,0,0,1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,
+0,48,0,0,0,0,1,0,10,2,21,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,
+0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,0,0,0,1,0,10,2,22,1,1,0,9,97,0,0,1,1,0,10,117,0,0,0,
+1,8,58,118,101,99,50,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,0,0,0,1,0,10,
+2,22,1,1,0,10,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,98,0,49,0,18,
+118,0,59,121,0,18,98,0,49,0,0,0,0,1,0,11,2,26,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,
+51,0,18,97,0,18,117,0,59,120,0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,
+0,0,0,1,0,11,2,26,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,
+0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,0,0,0,1,0,11,2,27,1,1,0,9,97,
+0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,47,0,18,97,0,18,117,0,59,
+121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,
+58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,
+18,98,0,47,0,0,0,0,1,0,11,2,21,1,1,0,9,97,0,0,1,1,0,11,117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,
+117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,0,0,0,1,0,11,2,
+21,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,98,0,48,0,18,118,
+0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,0,0,0,1,0,11,2,22,1,1,0,9,97,0,0,1,1,0,11,
+117,0,0,0,1,8,58,118,101,99,51,0,18,97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,
+97,0,18,117,0,59,122,0,49,0,0,0,0,1,0,11,2,22,1,1,0,11,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,
+51,0,18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,
+0,0,0,1,0,12,2,26,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,59,120,
+0,46,0,18,97,0,18,117,0,59,121,0,46,0,18,97,0,18,117,0,59,122,0,46,0,18,97,0,18,117,0,59,119,0,46,
+0,0,0,0,1,0,12,2,26,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,
+98,0,46,0,18,118,0,59,121,0,18,98,0,46,0,18,118,0,59,122,0,18,98,0,46,0,18,118,0,59,119,0,18,98,0,
+46,0,0,0,0,1,0,12,2,27,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,117,0,
+59,120,0,47,0,18,97,0,18,117,0,59,121,0,47,0,18,97,0,18,117,0,59,122,0,47,0,18,97,0,18,117,0,59,
+119,0,47,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,
+120,0,18,98,0,47,0,18,118,0,59,121,0,18,98,0,47,0,18,118,0,59,122,0,18,98,0,47,0,18,118,0,59,119,0,
+18,98,0,47,0,0,0,0,1,0,12,2,21,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,97,0,18,
+117,0,59,120,0,48,0,18,97,0,18,117,0,59,121,0,48,0,18,97,0,18,117,0,59,122,0,48,0,18,97,0,18,117,0,
+59,119,0,48,0,0,0,0,1,0,12,2,21,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,18,118,0,
+59,120,0,18,98,0,48,0,18,118,0,59,121,0,18,98,0,48,0,18,118,0,59,122,0,18,98,0,48,0,18,118,0,59,
+119,0,18,98,0,48,0,0,0,0,1,0,12,2,22,1,1,0,9,97,0,0,1,1,0,12,117,0,0,0,1,8,58,118,101,99,52,0,18,
+97,0,18,117,0,59,120,0,49,0,18,97,0,18,117,0,59,121,0,49,0,18,97,0,18,117,0,59,122,0,49,0,18,97,0,
+18,117,0,59,119,0,49,0,0,0,0,1,0,12,2,22,1,1,0,12,118,0,0,1,1,0,9,98,0,0,0,1,8,58,118,101,99,52,0,
+18,118,0,59,120,0,18,98,0,49,0,18,118,0,59,121,0,18,98,0,49,0,18,118,0,59,122,0,18,98,0,49,0,18,
+118,0,59,119,0,18,98,0,49,0,0,0,0,1,0,13,2,26,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,13,2,26,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,
+16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,13,2,27,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,13,2,27,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,
+16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,13,2,21,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,13,2,21,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,
+16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,13,2,22,1,1,0,9,97,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,
+50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,13,2,22,1,1,
+0,13,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,
+16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,14,2,26,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,
+51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,
+50,0,57,46,0,0,0,0,1,0,14,2,26,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,
+16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,
+0,0,0,1,0,14,2,27,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,
+48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,14,
+2,27,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,
+18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,14,2,21,1,1,0,9,
+97,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,
+0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,14,109,0,0,1,1,0,
+9,98,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,
+0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,14,2,22,1,1,0,9,97,0,0,1,1,0,14,110,0,0,0,1,8,
+58,109,97,116,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,
+18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,14,2,22,1,1,0,14,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,
+51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,
+18,98,0,49,0,0,0,0,1,0,15,2,26,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,
+110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,
+97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,15,2,26,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,
+116,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,
+0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,15,2,27,1,1,0,9,97,0,0,1,1,0,15,
+110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,
+47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,15,2,27,1,1,
+0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,
+16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,
+0,0,0,1,0,15,2,21,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,
+48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,
+110,0,16,10,51,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,15,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,
+0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,
+98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,15,2,22,1,1,0,9,97,0,0,1,1,0,15,110,0,0,0,
+1,8,58,109,97,116,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,
+97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,15,2,22,1,1,0,15,
+109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,
+49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,
+1,0,6,2,26,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,6,2,26,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,46,0,0,
+1,0,6,2,27,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,6,2,27,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,47,0,0,
+1,0,6,2,21,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,6,2,21,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,48,0,0,
+1,0,6,2,22,1,1,0,5,97,0,0,1,1,0,6,117,0,0,0,1,8,58,105,118,101,99,50,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,6,2,22,1,1,0,6,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,50,0,18,98,0,0,0,49,0,0,
+1,0,7,2,26,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,7,2,26,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,46,0,0,
+1,0,7,2,27,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,7,2,27,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,47,0,0,
+1,0,7,2,21,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,7,2,21,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,48,0,0,
+1,0,7,2,22,1,1,0,5,97,0,0,1,1,0,7,117,0,0,0,1,8,58,105,118,101,99,51,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,7,2,22,1,1,0,7,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,51,0,18,98,0,0,0,49,0,0,
+1,0,8,2,26,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,46,0,0,
+1,0,8,2,26,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,46,0,0,
+1,0,8,2,27,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,47,0,0,
+1,0,8,2,27,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,47,0,0,
+1,0,8,2,21,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,48,0,0,
+1,0,8,2,21,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,48,0,0,
+1,0,8,2,22,1,1,0,5,97,0,0,1,1,0,8,117,0,0,0,1,8,58,105,118,101,99,52,0,18,97,0,0,0,18,117,0,49,0,0,
+1,0,8,2,22,1,1,0,8,118,0,0,1,1,0,5,98,0,0,0,1,8,18,118,0,58,105,118,101,99,52,0,18,98,0,0,0,49,0,0,
+1,0,10,2,27,1,1,0,10,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,
+0,0,0,0,1,0,11,2,27,1,1,0,11,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,
+121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,12,2,27,1,1,0,12,118,0,0,0,1,8,58,118,101,99,52,0,18,
+118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,
+6,2,27,1,1,0,6,118,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,
+0,0,0,1,0,7,2,27,1,1,0,7,118,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,54,0,18,118,0,59,
+121,0,54,0,18,118,0,59,122,0,54,0,0,0,0,1,0,8,2,27,1,1,0,8,118,0,0,0,1,8,58,105,118,101,99,52,0,18,
+118,0,59,120,0,54,0,18,118,0,59,121,0,54,0,18,118,0,59,122,0,54,0,18,118,0,59,119,0,54,0,0,0,0,1,0,
+13,2,27,1,1,0,13,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,
+57,54,0,0,0,0,1,0,14,2,27,1,1,0,14,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,54,0,18,
+109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,15,2,27,1,1,0,15,109,0,0,0,1,8,58,
+109,97,116,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,
+18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,22,0,0,1,
+0,0,2,25,1,0,2,5,97,0,0,0,1,9,18,97,0,16,10,49,0,22,0,0,1,0,0,2,25,1,0,2,10,118,0,0,0,1,9,18,118,0,
+59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,52,0,
+9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,12,118,0,0,0,1,9,18,118,0,59,
+120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,0,59,119,0,52,0,0,1,0,0,2,25,
+1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,0,1,0,0,2,25,1,0,2,7,118,0,0,
+0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,0,1,0,0,2,25,1,0,2,
+8,118,0,0,0,1,9,18,118,0,59,120,0,52,0,9,18,118,0,59,121,0,52,0,9,18,118,0,59,122,0,52,0,9,18,118,
+0,59,119,0,52,0,0,1,0,0,2,25,1,0,2,13,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,
+0,57,52,0,0,1,0,0,2,25,1,0,2,14,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,
+52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,
+9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,
+2,24,1,0,2,9,97,0,0,0,1,9,18,97,0,17,49,0,48,0,0,21,0,0,1,0,0,2,24,1,0,2,5,97,0,0,0,1,9,18,97,0,16,
+10,49,0,21,0,0,1,0,0,2,24,1,0,2,10,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,0,
+1,0,0,2,24,1,0,2,11,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,18,118,0,59,
+122,0,51,0,0,1,0,0,2,24,1,0,2,12,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,0,59,121,0,51,0,9,
+18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,6,118,0,0,0,1,9,18,118,0,59,120,
+0,51,0,9,18,118,0,59,121,0,51,0,0,1,0,0,2,24,1,0,2,7,118,0,0,0,1,9,18,118,0,59,120,0,51,0,9,18,118,
+0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,0,1,0,0,2,24,1,0,2,8,118,0,0,0,1,9,18,118,0,59,120,0,51,0,
+9,18,118,0,59,121,0,51,0,9,18,118,0,59,122,0,51,0,9,18,118,0,59,119,0,51,0,0,1,0,0,2,24,1,0,2,13,
+109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,0,0,2,24,1,0,2,14,109,0,
+0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,
+0,0,2,24,1,0,2,15,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,
+0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1,0,9,2,25,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,
+0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,5,2,25,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,
+2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,52,0,8,18,98,0,0,0,1,0,10,2,25,1,0,2,10,118,0,0,1,1,0,5,0,0,0,
+1,8,58,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,0,0,0,1,0,11,2,25,1,0,2,11,
+118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,
+0,59,122,0,61,0,0,0,0,1,0,12,2,25,1,0,2,12,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,
+59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,118,0,59,119,0,61,0,0,0,0,1,0,6,2,
+25,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,18,118,0,59,120,0,61,0,18,118,0,59,121,
+0,61,0,0,0,0,1,0,7,2,25,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,51,0,18,118,0,59,120,0,
+61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,0,0,0,1,0,8,2,25,1,0,2,8,118,0,0,1,1,0,5,0,0,0,
+1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,61,0,18,118,0,59,121,0,61,0,18,118,0,59,122,0,61,0,18,
+118,0,59,119,0,61,0,0,0,0,1,0,13,2,25,1,0,2,13,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,
+0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,14,2,25,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,
+8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,
+61,0,0,0,0,1,0,15,2,25,1,0,2,15,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,
+61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,
+9,2,24,1,0,2,9,97,0,0,1,1,0,5,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,1,
+0,5,2,24,1,0,2,5,97,0,0,1,1,0,5,0,0,0,1,3,2,0,5,1,98,0,2,18,97,0,0,0,9,18,97,0,51,0,8,18,98,0,0,0,
+1,0,10,2,24,1,0,2,10,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,60,0,18,118,0,
+59,121,0,60,0,0,0,0,1,0,11,2,24,1,0,2,11,118,0,0,1,1,0,5,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,
+120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,1,0,12,2,24,1,0,2,12,118,0,0,1,1,0,
+5,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,
+0,18,118,0,59,119,0,60,0,0,0,0,1,0,6,2,24,1,0,2,6,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,50,0,
+18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,0,0,0,1,0,7,2,24,1,0,2,7,118,0,0,1,1,0,5,0,0,0,1,8,
+58,105,118,101,99,51,0,18,118,0,59,120,0,60,0,18,118,0,59,121,0,60,0,18,118,0,59,122,0,60,0,0,0,0,
+1,0,8,2,24,1,0,2,8,118,0,0,1,1,0,5,0,0,0,1,8,58,105,118,101,99,52,0,18,118,0,59,120,0,60,0,18,118,
+0,59,121,0,60,0,18,118,0,59,122,0,60,0,18,118,0,59,119,0,60,0,0,0,0,1,0,13,2,24,1,0,2,13,109,0,0,1,
+1,0,5,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,
+0,14,2,24,1,0,2,14,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,60,0,18,109,
+0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,15,2,24,1,0,2,15,109,0,0,1,1,0,5,0,0,0,
+1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,
+57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,1,2,15,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,
+99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,97,0,0,18,98,0,0,0,8,18,99,0,0,0,1,
+0,1,2,15,1,1,0,5,97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,
+116,0,18,98,0,0,0,40,0,0,1,0,1,2,16,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,99,0,0,0,4,102,108,
+111,97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,0,1,2,16,1,1,0,5,
+97,0,0,1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,
+0,41,0,0,1,0,1,2,18,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,
+111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113,
+117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,18,1,1,0,5,97,0,0,
+1,1,0,5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,43,0,
+0,1,0,1,2,17,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,1,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,
+116,95,108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,
+108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,0,1,2,17,1,1,0,5,97,0,0,1,1,0,
+5,98,0,0,0,1,8,58,102,108,111,97,116,0,18,97,0,0,0,58,102,108,111,97,116,0,18,98,0,0,0,42,0,0,1,0,
+1,2,11,1,1,0,1,97,0,0,1,1,0,1,98,0,0,0,1,8,18,97,0,18,98,0,39,0,0,1,0,1,2,29,1,1,0,1,97,0,0,0,1,8,
+18,97,0,15,2,48,0,38,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,9,102,0,0,0,1,4,102,108,111,97,116,95,
+112,114,105,110,116,0,18,102,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,5,105,0,0,0,1,4,105,110,
+116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,1,98,0,0,0,1,4,98,
+111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,10,118,0,0,
+0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,
+0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,11,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,
+59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,
+118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,12,118,0,0,0,1,9,58,112,114,105,110,116,
+0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,
+116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,
+105,110,116,0,1,1,0,6,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,
+105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,7,118,0,0,0,1,9,58,112,
+114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,9,58,
+112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,8,118,0,0,0,1,
+9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,
+0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,119,
+0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,2,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,
+120,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,121,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,
+0,3,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,0,18,
+118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,0,1,0,0,0,112,114,105,110,
+116,0,1,1,0,4,118,0,0,0,1,9,58,112,114,105,110,116,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,
+116,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,
+110,116,0,18,118,0,59,119,0,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,13,109,0,0,0,1,9,58,112,
+114,105,110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,
+0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,14,109,0,0,0,1,9,58,112,114,105,110,116,0,18,109,0,16,8,
+48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,0,
+18,109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,15,109,0,0,0,1,9,58,112,114,105,
+110,116,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,49,0,57,0,0,0,9,58,
+112,114,105,110,116,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,0,18,109,0,16,10,51,0,
+57,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,16,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,
+0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,17,101,0,0,0,1,4,105,110,116,95,112,114,105,
+110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,18,101,0,0,0,1,4,105,110,116,95,112,
+114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,19,101,0,0,0,1,4,105,110,116,
+95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,20,101,0,0,0,1,4,105,
+110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,0,0,0,112,114,105,110,116,0,1,1,0,21,101,0,0,0,1,
+4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0
diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc
index b4c5aa3ec2..12a18ee792 100755
--- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc
@@ -1,72 +1,35 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
-//
+//
// TODO:
-// - implement texture1D, texture2D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
// - implement dFdx, dFdy,
-//
-
-//
-// From Shader Spec, ver. 1.10, rev. 59
-//
-// The output of the fragment shader is processed by the fixed function operations at the back end
-// of the OpenGL pipeline. Fragment shaders output values to the OpenGL pipeline using the built-in
-// variables gl_FragColor, gl_FragData and gl_FragDepth, unless the discard keyword is executed.
-//
-// These variables may be written more than once within a fragment shader. If so, the last value
-// assigned is the one used in the subsequent fixed function pipeline. The values written to these
-// variables may be read back after writing them. Reading from these variables before writing them
-// results in an undefined value. The fixed functionality computed depth for a fragment may be
-// obtained by reading gl_FragCoord.z, described below.
-//
-// Writing to gl_FragColor specifies the fragment color that will be used by the subsequent fixed
-// functionality pipeline. If subsequent fixed functionality consumes fragment color and an
-// execution of a fragment shader does not write a value to gl_FragColor then the fragment color
-// consumed is undefined.
-//
-// If the frame buffer is configured as a color index buffer then behavior is undefined when using
-// a fragment shader.
-//
-// Writing to gl_FragDepth will establish the depth value for the fragment being processed. If
-// depth buffering is enabled, and a shader does not write gl_FragDepth, then the fixed function
-// value for depth will be used as the fragment's depth value. If a shader statically assigns
-// a value to gl_FragDepth, and there is an execution path through the shader that does not set
-// gl_FragDepth, then the value of the fragment's depth may be undefined for executions of the
-// shader that take that path. That is, if a shader statically contains a write gl_FragDepth, then
-// it is responsible for always writing it.
//
-// (A shader contains a static assignment to a variable x if, after pre-processing, the shader
-// contains statement that would write x, whether or not run-time flow of control will cause
-// that statement to be executed.)
+
//
-// The variable gl_FragData is an array. Writing to gl_FragData[n] specifies the fragment data
-// that will be used by the subsequent fixed functionality pipeline for data n. If subsequent
-// fixed functionality consumes fragment data and an execution of a fragment shader does not
-// write a value to it, then the fragment data consumed is undefined.
+// From Shader Spec, ver. 1.10, rev. 59
//
-// If a shader statically assigns a value to gl_FragColor, it may not assign a value to any element
-// of gl_FragData. If a shader statically writes a value to any element of gl_FragData, it may not
-// assign a value to gl_FragColor. That is, a shader may assign values to either gl_FragColor or
-// gl_FragData, but not both.
-//
-// If a shader executes the discard keyword, the fragment is discarded, and the values of
-// gl_FragDepth, gl_FragColor and gl_FragData become irrelevant.
-//
-// The variable gl_FragCoord is available as a read-only variable from within fragment shaders
-// and it holds the window relative coordinates x, y, z, and 1/w values for the fragment. This
-// value is the result of the fixed functionality that interpolates primitives after vertex
-// processing to generate fragments. The z component is the depth value that would be used for
-// the fragment's depth if a shader contained no writes to gl_FragDepth. This is useful for
-// invariance if a shader conditionally computes gl_FragDepth but otherwise wants the fixed
-// functionality fragment depth.
-//
-// The fragment shader has access to the read-only built-in variable gl_FrontFacing whose value
-// is true if the fragment belongs to a front-facing primitive. One use of this is to emulate
-// two-sided lighting by selecting one of two colors calculated by the vertex shader.
-//
-// The built-in variables that are accessible from a fragment shader are intrinsically given types
-// as follows:
-//
__fixed_input vec4 gl_FragCoord;
__fixed_input bool gl_FrontFacing;
@@ -74,292 +37,135 @@ __fixed_output vec4 gl_FragColor;
__fixed_output vec4 gl_FragData[gl_MaxDrawBuffers];
__fixed_output float gl_FragDepth;
-//
-// However, they do not behave like variables with no qualifier; their behavior is as described
-// above. These built-in variables have global scope.
-//
-
-//
-// Unlike user-defined varying variables, the built-in varying variables don't have a strict
-// one-to-one correspondence between the vertex language and the fragment language. Two sets are
-// provided, one for each language. Their relationship is described below.
-//
-// The following varying variables are available to read from in a fragment shader. The gl_Color
-// and gl_SecondaryColor names are the same names as attributes passed to the vertex shader.
-// However, there is no name conflict, because attributes are visible only in vertex shaders
-// and the following are only visible in a fragment shader.
-//
-
varying vec4 gl_Color;
varying vec4 gl_SecondaryColor;
-varying vec4 gl_TexCoord[]; // at most will be gl_MaxTextureCoords
+varying vec4 gl_TexCoord[gl_MaxTextureCoords];
varying float gl_FogFragCoord;
-//
-// The values in gl_Color and gl_SecondaryColor will be derived automatically by the system from
-// gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and gl_BackSecondaryColor based on which
-// face is visible. If fixed functionality is used for vertex processing, then gl_FogFragCoord will
-// either be the z-coordinate of the fragment in eye space, or the interpolation of the fog
-// coordinate, as described in section 3.10 of the OpenGL 1.4 Specification. The gl_TexCoord[]
-// values are the interpolated gl_TexCoord[] values from a vertex shader or the texture coordinates
-// of any fixed pipeline based vertex functionality.
-//
-// Indices to the fragment shader gl_TexCoord array are as described above in the vertex shader
-// text.
-//
-
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
+//
// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
+//
+
+vec4 texture1D (sampler1D sampler, float coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, bias;
+ return texel;
+}
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1D (sampler1D sampler, float coord, float bias) {
- return vec4 (0.0);
-}
vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias) {
return texture1D (sampler, coord.s / coord.t, bias);
-}
+}
+
vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias) {
return texture1D (sampler, coord.s / coord.q, bias);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {
+vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, bias;
+ return texel;
+}
+
+vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {
return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), bias);
-}
-vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias) {
- return texture2D (sampler, vec2 (coord.s / coord.q, coord.s / coord.q), bias);
-}
+}
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {
- return texture3DProj (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q),
- bias);
+vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias) {
+ return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q), bias);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
+vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, bias;
+ return texel;
+}
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {
- return vec4 (0.0);
+vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {
+ return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), bias);
}
-// XXX
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {
- return vec4 (0.0);
-}
-vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);
+
+vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, bias;
+ return texel;
}
-vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {
+
+vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, bias;
+ return texel;
+}
+
+vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);
+}
+
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, bias;
+ return texel;
+}
+
+vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {
return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), bias);
}
//
// 8.8 Fragment Processing Functions
-//
-// Fragment processing functions are only available in shaders intended for use on the fragment
-// processor. Derivatives may be computationally expensive and/or numerically unstable. Therefore,
-// an OpenGL implementation may approximate the true derivatives by using a fast but not entirely
-// accurate derivative computation.
-//
-// The expected behavior of a derivative is specified using forward/backward differencing.
-//
-// Forward differencing:
-//
-// F(x+dx) - F(x) ~ dFdx(x) * dx 1a
-// dFdx(x) ~ (F(x+dx) - F(x)) / dx 1b
-//
-// Backward differencing:
-//
-// F(x-dx) - F(x) ~ -dFdx(x) * dx 2a
-// dFdx(x) ~ (F(x) - F(x-dx)) / dx 2b
-//
-// With single-sample rasterization, dx <= 1.0 in equations 1b and 2b. For multi-sample
-// rasterization, dx < 2.0 in equations 1b and 2b.
-//
-// dFdy is approximated similarly, with y replacing x.
-//
-// A GL implementation may use the above or other methods to perform the calculation, subject
-// to the following conditions:
-//
-// 1) The method may use piecewise linear approximations. Such linear approximations imply that
-// higher order derivatives, dFdx(dFdx(x)) and above, are undefined.
-//
-// 2) The method may assume that the function evaluated is continuous. Therefore derivatives within
-// the body of a non-uniform conditional are undefined.
-//
-// 3) The method may differ per fragment, subject to the constraint that the method may vary by
-// window coordinates, not screen coordinates. The invariance requirement described in section
-// 3.1 of the OpenGL 1.4 specification is relaxed for derivative calculations, because
-// the method may be a function of fragment location.
-//
-// Other properties that are desirable, but not required, are:
-//
-// 4) Functions should be evaluated within the interior of a primitive (interpolated, not
-// extrapolated).
-//
-// 5) Functions for dFdx should be evaluated while holding y constant. Functions for dFdy should
-// be evaluated while holding x constant. However, mixed higher order derivatives, like
-// dFdx(dFdy(y)) and dFdy(dFdx(x)) are undefined.
-//
-// In some implementations, varying degrees of derivative accuracy may be obtained by providing
-// GL hints (section 5.6 of the OpenGL 1.4 specification), allowing a user to make an image
-// quality versus speed tradeoff.
-//
+//
-//
-// Returns the derivative in x using local differencing for the input argument p.
-//
-// XXX
-float dFdx (float p) {
- return 0.0;
-}
-// XXX
-vec2 dFdx (vec2 p) {
- return vec2 (0.0);
+float dFdx (float p) {
+ // XXX:
+ return 0.001;
}
-// XXX
-vec3 dFdx (vec3 p) {
- return vec3 (0.0);
+
+vec2 dFdx (vec2 p) {
+ // XXX:
+ return vec2 (0.001);
}
-// XXX
-vec4 dFdx (vec4 p) {
- return vec4 (0.0);
+
+vec3 dFdx (vec3 p) {
+ // XXX:
+ return vec3 (0.001);
}
-//
-// Returns the derivative in y using local differencing for the input argument p.
-//
-// These two functions are commonly used to estimate the filter width used to anti-alias procedural
-// textures.We are assuming that the expression is being evaluated in parallel on a SIMD array so
-// that at any given point in time the value of the function is known at the grid points
-// represented by the SIMD array. Local differencing between SIMD array elements can therefore
-// be used to derive dFdx, dFdy, etc.
-//
-// XXX
-float dFdy (float p) {
- return 0.0;
+vec4 dFdx (vec4 p) {
+ // XXX:
+ return vec4 (0.001);
}
-// XXX
-vec2 dFdy (vec2 p) {
- return vec2 (0.0);
+
+float dFdy (float p) {
+ // XXX:
+ return 0.001;
}
-// XXX
-vec3 dFdy (vec3 p) {
- return vec3 (0.0);
+
+vec2 dFdy (vec2 p) {
+ // XXX:
+ return vec2 (0.001);
}
-// XXX
-vec4 dFdy (vec4 p) {
- return vec4 (0.0);
+
+vec3 dFdy (vec3 p) {
+ // XXX:
+ return vec3 (0.001);
}
-//
-// Returns the sum of the absolute derivative in x and y using local differencing for the input
-// argument p, i.e.:
-//
-// return = abs (dFdx (p)) + abs (dFdy (p));
-//
+vec4 dFdy (vec4 p) {
+ // XXX:
+ return vec4 (0.001);
+}
float fwidth (float p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}
+}
+
vec2 fwidth (vec2 p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}
+}
+
vec3 fwidth (vec3 p) {
return abs (dFdx (p)) + abs (dFdy (p));
-}
+}
+
vec4 fwidth (vec4 p) {
return abs (dFdx (p)) + abs (dFdy (p));
}
diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h
index 9a0af42144..bfc592870f 100644
--- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h
+++ b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h
@@ -1,67 +1,79 @@
-
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
-/* slang_fragment_builtin.gc */
-
-2,2,2,6,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,1,1,103,108,95,70,114,111,110,
-116,70,97,99,105,110,103,0,0,0,2,2,5,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0,2,2,5,
-12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66,117,102,
-102,101,114,115,0,0,0,2,2,5,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3,12,1,103,
-108,95,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,
-111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,4,0,2,2,3,9,1,103,108,95,70,
-111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,
-16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,
-58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,
-106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,
-115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
-111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,
-116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,
-12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,
-18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,
-0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,
-112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,
-52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,
-115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,
-116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,
-111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,18,
-99,111,111,114,100,0,59,112,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,
-101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,
-1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,
-114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,
-18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,
-0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,
-99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,
-0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,
-1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,51,
-68,80,114,111,106,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,
-59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,
-100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,
-98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,
-112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,
-52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,
-101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,
-48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,101,114,0,
-0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,
-0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,
-114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,
-49,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,
-99,111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,
-114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,
-114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,
-105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,
-101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,
-114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,
-111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,9,0,100,70,100,120,0,1,0,0,9,
-112,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,100,70,100,120,0,1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,
-0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,
-0,48,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,
-0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,100,70,100,
-121,0,1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,100,70,100,121,0,1,
-0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,100,70,100,121,0,1,0,0,12,
-112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,0,0,9,
-112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,
-0,18,112,0,0,0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,0,0,10,112,0,0,0,1,8,58,97,98,115,0,
-58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,
-0,11,0,102,119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,
-0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,
-104,0,1,0,0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,
-100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_fragment_builtin.gc */
+
+3,2,2,6,12,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,6,1,1,103,108,95,70,114,111,110,
+116,70,97,99,105,110,103,0,0,0,2,2,5,12,1,103,108,95,70,114,97,103,67,111,108,111,114,0,0,0,2,2,5,
+12,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108,95,77,97,120,68,114,97,119,66,117,102,
+102,101,114,115,0,0,0,2,2,5,9,1,103,108,95,70,114,97,103,68,101,112,116,104,0,0,0,2,2,3,12,1,103,
+108,95,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,
+111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,
+101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,
+67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,
+101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,
+101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,
+108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,
+0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,
+1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,
+68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,
+1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,
+0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
+100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,
+0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,
+120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,
+0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,
+80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,
+98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,
+58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,
+111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,
+0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,
+1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,
+68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,
+111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,
+116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,
+101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,
+108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,
+117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,
+59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,
+98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,
+112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,
+101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,
+101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,
+0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,
+118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,
+0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,
+104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,
+111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,
+112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
+113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,
+0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,
+101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,
+101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,
+112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,
+0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,
+0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,
+115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,
+114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,
+99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,
+1,0,9,0,100,70,100,120,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,120,0,
+1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,
+0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,
+0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,
+9,112,0,0,0,1,8,17,48,0,48,48,49,0,0,0,0,1,0,10,0,100,70,100,121,0,1,0,0,10,112,0,0,0,1,8,58,118,
+101,99,50,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,11,0,100,70,100,121,0,1,0,0,11,112,0,0,0,1,8,58,118,
+101,99,51,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,12,0,100,70,100,121,0,1,0,0,12,112,0,0,0,1,8,58,118,
+101,99,52,0,17,48,0,48,48,49,0,0,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,0,0,9,112,0,0,0,1,8,
+58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,
+0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,0,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,
+100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,
+119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,
+58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,0,
+0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,
+100,121,0,18,112,0,0,0,0,0,46,0,0,0
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn
index 65d7fe3532..0f15353069 100644
--- a/src/mesa/shader/slang/library/slang_shader.syn
+++ b/src/mesa/shader/slang/library/slang_shader.syn
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.2
+ * Version: 6.5
*
- * Copyright (C) 2004-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -49,7 +49,7 @@
.syntax translation_unit;
/* revision number - increment after each change affecting emitted output */
-.emtcode REVISION 2
+.emtcode REVISION 3
/* external declaration */
.emtcode EXTERNAL_NULL 0
@@ -66,38 +66,35 @@
.emtcode FUNCTION_OPERATOR 2
/* operator type */
-.emtcode OPERATOR_ASSIGN 1
-.emtcode OPERATOR_ADDASSIGN 2
-.emtcode OPERATOR_SUBASSIGN 3
-.emtcode OPERATOR_MULASSIGN 4
-.emtcode OPERATOR_DIVASSIGN 5
-/*.emtcode OPERATOR_MODASSIGN 6*/
-/*.emtcode OPERATOR_LSHASSIGN 7*/
-/*.emtcode OPERATOR_RSHASSIGN 8*/
-/*.emtcode OPERATOR_ORASSIGN 9*/
-/*.emtcode OPERATOR_XORASSIGN 10*/
-/*.emtcode OPERATOR_ANDASSIGN 11*/
-.emtcode OPERATOR_LOGICALXOR 12
-/*.emtcode OPERATOR_BITOR 13*/
-/*.emtcode OPERATOR_BITXOR 14*/
-/*.emtcode OPERATOR_BITAND 15*/
-.emtcode OPERATOR_EQUAL 16
-.emtcode OPERATOR_NOTEQUAL 17
-.emtcode OPERATOR_LESS 18
-.emtcode OPERATOR_GREATER 19
-.emtcode OPERATOR_LESSEQUAL 20
-.emtcode OPERATOR_GREATEREQUAL 21
-/*.emtcode OPERATOR_LSHIFT 22*/
-/*.emtcode OPERATOR_RSHIFT 23*/
-.emtcode OPERATOR_MULTIPLY 24
-.emtcode OPERATOR_DIVIDE 25
-/*.emtcode OPERATOR_MODULUS 26*/
-.emtcode OPERATOR_INCREMENT 27
-.emtcode OPERATOR_DECREMENT 28
-.emtcode OPERATOR_PLUS 29
-.emtcode OPERATOR_MINUS 30
-/*.emtcode OPERATOR_COMPLEMENT 31*/
-.emtcode OPERATOR_NOT 32
+.emtcode OPERATOR_ADDASSIGN 1
+.emtcode OPERATOR_SUBASSIGN 2
+.emtcode OPERATOR_MULASSIGN 3
+.emtcode OPERATOR_DIVASSIGN 4
+/*.emtcode OPERATOR_MODASSIGN 5*/
+/*.emtcode OPERATOR_LSHASSIGN 6*/
+/*.emtcode OPERATOR_RSHASSIGN 7*/
+/*.emtcode OPERATOR_ORASSIGN 8*/
+/*.emtcode OPERATOR_XORASSIGN 9*/
+/*.emtcode OPERATOR_ANDASSIGN 10*/
+.emtcode OPERATOR_LOGICALXOR 11
+/*.emtcode OPERATOR_BITOR 12*/
+/*.emtcode OPERATOR_BITXOR 13*/
+/*.emtcode OPERATOR_BITAND 14*/
+.emtcode OPERATOR_LESS 15
+.emtcode OPERATOR_GREATER 16
+.emtcode OPERATOR_LESSEQUAL 17
+.emtcode OPERATOR_GREATEREQUAL 18
+/*.emtcode OPERATOR_LSHIFT 19*/
+/*.emtcode OPERATOR_RSHIFT 20*/
+.emtcode OPERATOR_MULTIPLY 21
+.emtcode OPERATOR_DIVIDE 22
+/*.emtcode OPERATOR_MODULUS 23*/
+.emtcode OPERATOR_INCREMENT 24
+.emtcode OPERATOR_DECREMENT 25
+.emtcode OPERATOR_PLUS 26
+.emtcode OPERATOR_MINUS 27
+/*.emtcode OPERATOR_COMPLEMENT 28*/
+.emtcode OPERATOR_NOT 29
/* init declarator list */
.emtcode DECLARATOR_NONE 0
@@ -586,9 +583,14 @@ declaration_2
init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;
/*
- <function_prototype> ::= <function_declarator> ")"
+ <function_prototype> ::= <function_header> "void" ")"
+ | <function_declarator> ")"
*/
function_prototype
+ function_prototype_1 .or function_prototype_2;
+function_prototype_1
+ function_header .and "void" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;
+function_prototype_2
function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;
/*
@@ -684,7 +686,6 @@ overriden_operator
minusminus .emit OPERATOR_DECREMENT .or
minusequals .emit OPERATOR_SUBASSIGN .or
minus .emit OPERATOR_MINUS .or
- bangequals .emit OPERATOR_NOTEQUAL .or
bang .emit OPERATOR_NOT .or
starequals .emit OPERATOR_MULASSIGN .or
star .emit OPERATOR_MULTIPLY .or
@@ -698,8 +699,6 @@ overriden_operator
/*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/
/*greatergreater .emit OPERATOR_RSHIFT .or*/
greater .emit OPERATOR_GREATER .or
- equalsequals .emit OPERATOR_EQUAL .or
- equals .emit OPERATOR_ASSIGN .or
/*percentequals .emit OPERATOR_MODASSIGN .or*/
/*percent .emit OPERATOR_MODULUS .or*/
/*ampersandequals .emit OPERATOR_ANDASSIGN */
@@ -1174,16 +1173,26 @@ __asm_statement
"__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;
/*
- <asm_arguments> ::= <identifier>
- | <asm_arguments> "," <identifier>
+ <asm_arguments> ::= <asm_argument>
+ | <asm_arguments> "," <asm_argument>
note: this is an extension to the standard language specification - normally slang disallows
__asm statements
*/
asm_arguments
- variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;
+ asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;
asm_arguments_1
- comma .and variable_identifier .and .true .emit OP_END;
+ comma .and asm_argument .and .true .emit OP_END;
+
+/*
+ <asm_argument> ::= <variable_identifier>
+ | <floatconstant>
+
+note: this is an extension to the standard language specification - normally slang disallows
+ __asm statements
+*/
+asm_argument
+ variable_identifier .or floatconstant;
/*
<translation_unit> ::= <external_declaration>
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h
index 4645e1419e..62433d796f 100644
--- a/src/mesa/shader/slang/library/slang_shader_syn.h
+++ b/src/mesa/shader/slang/library/slang_shader_syn.h
@@ -1,5 +1,5 @@
".syntax translation_unit;\n"
-".emtcode REVISION 2\n"
+".emtcode REVISION 3\n"
".emtcode EXTERNAL_NULL 0\n"
".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n"
".emtcode EXTERNAL_DECLARATION 2\n"
@@ -8,25 +8,22 @@
".emtcode FUNCTION_ORDINARY 0\n"
".emtcode FUNCTION_CONSTRUCTOR 1\n"
".emtcode FUNCTION_OPERATOR 2\n"
-".emtcode OPERATOR_ASSIGN 1\n"
-".emtcode OPERATOR_ADDASSIGN 2\n"
-".emtcode OPERATOR_SUBASSIGN 3\n"
-".emtcode OPERATOR_MULASSIGN 4\n"
-".emtcode OPERATOR_DIVASSIGN 5\n"
-".emtcode OPERATOR_LOGICALXOR 12\n"
-".emtcode OPERATOR_EQUAL 16\n"
-".emtcode OPERATOR_NOTEQUAL 17\n"
-".emtcode OPERATOR_LESS 18\n"
-".emtcode OPERATOR_GREATER 19\n"
-".emtcode OPERATOR_LESSEQUAL 20\n"
-".emtcode OPERATOR_GREATEREQUAL 21\n"
-".emtcode OPERATOR_MULTIPLY 24\n"
-".emtcode OPERATOR_DIVIDE 25\n"
-".emtcode OPERATOR_INCREMENT 27\n"
-".emtcode OPERATOR_DECREMENT 28\n"
-".emtcode OPERATOR_PLUS 29\n"
-".emtcode OPERATOR_MINUS 30\n"
-".emtcode OPERATOR_NOT 32\n"
+".emtcode OPERATOR_ADDASSIGN 1\n"
+".emtcode OPERATOR_SUBASSIGN 2\n"
+".emtcode OPERATOR_MULASSIGN 3\n"
+".emtcode OPERATOR_DIVASSIGN 4\n"
+".emtcode OPERATOR_LOGICALXOR 11\n"
+".emtcode OPERATOR_LESS 15\n"
+".emtcode OPERATOR_GREATER 16\n"
+".emtcode OPERATOR_LESSEQUAL 17\n"
+".emtcode OPERATOR_GREATEREQUAL 18\n"
+".emtcode OPERATOR_MULTIPLY 21\n"
+".emtcode OPERATOR_DIVIDE 22\n"
+".emtcode OPERATOR_INCREMENT 24\n"
+".emtcode OPERATOR_DECREMENT 25\n"
+".emtcode OPERATOR_PLUS 26\n"
+".emtcode OPERATOR_MINUS 27\n"
+".emtcode OPERATOR_NOT 29\n"
".emtcode DECLARATOR_NONE 0\n"
".emtcode DECLARATOR_NEXT 1\n"
".emtcode VARIABLE_NONE 0\n"
@@ -272,6 +269,10 @@
"declaration_2\n"
" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n"
"function_prototype\n"
+" function_prototype_1 .or function_prototype_2;\n"
+"function_prototype_1\n"
+" function_header .and \"void\" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"
+"function_prototype_2\n"
" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"
"function_declarator\n"
" function_header_with_parameters .or function_header;\n"
@@ -298,7 +299,6 @@
" minusminus .emit OPERATOR_DECREMENT .or\n"
" minusequals .emit OPERATOR_SUBASSIGN .or\n"
" minus .emit OPERATOR_MINUS .or\n"
-" bangequals .emit OPERATOR_NOTEQUAL .or\n"
" bang .emit OPERATOR_NOT .or\n"
" starequals .emit OPERATOR_MULASSIGN .or\n"
" star .emit OPERATOR_MULTIPLY .or\n"
@@ -312,8 +312,6 @@
" \n"
" \n"
" greater .emit OPERATOR_GREATER .or\n"
-" equalsequals .emit OPERATOR_EQUAL .or\n"
-" equals .emit OPERATOR_ASSIGN .or\n"
" \n"
" \n"
" \n"
@@ -566,9 +564,11 @@
"__asm_statement\n"
" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n"
"asm_arguments\n"
-" variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;\n"
+" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n"
"asm_arguments_1\n"
-" comma .and variable_identifier .and .true .emit OP_END;\n"
+" comma .and asm_argument .and .true .emit OP_END;\n"
+"asm_argument\n"
+" variable_identifier .or floatconstant;\n"
"translation_unit\n"
" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"
" .loop external_declaration .and optional_space .and\n"
@@ -755,4 +755,4 @@
" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n"
"err_identifier\n"
" id_character_first .and .loop id_character_next;\n"
-""
+"" \ No newline at end of file
diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin.gc b/src/mesa/shader/slang/library/slang_vertex_builtin.gc
index 850fd2bb85..37555ebd1b 100755
--- a/src/mesa/shader/slang/library/slang_vertex_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_vertex_builtin.gc
@@ -1,63 +1,34 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
-//
-// TODO:
-// - what to do with ftransform? can it stay in the current form?
-// - implement texture1DLod, texture2DLod, texture3DLod, textureCubeLod,
-// - implement shadow1DLod, shadow2DLod,
-//
-
-//
+//
// From Shader Spec, ver. 1.10, rev. 59
-//
-// Some OpenGL operations still continue to occur in fixed functionality in between the vertex
-// processor and the fragment processor. Other OpenGL operations continue to occur in fixed
-// functionality after the fragment processor. Shaders communicate with the fixed functionality
-// of OpenGL through the use of built-in variables.
-//
-// The variable gl_Position is available only in the vertex language and is intended for writing
-// the homogeneous vertex position. All executions of a well-formed vertex shader must write
-// a value into this variable. It can be written at any time during shader execution. It may also
-// be read back by the shader after being written. This value will be used by primitive assembly,
-// clipping, culling, and other fixed functionality operations that operate on primitives after
-// vertex processing has occurred. Compilers may generate a diagnostic message if they detect
-// gl_Position is not written, or read before being written, but not all such cases are detectable.
-// Results are undefined if a vertex shader is executed and does not write gl_Position.
-//
-// The variable gl_PointSize is available only in the vertex language and is intended for a vertex
-// shader to write the size of the point to be rasterized. It is measured in pixels.
-//
-// The variable gl_ClipVertex is available only in the vertex language and provides a place for
-// vertex shaders to write the coordinate to be used with the user clipping planes. The user must
-// ensure the clip vertex and user clipping planes are defined in the same coordinate space. User
-// clip planes work properly only under linear transform. It is undefined what happens under
-// non-linear transform.
-//
-// These built-in vertex shader variables for communicating with fixed functionality are
-// intrinsically declared with the following types:
-//
-
-__fixed_output vec4 gl_Position; // must be written to
-__fixed_output float gl_PointSize; // may be written to
-__fixed_output vec4 gl_ClipVertex; // may be written to
-
-//
-// If gl_PointSize or gl_ClipVertex are not written to, their values are undefined. Any of these
-// variables can be read back by the shader after writing to them, to retrieve what was written.
-// Reading them before writing them results in undefined behavior. If they are written more than
-// once, it is the last value written that is consumed by the subsequent operations.
-//
-// These built-in variables have global scope.
-//
-
-//
-// The following attribute names are built into the OpenGL vertex language and can be used from
-// within a vertex shader to access the current values of attributes declared by OpenGL. All page
-// numbers and notations are references to the OpenGL 1.4 specification.
-//
+//
-//
-// Vertex Attributes, p. 19.
-//
+__fixed_output vec4 gl_Position;
+__fixed_output float gl_PointSize;
+__fixed_output vec4 gl_ClipVertex;
attribute vec4 gl_Color;
attribute vec4 gl_SecondaryColor;
@@ -73,190 +44,85 @@ attribute vec4 gl_MultiTexCoord6;
attribute vec4 gl_MultiTexCoord7;
attribute float gl_FogCoord;
-//
-// Unlike user-defined varying variables, the built-in varying variables don't have a strict
-// one-to-one correspondence between the vertex language and the fragment language. Two sets are
-// provided, one for each language. Their relationship is described below.
-//
-// The following built-in varying variables are available to write to in a vertex shader.
-// A particular one should be written to if any functionality in a corresponding fragment shader
-// or fixed pipeline uses it or state derived from it. Otherwise, behavior is undefined.
-//
-
varying vec4 gl_FrontColor;
varying vec4 gl_BackColor;
varying vec4 gl_FrontSecondaryColor;
varying vec4 gl_BackSecondaryColor;
-varying vec4 gl_TexCoord[]; // at most will be gl_MaxTextureCoords
+varying vec4 gl_TexCoord[gl_MaxTextureCoords];
varying float gl_FogFragCoord;
-//
-// For gl_FogFragCoord, the value written will be used as the "c" value on page 160 of the
-// OpenGL 1.4 Specification by the fixed functionality pipeline. For example, if the z-coordinate
-// of the fragment in eye space is desired as "c", then that's what the vertex shader should write
-// into gl_FogFragCoord.
-//
-// As with all arrays, indices used to subscript gl_TexCoord must either be an integral constant
-// expressions, or this array must be re-declared by the shader with a size. The size can be
-// at most gl_MaxTextureCoords. Using indexes close to 0 may aid the implementation
-// in preserving varying resources.
-//
-
-//
-// The OpenGL Shading Language defines an assortment of built-in convenience functions for scalar
-// and vector operations. Many of these built-in functions can be used in more than one type
-// of shader, but some are intended to provide a direct mapping to hardware and so are available
-// only for a specific type of shader.
-//
-// The built-in functions basically fall into three categories:
-//
-// * They expose some necessary hardware functionality in a convenient way such as accessing
-// a texture map. There is no way in the language for these functions to be emulated by a shader.
-//
-// * They represent a trivial operation (clamp, mix, etc.) that is very simple for the user
-// to write, but they are very common and may have direct hardware support. It is a very hard
-// problem for the compiler to map expressions to complex assembler instructions.
-//
-// * They represent an operation graphics hardware is likely to accelerate at some point. The
-// trigonometry functions fall into this category.
-//
-// Many of the functions are similar to the same named ones in common C libraries, but they support
-// vector input as well as the more traditional scalar input.
-//
-// Applications should be encouraged to use the built-in functions rather than do the equivalent
-// computations in their own shader code since the built-in functions are assumed to be optimal
-// (e.g., perhaps supported directly in hardware).
-//
-// User code can replace built-in functions with their own if they choose, by simply re-declaring
-// and defining the same name and argument list.
-//
-
-//
+//
// Geometric Functions
-//
-// These operate on vectors as vectors, not component-wise.
-//
-
-//
-// For vertex shaders only. This function will ensure that the incoming vertex value will be
-// transformed in a way that produces exactly the same result as would be produced by OpenGL's
-// fixed functionality transform. It is intended to be used to compute gl_Position, e.g.,
-// gl_Position = ftransform()
-// This function should be used, for example, when an application is rendering the same geometry in
-// separate passes, and one pass uses the fixed functionality path to render and another pass uses
-// programmable shaders.
-//
-
+//
+
vec4 ftransform () {
return gl_ModelViewProjectionMatrix * gl_Vertex;
}
-//
+//
// 8.7 Texture Lookup Functions
-//
-// Texture lookup functions are available to both vertex and fragment shaders. However, level
-// of detail is not computed by fixed functionality for vertex shaders, so there are some
-// differences in operation between vertex and fragment texture lookups. The functions in the table
-// below provide access to textures through samplers, as set up through the OpenGL API. Texture
-// properties such as size, pixel format, number of dimensions, filtering method, number of mip-map
-// levels, depth comparison, and so on are also defined by OpenGL API calls. Such properties are
-// taken into account as the texture is accessed via the built-in functions defined below.
-//
-// If a non-shadow texture call is made to a sampler that represents a depth texture with depth
-// comparisons turned on, then results are undefined. If a shadow texture call is made to a sampler
-// that represents a depth texture with depth comparisions turned off, the results are undefined.
-// If a shadow texture call is made to a sampler that does not represent a depth texture, then
-// results are undefined.
-//
-// In all functions below, the bias parameter is optional for fragment shaders. The bias parameter
-// is not accepted in a vertex shader. For a fragment shader, if bias is present, it is added to
-// the calculated level of detail prior to performing the texture access operation. If the bias
-// parameter is not provided, then the implementation automatically selects level of detail:
-// For a texture that is not mip-mapped, the texture is used directly. If it is mip-mapped and
-// running in a fragment shader, the LOD computed by the implementation is used to do the texture
-// lookup. If it is mip-mapped and running on the vertex shader, then the base texture is used.
-//
-// The built-ins suffixed with "Lod" are allowed only in a vertex shader. For the "Lod" functions,
-// lod is directly used as the level of detail.
-//
+//
+
+vec4 texture1DLod (sampler1D sampler, float coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex1d texel, sampler, coord, lod;
+ return texel;
+}
-//
-// Use the texture coordinate coord to do a texture lookup in the 1D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate coord.s is divided by
-// the last component of coord.
-//
-// XXX
-vec4 texture1DLod (sampler1D sampler, float coord, float lod) {
- return vec4 (0.0);
-}
vec4 texture1DProjLod (sampler1D sampler, vec2 coord, float lod) {
return texture1DLod (sampler, coord.s / coord.t, lod);
-}
+}
+
vec4 texture1DProjLod (sampler1D sampler, vec4 coord, float lod) {
return texture1DLod (sampler, coord.s / coord.q, lod);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate (coord.s, coord.t) is
-// divided by the last component of coord. The third component of coord is ignored for the vec4
-// coord variant.
-//
-// XXX
-vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod) {
- return vec4 (0.0);
-}
-vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod) {
+vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex2d texel, sampler, coord, lod;
+ return texel;
+}
+
+vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod) {
return texture2DLod (sampler, vec2 (coord.s / coord.p, coord.t / coord.p), lod);
-}
-vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod) {
+}
+
+vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod) {
return texture2DLod (sampler, vec2 (coord.s / coord.q, coord.t / coord.q), lod);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound
-// to sampler. For the projective ("Proj") versions, the texture coordinate is divided by coord.q.
-//
-// XXX
-vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod) {
- return vec4 (0.0);
+vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_tex3d texel, sampler, coord, lod;
+ return texel;
}
-vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod) {
- return texture3DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.s / coord.q),
- lod);
+vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod) {
+ return texture3DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), lod);
}
-//
-// Use the texture coordinate coord to do a texture lookup in the cube map texture currently bound
-// to sampler. The direction of coord is used to select which face to do a 2-dimensional texture
-// lookup in, as described in section 3.8.6 in version 1.4 of the OpenGL specification.
-//
-// XXX
-vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod) {
- return vec4 (0.0);
+vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_texcube texel, sampler, coord, lod;
+ return texel;
}
-//
-// Use texture coordinate coord to do a depth comparison lookup on the depth texture bound
-// to sampler, as described in section 3.8.14 of version 1.4 of the OpenGL specification. The 3rd
-// component of coord (coord.p) is used as the R value. The texture bound to sampler must be a
-// depth texture, or results are undefined. For the projective ("Proj") version of each built-in,
-// the texture coordinate is divide by coord.q, giving a depth value R of coord.p/coord.q. The
-// second component of coord is ignored for the "1D" variants.
-//
-// XXX
-vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod) {
- return vec4 (0.0);
+vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_shad1d texel, sampler, coord, lod;
+ return texel;
}
-// XXX
-vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod) {
- return vec4 (0.0);
-}
-vec4 shadow1DProjLod (sampler1DShadow sampler, vec4 coord, float lod) {
- return shadow1DLod (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), lod);
-}
-vec4 shadow2DProjLod (sampler2DShadow sampler, vec4 coord, float lod) {
- return shadow2DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q),
- lod);
+
+vec4 shadow1DProjLod (sampler1DShadow sampler, vec4 coord, float lod) {
+ return shadow1DLod (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), lod);
+}
+
+vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod) {
+ vec4 texel;
+ __asm vec4_shad2d texel, sampler, coord, lod;
+ return texel;
+}
+
+vec4 shadow2DProjLod (sampler2DShadow sampler, vec4 coord, float lod) {
+ return shadow2DLod (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q), lod);
}
diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
index cfc171c455..62e081957f 100644
--- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
+++ b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
@@ -1,66 +1,78 @@
-
-/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
-/* slang_vertex_builtin.gc */
-
-2,2,2,5,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,9,1,103,108,95,80,111,105,110,
-116,83,105,122,101,0,0,0,2,2,5,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2,2,2,
-12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,
-111,108,111,114,0,0,0,2,2,2,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,12,1,103,108,95,86,
-101,114,116,101,120,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,
-48,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,2,12,
-1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,12,1,103,108,95,77,
-117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,
-101,120,67,111,111,114,100,52,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,
-114,100,53,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2,
-2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,2,9,1,103,108,95,
-70,111,103,67,111,111,114,100,0,0,0,2,2,3,12,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,
-0,0,2,2,3,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,70,114,111,
-110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,66,97,99,
-107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,
-111,111,114,100,0,4,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,
-12,0,102,116,114,97,110,115,102,111,114,109,0,0,1,8,18,103,108,95,77,111,100,101,108,86,105,101,
-119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,18,103,108,95,86,101,114,116,101,
-120,0,48,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,0,0,16,115,97,109,112,108,
-101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,118,101,99,52,0,17,48,
-0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,0,0,16,
-115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,
-116,101,120,116,117,114,101,49,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,
-100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,
-116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,
-99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,
-100,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,
-59,113,0,49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,0,
-0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,
-58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,
-106,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,
-108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,115,97,109,112,108,101,
-114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,
-18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,18,108,111,100,0,0,0,0,
-0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,0,0,17,115,97,109,112,
-108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,
-117,114,101,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,
-114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,
-111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,
-51,68,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,
-108,111,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,
-101,51,68,80,114,111,106,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
-114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,76,111,100,0,18,115,
-97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,
-100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,
-111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,
-12,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,0,0,19,115,97,109,112,108,101,114,0,
-0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,
-0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,
-1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,
-0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,
-0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,
-0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,0,0,20,115,97,109,112,108,
-101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,100,111,
-119,49,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,
-0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,
-18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,
-50,68,80,114,111,106,76,111,100,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,
-100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,100,111,119,50,68,76,111,100,0,18,115,97,109,
-112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,
-113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,
-114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,0
+
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */
+/* slang_vertex_builtin.gc */
+
+3,2,2,5,12,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,5,9,1,103,108,95,80,111,105,110,
+116,83,105,122,101,0,0,0,2,2,5,12,1,103,108,95,67,108,105,112,86,101,114,116,101,120,0,0,0,2,2,2,
+12,1,103,108,95,67,111,108,111,114,0,0,0,2,2,2,12,1,103,108,95,83,101,99,111,110,100,97,114,121,67,
+111,108,111,114,0,0,0,2,2,2,11,1,103,108,95,78,111,114,109,97,108,0,0,0,2,2,2,12,1,103,108,95,86,
+101,114,116,101,120,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,
+48,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,2,12,
+1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,2,12,1,103,108,95,77,
+117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,
+101,120,67,111,111,114,100,52,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,
+114,100,53,0,0,0,2,2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,54,0,0,0,2,
+2,2,12,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,55,0,0,0,2,2,2,9,1,103,108,95,
+70,111,103,67,111,111,114,100,0,0,0,2,2,3,12,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,
+0,0,2,2,3,12,1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,70,114,111,
+110,116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,66,97,99,
+107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,
+111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,
+0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0,1,0,12,0,102,116,114,97,
+110,115,102,111,114,109,0,0,1,8,18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,
+99,116,105,111,110,77,97,116,114,105,120,0,18,103,108,95,86,101,114,116,101,120,0,48,0,0,1,0,12,0,
+116,101,120,116,117,114,101,49,68,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,9,99,
+111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,
+52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,
+114,101,49,68,80,114,111,106,76,111,100,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,
+49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,
+0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,
+0,1,8,58,116,101,120,116,117,114,101,49,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,18,99,
+111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,108,111,100,0,0,0,0,0,1,0,12,0,
+116,101,120,116,117,114,101,50,68,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,
+111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,
+52,95,116,101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,
+114,101,50,68,80,114,111,106,76,111,100,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,
+115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,
+114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,
+18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,
+0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,
+8,58,116,101,120,116,117,114,101,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,
+99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,
+100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,116,101,
+120,116,117,114,101,51,68,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,
+116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,
+114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,
+101,51,68,80,114,111,106,76,111,100,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,76,111,100,0,18,115,
+97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,
+111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,
+12,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,0,0,19,115,97,109,112,108,101,114,0,
+0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,
+4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,
+101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,
+115,104,97,100,111,119,49,68,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,
+111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,
+95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,
+111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,
+119,49,68,80,114,111,106,76,111,100,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,
+114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,76,111,100,0,18,115,97,
+109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,
+0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,108,111,100,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,76,111,100,0,1,0,0,21,115,
+97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,3,2,0,12,1,
+116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,108,111,100,0,0,0,8,18,116,101,120,101,
+108,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,0,0,21,115,97,109,
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,108,111,100,0,0,0,1,8,58,115,104,97,
+100,111,119,50,68,76,111,100,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,
+114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,
+111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,
+49,0,0,0,18,108,111,100,0,0,0,0,0,0
diff --git a/src/mesa/shader/slang/slang_analyse.c b/src/mesa/shader/slang/slang_analyse.c
new file mode 100644
index 0000000000..164dbec350
--- /dev/null
+++ b/src/mesa/shader/slang/slang_analyse.c
@@ -0,0 +1,100 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_analyse.c
+ * slang assembly code analysis
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_analyse.h"
+#include "slang_utility.h"
+
+GLboolean _slang_analyse_texture_usage (slang_program *prog)
+{
+ GLuint i, count = 0;
+
+ slang_texture_usages_dtr (&prog->texture_usage);
+ slang_texture_usages_ctr (&prog->texture_usage);
+
+ /*
+ * We could do a full code analysis to find out which uniforms are actually used.
+ * For now, we are very conservative and extract them from uniform binding table, which
+ * in turn also do not come from code analysis.
+ */
+
+ for (i = 0; i < prog->uniforms.count; i++)
+ {
+ slang_uniform_binding *b = &prog->uniforms.table[i];
+
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && b->quant->structure == NULL)
+ {
+ switch (b->quant->u.basic_type)
+ {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ count++;
+ break;
+ }
+ }
+ }
+
+ if (count == 0)
+ return GL_TRUE;
+ prog->texture_usage.table = (slang_texture_usage *) slang_alloc_malloc (
+ count * sizeof (slang_texture_usage));
+ if (prog->texture_usage.table == NULL)
+ return GL_FALSE;
+ prog->texture_usage.count = count;
+
+ for (count = i = 0; i < prog->uniforms.count; i++)
+ {
+ slang_uniform_binding *b = &prog->uniforms.table[i];
+
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && b->quant->structure == NULL)
+ {
+ switch (b->quant->u.basic_type)
+ {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ prog->texture_usage.table[count].quant = b->quant;
+ prog->texture_usage.table[count].frag_address = b->address[SLANG_SHADER_FRAGMENT];
+ count++;
+ break;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/shader/slang/slang_analyse.h b/src/mesa/shader/slang/slang_analyse.h
new file mode 100644
index 0000000000..89814b3cc3
--- /dev/null
+++ b/src/mesa/shader/slang/slang_analyse.h
@@ -0,0 +1,50 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_ANALYSE_H
+#define SLANG_ANALYSE_H
+
+#include "slang_link.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Texture usage analysis is a bit more difficult than for fragment programs. While fragment
+ * programs statically link to texture targets and texture units, shaders statically link
+ * only to texture targets. The texture unit linkage is determined just before the execution
+ * of a given primitive by reading active uniform samplers.
+ *
+ * This procedure retrieves a list of uniforms that reach texture sample instructions.
+ */
+
+GLboolean _slang_analyse_texture_usage (slang_program *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c
index 6f928d7378..b7904b72fe 100644
--- a/src/mesa/shader/slang/slang_assemble.c
+++ b/src/mesa/shader/slang/slang_assemble.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,171 +29,210 @@
*/
#include "imports.h"
-#include "slang_utility.h"
#include "slang_assemble.h"
#include "slang_compile.h"
#include "slang_storage.h"
-#include "slang_assemble_constructor.h"
-#include "slang_assemble_typeinfo.h"
-#include "slang_assemble_conditional.h"
-#include "slang_assemble_assignment.h"
/* slang_assembly */
-static void slang_assembly_construct (slang_assembly *assem)
+static GLboolean slang_assembly_construct (slang_assembly *assem)
{
assem->type = slang_asm_none;
+ return GL_TRUE;
}
-static void slang_assembly_destruct (slang_assembly *assem)
+static GLvoid slang_assembly_destruct (slang_assembly *assem)
{
}
/* slang_assembly_file */
-void slang_assembly_file_construct (slang_assembly_file *file)
+GLboolean slang_assembly_file_construct (slang_assembly_file *file)
{
file->code = NULL;
file->count = 0;
+ file->capacity = 0;
+ return GL_TRUE;
}
-void slang_assembly_file_destruct (slang_assembly_file *file)
+GLvoid slang_assembly_file_destruct (slang_assembly_file *file)
{
- unsigned int i;
+ GLuint i;
for (i = 0; i < file->count; i++)
- slang_assembly_destruct (file->code + i);
+ slang_assembly_destruct (&file->code[i]);
slang_alloc_free (file->code);
}
-static int slang_assembly_file_push_new (slang_assembly_file *file)
+static GLboolean push_new (slang_assembly_file *file)
{
- file->code = (slang_assembly *) slang_alloc_realloc (file->code, file->count * sizeof (
- slang_assembly), (file->count + 1) * sizeof (slang_assembly));
- if (file->code != NULL)
+ if (file->count == file->capacity)
{
- slang_assembly_construct (file->code + file->count);
- file->count++;
- return 1;
+ GLuint n;
+
+ if (file->capacity == 0)
+ n = 256;
+ else
+ n = file->capacity * 2;
+ file->code = (slang_assembly *) slang_alloc_realloc (file->code,
+ file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly));
+ if (file->code == NULL)
+ return GL_FALSE;
+ file->capacity = n;
}
- return 0;
+ if (!slang_assembly_construct (&file->code[file->count]))
+ return GL_FALSE;
+ file->count++;
+ return GL_TRUE;
}
-static int slang_assembly_file_push_general (slang_assembly_file *file, slang_assembly_type type,
- GLfloat literal, GLuint label, GLuint size)
+static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal,
+ GLuint label, GLuint size)
{
slang_assembly *assem;
- if (!slang_assembly_file_push_new (file))
- return 0;
- assem = file->code + file->count - 1;
+
+ if (!push_new (file))
+ return GL_FALSE;
+ assem = &file->code[file->count - 1];
assem->type = type;
assem->literal = literal;
assem->param[0] = label;
assem->param[1] = size;
- return 1;
+ return GL_TRUE;
}
-int slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)
+GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)
{
- return slang_assembly_file_push_general (file, type, (GLfloat) 0, 0, 0);
+ return push_gen (file, type, (GLfloat) 0, 0, 0);
}
-int slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,
+GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,
GLuint label)
{
- return slang_assembly_file_push_general (file, type, (GLfloat) 0, label, 0);
+ return push_gen (file, type, (GLfloat) 0, label, 0);
}
-int slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,
+GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,
GLuint label1, GLuint label2)
{
- return slang_assembly_file_push_general (file, type, (GLfloat) 0, label1, label2);
+ return push_gen (file, type, (GLfloat) 0, label1, label2);
}
-int slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,
+GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,
GLfloat literal)
{
- return slang_assembly_file_push_general (file, type, literal, 0, 0);
+ return push_gen (file, type, literal, 0, 0);
+}
+
+#define PUSH slang_assembly_file_push
+#define PLAB slang_assembly_file_push_label
+#define PLAB2 slang_assembly_file_push_label2
+#define PLIT slang_assembly_file_push_literal
+
+/* slang_assembly_file_restore_point */
+
+GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file,
+ slang_assembly_file_restore_point *point)
+{
+ point->count = file->count;
+ return GL_TRUE;
+}
+
+GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file,
+ slang_assembly_file_restore_point *point)
+{
+ GLuint i;
+
+ for (i = point->count; i < file->count; i++)
+ slang_assembly_destruct (&file->code[i]);
+ file->count = point->count;
+ return GL_TRUE;
}
/* utility functions */
-static int sizeof_variable (slang_type_specifier *spec, slang_type_qualifier qual,
- slang_operation *array_size, slang_assembly_name_space *space, unsigned int *size)
+static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec,
+ slang_type_qualifier qual, GLuint array_len, GLuint *size)
{
slang_storage_aggregate agg;
- slang_storage_aggregate_construct (&agg);
- if (!_slang_aggregate_variable (&agg, spec, array_size, space->funcs, space->structs))
+ /* calculate the size of the variable's aggregate */
+ if (!slang_storage_aggregate_construct (&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
{
slang_storage_aggregate_destruct (&agg);
- return 0;
+ return GL_FALSE;
}
*size += _slang_sizeof_aggregate (&agg);
+ slang_storage_aggregate_destruct (&agg);
+
+ /* for reference variables consider the additional address overhead */
if (qual == slang_qual_out || qual == slang_qual_inout)
*size += 4;
- slang_storage_aggregate_destruct (&agg);
- return 1;
+
+ return GL_TRUE;
}
-static int sizeof_variable2 (slang_variable *var, slang_assembly_name_space *space,
- unsigned int *size)
+static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size)
{
var->address = *size;
if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout)
var->address += 4;
- return sizeof_variable (&var->type.specifier, var->type.qualifier, var->array_size, space,
- size);
+ return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size);
}
-static int sizeof_variables (slang_variable_scope *vars, unsigned int start, unsigned int stop,
- slang_assembly_name_space *space, unsigned int *size)
+static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start,
+ GLuint stop, GLuint *size)
{
- unsigned int i;
+ GLuint i;
for (i = start; i < stop; i++)
- if (!sizeof_variable2 (vars->variables + i, space, size))
- return 0;
- return 1;
+ if (!sizeof_variable2 (A, &vars->variables[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
-static int collect_locals (slang_operation *op, slang_assembly_name_space *space,
- unsigned int *size)
+static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size)
{
- unsigned int i;
+ GLuint i;
- if (!sizeof_variables (op->locals, 0, op->locals->num_variables, space, size))
- return 0;
+ if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size))
+ return GL_FALSE;
for (i = 0; i < op->num_children; i++)
- if (!collect_locals (op->children + i, space, size))
- return 0;
- return 1;
+ if (!collect_locals (A, &op->children[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
/* _slang_locate_function() */
-slang_function *_slang_locate_function (const char *name, slang_operation *params,
- unsigned int num_params, slang_assembly_name_space *space)
+slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name,
+ slang_operation *params, GLuint num_params, slang_assembly_name_space *space,
+ slang_atom_pool *atoms)
{
- unsigned int i;
+ GLuint i;
- for (i = 0; i < space->funcs->num_functions; i++)
+ for (i = 0; i < funcs->num_functions; i++)
{
- unsigned int j;
- slang_function *f = space->funcs->functions + i;
+ GLuint j;
+ slang_function *f = &funcs->functions[i];
- if (slang_string_compare (name, f->header.name) != 0)
+ if (a_name != f->header.a_name)
continue;
if (f->param_count != num_params)
continue;
for (j = 0; j < num_params; j++)
{
slang_assembly_typeinfo ti;
- slang_assembly_typeinfo_construct (&ti);
- if (!_slang_typeof_operation (params + j, space, &ti))
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return NULL;
+ if (!_slang_typeof_operation_ (&params[j], space, &ti, atoms))
{
slang_assembly_typeinfo_destruct (&ti);
- return 0;
+ return NULL;
}
if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier))
{
@@ -201,665 +240,1028 @@ slang_function *_slang_locate_function (const char *name, slang_operation *param
break;
}
slang_assembly_typeinfo_destruct (&ti);
+
/* "out" and "inout" formal parameter requires the actual parameter to be l-value */
if (!ti.can_be_referenced &&
- (f->parameters->variables[j].type.qualifier == slang_qual_out ||
- f->parameters->variables[j].type.qualifier == slang_qual_inout))
+ (f->parameters->variables[j].type.qualifier == slang_qual_out ||
+ f->parameters->variables[j].type.qualifier == slang_qual_inout))
break;
}
if (j == num_params)
return f;
}
- if (space->funcs->outer_scope != NULL)
- {
- slang_assembly_name_space my_space = *space;
- my_space.funcs = space->funcs->outer_scope;
- return _slang_locate_function (name, params, num_params, &my_space);
- }
+ if (funcs->outer_scope != NULL)
+ return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms);
return NULL;
}
/* _slang_assemble_function() */
-int _slang_assemble_function (slang_assembly_file *file, slang_function *fun,
- slang_assembly_name_space *space)
+GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun)
{
- unsigned int param_size, local_size;
- unsigned int skip, cleanup;
- slang_assembly_flow_control flow;
- slang_assembly_local_info info;
- slang_assembly_stack_info stk;
+ GLuint param_size, local_size;
+ GLuint skip, cleanup;
- fun->address = file->count;
+ fun->address = A->file->count;
if (fun->body == NULL)
{
- /* TODO: jump to the actual function body */
- return 1;
+ /* jump to the actual function body - we do not know it, so add the instruction
+ * to fixup table */
+ fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table,
+ fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint));
+ if (fun->fixups.table == NULL)
+ return GL_FALSE;
+ fun->fixups.table[fun->fixups.count] = fun->address;
+ fun->fixups.count++;
+ if (!PUSH (A->file, slang_asm_jump))
+ return GL_FALSE;
+ return GL_TRUE;
+ }
+ else
+ {
+ GLuint i;
+
+ /* resolve all fixup table entries and delete it */
+ for (i = 0; i < fun->fixups.count; i++)
+ A->file->code[fun->fixups.table[i]].param[0] = fun->address;
+ slang_fixup_table_free (&fun->fixups);
}
- /* calculate return value and parameters size */
+ /* At this point traverse function formal parameters and code to calculate
+ * total memory size to be allocated on the stack.
+ * During this process the variables will be assigned local addresses to
+ * reference them in the code.
+ * No storage optimizations are performed so exclusive scopes are not detected and shared. */
+
+ /* calculate return value size */
param_size = 0;
if (fun->header.type.specifier.type != slang_spec_void)
- if (!sizeof_variable (&fun->header.type.specifier, slang_qual_none, NULL, space,
- &param_size))
- return 0;
- info.ret_size = param_size;
- if (!sizeof_variables (fun->parameters, 0, fun->param_count, space, &param_size))
- return 0;
-
- /* calculate local variables size, take into account the four-byte return address and
- temporaries for various tasks */
- info.addr_tmp = param_size + 4;
- info.swizzle_tmp = param_size + 4 + 4;
+ if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &param_size))
+ return GL_FALSE;
+ A->local.ret_size = param_size;
+
+ /* calculate formal parameter list size */
+ if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, &param_size))
+ return GL_FALSE;
+
+ /* calculate local variables size - take into account the four-byte return address and
+ * temporaries for various tasks (4 for addr and 16 for swizzle temporaries).
+ * these include variables from the formal parameter scope and from the code */
+ A->local.addr_tmp = param_size + 4;
+ A->local.swizzle_tmp = param_size + 4 + 4;
local_size = param_size + 4 + 4 + 16;
- if (!sizeof_variables (fun->parameters, fun->param_count, fun->parameters->num_variables, space,
- &local_size))
- return 0;
- if (!collect_locals (fun->body, space, &local_size))
- return 0;
+ if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
+ &local_size))
+ return GL_FALSE;
+ if (!collect_locals (A, fun->body, &local_size))
+ return GL_FALSE;
/* allocate local variable storage */
- if (!slang_assembly_file_push_label (file, slang_asm_local_alloc, local_size - param_size - 4))
- return 0;
+ if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4))
+ return GL_FALSE;
/* mark a new frame for function variable storage */
- if (!slang_assembly_file_push_label (file, slang_asm_enter, local_size))
- return 0;
+ if (!PLAB (A->file, slang_asm_enter, local_size))
+ return GL_FALSE;
- /* skip the cleanup jump */
- skip = file->count;
- if (!slang_assembly_file_push_new (file))
- return 0;
- file->code[skip].type = slang_asm_jump;
+ /* jump directly to the actual code */
+ skip = A->file->count;
+ if (!push_new (A->file))
+ return GL_FALSE;
+ A->file->code[skip].type = slang_asm_jump;
/* all "return" statements will be directed here */
- flow.function_end = file->count;
- cleanup = file->count;
- if (!slang_assembly_file_push_new (file))
- return 0;
- file->code[cleanup].type = slang_asm_jump;
+ A->flow.function_end = A->file->count;
+ cleanup = A->file->count;
+ if (!push_new (A->file))
+ return GL_FALSE;
+ A->file->code[cleanup].type = slang_asm_jump;
/* execute the function body */
- file->code[skip].param[0] = file->count;
- if (!_slang_assemble_operation (file, fun->body, 0, &flow, space, &info, &stk))
- return 0;
+ A->file->code[skip].param[0] = A->file->count;
+ if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid))
+ return GL_FALSE;
/* this is the end of the function - restore the old function frame */
- file->code[cleanup].param[0] = file->count;
- if (!slang_assembly_file_push (file, slang_asm_leave))
- return 0;
+ A->file->code[cleanup].param[0] = A->file->count;
+ if (!PUSH (A->file, slang_asm_leave))
+ return GL_FALSE;
/* free local variable storage */
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, local_size - param_size - 4))
- return 0;
+ if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* return from the function */
+ if (!PUSH (A->file, slang_asm_return))
+ return GL_FALSE;
- /* jump out of the function */
- if (!slang_assembly_file_push (file, slang_asm_return))
- return 0;
- return 1;
+ return GL_TRUE;
}
-int _slang_cleanup_stack (slang_assembly_file *file, slang_operation *op, int ref,
- slang_assembly_name_space *space)
+GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op)
{
slang_assembly_typeinfo ti;
- unsigned int size;
+ GLuint size = 0;
- slang_assembly_typeinfo_construct (&ti);
- if (!_slang_typeof_operation (op, space, &ti))
+ /* get type info of the operation and calculate its size */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
{
slang_assembly_typeinfo_destruct (&ti);
- return 0;
+ return GL_FALSE;
}
- if (ti.spec.type == slang_spec_void)
- size = 0;
- else if (ref)
- size = 4;
- else
- {
- size = 0;
- if (!sizeof_variable (&ti.spec, slang_qual_none, NULL, space, &size))
+ if (ti.spec.type != slang_spec_void) {
+ if (A->ref == slang_ref_force) {
+ size = 4;
+ }
+ else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size))
{
slang_assembly_typeinfo_destruct (&ti);
- return 0;
+ return GL_FALSE;
}
}
slang_assembly_typeinfo_destruct (&ti);
+
+ /* if nonzero, free it from the stack */
if (size != 0)
{
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, size))
- return 0;
+ if (!PLAB (A->file, slang_asm_local_free, size))
+ return GL_FALSE;
}
- return 1;
+
+ return GL_TRUE;
}
/* _slang_assemble_operation() */
-/* XXX: general swizzle! */
-static int dereference_aggregate (slang_assembly_file *file, const slang_storage_aggregate *agg,
- unsigned int index, unsigned int *size, slang_assembly_local_info *info)
+static GLboolean dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *size, slang_swizzle *swz, GLboolean is_swizzled)
{
- unsigned int i;
+ GLuint i;
for (i = agg->count; i > 0; i--)
{
- const slang_storage_array *arr = agg->arrays + i - 1;
- unsigned int j;
+ const slang_storage_array *arr = &agg->arrays[i - 1];
+ GLuint j;
for (j = arr->length; j > 0; j--)
{
if (arr->type == slang_stor_aggregate)
{
- if (!dereference_aggregate (file, arr->aggregate, index, size, info))
- return 0;
+ if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled))
+ return GL_FALSE;
}
else
{
+ GLuint src_offset;
+ slang_assembly_type ty;
+
*size -= 4;
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, info->addr_tmp,
- 4))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_deref))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_addr_push, *size))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_add))
- return 0;
+
+ /* calculate the offset within source variable to read */
+ if (is_swizzled)
+ {
+ /* swizzle the index to get the actual offset */
+ src_offset = swz->swizzle[*size / 4] * 4;
+ }
+ else
+ {
+ /* no swizzling - read sequentially */
+ src_offset = *size;
+ }
+
+ /* dereference data slot of a basic type */
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, src_offset))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+
switch (arr->type)
{
case slang_stor_bool:
- if (!slang_assembly_file_push (file, slang_asm_bool_deref))
- return 0;
+ ty = slang_asm_bool_deref;
break;
case slang_stor_int:
- if (!slang_assembly_file_push (file, slang_asm_int_deref))
- return 0;
+ ty = slang_asm_int_deref;
break;
case slang_stor_float:
- if (!slang_assembly_file_push (file, slang_asm_float_deref))
- return 0;
+ ty = slang_asm_float_deref;
break;
+ default:
+ _mesa_problem(NULL, "Unexpected arr->type in dereference_aggregate");
+ ty = slang_asm_none;
}
- index += 4;
+ if (!PUSH (A->file, ty))
+ return GL_FALSE;
}
}
}
- return 1;
+
+ return GL_TRUE;
}
-/* XXX: general swizzle! */
-int dereference (slang_assembly_file *file, slang_operation *op,
- slang_assembly_name_space *space, slang_assembly_local_info *info)
+
+GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op)
{
slang_assembly_typeinfo ti;
- int result;
+ GLboolean result = GL_FALSE;
slang_storage_aggregate agg;
- unsigned int size;
-
- slang_assembly_typeinfo_construct (&ti);
- if (!_slang_typeof_operation (op, space, &ti))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return 0;
- }
-
- slang_storage_aggregate_construct (&agg);
- if (!_slang_aggregate_variable (&agg, &ti.spec, NULL, space->funcs, space->structs))
- {
- slang_storage_aggregate_destruct (&agg);
- slang_assembly_typeinfo_destruct (&ti);
- return 0;
- }
+ GLuint size;
+
+ /* get type information of the given operation */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ /* construct aggregate from the type info */
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+ /* dereference the resulting aggregate */
size = _slang_sizeof_aggregate (&agg);
- result = dereference_aggregate (file, &agg, 0, &size, info);
+ result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled);
+end:
slang_storage_aggregate_destruct (&agg);
+end1:
slang_assembly_typeinfo_destruct (&ti);
return result;
}
-static int call_function (slang_assembly_file *file, slang_function *fun, slang_operation *params,
- unsigned int param_count, int assignment, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun,
+ slang_operation *params, GLuint param_count, GLboolean assignment)
{
- unsigned int i;
- slang_assembly_stack_info stk;
+ GLuint i;
+ slang_swizzle p_swz[64];
+ slang_ref_type p_ref[64];
+
+ /* TODO: fix this, allocate dynamically */
+ if (param_count > 64)
+ return GL_FALSE;
/* make room for the return value, if any */
if (fun->header.type.specifier.type != slang_spec_void)
{
- unsigned int ret_size = 0;
- if (!sizeof_variable (&fun->header.type.specifier, slang_qual_none, NULL, space, &ret_size))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_local_alloc, ret_size))
- return 0;
+ GLuint ret_size = 0;
+
+ if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_alloc, ret_size))
+ return GL_FALSE;
}
/* push the actual parameters on the stack */
for (i = 0; i < param_count; i++)
{
- slang_assembly_flow_control flow;
-
if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
fun->parameters->variables[i].type.qualifier == slang_qual_out)
{
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, info->addr_tmp, 4))
- return 0;
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
/* TODO: optimize the "out" parameter case */
- /* TODO: inspect stk */
- if (!_slang_assemble_operation (file, params + i, 1, &flow, space, info, &stk))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_copy))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_deref))
- return 0;
+ if (!_slang_assemble_operation (A, &params[i], slang_ref_force))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
if (i == 0 && assignment)
{
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, info->addr_tmp,
- 4))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_deref))
- return 0;
+ /* duplicate the resulting address */
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
}
- if (!dereference (file, params, space, info))
- return 0;
+ if (!_slang_dereference (A, &params[i]))
+ return GL_FALSE;
}
else
{
- /* TODO: for "out" and "inout" parameters also push the address (first) */
- /* TODO: optimize the "out" parameter case */
- /* TODO: inspect stk */
- if (!_slang_assemble_operation (file, params + i, 0, &flow, space, info, &stk))
- return 0;
+ if (!_slang_assemble_operation (A, &params[i], slang_ref_forbid))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
}
}
/* call the function */
- if (!slang_assembly_file_push_label (file, slang_asm_call, fun->address))
- return 0;
+ if (!PLAB (A->file, slang_asm_call, fun->address))
+ return GL_FALSE;
/* pop the parameters from the stack */
for (i = param_count; i > 0; i--)
{
- unsigned int j = i - 1;
+ GLuint j = i - 1;
+
+ A->swz = p_swz[j];
+ A->ref = p_ref[j];
if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
fun->parameters->variables[j].type.qualifier == slang_qual_out)
{
- if (!_slang_assemble_assignment (file, params + j, space, info))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
+ /* for output parameter copy the contents of the formal parameter
+ * back to the original actual parameter */
+ if (!_slang_assemble_assignment (A, &params[j]))
+ return GL_FALSE;
+ /* pop the actual parameter's address */
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
}
else
{
- if (!_slang_cleanup_stack (file, params + j, 0, space))
- return 0;
+ /* pop the value of the parameter */
+ if (!_slang_cleanup_stack (A, &params[j]))
+ return GL_FALSE;
}
}
- return 1;
+ return GL_TRUE;
}
-int call_function_name (slang_assembly_file *file, const char *name, slang_operation *params,
- unsigned int param_count, int assignment, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name,
+ slang_operation *params, GLuint param_count, GLboolean assignment)
{
- slang_function *fun = _slang_locate_function (name, params, param_count, space);
+ slang_atom atom;
+ slang_function *fun;
+
+ atom = slang_atom_pool_atom (A->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+ fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms);
if (fun == NULL)
- return 0;
- return call_function (file, fun, params, param_count, assignment, space, info);
+ return GL_FALSE;
+ return _slang_assemble_function_call (A, fun, params, param_count, assignment);
}
-static int call_function_name_dummyint (slang_assembly_file *file, const char *name,
- slang_operation *params, slang_assembly_name_space *space, slang_assembly_local_info *info)
+static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name,
+ slang_operation *params)
{
- slang_operation p2[2];
- int result;
-
- p2[0] = *params;
- if (!slang_operation_construct_a (p2 + 1))
- return 0;
- p2[1].type = slang_oper_literal_int;
- result = call_function_name (file, name, p2, 2, 0, space, info);
- slang_operation_destruct (p2 + 1);
+ slang_operation p[2];
+ GLboolean result;
+
+ p[0] = params[0];
+ if (!slang_operation_construct (&p[1]))
+ return GL_FALSE;
+ p[1].type = slang_oper_literal_int;
+ result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE);
+ slang_operation_destruct (&p[1]);
return result;
}
-static int call_asm_instruction (slang_assembly_file *file, const char *name)
+static const struct
{
- const struct
- {
- const char *name;
- slang_assembly_type code1, code2;
- } inst[] = {
- { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },
- { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },
- { "float_copy", slang_asm_float_copy, slang_asm_none },
- { "int_copy", slang_asm_int_copy, slang_asm_none },
- { "bool_copy", slang_asm_bool_copy, slang_asm_none },
- { "float_add", slang_asm_float_add, slang_asm_float_copy },
- { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },
- { "float_divide", slang_asm_float_divide, slang_asm_float_copy },
- { "float_negate", slang_asm_float_negate, slang_asm_float_copy },
- { "float_less", slang_asm_float_less, slang_asm_bool_copy },
- { "float_equal", slang_asm_float_equal, slang_asm_bool_copy },
- { NULL, slang_asm_none, slang_asm_none }
- };
- unsigned int i;
+ const char *name;
+ slang_assembly_type code1, code2;
+} inst[] = {
+ /* core */
+ { "float_add", slang_asm_float_add, slang_asm_float_copy },
+ { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },
+ { "float_divide", slang_asm_float_divide, slang_asm_float_copy },
+ { "float_negate", slang_asm_float_negate, slang_asm_float_copy },
+ { "float_less", slang_asm_float_less, slang_asm_bool_copy },
+ { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy },
+ { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },
+ { "float_sine", slang_asm_float_sine, slang_asm_float_copy },
+ { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy },
+ { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy },
+ { "float_power", slang_asm_float_power, slang_asm_float_copy },
+ { "float_log2", slang_asm_float_log2, slang_asm_float_copy },
+ { "float_floor", slang_asm_float_floor, slang_asm_float_copy },
+ { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy },
+ { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy },
+ { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy },
+ { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },
+ { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },
+ { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },
+ { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },
+ { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },
+ { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },
+ { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },
+ { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },
+ { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },
+ /* mesa-specific extensions */
+ { "float_print", slang_asm_float_deref, slang_asm_float_print },
+ { "int_print", slang_asm_int_deref, slang_asm_int_print },
+ { "bool_print", slang_asm_bool_deref, slang_asm_bool_print },
+ { NULL, slang_asm_none, slang_asm_none }
+};
+
+static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name)
+{
+ const char *id;
+ GLuint i;
+
+ id = slang_atom_pool_id (A->atoms, a_name);
for (i = 0; inst[i].name != NULL; i++)
- if (slang_string_compare (name, inst[i].name) == 0)
+ if (slang_string_compare (id, inst[i].name) == 0)
break;
if (inst[i].name == NULL)
- return 0;
+ return GL_FALSE;
- if (!slang_assembly_file_push_label2 (file, inst[i].code1, 4, 0))
- return 0;
+ if (!PLAB2 (A->file, inst[i].code1, 4, 0))
+ return GL_FALSE;
if (inst[i].code2 != slang_asm_none)
- if (!slang_assembly_file_push_label2 (file, inst[i].code2, 4, 0))
- return 0;
+ if (!PLAB2 (A->file, inst[i].code2, 4, 0))
+ return GL_FALSE;
/* clean-up the stack from the remaining dst address */
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
- return 1;
+ return GL_TRUE;
}
-/* XXX: general swizzle! */
-static int equality_aggregate (slang_assembly_file *file, const slang_storage_aggregate *agg,
- unsigned int *index, unsigned int size, slang_assembly_local_info *info, unsigned int z_label)
+static GLboolean equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *index, GLuint size, GLuint z_label)
{
- unsigned int i;
+ GLuint i;
for (i = 0; i < agg->count; i++)
{
- const slang_storage_array *arr = agg->arrays + i;
- unsigned int j;
+ const slang_storage_array *arr = &agg->arrays[i];
+ GLuint j;
for (j = 0; j < arr->length; j++)
{
if (arr->type == slang_stor_aggregate)
{
- if (!equality_aggregate (file, arr->aggregate, index, size, info, z_label))
- return 0;
+ if (!equality_aggregate (A, arr->aggregate, index, size, z_label))
+ return GL_FALSE;
}
else
{
- if (!slang_assembly_file_push_label2 (file, slang_asm_float_equal, size + *index,
- *index))
- return 0;
+ if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index))
+ return GL_FALSE;
*index += 4;
- if (!slang_assembly_file_push_label (file, slang_asm_jump_if_zero, z_label))
- return 0;
+ if (!PLAB (A->file, slang_asm_jump_if_zero, z_label))
+ return GL_FALSE;
}
}
}
- return 1;
+
+ return GL_TRUE;
}
-/* XXX: general swizzle! */
-static int equality (slang_assembly_file *file, slang_operation *op,
- slang_assembly_name_space *space, slang_assembly_local_info *info, int equal)
+
+static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal)
{
slang_assembly_typeinfo ti;
- int result;
+ GLboolean result = GL_FALSE;
slang_storage_aggregate agg;
- unsigned int index, size;
- unsigned int skip_jump, true_label, true_jump, false_label, false_jump;
+ GLuint index, size;
+ GLuint skip_jump, true_label, true_jump, false_label, false_jump;
/* get type of operation */
- slang_assembly_typeinfo_construct (&ti);
- if (!_slang_typeof_operation (op, space, &ti))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return 0;
- }
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
/* convert it to an aggregate */
- slang_storage_aggregate_construct (&agg);
- if (!(result = _slang_aggregate_variable (&agg, &ti.spec, NULL, space->funcs, space->structs)))
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
goto end;
/* compute the size of the agregate - there are two such aggregates on the stack */
size = _slang_sizeof_aggregate (&agg);
/* jump to the actual data-comparison code */
- skip_jump = file->count;
- if (!(result = slang_assembly_file_push (file, slang_asm_jump)))
+ skip_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
goto end;
/* pop off the stack the compared data and push 1 */
- true_label = file->count;
- if (!(result = slang_assembly_file_push_label (file, slang_asm_local_free, size * 2)))
+ true_label = A->file->count;
+ if (!PLAB (A->file, slang_asm_local_free, size * 2))
goto end;
- if (!(result = slang_assembly_file_push_literal (file, slang_asm_bool_push, 1.0f)))
+ if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1))
goto end;
- true_jump = file->count;
- if (!(result = slang_assembly_file_push (file, slang_asm_jump)))
+ true_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
goto end;
- false_label = file->count;
- if (!(result = slang_assembly_file_push_label (file, slang_asm_local_free, size * 2)))
+ false_label = A->file->count;
+ if (!PLAB (A->file, slang_asm_local_free, size * 2))
goto end;
- if (!(result = slang_assembly_file_push_literal (file, slang_asm_bool_push, 0.0f)))
+ if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0))
goto end;
- false_jump = file->count;
- if (!(result = slang_assembly_file_push (file, slang_asm_jump)))
+ false_jump = A->file->count;
+ if (!PUSH (A->file, slang_asm_jump))
goto end;
- file->code[skip_jump].param[0] = file->count;
+ A->file->code[skip_jump].param[0] = A->file->count;
/* compare the data on stack, it will eventually jump either to true or false label */
index = 0;
- if (!(result = equality_aggregate (file, &agg, &index, size, info,
- equal ? false_label : true_label)))
+ if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label))
goto end;
- if (!(result = slang_assembly_file_push_label (file, slang_asm_jump,
- equal ? true_label : false_label)))
+ if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label))
goto end;
- file->code[true_jump].param[0] = file->count;
- file->code[false_jump].param[0] = file->count;
+ A->file->code[true_jump].param[0] = A->file->count;
+ A->file->code[false_jump].param[0] = A->file->count;
- result = 1;
+ result = GL_TRUE;
end:
slang_storage_aggregate_destruct (&agg);
+end1:
slang_assembly_typeinfo_destruct (&ti);
return result;
}
-int _slang_assemble_operation (slang_assembly_file *file, slang_operation *op, int reference,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info, slang_assembly_stack_info *stk)
+static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie,
+ slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref)
{
- unsigned int assem;
+ GLuint asize = 0, esize = 0;
+
+ /* get type info of the master expression (matrix, vector or an array */
+ if (!_slang_typeof_operation (A, &op->children[0], tia))
+ return GL_FALSE;
+ if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
+ return GL_FALSE;
+
+ /* get type info of the result (matrix column, vector row or array element) */
+ if (!_slang_typeof_operation (A, op, tie))
+ return GL_FALSE;
+ if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* when indexing an l-value swizzle, push the swizzle_tmp */
+ if (ref == slang_ref_force && tia->is_swizzled)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the subscript expression */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force && tia->is_swizzled)
+ {
+ GLuint i;
+
+ /* copy the swizzle indexes to the swizzle_tmp */
+ for (i = 0; i < tia->swz.num_components; i++)
+ {
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, i * 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+
+ /* offset the pushed swizzle_tmp address and dereference it */
+ if (!PUSH (A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_addr_push, 4))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ else
+ {
+ /* convert the integer subscript to a relative address */
+ if (!PUSH (A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ }
+
+ if (!PLAB (A->file, slang_asm_addr_push, esize))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force)
+ {
+ /* offset the base address with the relative address */
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ else
+ {
+ GLuint i;
+
+ /* move the selected element to the beginning of the master expression */
+ for (i = 0; i < esize; i += 4)
+ if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+
+ /* free the rest of the master expression */
+ if (!PLAB (A->file, slang_asm_local_free, asize - esize))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia,
+ slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref)
+{
+ /* get type info of the result (field or swizzle) */
+ if (!_slang_typeof_operation (A, op, tia))
+ return GL_FALSE;
+
+ /* get type info of the master expression being accessed (struct or vector) */
+ if (!_slang_typeof_operation (A, &op->children[0], tib))
+ return GL_FALSE;
+
+ /* if swizzling a vector in-place, the swizzle temporary is needed */
+ if (ref == slang_ref_forbid && tia->is_swizzled)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* assemble the field expression */
+ if (tia->is_swizzled)
+ {
+ if (ref == slang_ref_force)
+ {
+#if 0
+ if (tia->swz.num_components == 1)
+ {
+ /* simple case - adjust the vector's address to point to the selected component */
+ if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
+ return 0;
+ if (!PUSH (file, slang_asm_addr_add))
+ return 0;
+ }
+ else
+#endif
+ {
+ /* two or more vector components are being referenced - the so-called write mask
+ * must be passed to the upper operations and applied when assigning value
+ * to this swizzle */
+ A->swz = tia->swz;
+ }
+ }
+ else
+ {
+ /* swizzle the vector in-place using the swizzle temporary */
+ if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec))
+ return GL_FALSE;
+ }
+ }
+ else
+ {
+ GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
+ GLboolean relocate, shrink;
+
+ /* calculate struct size, field offset and field size */
+ for (i = 0; i < tib->spec._struct->fields->num_variables; i++)
+ {
+ slang_variable *field;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ field = &tib->spec._struct->fields->variables[i];
+ if (!slang_storage_aggregate_construct (&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len,
+ A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms))
+ {
+ slang_storage_aggregate_destruct (&agg);
+ return GL_FALSE;
+ }
+ size = _slang_sizeof_aggregate (&agg);
+ slang_storage_aggregate_destruct (&agg);
+
+ if (op->a_id == field->a_name)
+ {
+ field_size = size;
+ struct_size = field_offset + size;
+ }
+ else if (struct_size != 0)
+ struct_size += size;
+ else
+ field_offset += size;
+ }
+
+ /*
+ * OPTIMIZATION: If selecting the last field, no relocation is needed.
+ */
+ relocate = field_offset != struct_size - field_size;
- stk->swizzle_mask = 0;
+ /*
+ * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.
+ */
+ shrink = field_size != struct_size;
- assem = file->count;
- if (!slang_assembly_file_push_new (file))
- return 0;
+ if (relocate)
+ {
+ if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ }
+
+ if (ref == slang_ref_force)
+ {
+ if (relocate)
+ {
+ if (!PUSH (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ }
+ else
+ {
+ GLuint free_b = 0;
+
+ if (relocate)
+ {
+ GLuint i;
+
+ /*
+ * Move the selected element to the end of the master expression.
+ * Do it in reverse order to avoid overwriting itself.
+ */
+ for (i = field_size; i > 0; i -= 4)
+ if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i))
+ return GL_FALSE;
+ free_b += 4;
+ }
+
+ if (shrink)
+ {
+ /* free the rest of the master expression */
+ free_b += struct_size - field_size;
+ }
+
+ if (free_b)
+ {
+ if (!PLAB (A->file, slang_asm_local_free, free_b))
+ return GL_FALSE;
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref)
+{
+ /* set default results */
+ A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref;
+ A->swz.num_components = 0;
switch (op->type)
{
case slang_oper_block_no_new_scope:
case slang_oper_block_new_scope:
{
- unsigned int i;
+ GLuint i;
+
for (i = 0; i < op->num_children; i++)
{
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children + i, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + i, 0, space))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[i]))
+ return GL_FALSE;
}
}
break;
case slang_oper_variable_decl:
{
- unsigned int i;
+ GLuint i;
+ slang_operation assign;
+ GLboolean result;
+
+ /* Construct assignment expression placeholder. */
+ if (!slang_operation_construct (&assign))
+ return GL_FALSE;
+ assign.type = slang_oper_assign;
+ assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
+ if (assign.children == NULL)
+ {
+ slang_operation_destruct (&assign);
+ return GL_FALSE;
+ }
+ for (assign.num_children = 0; assign.num_children < 2; assign.num_children++)
+ if (!slang_operation_construct (&assign.children[assign.num_children]))
+ {
+ slang_operation_destruct (&assign);
+ return GL_FALSE;
+ }
+ result = GL_TRUE;
for (i = 0; i < op->num_children; i++)
{
- /* TODO: perform initialization of op->children[i] */
- /* TODO: clean-up stack */
+ slang_variable *var;
+
+ var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE);
+ if (var == NULL)
+ {
+ result = GL_FALSE;
+ break;
+ }
+ if (var->initializer == NULL)
+ continue;
+
+ if (!slang_operation_copy (&assign.children[0], &op->children[i]) ||
+ !slang_operation_copy (&assign.children[1], var->initializer) ||
+ !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) ||
+ !_slang_cleanup_stack (A, &assign))
+ {
+ result = GL_FALSE;
+ break;
+ }
}
+ slang_operation_destruct (&assign);
+ if (!result)
+ return GL_FALSE;
}
break;
case slang_oper_asm:
{
- unsigned int i;
- for (i = 0; i < op->num_children; i++)
- {
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children + i, i == 0, flow, space, info,
- &stk))
- return 0;
- /* TODO: inspect stk */
- }
- if (!call_asm_instruction (file, op->identifier))
- return 0;
+ GLuint i;
+
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ for (i = 1; i < op->num_children; i++)
+ if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid))
+ return GL_FALSE;
+ if (!call_asm_instruction (A, op->a_id))
+ return GL_FALSE;
}
break;
case slang_oper_break:
- file->code[assem].type = slang_asm_jump;
- file->code[assem].param[0] = flow->loop_end;
+ if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end))
+ return GL_FALSE;
break;
case slang_oper_continue:
- file->code[assem].type = slang_asm_jump;
- file->code[assem].param[0] = flow->loop_start;
+ if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start))
+ return GL_FALSE;
break;
case slang_oper_discard:
- file->code[assem].type = slang_asm_discard;
- if (!slang_assembly_file_push (file, slang_asm_exit))
- return 0;
+ if (!PUSH (A->file, slang_asm_discard))
+ return GL_FALSE;
+ if (!PUSH (A->file, slang_asm_exit))
+ return GL_FALSE;
break;
case slang_oper_return:
- if (info->ret_size != 0)
+ if (A->local.ret_size != 0)
{
- slang_assembly_stack_info stk;
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, 0, info->ret_size))
- return 0;
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- if (!_slang_assemble_assignment (file, op->children, space, info))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
+ /* push the result's address */
+ if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ A->swz.num_components = 0;
+ /* assign the operation to the function result (it was reserved on the stack) */
+ if (!_slang_assemble_assignment (A, op->children))
+ return GL_FALSE;
+
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
}
- if (!slang_assembly_file_push_label (file, slang_asm_jump, flow->function_end))
- return 0;
+ if (!PLAB (A->file, slang_asm_jump, A->flow.function_end))
+ return GL_FALSE;
break;
case slang_oper_expression:
- {
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children, reference, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- }
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], ref))
+ return GL_FALSE;
break;
case slang_oper_if:
- if (!_slang_assemble_if (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_if (A, op))
+ return GL_FALSE;
break;
case slang_oper_while:
- if (!_slang_assemble_while (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_while (A, op))
+ return GL_FALSE;
break;
case slang_oper_do:
- if (!_slang_assemble_do (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_do (A, op))
+ return GL_FALSE;
break;
case slang_oper_for:
- if (!_slang_assemble_for (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_for (A, op))
+ return GL_FALSE;
break;
case slang_oper_void:
break;
case slang_oper_literal_bool:
- file->code[assem].type = slang_asm_bool_push;
- file->code[assem].literal = op->literal;
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_bool_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_literal_int:
- file->code[assem].type = slang_asm_int_push;
- file->code[assem].literal = op->literal;
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_int_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_literal_float:
- file->code[assem].type = slang_asm_float_push;
- file->code[assem].literal = op->literal;
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT (A->file, slang_asm_float_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_identifier:
{
slang_variable *var;
- unsigned int size;
- var = _slang_locate_variable (op->locals, op->identifier, 1);
+ GLuint size;
+
+ /* find the variable and calculate its size */
+ var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
if (var == NULL)
- return 0;
+ return GL_FALSE;
size = 0;
- if (!sizeof_variable (&var->type.specifier, slang_qual_none, var->array_size, space,
- &size))
- return 0;
- if (var->initializer != NULL)
+ if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size))
+ return GL_FALSE;
+
+ /* prepare stack for dereferencing */
+ if (ref == slang_ref_forbid)
+ if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+
+ /* push the variable's address */
+ if (var->global)
{
- assert (!"var->initializer, oper_identifier");
+ if (!PLAB (A->file, slang_asm_global_addr, var->address))
+ return GL_FALSE;
}
else
{
- if (!reference)
- {
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr,
- info->addr_tmp, 4))
- return 0;
- }
- /* XXX: globals! */
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, var->address,
- size))
- return 0;
- if (!reference)
- {
- if (!slang_assembly_file_push (file, slang_asm_addr_copy))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
- if (!dereference (file, op, space, info))
- return 0;
- }
+ if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size))
+ return GL_FALSE;
+ }
+
+ /* perform the dereference */
+ if (ref == slang_ref_forbid)
+ {
+ if (!PUSH (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference (A, op))
+ return GL_FALSE;
}
}
break;
case slang_oper_sequence:
- {
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children, 0, space))
- return 0;
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info,
- &stk))
- return 0;
- /* TODO: inspect stk */
- }
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_assign:
- if (!_slang_assemble_assign (file, op, "=", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "=", ref))
+ return GL_FALSE;
break;
case slang_oper_addassign:
- if (!_slang_assemble_assign (file, op, "+=", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "+=", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
case slang_oper_subassign:
- if (!_slang_assemble_assign (file, op, "-=", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "-=", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
case slang_oper_mulassign:
- if (!_slang_assemble_assign (file, op, "*=", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "*=", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
/*case slang_oper_modassign:*/
/*case slang_oper_lshassign:*/
@@ -868,197 +1270,136 @@ int _slang_assemble_operation (slang_assembly_file *file, slang_operation *op, i
/*case slang_oper_xorassign:*/
/*case slang_oper_andassign:*/
case slang_oper_divassign:
- if (!_slang_assemble_assign (file, op, "/=", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "/=", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
case slang_oper_select:
- if (!_slang_assemble_select (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_select (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_logicalor:
- if (!_slang_assemble_logicalor (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_logicalor (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_logicaland:
- if (!_slang_assemble_logicaland (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_logicaland (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_logicalxor:
- if (!call_function_name (file, "^^", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
/*case slang_oper_bitor:*/
/*case slang_oper_bitxor:*/
/*case slang_oper_bitand:*/
case slang_oper_less:
- if (!call_function_name (file, "<", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_greater:
- if (!call_function_name (file, ">", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_lessequal:
- if (!call_function_name (file, "<=", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_greaterequal:
- if (!call_function_name (file, ">=", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
/*case slang_oper_lshift:*/
/*case slang_oper_rshift:*/
case slang_oper_add:
- if (!call_function_name (file, "+", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_subtract:
- if (!call_function_name (file, "-", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_multiply:
- if (!call_function_name (file, "*", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
/*case slang_oper_modulus:*/
case slang_oper_divide:
- if (!call_function_name (file, "/", op->children, 2, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_equal:
- {
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- if (!equality (file, op->children, space, info, 1))
- return 0;
- }
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality (A, op->children, GL_TRUE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_notequal:
- {
- slang_assembly_stack_info stk;
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
- if (!equality (file, op->children, space, info, 0))
- return 0;
- }
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality (A, op->children, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_preincrement:
- if (!_slang_assemble_assign (file, op, "++", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "++", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
case slang_oper_predecrement:
- if (!_slang_assemble_assign (file, op, "--", reference, space, info))
- return 0;
+ if (!_slang_assemble_assign (A, op, "--", ref))
+ return GL_FALSE;
+ A->ref = ref;
break;
case slang_oper_plus:
- if (!call_function_name (file, "+", op->children, 1, 0, space, info))
- return 0;
+ if (!_slang_dereference (A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_minus:
- if (!call_function_name (file, "-", op->children, 1, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
/*case slang_oper_complement:*/
case slang_oper_not:
- if (!call_function_name (file, "!", op->children, 1, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_subscript:
{
- slang_assembly_stack_info _stk;
slang_assembly_typeinfo ti_arr, ti_elem;
- unsigned int arr_size = 0, elem_size = 0;
- if (!_slang_assemble_operation (file, op->children, reference, flow, space, info,
- &_stk))
- return 0;
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &_stk))
- return 0;
- slang_assembly_typeinfo_construct (&ti_arr);
- if (!_slang_typeof_operation (op->children, space, &ti_arr))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- return 0;
- }
- if (!sizeof_variable (&ti_arr.spec, slang_qual_none, NULL, space, &arr_size))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- return 0;
- }
- slang_assembly_typeinfo_construct (&ti_elem);
- if (!_slang_typeof_operation (op, space, &ti_elem))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- if (!sizeof_variable (&ti_elem.spec, slang_qual_none, NULL, space, &elem_size))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- if (!slang_assembly_file_push (file, slang_asm_int_to_addr))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- if (!slang_assembly_file_push_label (file, slang_asm_addr_push, elem_size))
+
+ if (!slang_assembly_typeinfo_construct (&ti_arr))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct (&ti_elem))
{
slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
+ return GL_FALSE;
}
- if (!slang_assembly_file_push (file, slang_asm_addr_multiply))
+ if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref))
{
slang_assembly_typeinfo_destruct (&ti_arr);
slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- if (reference)
- {
- if (!slang_assembly_file_push (file, slang_asm_addr_add))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- }
- else
- {
- unsigned int i;
- for (i = 0; i < elem_size; i += 4)
- {
- if (!slang_assembly_file_push_label2 (file, slang_asm_float_move,
- arr_size - elem_size + i + 4, i + 4))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- }
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
- if (!slang_assembly_file_push_label (file, slang_asm_local_free,
- arr_size - elem_size))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return 0;
- }
+ return GL_FALSE;
}
slang_assembly_typeinfo_destruct (&ti_arr);
slang_assembly_typeinfo_destruct (&ti_elem);
@@ -1066,123 +1407,58 @@ int _slang_assemble_operation (slang_assembly_file *file, slang_operation *op, i
break;
case slang_oper_call:
{
- slang_function *fun = _slang_locate_function (op->identifier, op->children,
- op->num_children, space);
+ slang_function *fun;
+
+ fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children,
+ &A->space, A->atoms);
if (fun == NULL)
{
- if (!_slang_assemble_constructor (file, op, flow, space, info))
- return 0;
+ if (!_slang_assemble_constructor (A, op))
+ return GL_FALSE;
}
else
{
- if (!call_function (file, fun, op->children, op->num_children, 0, space, info))
- return 0;
+ if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE))
+ return GL_FALSE;
}
+ A->ref = slang_ref_forbid;
}
break;
case slang_oper_field:
{
slang_assembly_typeinfo ti_after, ti_before;
- slang_assembly_stack_info _stk;
- slang_assembly_typeinfo_construct (&ti_after);
- if (!_slang_typeof_operation (op, space, &ti_after))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- return 0;
- }
- slang_assembly_typeinfo_construct (&ti_before);
- if (!_slang_typeof_operation (op->children, space, &ti_before))
+
+ if (!slang_assembly_typeinfo_construct (&ti_after))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct (&ti_before))
{
slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
- if (!reference && ti_after.is_swizzled)
- {
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr,
- info->swizzle_tmp, 16))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
+ return GL_FALSE;
}
- if (!_slang_assemble_operation (file, op->children, reference, flow, space, info,
- &_stk))
+ if (!handle_field (A, &ti_after, &ti_before, op, ref))
{
slang_assembly_typeinfo_destruct (&ti_after);
slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
- /* TODO: inspect stk */
- if (ti_after.is_swizzled)
- {
- if (reference)
- {
- if (ti_after.swz.num_components == 1)
- {
- if (!slang_assembly_file_push_label (file, slang_asm_addr_push,
- ti_after.swz.swizzle[0] * 4))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
- if (!slang_assembly_file_push (file, slang_asm_addr_add))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
- }
- else
- {
- unsigned int i;
- for (i = 0; i < ti_after.swz.num_components; i++)
- stk->swizzle_mask |= 1 << ti_after.swz.swizzle[i];
- }
- }
- else
- {
- if (!_slang_assemble_constructor_from_swizzle (file, &ti_after.swz,
- &ti_after.spec, &ti_before.spec, info))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return 0;
- }
- }
- }
- else
- {
- if (reference)
- {
- /* TODO: struct field address */
- }
- else
- {
- /* TODO: struct field value */
- }
+ return GL_FALSE;
}
slang_assembly_typeinfo_destruct (&ti_after);
slang_assembly_typeinfo_destruct (&ti_before);
}
break;
case slang_oper_postincrement:
- if (!call_function_name_dummyint (file, "++", op->children, space, info))
- return 0;
- if (!dereference (file, op, space, info))
- return 0;
+ if (!assemble_function_call_name_dummyint (A, "++", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
case slang_oper_postdecrement:
- if (!call_function_name_dummyint (file, "--", op->children, space, info))
- return 0;
- if (!dereference (file, op, space, info))
- return 0;
+ if (!assemble_function_call_name_dummyint (A, "--", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
break;
default:
- return 0;
+ return GL_FALSE;
}
- return 1;
+
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_assemble.h b/src/mesa/shader/slang/slang_assemble.h
index d93755c7e7..0cde845f85 100644
--- a/src/mesa/shader/slang/slang_assemble.h
+++ b/src/mesa/shader/slang/slang_assemble.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,12 +25,14 @@
#if !defined SLANG_ASSEMBLE_H
#define SLANG_ASSEMBLE_H
-#include "slang_compile.h"
+#include "slang_utility.h"
#if defined __cplusplus
extern "C" {
#endif
+struct slang_operation_;
+
typedef enum slang_assembly_type_
{
/* core */
@@ -44,8 +46,20 @@ typedef enum slang_assembly_type_
slang_asm_float_divide,
slang_asm_float_negate,
slang_asm_float_less,
- slang_asm_float_equal,
+ slang_asm_float_equal_exp,
+ slang_asm_float_equal_int,
slang_asm_float_to_int,
+ slang_asm_float_sine,
+ slang_asm_float_arcsine,
+ slang_asm_float_arctan,
+ slang_asm_float_power,
+ slang_asm_float_log2,
+ slang_asm_float_floor,
+ slang_asm_float_ceil,
+ slang_asm_float_noise1,
+ slang_asm_float_noise2,
+ slang_asm_float_noise3,
+ slang_asm_float_noise4,
slang_asm_int_copy,
slang_asm_int_move,
slang_asm_int_push,
@@ -61,6 +75,12 @@ typedef enum slang_assembly_type_
slang_asm_addr_deref,
slang_asm_addr_add,
slang_asm_addr_multiply,
+ slang_asm_vec4_tex1d,
+ slang_asm_vec4_tex2d,
+ slang_asm_vec4_tex3d,
+ slang_asm_vec4_texcube,
+ slang_asm_vec4_shad1d,
+ slang_asm_vec4_shad2d,
slang_asm_jump,
slang_asm_jump_if_zero,
slang_asm_enter,
@@ -68,10 +88,15 @@ typedef enum slang_assembly_type_
slang_asm_local_alloc,
slang_asm_local_free,
slang_asm_local_addr,
+ slang_asm_global_addr,
slang_asm_call,
slang_asm_return,
slang_asm_discard,
slang_asm_exit,
+ /* mesa-specific extensions */
+ slang_asm_float_print,
+ slang_asm_int_print,
+ slang_asm_bool_print,
slang_asm__last
} slang_assembly_type;
@@ -85,23 +110,59 @@ typedef struct slang_assembly_
typedef struct slang_assembly_file_
{
slang_assembly *code;
- unsigned int count;
+ GLuint count;
+ GLuint capacity;
} slang_assembly_file;
-void slang_assembly_file_construct (slang_assembly_file *);
-void slang_assembly_file_destruct (slang_assembly_file *);
-int slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
-int slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
-int slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
-int slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
+GLboolean slang_assembly_file_construct (slang_assembly_file *);
+GLvoid slang_assembly_file_destruct (slang_assembly_file *);
+GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
+GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
+GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
+GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
+
+typedef struct slang_assembly_file_restore_point_
+{
+ GLuint count;
+} slang_assembly_file_restore_point;
+
+GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *,
+ slang_assembly_file_restore_point *);
typedef struct slang_assembly_flow_control_
{
- unsigned int loop_start; /* for "continue" statement */
- unsigned int loop_end; /* for "break" statement */
- unsigned int function_end; /* for "return" statement */
+ GLuint loop_start; /* for "continue" statement */
+ GLuint loop_end; /* for "break" statement */
+ GLuint function_end; /* for "return" statement */
} slang_assembly_flow_control;
+typedef struct slang_assembly_local_info_
+{
+ GLuint ret_size;
+ GLuint addr_tmp;
+ GLuint swizzle_tmp;
+} slang_assembly_local_info;
+
+typedef enum
+{
+ slang_ref_force,
+ slang_ref_forbid/*,
+ slang_ref_freelance*/
+} slang_ref_type;
+
+/*
+ * Holds a complete information about vector swizzle - the <swizzle> array contains
+ * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w".
+ * Example: "xwz" --> { 3, { 0, 3, 2, not used } }.
+ */
+typedef struct slang_swizzle_
+{
+ GLuint num_components;
+ GLuint swizzle[4];
+} slang_swizzle;
+
typedef struct slang_assembly_name_space_
{
struct slang_function_scope_ *funcs;
@@ -109,34 +170,45 @@ typedef struct slang_assembly_name_space_
struct slang_variable_scope_ *vars;
} slang_assembly_name_space;
-slang_function *_slang_locate_function (const char *name, slang_operation *params,
- unsigned int num_params, slang_assembly_name_space *space);
+typedef struct slang_assemble_ctx_
+{
+ slang_assembly_file *file;
+ struct slang_machine_ *mach;
+ slang_atom_pool *atoms;
+ slang_assembly_name_space space;
+ slang_assembly_flow_control flow;
+ slang_assembly_local_info local;
+ slang_ref_type ref;
+ slang_swizzle swz;
+} slang_assemble_ctx;
-int _slang_assemble_function (slang_assembly_file *, struct slang_function_ *,
- slang_assembly_name_space *);
+struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name,
+ struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space,
+ slang_atom_pool *);
-typedef struct slang_assembly_stack_info_
-{
- unsigned int swizzle_mask;
-} slang_assembly_stack_info;
+GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *);
-int _slang_cleanup_stack (slang_assembly_file *, slang_operation *, int ref,
- slang_assembly_name_space *);
+GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *);
-typedef struct slang_assembly_local_info_
-{
- unsigned int ret_size;
- unsigned int addr_tmp;
- unsigned int swizzle_tmp;
-} slang_assembly_local_info;
+GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *);
+
+GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *,
+ struct slang_operation_ *, GLuint, GLboolean);
-int _slang_assemble_operation (slang_assembly_file *, struct slang_operation_ *, int reference,
- slang_assembly_flow_control *, slang_assembly_name_space *, slang_assembly_local_info *,
- slang_assembly_stack_info *);
+GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *,
+ struct slang_operation_ *, GLuint, GLboolean);
+
+GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *,
+ slang_ref_type);
#ifdef __cplusplus
}
#endif
+#include "slang_assemble_assignment.h"
+#include "slang_assemble_typeinfo.h"
+#include "slang_assemble_constructor.h"
+#include "slang_assemble_conditional.h"
+
#endif
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.c b/src/mesa/shader/slang/slang_assemble_assignment.c
index 551f5d9b11..868724ed3e 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.c
+++ b/src/mesa/shader/slang/slang_assemble_assignment.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,53 +29,67 @@
*/
#include "imports.h"
-#include "slang_assemble_assignment.h"
-#include "slang_assemble_typeinfo.h"
+#include "slang_assemble.h"
#include "slang_storage.h"
-#include "slang_utility.h"
/*
- _slang_assemble_assignment()
-
- copies values on the stack (<component 0> to <component N-1>) to a memory
- location pointed by <addr of variable>;
-
- in:
- +------------------+
- | addr of variable |
- +------------------+
- | component N-1 |
- | ... |
- | component 0 |
- +------------------+
-
- out:
- +------------------+
- | addr of variable |
- +------------------+
-*/
-/* TODO: add support for swizzle mask */
-static int assign_aggregate (slang_assembly_file *file, const slang_storage_aggregate *agg,
- unsigned int *index, unsigned int size, slang_assembly_local_info *info)
+ * _slang_assemble_assignment()
+ *
+ * Copies values on the stack (<component 0> to <component N-1>) to a memory
+ * location pointed by <addr of variable>.
+ *
+ * in:
+ * +------------------+
+ * | addr of variable |
+ * +------------------+
+ * | component N-1 |
+ * | ... |
+ * | component 0 |
+ * +------------------+
+ *
+ * out:
+ * +------------------+
+ * | addr of variable |
+ * +------------------+
+ */
+
+static GLboolean assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg,
+ GLuint *index, GLuint size)
{
- unsigned int i;
+ GLuint i;
for (i = 0; i < agg->count; i++)
{
- const slang_storage_array *arr = agg->arrays + i;
- unsigned int j;
+ const slang_storage_array *arr = &agg->arrays[i];
+ GLuint j;
for (j = 0; j < arr->length; j++)
{
if (arr->type == slang_stor_aggregate)
{
- if (!assign_aggregate (file, arr->aggregate, index, size, info))
- return 0;
+ if (!assign_aggregate (A, arr->aggregate, index, size))
+ return GL_FALSE;
}
else
{
+ GLuint dst_addr_loc, dst_offset;
slang_assembly_type ty;
+ /* calculate the distance from top of the stack to the destination address */
+ dst_addr_loc = size - *index;
+
+ /* calculate the offset within destination variable to write */
+ if (A->swz.num_components != 0)
+ {
+ /* swizzle the index to get the actual offset */
+ dst_offset = A->swz.swizzle[*index / 4] * 4;
+ }
+ else
+ {
+ /* no swizzling - write sequentially */
+ dst_offset = *index;
+ }
+
switch (arr->type)
{
case slang_stor_bool:
@@ -90,98 +104,91 @@ static int assign_aggregate (slang_assembly_file *file, const slang_storage_aggr
default:
break;
}
- if (!slang_assembly_file_push_label2 (file, ty, size - *index, *index))
- return 0;
+ if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset))
+ return GL_FALSE;
+
*index += 4;
}
}
}
- return 1;
+
+ return GL_TRUE;
}
-int _slang_assemble_assignment (slang_assembly_file *file, slang_operation *op,
- slang_assembly_name_space *space, slang_assembly_local_info *info)
+GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op)
{
slang_assembly_typeinfo ti;
- int result;
+ GLboolean result = GL_FALSE;
slang_storage_aggregate agg;
- unsigned int index, size;
+ GLuint index, size;
- slang_assembly_typeinfo_construct (&ti);
- if (!_slang_typeof_operation (op, space, &ti))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return 0;
- }
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
- slang_storage_aggregate_construct (&agg);
- if (!_slang_aggregate_variable (&agg, &ti.spec, NULL, space->funcs, space->structs))
- {
- slang_storage_aggregate_destruct (&agg);
- slang_assembly_typeinfo_destruct (&ti);
- return 0;
- }
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
index = 0;
size = _slang_sizeof_aggregate (&agg);
- result = assign_aggregate (file, &agg, &index, size, info);
+ result = assign_aggregate (A, &agg, &index, size);
+end1:
slang_storage_aggregate_destruct (&agg);
+end:
slang_assembly_typeinfo_destruct (&ti);
return result;
}
/*
- _slang_assemble_assign()
-
- performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's
- children
-*/
-
-int dereference (slang_assembly_file *file, slang_operation *op,
- slang_assembly_name_space *space, slang_assembly_local_info *info);
-
-int call_function_name (slang_assembly_file *file, const char *name, slang_operation *params,
- unsigned int param_count, int assignment, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+ * _slang_assemble_assign()
+ *
+ * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's
+ * children.
+ */
-int _slang_assemble_assign (slang_assembly_file *file, slang_operation *op, const char *oper,
- int ref, slang_assembly_name_space *space, slang_assembly_local_info *info)
+GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper,
+ slang_ref_type ref)
{
- slang_assembly_stack_info stk;
- slang_assembly_flow_control flow;
+ slang_swizzle swz;
- if (!ref)
+ if (ref == slang_ref_forbid)
{
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, info->addr_tmp, 4))
- return 0;
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
}
if (slang_string_compare ("=", oper) == 0)
{
- if (!_slang_assemble_operation (file, op->children, 1, &flow, space, info, &stk))
- return 0;
- if (!_slang_assemble_operation (file, op->children + 1, 0, &flow, space, info, &stk))
- return 0;
- if (!_slang_assemble_assignment (file, op->children, space, info))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ swz = A->swz;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->swz = swz;
+ if (!_slang_assemble_assignment (A, op->children))
+ return GL_FALSE;
}
else
{
- if (!call_function_name (file, oper, op->children, op->num_children, 1, space, info))
- return 0;
+ if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE))
+ return GL_FALSE;
}
- if (!ref)
+ if (ref == slang_ref_forbid)
{
- if (!slang_assembly_file_push (file, slang_asm_addr_copy))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
- if (!dereference (file, op->children, space, info))
- return 0;
+ if (!slang_assembly_file_push (A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference (A, op->children))
+ return GL_FALSE;
}
- return 1;
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.h b/src/mesa/shader/slang/slang_assemble_assignment.h
index 06972ad176..111459be92 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.h
+++ b/src/mesa/shader/slang/slang_assemble_assignment.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,17 +25,14 @@
#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
#define SLANG_ASSEMBLE_ASSIGNMENT_H
-#include "slang_assemble.h"
-
#if defined __cplusplus
extern "C" {
#endif
-int _slang_assemble_assignment (slang_assembly_file *, slang_operation *,
- slang_assembly_name_space *, slang_assembly_local_info *);
+GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_assign (slang_assembly_file *, slang_operation *, const char *, int ref,
- slang_assembly_name_space *, slang_assembly_local_info *);
+GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *,
+ slang_ref_type);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_assemble_conditional.c b/src/mesa/shader/slang/slang_assemble_conditional.c
index 498938bdd5..b29d0cf30c 100644
--- a/src/mesa/shader/slang/slang_assemble_conditional.c
+++ b/src/mesa/shader/slang/slang_assemble_conditional.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,457 +29,420 @@
*/
#include "imports.h"
-#include "slang_utility.h"
-#include "slang_assemble_conditional.h"
#include "slang_assemble.h"
+#include "slang_compile.h"
-/* _slang_assemble_logicaland() */
+/*
+ * _slang_assemble_logicaland()
+ *
+ * and:
+ * <left-expression>
+ * jumpz zero
+ * <right-expression>
+ * jump end
+ * zero:
+ * push 0
+ * end:
+ */
-int _slang_assemble_logicaland (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_logicaland (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- and:
- <left-expression>
- jumpz zero
- <right-expression>
- jump end
- zero:
- push 0
- end:
- */
-
- unsigned int zero_jump, end_jump;
- slang_assembly_stack_info stk;
+ GLuint zero_jump, end_jump;
/* evaluate left expression */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
/* jump to pushing 0 if not true */
- zero_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ zero_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* evaluate right expression */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
/* jump to the end of the expression */
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* push 0 on stack */
- file->code[zero_jump].param[0] = file->count;
- if (!slang_assembly_file_push (file, slang_asm_bool_push))
- return 0;
+ A->file->code[zero_jump].param[0] = A->file->count;
+ if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 0))
+ return GL_FALSE;
/* the end of the expression */
- file->code[end_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_logicalor() */
+/*
+ * _slang_assemble_logicalor()
+ *
+ * or:
+ * <left-expression>
+ * jumpz right
+ * push 1
+ * jump end
+ * right:
+ * <right-expression>
+ * end:
+ */
-int _slang_assemble_logicalor (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_logicalor (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- or:
- <left-expression>
- jumpz right
- push 1
- jump end
- right:
- <right-expression>
- end:
- */
-
- unsigned int right_jump, end_jump;
- slang_assembly_stack_info stk;
+ GLuint right_jump, end_jump;
/* evaluate left expression */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
/* jump to evaluation of right expression if not true */
- right_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ right_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* push 1 on stack */
- if (!slang_assembly_file_push_literal (file, slang_asm_bool_push, 1.0f))
- return 0;
+ if (!slang_assembly_file_push_literal (A->file, slang_asm_bool_push, (GLfloat) 1))
+ return GL_FALSE;
/* jump to the end of the expression */
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* evaluate right expression */
- file->code[right_jump].param[0] = file->count;
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ A->file->code[right_jump].param[0] = A->file->count;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
/* the end of the expression */
- file->code[end_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_select() */
+/*
+ * _slang_assemble_select()
+ *
+ * select:
+ * <condition-expression>
+ * jumpz false
+ * <true-expression>
+ * jump end
+ * false:
+ * <false-expression>
+ * end:
+ */
-int _slang_assemble_select (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_select (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- select:
- <condition-expression>
- jumpz false
- <true-expression>
- jump end
- false:
- <false-expression>
- end:
- */
-
- unsigned int cond_jump, end_jump;
- slang_assembly_stack_info stk;
+ GLuint cond_jump, end_jump;
/* execute condition expression */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
/* jump to false expression if not true */
- cond_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* execute true expression */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
/* jump to the end of the expression */
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* resolve false point */
- file->code[cond_jump].param[0] = file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
/* execute false expression */
- if (!_slang_assemble_operation (file, op->children + 2, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid))
+ return GL_FALSE;
/* resolve the end of the expression */
- file->code[end_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_for() */
+/*
+ * _slang_assemble_for()
+ *
+ * for:
+ * <init-statement>
+ * jump start
+ * break:
+ * jump end
+ * continue:
+ * <loop-increment>
+ * start:
+ * <condition-statement>
+ * jumpz end
+ * <loop-body>
+ * jump continue
+ * end:
+ */
-int _slang_assemble_for (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_for (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- for:
- <init-statement>
- jump start
- break:
- jump end
- continue:
- <loop-increment>
- start:
- <condition-statement>
- jumpz end
- <loop-body>
- jump continue
- end:
- */
-
- unsigned int start_jump, end_jump, cond_jump;
- unsigned int break_label, cont_label;
- slang_assembly_flow_control loop_flow = *flow;
- slang_assembly_stack_info stk;
+ GLuint start_jump, end_jump, cond_jump;
+ GLuint break_label, cont_label;
+ slang_assembly_flow_control save_flow = A->flow;
/* execute initialization statement */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children, 0, space))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
/* skip the "go to the end of the loop" and loop-increment statements */
- start_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ start_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* go to the end of the loop - break statements are directed here */
- break_label = file->count;
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* resolve the beginning of the loop - continue statements are directed here */
- cont_label = file->count;
+ cont_label = A->file->count;
/* execute loop-increment statement */
- if (!_slang_assemble_operation (file, op->children + 2, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + 2, 0, space))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[2]))
+ return GL_FALSE;
/* resolve the condition point */
- file->code[start_jump].param[0] = file->count;
+ A->file->code[start_jump].param[0] = A->file->count;
/* execute condition statement */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: inspect stk */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
/* jump to the end of the loop if not true */
- cond_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* execute loop body */
- loop_flow.loop_start = cont_label;
- loop_flow.loop_end = break_label;
- if (!_slang_assemble_operation (file, op->children + 3, 0, &loop_flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + 3, 0, space))
- return 0;
+ A->flow.loop_start = cont_label;
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[3], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[3]))
+ return GL_FALSE;
+ A->flow = save_flow;
/* go to the beginning of the loop */
- if (!slang_assembly_file_push_label (file, slang_asm_jump, cont_label))
- return 0;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, cont_label))
+ return GL_FALSE;
/* resolve the end of the loop */
- file->code[end_jump].param[0] = file->count;
- file->code[cond_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_do() */
+/*
+ * _slang_assemble_do()
+ *
+ * do:
+ * jump start
+ * break:
+ * jump end
+ * continue:
+ * jump condition
+ * start:
+ * <loop-body>
+ * condition:
+ * <condition-statement>
+ * jumpz end
+ * jump start
+ * end:
+ */
-int _slang_assemble_do (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_do (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- do:
- jump start
- break:
- jump end
- continue:
- jump condition
- start:
- <loop-body>
- condition:
- <condition-statement>
- jumpz end
- jump start
- end:
- */
-
- unsigned int skip_jump, end_jump, cont_jump, cond_jump;
- unsigned int break_label, cont_label;
- slang_assembly_flow_control loop_flow = *flow;
- slang_assembly_stack_info stk;
+ GLuint skip_jump, end_jump, cont_jump, cond_jump;
+ GLuint break_label, cont_label;
+ slang_assembly_flow_control save_flow = A->flow;
/* skip the "go to the end of the loop" and "go to condition" statements */
- skip_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ skip_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* go to the end of the loop - break statements are directed here */
- break_label = file->count;
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* go to condition - continue statements are directed here */
- cont_label = file->count;
- cont_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ cont_label = A->file->count;
+ cont_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* resolve the beginning of the loop */
- file->code[skip_jump].param[0] = file->count;
+ A->file->code[skip_jump].param[0] = A->file->count;
/* execute loop body */
- loop_flow.loop_start = cont_label;
- loop_flow.loop_end = break_label;
- if (!_slang_assemble_operation (file, op->children, 0, &loop_flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children, 0, space))
- return 0;
+ A->flow.loop_start = cont_label;
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[0]))
+ return GL_FALSE;
+ A->flow = save_flow;
/* resolve condition point */
- file->code[cont_jump].param[0] = file->count;
+ A->file->code[cont_jump].param[0] = A->file->count;
/* execute condition statement */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
/* jump to the end of the loop if not true */
- cond_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* jump to the beginning of the loop */
- if (!slang_assembly_file_push_label (file, slang_asm_jump, file->code[skip_jump].param[0]))
- return 0;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))
+ return GL_FALSE;
/* resolve the end of the loop */
- file->code[end_jump].param[0] = file->count;
- file->code[cond_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_while() */
+/*
+ * _slang_assemble_while()
+ *
+ * while:
+ * jump continue
+ * break:
+ * jump end
+ * continue:
+ * <condition-statement>
+ * jumpz end
+ * <loop-body>
+ * jump continue
+ * end:
+ */
-int _slang_assemble_while (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_while (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- while:
- jump continue
- break:
- jump end
- continue:
- <condition-statement>
- jumpz end
- <loop-body>
- jump continue
- end:
- */
-
- unsigned int skip_jump, end_jump, cond_jump;
- unsigned int break_label;
- slang_assembly_flow_control loop_flow = *flow;
- slang_assembly_stack_info stk;
+ GLuint skip_jump, end_jump, cond_jump;
+ GLuint break_label;
+ slang_assembly_flow_control save_flow = A->flow;
/* skip the "go to the end of the loop" statement */
- skip_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ skip_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* go to the end of the loop - break statements are directed here */
- break_label = file->count;
- end_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ break_label = A->file->count;
+ end_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* resolve the beginning of the loop - continue statements are directed here */
- file->code[skip_jump].param[0] = file->count;
+ A->file->code[skip_jump].param[0] = A->file->count;
/* execute condition statement */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
/* jump to the end of the loop if not true */
- cond_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* execute loop body */
- loop_flow.loop_start = file->code[skip_jump].param[0];
- loop_flow.loop_end = break_label;
- if (!_slang_assemble_operation (file, op->children + 1, 0, &loop_flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + 1, 0, space))
- return 0;
+ A->flow.loop_start = A->file->code[skip_jump].param[0];
+ A->flow.loop_end = break_label;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[1]))
+ return GL_FALSE;
+ A->flow = save_flow;
/* jump to the beginning of the loop */
- if (!slang_assembly_file_push_label (file, slang_asm_jump, file->code[skip_jump].param[0]))
- return 0;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_jump, A->file->code[skip_jump].param[0]))
+ return GL_FALSE;
/* resolve the end of the loop */
- file->code[end_jump].param[0] = file->count;
- file->code[cond_jump].param[0] = file->count;
+ A->file->code[end_jump].param[0] = A->file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
-/* _slang_assemble_if() */
+/*
+ * _slang_assemble_if()
+ *
+ * if:
+ * <condition-statement>
+ * jumpz else
+ * <true-statement>
+ * jump end
+ * else:
+ * <false-statement>
+ * end:
+ */
-int _slang_assemble_if (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+GLboolean _slang_assemble_if (slang_assemble_ctx *A, slang_operation *op)
{
- /*
- if:
- <condition-statement>
- jumpz else
- <true-statement>
- jump end
- else:
- <false-statement>
- end:
- */
-
- unsigned int cond_jump, else_jump;
- slang_assembly_stack_info stk;
+ GLuint cond_jump, else_jump;
/* execute condition statement */
- if (!_slang_assemble_operation (file, op->children, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
+ if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
/* jump to false-statement if not true */
- cond_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump_if_zero))
- return 0;
+ cond_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump_if_zero))
+ return GL_FALSE;
/* execute true-statement */
- if (!_slang_assemble_operation (file, op->children + 1, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + 1, 0, space))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[1]))
+ return GL_FALSE;
/* skip if-false statement */
- else_jump = file->count;
- if (!slang_assembly_file_push (file, slang_asm_jump))
- return 0;
+ else_jump = A->file->count;
+ if (!slang_assembly_file_push (A->file, slang_asm_jump))
+ return GL_FALSE;
/* resolve start of false-statement */
- file->code[cond_jump].param[0] = file->count;
+ A->file->code[cond_jump].param[0] = A->file->count;
/* execute false-statement */
- if (!_slang_assemble_operation (file, op->children + 2, 0, flow, space, info, &stk))
- return 0;
- /* TODO: pass-in stk to cleanup */
- if (!_slang_cleanup_stack (file, op->children + 2, 0, space))
- return 0;
+ if (!_slang_assemble_operation (A, &op->children[2], slang_ref_forbid/*slang_ref_freelance*/))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack (A, &op->children[2]))
+ return GL_FALSE;
/* resolve end of if-false statement */
- file->code[else_jump].param[0] = file->count;
+ A->file->code[else_jump].param[0] = A->file->count;
- return 1;
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_assemble_conditional.h b/src/mesa/shader/slang/slang_assemble_conditional.h
index f52b4129d3..ef0c2172c9 100644
--- a/src/mesa/shader/slang/slang_assemble_conditional.h
+++ b/src/mesa/shader/slang/slang_assemble_conditional.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,39 +25,23 @@
#if !defined SLANG_ASSEMBLE_CONDITIONAL_H
#define SLANG_ASSEMBLE_CONDITIONAL_H
-#include "slang_assemble.h"
-
#if defined __cplusplus
extern "C" {
#endif
-int _slang_assemble_logicaland (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_logicaland (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_logicalor (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_logicalor (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_select (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_select (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_for (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_for (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_do (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_do (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_while (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_while (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_if (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_if (slang_assemble_ctx *, struct slang_operation_ *);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c
index 76a30f6b6c..ea82e85342 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.c
+++ b/src/mesa/shader/slang/slang_assemble_constructor.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,22 +29,20 @@
*/
#include "imports.h"
-#include "slang_utility.h"
-#include "slang_assemble_constructor.h"
-#include "slang_assemble_typeinfo.h"
+#include "slang_assemble.h"
#include "slang_storage.h"
/* _slang_is_swizzle() */
-int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz)
+GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz)
{
- unsigned int i;
- int xyzw = 0, rgba = 0, stpq = 0;
+ GLuint i;
+ GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
/* the swizzle can be at most 4-component long */
swz->num_components = slang_string_length (field);
if (swz->num_components > 4)
- return 0;
+ return GL_FALSE;
for (i = 0; i < swz->num_components; i++)
{
@@ -55,22 +53,22 @@ int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz)
case 'y':
case 'z':
case 'w':
- xyzw = 1;
+ xyzw = GL_TRUE;
break;
case 'r':
case 'g':
case 'b':
case 'a':
- rgba = 1;
+ rgba = GL_TRUE;
break;
case 's':
case 't':
case 'p':
case 'q':
- stpq = 1;
+ stpq = GL_TRUE;
break;
default:
- return 0;
+ return GL_FALSE;
}
/* collect swizzle component */
@@ -84,58 +82,60 @@ int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz)
case 'y':
case 'g':
case 't':
- if (rows < 2)
- return 0;
swz->swizzle[i] = 1;
break;
case 'z':
case 'b':
case 'p':
- if (rows < 3)
- return 0;
swz->swizzle[i] = 2;
break;
case 'w':
case 'a':
case 'q':
- if (rows < 4)
- return 0;
swz->swizzle[i] = 3;
break;
}
+
+ /* check if the component is valid for given vector's row count */
+ if (rows <= swz->swizzle[i])
+ return GL_FALSE;
}
/* only one swizzle group can be used */
if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
- return 0;
+ return GL_FALSE;
- return 1;
+ return GL_TRUE;
}
/* _slang_is_swizzle_mask() */
-int _slang_is_swizzle_mask (const slang_swizzle *swz, unsigned int rows)
+GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows)
{
- unsigned int c, i;
+ GLuint i, c = 0;
+ /* the swizzle may not be longer than the vector dim */
if (swz->num_components > rows)
- return 0;
- c = swz->swizzle[0];
- for (i = 1; i < swz->num_components; i++)
+ return GL_FALSE;
+
+ /* the swizzle components cannot be duplicated */
+ for (i = 0; i < swz->num_components; i++)
{
- if (swz->swizzle[i] <= c)
- return 0;
- c = swz->swizzle[i];
+ if ((c & (1 << swz->swizzle[i])) != 0)
+ return GL_FALSE;
+ c |= 1 << swz->swizzle[i];
}
- return 1;
+
+ return GL_TRUE;
}
/* _slang_multiply_swizzles() */
-void _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
+GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
const slang_swizzle *right)
{
- unsigned int i;
+ GLuint i;
+
dst->num_components = right->num_components;
for (i = 0; i < right->num_components; i++)
dst->swizzle[i] = left->swizzle[right->swizzle[i]];
@@ -143,45 +143,89 @@ void _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
/* _slang_assemble_constructor() */
-static int constructor_aggregate (slang_assembly_file *file, const slang_storage_aggregate *flat,
- unsigned int *index, slang_operation *op, unsigned int size, slang_assembly_flow_control *flow,
- slang_assembly_name_space *space, slang_assembly_local_info *info)
+static GLboolean sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op)
{
slang_assembly_typeinfo ti;
- int result;
+ GLboolean result = GL_FALSE;
slang_storage_aggregate agg, flat_agg;
- slang_assembly_stack_info stk;
- unsigned int i;
- slang_assembly_typeinfo_construct (&ti);
- if (!(result = _slang_typeof_operation (op, space, &ti)))
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
goto end1;
- slang_storage_aggregate_construct (&agg);
- if (!(result = _slang_aggregate_variable (&agg, &ti.spec, NULL, space->funcs, space->structs)))
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
goto end2;
- slang_storage_aggregate_construct (&flat_agg);
- if (!(result = _slang_flatten_aggregate (&flat_agg, &agg)))
+ if (!slang_storage_aggregate_construct (&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat_agg, &agg))
+ goto end;
+
+ *size = flat_agg.count * 4;
+
+ result = GL_TRUE;
+end:
+ slang_storage_aggregate_destruct (&flat_agg);
+end2:
+ slang_storage_aggregate_destruct (&agg);
+end1:
+ slang_assembly_typeinfo_destruct (&ti);
+ return result;
+}
+
+static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat,
+ slang_operation *op, GLuint garbage_size)
+{
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat_agg;
+
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end2;
+
+ if (!slang_storage_aggregate_construct (&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat_agg, &agg))
goto end;
- if (!(result = _slang_assemble_operation (file, op, 0, flow, space, info, &stk)))
+ if (!_slang_assemble_operation (A, op, slang_ref_forbid))
goto end;
- for (i = 0; i < flat_agg.count; i++)
+ /* TODO: convert (generic) elements */
+
+ /* free the garbage */
+ if (garbage_size != 0)
{
- const slang_storage_array *arr1 = flat_agg.arrays + i;
- const slang_storage_array *arr2 = flat->arrays + *index;
+ GLuint i;
- if (arr1->type != arr2->type)
+ /* move the non-garbage part to the end of the argument */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0))
+ goto end;
+ for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4)
{
- /* TODO: convert (generic) from arr1 to arr2 */
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move,
+ garbage_size + i, i))
+ {
+ goto end;
+ }
}
- (*index)++;
- /* TODO: watch the index, if it reaches the size, pop off the stack subsequent values */
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4))
+ goto end;
}
- result = 1;
+ result = GL_TRUE;
end:
slang_storage_aggregate_destruct (&flat_agg);
end2:
@@ -190,40 +234,81 @@ end1:
slang_assembly_typeinfo_destruct (&ti);
return result;
}
-/* XXX: general swizzle! */
-int _slang_assemble_constructor (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info)
+
+GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op)
{
slang_assembly_typeinfo ti;
- int result;
+ GLboolean result = GL_FALSE;
slang_storage_aggregate agg, flat;
- unsigned int size, index, i;
+ GLuint size, i;
+ GLuint arg_sums[2];
- slang_assembly_typeinfo_construct (&ti);
- if (!(result = _slang_typeof_operation (op, space, &ti)))
+ /* get typeinfo of the constructor (the result of constructor expression) */
+ if (!slang_assembly_typeinfo_construct (&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation (A, op, &ti))
goto end1;
- slang_storage_aggregate_construct (&agg);
- if (!(result = _slang_aggregate_variable (&agg, &ti.spec, NULL, space->funcs, space->structs)))
+ /* create an aggregate of the constructor */
+ if (!slang_storage_aggregate_construct (&agg))
+ goto end1;
+ if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
goto end2;
+ /* calculate size of the constructor */
size = _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_construct (&flat);
- if (!(result = _slang_flatten_aggregate (&flat, &agg)))
+ /* flatten the constructor */
+ if (!slang_storage_aggregate_construct (&flat))
+ goto end2;
+ if (!_slang_flatten_aggregate (&flat, &agg))
goto end;
- index = 0;
+ /* collect the last two constructor's argument size sums */
+ arg_sums[0] = 0; /* will hold all but the last argument's size sum */
+ arg_sums[1] = 0; /* will hold all argument's size sum */
for (i = 0; i < op->num_children; i++)
{
- if (!(result = constructor_aggregate (file, &flat, &index, op->children + i, size, flow,
- space, info)))
+ GLuint arg_size;
+
+ if (!sizeof_argument (A, &arg_size, &op->children[i]))
goto end;
- /* TODO: watch the index, if it reaches the size, raise an error */
+ if (i > 0)
+ arg_sums[0] = arg_sums[1];
+ arg_sums[1] += arg_size;
+ }
+
+ /* check if there are too many arguments */
+ if (arg_sums[0] >= size)
+ {
+ /* TODO: info log: too many arguments in constructor list */
+ goto end;
+ }
+
+ /* check if there are too few arguments */
+ if (arg_sums[1] < size)
+ {
+ /* TODO: info log: too few arguments in constructor list */
+ goto end;
}
- result = 1;
+ /* traverse the children that form the constructor expression */
+ for (i = op->num_children; i > 0; i--)
+ {
+ GLuint garbage_size;
+
+ /* the last argument may be too big - calculate the unnecessary data size */
+ if (i == op->num_children)
+ garbage_size = arg_sums[1] - size;
+ else
+ garbage_size = 0;
+
+ if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size))
+ goto end;
+ }
+
+ result = GL_TRUE;
end:
slang_storage_aggregate_destruct (&flat);
end2:
@@ -234,106 +319,67 @@ end1:
}
/* _slang_assemble_constructor_from_swizzle() */
-/* XXX: wrong */
-int _slang_assemble_constructor_from_swizzle (slang_assembly_file *file, const slang_swizzle *swz,
- slang_type_specifier *spec, slang_type_specifier *master_spec, slang_assembly_local_info *info)
+
+GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz,
+ slang_type_specifier *spec, slang_type_specifier *master_spec)
{
- unsigned int master_rows, i;
- switch (master_spec->type)
- {
- case slang_spec_bool:
- case slang_spec_int:
- case slang_spec_float:
- master_rows = 1;
- break;
- case slang_spec_bvec2:
- case slang_spec_ivec2:
- case slang_spec_vec2:
- master_rows = 2;
- break;
- case slang_spec_bvec3:
- case slang_spec_ivec3:
- case slang_spec_vec3:
- master_rows = 3;
- break;
- case slang_spec_bvec4:
- case slang_spec_ivec4:
- case slang_spec_vec4:
- master_rows = 4;
- break;
- default:
- break;
- }
+ GLuint master_rows, i;
+
+ master_rows = _slang_type_dim (master_spec->type);
for (i = 0; i < master_rows; i++)
{
- switch (master_spec->type)
+ switch (_slang_type_base (master_spec->type))
{
case slang_spec_bool:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- if (!slang_assembly_file_push_label2 (file, slang_asm_bool_copy, (master_rows - i) * 4,
- i * 4))
- return 0;
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
break;
case slang_spec_int:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- if (!slang_assembly_file_push_label2 (file, slang_asm_int_copy, (master_rows - i) * 4,
- i * 4))
- return 0;
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
break;
case slang_spec_float:
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- if (!slang_assembly_file_push_label2 (file, slang_asm_float_copy,
- (master_rows - i) * 4, i * 4))
- return 0;
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
break;
default:
- break;
+ break;
}
}
- if (!slang_assembly_file_push_label (file, slang_asm_local_free, 4))
- return 0;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
for (i = swz->num_components; i > 0; i--)
{
- unsigned int n = i - 1;
- if (!slang_assembly_file_push_label2 (file, slang_asm_local_addr, info->swizzle_tmp, 16))
- return 0;
- if (!slang_assembly_file_push_label (file, slang_asm_addr_push, swz->swizzle[n] * 4))
- return 0;
- if (!slang_assembly_file_push (file, slang_asm_addr_add))
- return 0;
- switch (master_spec->type)
+ GLuint n = i - 1;
+
+ if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4))
+ return GL_FALSE;
+ if (!slang_assembly_file_push (A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ switch (_slang_type_base (master_spec->type))
{
case slang_spec_bool:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- if (!slang_assembly_file_push (file, slang_asm_bool_deref))
- return 0;
+ if (!slang_assembly_file_push (A->file, slang_asm_bool_deref))
+ return GL_FALSE;
break;
case slang_spec_int:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- if (!slang_assembly_file_push (file, slang_asm_int_deref))
- return 0;
+ if (!slang_assembly_file_push (A->file, slang_asm_int_deref))
+ return GL_FALSE;
break;
case slang_spec_float:
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- if (!slang_assembly_file_push (file, slang_asm_float_deref))
- return 0;
+ if (!slang_assembly_file_push (A->file, slang_asm_float_deref))
+ return GL_FALSE;
break;
default:
- break;
+ break;
}
}
- return 1;
+
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.h b/src/mesa/shader/slang/slang_assemble_constructor.h
index f8a0fead3c..4bd120c4a8 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.h
+++ b/src/mesa/shader/slang/slang_assemble_constructor.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,52 +25,36 @@
#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
#define SLANG_ASSEMBLE_CONSTRUCTOR_H
-#include "slang_assemble.h"
-#include "slang_compile.h"
-
#if defined __cplusplus
extern "C" {
#endif
/*
- holds a complete information about vector swizzle - the <swizzle> array contains
- vector component sources indices, where 0 is "x", 1 is "y", ...
- example: "xwz" --> { 3, { 0, 3, 2, n/u } }
-*/
-typedef struct slang_swizzle_
-{
- unsigned int num_components;
- unsigned int swizzle[4];
-} slang_swizzle;
-
-/*
- checks if a field selector is a general swizzle (an r-value swizzle with replicated
- components or an l-value swizzle mask) for a vector
- returns 1 if this is the case, <swz> is filled with swizzle information
- returns 0 otherwise
-*/
-int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz);
+ * Checks if a field selector is a general swizzle (an r-value swizzle with replicated
+ * components or an l-value swizzle mask) for a vector.
+ * Returns GL_TRUE if this is the case, <swz> is filled with swizzle information.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz);
/*
- checks if a general swizzle is an l-value swizzle - these swizzles do not have
- duplicated fields and they are specified in order
- returns 1 if this is a swizzle mask
- returns 0 otherwise
-*/
-int _slang_is_swizzle_mask (const slang_swizzle *swz, unsigned int rows);
+ * Checks if a general swizzle is an l-value swizzle - these swizzles do not have
+ * duplicated fields.
+ * Returns GL_TRUE if this is a swizzle mask.
+ * Returns GL_FALSE otherwise
+ */
+GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows);
/*
- combines two swizzles to form single swizzle
- example: "wzyx.yx" --> "zw"
-*/
-void _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
+ * Combines (multiplies) two swizzles to form single swizzle.
+ * Example: "vec.wzyx.yx" --> "vec.zw".
+ */
+GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
-int _slang_assemble_constructor (slang_assembly_file *file, slang_operation *op,
- slang_assembly_flow_control *flow, slang_assembly_name_space *space,
- slang_assembly_local_info *info);
+GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *);
-int _slang_assemble_constructor_from_swizzle (slang_assembly_file *file, const slang_swizzle *swz,
- slang_type_specifier *spec, slang_type_specifier *master_spec, slang_assembly_local_info *info);
+GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *,
+ slang_type_specifier *, slang_type_specifier *);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c
index ce78f66ebe..8c5275f7d5 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.c
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,28 +29,131 @@
*/
#include "imports.h"
-#include "slang_utility.h"
-#include "slang_assemble_typeinfo.h"
+#include "slang_assemble.h"
+#include "slang_compile.h"
+
+/*
+ * slang_type_specifier
+ */
+
+GLvoid slang_type_specifier_ctr (slang_type_specifier *self)
+{
+ self->type = slang_spec_void;
+ self->_struct = NULL;
+ self->_array = NULL;
+}
+
+GLvoid slang_type_specifier_dtr (slang_type_specifier *self)
+{
+ if (self->_struct != NULL)
+ {
+ slang_struct_destruct (self->_struct);
+ slang_alloc_free (self->_struct);
+ }
+ if (self->_array != NULL)
+ {
+ slang_type_specifier_dtr (self->_array);
+ slang_alloc_free (self->_array);
+ }
+}
+
+GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)
+{
+ slang_type_specifier z;
+
+ slang_type_specifier_ctr (&z);
+ z.type = y->type;
+ if (z.type == slang_spec_struct)
+ {
+ z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
+ if (z._struct == NULL)
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_construct (z._struct))
+ {
+ slang_alloc_free (z._struct);
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy (z._struct, y->_struct))
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ }
+ else if (z.type == slang_spec_array)
+ {
+ z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));
+ if (z._array == NULL)
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr (z._array);
+ if (!slang_type_specifier_copy (z._array, y->_array))
+ {
+ slang_type_specifier_dtr (&z);
+ return GL_FALSE;
+ }
+ }
+ slang_type_specifier_dtr (x);
+ *x = z;
+ return GL_TRUE;
+}
+
+GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)
+{
+ if (x->type != y->type)
+ return 0;
+ if (x->type == slang_spec_struct)
+ return slang_struct_equal (x->_struct, y->_struct);
+ if (x->type == slang_spec_array)
+ return slang_type_specifier_equal (x->_array, y->_array);
+ return 1;
+}
/* slang_assembly_typeinfo */
-void slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)
+GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)
{
- slang_type_specifier_construct (&ti->spec);
+ slang_type_specifier_ctr (&ti->spec);
+ ti->array_len = 0;
+ return GL_TRUE;
}
-void slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)
+GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)
{
- slang_type_specifier_destruct (&ti->spec);
+ slang_type_specifier_dtr (&ti->spec);
}
/* _slang_typeof_operation() */
-int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *space,
+static GLboolean typeof_existing_function (const char *name, slang_operation *params,
+ GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec,
+ slang_atom_pool *atoms)
+{
+ slang_atom atom;
+ GLboolean exists;
+
+ atom = slang_atom_pool_atom (atoms, name);
+ if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms))
+ return GL_FALSE;
+ return exists;
+}
+
+GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op,
slang_assembly_typeinfo *ti)
{
- ti->can_be_referenced = 0;
- ti->is_swizzled = 0;
+ return _slang_typeof_operation_ (op, &A->space, ti, A->atoms);
+}
+
+GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space,
+ slang_assembly_typeinfo *ti, slang_atom_pool *atoms)
+{
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
switch (op->type)
{
@@ -77,7 +180,7 @@ int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *spa
case slang_oper_divassign:
case slang_oper_preincrement:
case slang_oper_predecrement:
- if (!_slang_typeof_operation (op->children, space, ti))
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
return 0;
break;
case slang_oper_literal_bool:
@@ -103,20 +206,21 @@ int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *spa
{
slang_variable *var;
- var = _slang_locate_variable (op->locals, op->identifier, 1);
+ var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
if (var == NULL)
- return 0;
+ return GL_FALSE;
if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier))
- return 0;
- ti->can_be_referenced = 1;
+ return GL_FALSE;
+ ti->can_be_referenced = GL_TRUE;
+ ti->array_len = var->array_len;
}
break;
case slang_oper_sequence:
/* TODO: check [0] and [1] if they match */
- if (!_slang_typeof_operation (op->children + 1, space, ti))
- return 0;
- ti->can_be_referenced = 0;
- ti->is_swizzled = 0;
+ if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
break;
/*case slang_oper_modassign:*/
/*case slang_oper_lshassign:*/
@@ -126,10 +230,10 @@ int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *spa
/*case slang_oper_andassign:*/
case slang_oper_select:
/* TODO: check [1] and [2] if they match */
- if (!_slang_typeof_operation (op->children + 1, space, ti))
- return 0;
- ti->can_be_referenced = 0;
- ti->is_swizzled = 0;
+ if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
break;
/*case slang_oper_bitor:*/
/*case slang_oper_bitxor:*/
@@ -137,141 +241,99 @@ int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *spa
/*case slang_oper_lshift:*/
/*case slang_oper_rshift:*/
case slang_oper_add:
- {
- int exists;
- if (!_slang_typeof_function ("+", op->children, 2, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
break;
case slang_oper_subtract:
- {
- int exists;
- if (!_slang_typeof_function ("-", op->children, 2, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
break;
case slang_oper_multiply:
- {
- int exists;
- if (!_slang_typeof_function ("*", op->children, 2, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
break;
case slang_oper_divide:
- {
- int exists;
- if (!_slang_typeof_function ("/", op->children, 2, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms))
+ return GL_FALSE;
break;
/*case slang_oper_modulus:*/
case slang_oper_plus:
- {
- int exists;
- if (!_slang_typeof_function ("+", op->children, 1, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
break;
case slang_oper_minus:
- {
- int exists;
- if (!_slang_typeof_function ("-", op->children, 1, space, &ti->spec, &exists))
- return 0;
- if (!exists)
- return 0;
- }
+ if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms))
+ return GL_FALSE;
break;
/*case slang_oper_complement:*/
case slang_oper_subscript:
{
slang_assembly_typeinfo _ti;
- slang_assembly_typeinfo_construct (&_ti);
- if (!_slang_typeof_operation (op->children, space, &_ti))
+
+ if (!slang_assembly_typeinfo_construct (&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
{
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
ti->can_be_referenced = _ti.can_be_referenced;
- switch (_ti.spec.type)
+ if (_ti.spec.type == slang_spec_array)
{
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- ti->spec.type = slang_spec_bool;
- break;
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- ti->spec.type = slang_spec_int;
- break;
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- ti->spec.type = slang_spec_float;
- break;
- case slang_spec_mat2:
- ti->spec.type = slang_spec_vec2;
- break;
- case slang_spec_mat3:
- ti->spec.type = slang_spec_vec3;
- break;
- case slang_spec_mat4:
- ti->spec.type = slang_spec_vec4;
- break;
- case slang_spec_array:
if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array))
{
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
- break;
- default:
- slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ }
+ else
+ {
+ if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->spec.type = _slang_type_base (_ti.spec.type);
}
slang_assembly_typeinfo_destruct (&_ti);
}
break;
case slang_oper_call:
{
- int exists;
- if (!_slang_typeof_function (op->identifier, op->children, op->num_children, space,
- &ti->spec, &exists))
- return 0;
+ GLboolean exists;
+
+ if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec,
+ &exists, atoms))
+ return GL_FALSE;
if (!exists)
{
- slang_struct *s = slang_struct_scope_find (space->structs, op->identifier, 1);
+ slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE);
if (s != NULL)
{
ti->spec.type = slang_spec_struct;
ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
if (ti->spec._struct == NULL)
- return 0;
- if (!slang_struct_construct_a (ti->spec._struct))
+ return GL_FALSE;
+ if (!slang_struct_construct (ti->spec._struct))
{
slang_alloc_free (ti->spec._struct);
ti->spec._struct = NULL;
- return 0;
+ return GL_FALSE;
}
if (!slang_struct_copy (ti->spec._struct, s))
- return 0;
+ return GL_FALSE;
}
else
{
- slang_type_specifier_type type = slang_type_specifier_type_from_string (
- op->identifier);
+ const char *name;
+ slang_type_specifier_type type;
+
+ name = slang_atom_pool_id (atoms, op->a_id);
+ type = slang_type_specifier_type_from_string (name);
if (type == slang_spec_void)
- return 0;
+ return GL_FALSE;
ti->spec.type = type;
}
}
@@ -280,151 +342,246 @@ int _slang_typeof_operation (slang_operation *op, slang_assembly_name_space *spa
case slang_oper_field:
{
slang_assembly_typeinfo _ti;
- slang_assembly_typeinfo_construct (&_ti);
- if (!_slang_typeof_operation (op->children, space, &_ti))
+
+ if (!slang_assembly_typeinfo_construct (&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
{
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
if (_ti.spec.type == slang_spec_struct)
{
- slang_variable *field = _slang_locate_variable (_ti.spec._struct->fields,
- op->identifier, 0);
+ slang_variable *field;
+
+ field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE);
if (field == NULL)
{
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier))
{
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
+ ti->can_be_referenced = _ti.can_be_referenced;
}
else
{
- unsigned int rows;
- switch (_ti.spec.type)
+ GLuint rows;
+ const char *swizzle;
+ slang_type_specifier_type base;
+
+ /* determine the swizzle of the field expression */
+ if (!_slang_type_is_vector (_ti.spec.type))
{
- case slang_spec_vec2:
- case slang_spec_ivec2:
- case slang_spec_bvec2:
- rows = 2;
- break;
- case slang_spec_vec3:
- case slang_spec_ivec3:
- case slang_spec_bvec3:
- rows = 3;
- break;
- case slang_spec_vec4:
- case slang_spec_ivec4:
- case slang_spec_bvec4:
- rows = 4;
- break;
- default:
slang_assembly_typeinfo_destruct (&_ti);
- return 0;
+ return GL_FALSE;
}
- if (!_slang_is_swizzle (op->identifier, rows, &ti->swz))
- return 0;
- ti->is_swizzled = 1;
+ rows = _slang_type_dim (_ti.spec.type);
+ swizzle = slang_atom_pool_id (atoms, op->a_id);
+ if (!_slang_is_swizzle (swizzle, rows, &ti->swz))
+ {
+ slang_assembly_typeinfo_destruct (&_ti);
+ return GL_FALSE;
+ }
+ ti->is_swizzled = GL_TRUE;
ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz,
rows);
if (_ti.is_swizzled)
{
slang_swizzle swz;
+
+ /* swizzle the swizzle */
_slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz);
ti->swz = swz;
}
- switch (_ti.spec.type)
+ base = _slang_type_base (_ti.spec.type);
+ switch (ti->swz.num_components)
{
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- switch (ti->swz.num_components)
+ case 1:
+ ti->spec.type = base;
+ break;
+ case 2:
+ switch (base)
{
- case 1:
- ti->spec.type = slang_spec_float;
- break;
- case 2:
+ case slang_spec_float:
ti->spec.type = slang_spec_vec2;
break;
- case 3:
- ti->spec.type = slang_spec_vec3;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec2;
break;
- case 4:
- ti->spec.type = slang_spec_vec4;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec2;
+ break;
+ default:
break;
}
break;
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- switch (ti->swz.num_components)
+ case 3:
+ switch (base)
{
- case 1:
- ti->spec.type = slang_spec_int;
- break;
- case 2:
- ti->spec.type = slang_spec_ivec2;
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec3;
break;
- case 3:
+ case slang_spec_int:
ti->spec.type = slang_spec_ivec3;
break;
- case 4:
- ti->spec.type = slang_spec_ivec4;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec3;
+ break;
+ default:
break;
}
break;
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- switch (ti->swz.num_components)
+ case 4:
+ switch (base)
{
- case 1:
- ti->spec.type = slang_spec_bool;
- break;
- case 2:
- ti->spec.type = slang_spec_bvec2;
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec4;
break;
- case 3:
- ti->spec.type = slang_spec_bvec3;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec4;
break;
- case 4:
+ case slang_spec_bool:
ti->spec.type = slang_spec_bvec4;
break;
+ default:
+ break;
}
break;
default:
- break;
+ break;
}
}
slang_assembly_typeinfo_destruct (&_ti);
- return 1;
}
break;
case slang_oper_postincrement:
case slang_oper_postdecrement:
- if (!_slang_typeof_operation (op->children, space, ti))
- return 0;
- ti->can_be_referenced = 0;
- ti->is_swizzled = 0;
+ if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
break;
default:
- return 0;
+ return GL_FALSE;
}
- return 1;
+
+ return GL_TRUE;
}
/* _slang_typeof_function() */
-int _slang_typeof_function (const char *name, slang_operation *params, unsigned int num_params,
- slang_assembly_name_space *space, slang_type_specifier *spec, int *exists)
+GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params,
+ slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *atoms)
{
- slang_function *fun = _slang_locate_function (name, params, num_params, space);
+ slang_function *fun;
+
+ fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms);
*exists = fun != NULL;
if (fun == NULL)
- return 1;
+ return GL_TRUE;
return slang_type_specifier_copy (spec, &fun->header.type.specifier);
}
+/* _slang_type_is_matrix() */
+
+GLboolean _slang_type_is_matrix (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_mat2:
+ case slang_spec_mat3:
+ case slang_spec_mat4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+/* _slang_type_is_vector() */
+
+GLboolean _slang_type_is_vector (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+/* _slang_type_base_of_vector() */
+
+slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_float:
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ return slang_spec_float;
+ case slang_spec_int:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ return slang_spec_int;
+ case slang_spec_bool:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return slang_spec_bool;
+ case slang_spec_mat2:
+ return slang_spec_vec2;
+ case slang_spec_mat3:
+ return slang_spec_vec3;
+ case slang_spec_mat4:
+ return slang_spec_vec4;
+ default:
+ return slang_spec_void;
+ }
+}
+
+/* _slang_type_dim */
+
+GLuint _slang_type_dim (slang_type_specifier_type ty)
+{
+ switch (ty)
+ {
+ case slang_spec_float:
+ case slang_spec_int:
+ case slang_spec_bool:
+ return 1;
+ case slang_spec_vec2:
+ case slang_spec_ivec2:
+ case slang_spec_bvec2:
+ case slang_spec_mat2:
+ return 2;
+ case slang_spec_vec3:
+ case slang_spec_ivec3:
+ case slang_spec_bvec3:
+ case slang_spec_mat3:
+ return 3;
+ case slang_spec_vec4:
+ case slang_spec_ivec4:
+ case slang_spec_bvec4:
+ case slang_spec_mat4:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h
index 1c1839457e..257793990b 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.h
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,39 +25,88 @@
#if !defined SLANG_ASSEMBLE_TYPEINFO_H
#define SLANG_ASSEMBLE_TYPEINFO_H
-#include "slang_assemble_constructor.h"
-#include "slang_compile.h"
-
#if defined __cplusplus
extern "C" {
#endif
+typedef enum slang_type_specifier_type_
+{
+ slang_spec_void,
+ slang_spec_bool,
+ slang_spec_bvec2,
+ slang_spec_bvec3,
+ slang_spec_bvec4,
+ slang_spec_int,
+ slang_spec_ivec2,
+ slang_spec_ivec3,
+ slang_spec_ivec4,
+ slang_spec_float,
+ slang_spec_vec2,
+ slang_spec_vec3,
+ slang_spec_vec4,
+ slang_spec_mat2,
+ slang_spec_mat3,
+ slang_spec_mat4,
+ slang_spec_sampler1D,
+ slang_spec_sampler2D,
+ slang_spec_sampler3D,
+ slang_spec_samplerCube,
+ slang_spec_sampler1DShadow,
+ slang_spec_sampler2DShadow,
+ slang_spec_struct,
+ slang_spec_array
+} slang_type_specifier_type;
+
+typedef struct slang_type_specifier_
+{
+ slang_type_specifier_type type;
+ struct slang_struct_ *_struct; /* type: spec_struct */
+ struct slang_type_specifier_ *_array; /* type: spec_array */
+} slang_type_specifier;
+
+GLvoid slang_type_specifier_ctr (slang_type_specifier *);
+GLvoid slang_type_specifier_dtr (slang_type_specifier *);
+GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
+GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
+
typedef struct slang_assembly_typeinfo_
{
- int can_be_referenced;
- int is_swizzled;
+ GLboolean can_be_referenced;
+ GLboolean is_swizzled;
slang_swizzle swz;
slang_type_specifier spec;
+ GLuint array_len;
} slang_assembly_typeinfo;
-void slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
-void slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
+GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
+GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
/*
- retrieves type information about an operation
- returns 1 on success
- returns 0 otherwise
-*/
-int _slang_typeof_operation (slang_operation *, slang_assembly_name_space *,
+ * Retrieves type information about an operation.
+ * Returns GL_TRUE on success.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *,
slang_assembly_typeinfo *);
+GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *,
+ slang_assembly_typeinfo *, slang_atom_pool *);
/*
- retrieves type of a function prototype, if one exists
- returns 1 on success, even if the function was not found
- returns 0 otherwise
-*/
-int _slang_typeof_function (const char *name, slang_operation *params, unsigned int num_params,
- slang_assembly_name_space *space, slang_type_specifier *spec, int *exists);
+ * Retrieves type of a function prototype, if one exists.
+ * Returns GL_TRUE on success, even if the function was not found.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params,
+ GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *);
+
+GLboolean _slang_type_is_matrix (slang_type_specifier_type);
+
+GLboolean _slang_type_is_vector (slang_type_specifier_type);
+
+slang_type_specifier_type _slang_type_base (slang_type_specifier_type);
+
+GLuint _slang_type_dim (slang_type_specifier_type);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 3418f6fae2..d25f75dab9 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -27,557 +27,114 @@
* slang front-end compiler
* \author Michal Krol
*/
-
-#include "imports.h"
-#include "grammar_mesa.h"
-#include "slang_utility.h"
+
+#include "imports.h"
+#include "grammar_mesa.h"
#include "slang_compile.h"
#include "slang_preprocess.h"
-#include "slang_storage.h"
-#include "slang_assemble.h"
-#include "slang_execute.h"
+#include "slang_storage.h"
/*
- This is a straightforward implementation of the slang front-end compiler.
- Lots of error-checking functionality is missing but every well-formed shader source should
- compile successfully and execute as expected. However, some semantically ill-formed shaders
- may be accepted resulting in undefined behaviour.
-*/
-
-static void slang_variable_construct (slang_variable *);
-static int slang_variable_copy (slang_variable *, const slang_variable *);
-static void slang_struct_destruct (slang_struct *);
-static int slang_struct_equal (const slang_struct *, const slang_struct *);
-static void slang_variable_destruct (slang_variable *);
-
-/* slang_type_specifier_type */
-
-/* these must match with slang_type_specifier_type enum */
-static const char *type_specifier_type_names[] = {
- "void",
- "bool",
- "bvec2",
- "bvec3",
- "bvec4",
- "int",
- "ivec2",
- "ivec3",
- "ivec4",
- "float",
- "vec2",
- "vec3",
- "vec4",
- "mat2",
- "mat3",
- "mat4",
- "sampler1D",
- "sampler2D",
- "sampler3D",
- "samplerCube",
- "sampler1DShadow",
- "sampler2DShadow",
- NULL
-};
-
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)
-{
- const char **p = type_specifier_type_names;
- while (*p != NULL)
- {
- if (slang_string_compare (*p, name) == 0)
- return (slang_type_specifier_type) (p - type_specifier_type_names);
- p++;
- }
- return slang_spec_void;
-}
-
-/* slang_type_specifier */
-
-void slang_type_specifier_construct (slang_type_specifier *spec)
-{
- spec->type = slang_spec_void;
- spec->_struct = NULL;
- spec->_array = NULL;
-}
-
-void slang_type_specifier_destruct (slang_type_specifier *spec)
-{
- if (spec->_struct != NULL)
- {
- slang_struct_destruct (spec->_struct);
- slang_alloc_free (spec->_struct);
- }
- if (spec->_array != NULL)
- {
- slang_type_specifier_destruct (spec->_array);
- slang_alloc_free (spec->_array);
- }
-}
-
-int slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)
-{
- slang_type_specifier_destruct (x);
- slang_type_specifier_construct (x);
- x->type = y->type;
- if (x->type == slang_spec_struct)
- {
- x->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (x->_struct == NULL)
- return 0;
- if (!slang_struct_construct_a (x->_struct))
- {
- slang_alloc_free (x->_struct);
- x->_struct = NULL;
- return 0;
- }
- return slang_struct_copy (x->_struct, y->_struct);
- }
- if (x->type == slang_spec_array)
- {
- x->_array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));
- if (x->_array == NULL)
- return 0;
- slang_type_specifier_construct (x->_array);
- return slang_type_specifier_copy (x->_array, y->_array);
- }
- return 1;
-}
-
-int slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)
-{
- if (x->type != y->type)
- return 0;
- if (x->type == slang_spec_struct)
- return slang_struct_equal (x->_struct, y->_struct);
- if (x->type == slang_spec_array)
- return slang_type_specifier_equal (x->_array, y->_array);
- return 1;
-}
-
-/* slang_fully_specified_type */
-
-static void slang_fully_specified_type_construct (slang_fully_specified_type *type)
-{
- type->qualifier = slang_qual_none;
- slang_type_specifier_construct (&type->specifier);
-}
-
-static void slang_fully_specified_type_destruct (slang_fully_specified_type *type)
-{
- slang_type_specifier_destruct (&type->specifier);
-}
-
-static int slang_fully_specified_type_copy (slang_fully_specified_type *x,
- const slang_fully_specified_type *y)
-{
- slang_fully_specified_type_construct (x);
- slang_fully_specified_type_destruct (x);
- x->qualifier = y->qualifier;
- return slang_type_specifier_copy (&x->specifier, &y->specifier);
-}
+ * This is a straightforward implementation of the slang front-end compiler.
+ * Lots of error-checking functionality is missing but every well-formed shader source should
+ * compile successfully and execute as expected. However, some semantically ill-formed shaders
+ * may be accepted resulting in undefined behaviour.
+ */
-/* slang_variable_scope */
+/* slang_var_pool */
-static void slang_variable_scope_construct (slang_variable_scope *scope)
+static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size)
{
- scope->variables = NULL;
- scope->num_variables = 0;
- scope->outer_scope = NULL;
-}
+ GLuint addr;
-static void slang_variable_scope_destruct (slang_variable_scope *scope)
-{
- unsigned int i;
- for (i = 0; i < scope->num_variables; i++)
- slang_variable_destruct (scope->variables + i);
- slang_alloc_free (scope->variables);
-}
-
-static int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)
-{
- unsigned int i;
- slang_variable_scope_destruct (x);
- slang_variable_scope_construct (x);
- x->variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (
- slang_variable));
- if (x->variables == NULL)
- return 0;
- x->num_variables = y->num_variables;
- for (i = 0; i < x->num_variables; i++)
- slang_variable_construct (x->variables + i);
- for (i = 0; i < x->num_variables; i++)
- if (!slang_variable_copy (x->variables + i, y->variables + i))
- return 0;
- x->outer_scope = y->outer_scope;
- return 1;
+ addr = pool->next_addr;
+ pool->next_addr += size;
+ return addr;
}
-/* slang_operation */
-
-int slang_operation_construct_a (slang_operation *oper)
-{
- oper->type = slang_oper_none;
- oper->children = NULL;
- oper->num_children = 0;
- oper->literal = (float) 0;
- oper->identifier = NULL;
- oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (oper->locals == NULL)
- return 0;
- slang_variable_scope_construct (oper->locals);
- return 1;
-}
-
-void slang_operation_destruct (slang_operation *oper)
-{
- unsigned int i;
- for (i = 0; i < oper->num_children; i++)
- slang_operation_destruct (oper->children + i);
- slang_alloc_free (oper->children);
- slang_alloc_free (oper->identifier);
- slang_variable_scope_destruct (oper->locals);
- slang_alloc_free (oper->locals);
-}
+/* slang_translation_unit */
-static int slang_operation_copy (slang_operation *x, const slang_operation *y)
+int slang_translation_unit_construct (slang_translation_unit *unit)
{
- unsigned int i;
- for (i = 0; i < x->num_children; i++)
- slang_operation_destruct (x->children + i);
- slang_alloc_free (x->children);
- x->num_children = 0;
- slang_alloc_free (x->identifier);
- x->identifier = NULL;
- slang_variable_scope_destruct (x->locals);
- slang_variable_scope_construct (x->locals);
-
- x->type = y->type;
- x->children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (
- slang_operation));
- if (x->children == NULL)
+ unit->assembly = (slang_assembly_file *) slang_alloc_malloc (sizeof (slang_assembly_file));
+ if (unit->assembly == NULL)
return 0;
- for (i = 0; i < y->num_children; i++)
- if (!slang_operation_construct_a (x->children + i))
- {
- unsigned int j;
- for (j = 0; j < i; j++)
- slang_operation_destruct (x->children + j);
- slang_alloc_free (x->children);
- x->children = NULL;
- return 0;
- }
- x->num_children = y->num_children;
- for (i = 0; i < x->num_children; i++)
- if (!slang_operation_copy (x->children + i, y->children + i))
- return 0;
- x->literal = y->literal;
- if (y->identifier != NULL)
+ if (!slang_assembly_file_construct (unit->assembly))
{
- x->identifier = slang_string_duplicate (y->identifier);
- if (x->identifier == NULL)
- return 0;
- }
- if (!slang_variable_scope_copy (x->locals, y->locals))
+ slang_alloc_free (unit->assembly);
return 0;
- return 1;
-}
-
-/* slang_variable */
-
-static void slang_variable_construct (slang_variable *var)
-{
- slang_fully_specified_type_construct (&var->type);
- var->name = NULL;
- var->array_size = NULL;
- var->initializer = NULL;
- var->address = ~0;
-}
-
-static void slang_variable_destruct (slang_variable *var)
-{
- slang_fully_specified_type_destruct (&var->type);
- slang_alloc_free (var->name);
- if (var->array_size != NULL)
- {
- slang_operation_destruct (var->array_size);
- slang_alloc_free (var->array_size);
}
- if (var->initializer != NULL)
+ unit->global_pool = (slang_var_pool *) slang_alloc_malloc (sizeof (slang_var_pool));
+ if (unit->global_pool == NULL)
{
- slang_operation_destruct (var->initializer);
- slang_alloc_free (var->initializer);
- }
-}
-
-static int slang_variable_copy (slang_variable *x, const slang_variable *y)
-{
- slang_variable_destruct (x);
- slang_variable_construct (x);
- if (!slang_fully_specified_type_copy (&x->type, &y->type))
+ slang_assembly_file_destruct (unit->assembly);
+ slang_alloc_free (unit->assembly);
return 0;
- if (y->name != NULL)
- {
- x->name = slang_string_duplicate (y->name);
- if (x->name == NULL)
- return 0;
}
- if (y->array_size != NULL)
+ unit->global_pool->next_addr = 0;
+ unit->machine = (slang_machine *) slang_alloc_malloc (sizeof (slang_machine));
+ if (unit->machine == NULL)
{
- x->array_size = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (x->array_size == NULL)
- return 0;
- if (!slang_operation_construct_a (x->array_size))
- {
- slang_alloc_free (x->array_size);
- x->array_size = NULL;
- return 0;
- }
- if (!slang_operation_copy (x->array_size, y->array_size))
- return 0;
+ slang_alloc_free (unit->global_pool);
+ slang_assembly_file_destruct (unit->assembly);
+ slang_alloc_free (unit->assembly);
+ return 0;
}
- if (y->initializer != NULL)
+ slang_machine_ctr (unit->machine);
+ unit->atom_pool = (slang_atom_pool *) slang_alloc_malloc (sizeof (slang_atom_pool));
+ if (unit->atom_pool == NULL)
{
- x->initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (x->initializer == NULL)
- return 0;
- if (!slang_operation_construct_a (x->initializer))
- {
- slang_alloc_free (x->initializer);
- x->initializer = NULL;
- return 0;
- }
- if (!slang_operation_copy (x->initializer, y->initializer))
- return 0;
- }
- return 1;
-}
-
-slang_variable *_slang_locate_variable (slang_variable_scope *scope, const char *name, int all)
-{
- unsigned int i;
- for (i = 0; i < scope->num_variables; i++)
- if (slang_string_compare (name, scope->variables[i].name) == 0)
- return scope->variables + i;
- if (all && scope->outer_scope != NULL)
- return _slang_locate_variable (scope->outer_scope, name, 1);
- return NULL;
-}
-
-/* slang_struct_scope */
-
-static void slang_struct_scope_construct (slang_struct_scope *scope)
-{
- scope->structs = NULL;
- scope->num_structs = 0;
- scope->outer_scope = NULL;
-}
-
-static void slang_struct_scope_destruct (slang_struct_scope *scope)
-{
- unsigned int i;
- for (i = 0; i < scope->num_structs; i++)
- slang_struct_destruct (scope->structs + i);
- slang_alloc_free (scope->structs);
-}
-
-static int slang_struct_scope_copy (slang_struct_scope *x, const slang_struct_scope *y)
-{
- unsigned int i;
- slang_struct_scope_destruct (x);
- slang_struct_scope_construct (x);
- x->structs = (slang_struct *) slang_alloc_malloc (y->num_structs * sizeof (slang_struct));
- if (x->structs == NULL)
+ slang_alloc_free (unit->machine);
+ slang_alloc_free (unit->global_pool);
+ slang_assembly_file_destruct (unit->assembly);
+ slang_alloc_free (unit->assembly);
return 0;
- x->num_structs = y->num_structs;
- for (i = 0; i < x->num_structs; i++)
- {
- unsigned int j;
- if (!slang_struct_construct_a (x->structs + i))
- {
- for (j = 0; j < i; j++)
- slang_struct_destruct (x->structs + j);
- slang_alloc_free (x->structs);
- x->structs = NULL;
- return 0;
- }
}
- for (i = 0; i < x->num_structs; i++)
- if (!slang_struct_copy (x->structs + i, y->structs + i))
- return 0;
- x->outer_scope = y->outer_scope;
- return 1;
-}
-
-slang_struct *slang_struct_scope_find (slang_struct_scope *stru, const char *name, int all_scopes)
-{
- unsigned int i;
- for (i = 0; i < stru->num_structs; i++)
- if (slang_string_compare (name, stru->structs[i].name) == 0)
- return stru->structs + i;
- if (all_scopes && stru->outer_scope != NULL)
- return slang_struct_scope_find (stru->outer_scope, name, 1);
- return NULL;
-}
-
-/* slang_struct */
-
-int slang_struct_construct_a (slang_struct *stru)
-{
- stru->name = NULL;
- stru->fields = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (stru->fields == NULL)
- return 0;
- slang_variable_scope_construct (stru->fields);
- stru->structs = (slang_struct_scope *) slang_alloc_malloc (sizeof (slang_struct_scope));
- if (stru->structs == NULL)
+ slang_atom_pool_construct (unit->atom_pool);
+ if (!slang_translation_unit_construct2 (unit, unit->assembly, unit->global_pool, unit->machine,
+ unit->atom_pool))
{
- slang_variable_scope_destruct (stru->fields);
- slang_alloc_free (stru->fields);
+ slang_alloc_free (unit->atom_pool);
+ slang_alloc_free (unit->machine);
+ slang_alloc_free (unit->global_pool);
+ slang_assembly_file_destruct (unit->assembly);
+ slang_alloc_free (unit->assembly);
return 0;
}
- slang_struct_scope_construct (stru->structs);
- return 1;
-}
-
-static void slang_struct_destruct (slang_struct *stru)
-{
- slang_alloc_free (stru->name);
- slang_variable_scope_destruct (stru->fields);
- slang_alloc_free (stru->fields);
- slang_struct_scope_destruct (stru->structs);
- slang_alloc_free (stru->structs);
-}
-
-int slang_struct_copy (slang_struct *x, const slang_struct *y)
-{
- slang_alloc_free (x->name);
- x->name = NULL;
- slang_variable_scope_destruct (x->fields);
- slang_variable_scope_construct (x->fields);
- slang_struct_scope_destruct (x->structs);
- slang_struct_scope_construct (x->structs);
- if (y->name != NULL)
- {
- x->name = slang_string_duplicate (y->name);
- if (x->name == NULL)
- return 0;
- }
- if (!slang_variable_scope_copy (x->fields, y->fields))
- return 0;
- if (!slang_struct_scope_copy (x->structs, y->structs))
- return 0;
+ unit->free_assembly = 1;
+ unit->free_global_pool = 1;
+ unit->free_machine = 1;
+ unit->free_atom_pool = 1;
return 1;
}
-static int slang_struct_equal (const slang_struct *x, const slang_struct *y)
+int slang_translation_unit_construct2 (slang_translation_unit *unit, slang_assembly_file *file,
+ slang_var_pool *pool, struct slang_machine_ *mach, slang_atom_pool *atoms)
{
- unsigned int i;
- if (x->fields->num_variables != y->fields->num_variables)
+ if (!slang_variable_scope_construct (&unit->globals))
return 0;
- for (i = 0; i < x->fields->num_variables; i++)
+ if (!slang_function_scope_construct (&unit->functions))
{
- slang_variable *varx = x->fields->variables + i;
- slang_variable *vary = y->fields->variables + i;
- if (slang_string_compare (varx->name, vary->name) != 0)
- return 0;
- if (!slang_type_specifier_equal (&varx->type.specifier, &vary->type.specifier))
- return 0;
- if (varx->type.specifier.type == slang_spec_array)
- {
- /* TODO compare array sizes */
- }
+ slang_variable_scope_destruct (&unit->globals);
+ return 0;
}
- return 1;
-}
-
-/* slang_function */
-/* XXX mem! */
-static void slang_function_construct (slang_function *func)
-{
- func->kind = slang_func_ordinary;
- slang_variable_construct (&func->header);
- func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- slang_variable_scope_construct (func->parameters);
- func->body = NULL;
- func->address = ~0;
-}
-
-static void slang_function_destruct (slang_function *func)
-{
- slang_variable_destruct (&func->header);
- slang_variable_scope_destruct (func->parameters);
- slang_alloc_free (func->parameters);
- if (func->body != NULL)
+ if (!slang_struct_scope_construct (&unit->structs))
{
- slang_operation_destruct (func->body);
- slang_alloc_free (func->body);
- }
-}
-
-/* slang_function_scope */
-
-static void slang_function_scope_construct (slang_function_scope *scope)
-{
- scope->functions = NULL;
- scope->num_functions = 0;
- scope->outer_scope = NULL;
-}
-
-static void slang_function_scope_destruct (slang_function_scope *scope)
-{
- unsigned int i;
- for (i = 0; i < scope->num_functions; i++)
- slang_function_destruct (scope->functions + i);
- slang_alloc_free (scope->functions);
-}
-
-static int slang_function_scope_find_by_name (slang_function_scope *funcs, const char *name,
- int all_scopes)
-{
- unsigned int i;
- for (i = 0; i < funcs->num_functions; i++)
- if (slang_string_compare (name, funcs->functions[i].header.name) == 0)
- return 1;
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find_by_name (funcs->outer_scope, name, 1);
- return 0;
-}
-
-static slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,
- int all_scopes)
-{
- unsigned int i;
- for (i = 0; i < funcs->num_functions; i++)
- {
- slang_function *f = funcs->functions + i;
- unsigned int j;
- if (slang_string_compare (fun->header.name, f->header.name) != 0)
- continue;
- if (fun->param_count != f->param_count)
- continue;
- for (j = 0; j < fun->param_count; j++)
- {
- if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,
- &f->parameters->variables[j].type.specifier))
- {
- break;
- }
- }
- if (j == fun->param_count)
- return f;
+ slang_variable_scope_destruct (&unit->globals);
+ slang_function_scope_destruct (&unit->functions);
+ return 0;
}
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find (funcs->outer_scope, fun, 1);
- return NULL;
-}
-
-/* slang_translation_unit */
-
-void slang_translation_unit_construct (slang_translation_unit *unit)
-{
- slang_variable_scope_construct (&unit->globals);
- slang_function_scope_construct (&unit->functions);
- slang_struct_scope_construct (&unit->structs);
+ unit->assembly = file;
+ unit->free_assembly = 0;
+ unit->global_pool = pool;
+ unit->free_global_pool = 0;
+ unit->machine = mach;
+ unit->free_machine = 0;
+ unit->atom_pool = atoms;
+ unit->free_atom_pool = 0;
+ slang_export_data_table_ctr (&unit->exp_data);
+ slang_export_code_table_ctr (&unit->exp_code);
+ return 1;
}
void slang_translation_unit_destruct (slang_translation_unit *unit)
@@ -585,6 +142,25 @@ void slang_translation_unit_destruct (slang_translation_unit *unit)
slang_variable_scope_destruct (&unit->globals);
slang_function_scope_destruct (&unit->functions);
slang_struct_scope_destruct (&unit->structs);
+ if (unit->free_assembly)
+ {
+ slang_assembly_file_destruct (unit->assembly);
+ slang_alloc_free (unit->assembly);
+ }
+ if (unit->free_global_pool)
+ slang_alloc_free (unit->global_pool);
+ if (unit->free_machine)
+ {
+ slang_machine_dtr (unit->machine);
+ slang_alloc_free (unit->machine);
+ }
+ if (unit->free_atom_pool)
+ {
+ slang_atom_pool_destruct (unit->atom_pool);
+ slang_alloc_free (unit->atom_pool);
+ }
+ slang_export_data_table_dtr (&unit->exp_data);
+ slang_export_code_table_ctr (&unit->exp_code);
}
/* slang_info_log */
@@ -606,19 +182,21 @@ void slang_info_log_destruct (slang_info_log *log)
static int slang_info_log_message (slang_info_log *log, const char *prefix, const char *msg)
{
unsigned int new_size;
+
if (log->dont_free_text)
return 0;
new_size = slang_string_length (prefix) + 3 + slang_string_length (msg);
if (log->text != NULL)
{
- log->text = (char *) slang_alloc_realloc (log->text, slang_string_length (log->text) + 1,
- new_size + slang_string_length (log->text) + 1);
+ unsigned int text_len = slang_string_length (log->text);
+
+ log->text = (char *) slang_alloc_realloc (log->text, text_len + 1, new_size + text_len + 1);
}
else
{
log->text = (char *) slang_alloc_malloc (new_size + 1);
if (log->text != NULL)
- *log->text = '\0';
+ log->text[0] = '\0';
}
if (log->text == NULL)
return 0;
@@ -673,20 +251,37 @@ typedef struct slang_parse_ctx_
const byte *I;
slang_info_log *L;
int parsing_builtin;
+ int global_scope;
+ slang_atom_pool *atoms;
} slang_parse_ctx;
+/* slang_output_ctx */
+
+typedef struct slang_output_ctx_
+{
+ slang_variable_scope *vars;
+ slang_function_scope *funs;
+ slang_struct_scope *structs;
+ slang_assembly_file *assembly;
+ slang_var_pool *global_pool;
+ slang_machine *machine;
+} slang_output_ctx;
+
/* _slang_compile() */
-static int parse_identifier (slang_parse_ctx *C, char **id)
+static void parse_identifier_str (slang_parse_ctx *C, char **id)
{
- *id = slang_string_duplicate ((const char *) C->I);
- if (*id == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- C->I += _mesa_strlen ((const char *) C->I) + 1;
- return 1;
+ *id = (char *) C->I;
+ C->I += _mesa_strlen (*id) + 1;
+}
+
+static slang_atom parse_identifier (slang_parse_ctx *C)
+{
+ const char *id;
+
+ id = (const char *) C->I;
+ C->I += _mesa_strlen (id) + 1;
+ return slang_atom_pool_atom (C->atoms, id);
}
static int parse_number (slang_parse_ctx *C, int *number)
@@ -718,30 +313,14 @@ static int parse_float (slang_parse_ctx *C, float *number)
char *exponent = NULL;
char *whole = NULL;
- if (!parse_identifier (C, &integral))
- return 0;
+ parse_identifier_str (C, &integral);
+ parse_identifier_str (C, &fractional);
+ parse_identifier_str (C, &exponent);
- if (!parse_identifier (C, &fractional))
- {
- slang_alloc_free (integral);
- return 0;
- }
-
- if (!parse_identifier (C, &exponent))
- {
- slang_alloc_free (fractional);
- slang_alloc_free (integral);
- return 0;
- }
-
- whole = (char *) (slang_alloc_malloc ((_mesa_strlen (integral) +
- _mesa_strlen (fractional) + _mesa_strlen (exponent) + 3) *
- sizeof (char)));
+ whole = (char *) (slang_alloc_malloc ((_mesa_strlen (integral) + _mesa_strlen (fractional) +
+ _mesa_strlen (exponent) + 3) * sizeof (char)));
if (whole == NULL)
{
- slang_alloc_free (exponent);
- slang_alloc_free (fractional);
- slang_alloc_free (integral);
slang_info_log_memory (C->L);
return 0;
}
@@ -755,14 +334,11 @@ static int parse_float (slang_parse_ctx *C, float *number)
*number = (float) (_mesa_strtod(whole, (char **)NULL));
slang_alloc_free (whole);
- slang_alloc_free (exponent);
- slang_alloc_free (fractional);
- slang_alloc_free (integral);
return 1;
}
/* revision number - increment after each change affecting emitted output */
-#define REVISION 2
+#define REVISION 3
static int check_revision (slang_parse_ctx *C)
{
@@ -775,10 +351,200 @@ static int check_revision (slang_parse_ctx *C)
return 1;
}
-static int parse_statement (slang_parse_ctx *, slang_operation *, slang_variable_scope *,
- slang_struct_scope *, slang_function_scope *);
-static int parse_expression (slang_parse_ctx *, slang_operation *, slang_variable_scope *,
- slang_struct_scope *, slang_function_scope *);
+static int parse_statement (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
+static int parse_expression (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
+static int parse_type_specifier (slang_parse_ctx *, slang_output_ctx *, slang_type_specifier *);
+
+static GLboolean parse_array_len (slang_parse_ctx *C, slang_output_ctx *O, GLuint *len)
+{
+ slang_operation array_size;
+ slang_assembly_name_space space;
+ GLboolean result;
+
+ if (!slang_operation_construct (&array_size))
+ return GL_FALSE;
+ if (!parse_expression (C, O, &array_size))
+ {
+ slang_operation_destruct (&array_size);
+ return GL_FALSE;
+ }
+
+ space.funcs = O->funs;
+ space.structs = O->structs;
+ space.vars = O->vars;
+ result = _slang_evaluate_int (O->assembly, O->machine, &space, &array_size, len, C->atoms);
+ slang_operation_destruct (&array_size);
+ return result;
+}
+
+static GLboolean calculate_var_size (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var)
+{
+ slang_storage_aggregate agg;
+
+ if (!slang_storage_aggregate_construct (&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable (&agg, &var->type.specifier, var->array_len, O->funs, O->structs,
+ O->vars, O->machine, O->assembly, C->atoms))
+ {
+ slang_storage_aggregate_destruct (&agg);
+ return GL_FALSE;
+ }
+ var->size = _slang_sizeof_aggregate (&agg);
+ slang_storage_aggregate_destruct (&agg);
+ return GL_TRUE;
+}
+
+static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var,
+ const slang_type_specifier *sp)
+{
+ /* sized array - mark it as array, copy the specifier to the array element and
+ * parse the expression */
+ var->type.specifier.type = slang_spec_array;
+ var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (
+ slang_type_specifier));
+ if (var->type.specifier._array == NULL)
+ {
+ slang_info_log_memory (C->L);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr (var->type.specifier._array);
+ return slang_type_specifier_copy (var->type.specifier._array, sp);
+}
+
+/* structure field */
+#define FIELD_NONE 0
+#define FIELD_NEXT 1
+#define FIELD_ARRAY 2
+
+static GLboolean parse_struct_field_var (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var,
+ const slang_type_specifier *sp)
+{
+ var->a_name = parse_identifier (C);
+ if (var->a_name == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ switch (*C->I++)
+ {
+ case FIELD_NONE:
+ if (!slang_type_specifier_copy (&var->type.specifier, sp))
+ return GL_FALSE;
+ break;
+ case FIELD_ARRAY:
+ if (!convert_to_array (C, var, sp))
+ return GL_FALSE;
+ if (!parse_array_len (C, O, &var->array_len))
+ return GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return calculate_var_size (C, O, var);
+}
+
+static int parse_struct_field (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *st,
+ slang_type_specifier *sp)
+{
+ slang_output_ctx o = *O;
+
+ o.structs = st->structs;
+ if (!parse_type_specifier (C, &o, sp))
+ return 0;
+ do
+ {
+ slang_variable *var;
+
+ st->fields->variables = (slang_variable *) slang_alloc_realloc (st->fields->variables,
+ st->fields->num_variables * sizeof (slang_variable),
+ (st->fields->num_variables + 1) * sizeof (slang_variable));
+ if (st->fields->variables == NULL)
+ {
+ slang_info_log_memory (C->L);
+ return 0;
+ }
+ var = &st->fields->variables[st->fields->num_variables];
+ if (!slang_variable_construct (var))
+ return 0;
+ st->fields->num_variables++;
+ if (!parse_struct_field_var (C, &o, var, sp))
+ return 0;
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ return 1;
+}
+
+static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct **st)
+{
+ slang_atom a_name;
+ const char *name;
+
+ /* parse struct name (if any) and make sure it is unique in current scope */
+ a_name = parse_identifier (C);
+ if (a_name == SLANG_ATOM_NULL)
+ return 0;
+ name = slang_atom_pool_id (C->atoms, a_name);
+ if (name[0] != '\0' && slang_struct_scope_find (O->structs, a_name, 0) != NULL)
+ {
+ slang_info_log_error (C->L, "%s: duplicate type name", name);
+ return 0;
+ }
+
+ /* set-up a new struct */
+ *st = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
+ if (*st == NULL)
+ {
+ slang_info_log_memory (C->L);
+ return 0;
+ }
+ if (!slang_struct_construct (*st))
+ {
+ slang_alloc_free (*st);
+ *st = NULL;
+ slang_info_log_memory (C->L);
+ return 0;
+ }
+ (**st).a_name = a_name;
+ (**st).structs->outer_scope = O->structs;
+
+ /* parse individual struct fields */
+ do
+ {
+ slang_type_specifier sp;
+
+ slang_type_specifier_ctr (&sp);
+ if (!parse_struct_field (C, O, *st, &sp))
+ {
+ slang_type_specifier_dtr (&sp);
+ return 0;
+ }
+ slang_type_specifier_dtr (&sp);
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ /* if named struct, copy it to current scope */
+ if (name[0] != '\0')
+ {
+ slang_struct *s;
+
+ O->structs->structs = (slang_struct *) slang_alloc_realloc (O->structs->structs,
+ O->structs->num_structs * sizeof (slang_struct),
+ (O->structs->num_structs + 1) * sizeof (slang_struct));
+ if (O->structs->structs == NULL)
+ {
+ slang_info_log_memory (C->L);
+ return 0;
+ }
+ s = &O->structs->structs[O->structs->num_structs];
+ if (!slang_struct_construct (s))
+ return 0;
+ O->structs->num_structs++;
+ if (!slang_struct_copy (s, *st))
+ return 0;
+ }
+
+ return 1;
+}
/* type qualifier */
#define TYPE_QUALIFIER_NONE 0
@@ -846,13 +612,7 @@ static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual)
#define TYPE_SPECIFIER_STRUCT 22
#define TYPE_SPECIFIER_TYPENAME 23
-/* structure field */
-#define FIELD_NONE 0
-#define FIELD_NEXT 1
-#define FIELD_ARRAY 2
-
-static int parse_type_specifier (slang_parse_ctx *C, slang_type_specifier *spec,
- slang_struct_scope *structs, slang_variable_scope *scope, slang_function_scope *funcs)
+static int parse_type_specifier (slang_parse_ctx *C, slang_output_ctx *O, slang_type_specifier *spec)
{
switch (*C->I++)
{
@@ -924,144 +684,34 @@ static int parse_type_specifier (slang_parse_ctx *C, slang_type_specifier *spec,
break;
case TYPE_SPECIFIER_STRUCT:
spec->type = slang_spec_struct;
- {
- char *name;
- if (!parse_identifier (C, &name))
- return 0;
- if (*name != '\0' && slang_struct_scope_find (structs, name, 0) != NULL)
- {
- slang_info_log_error (C->L, "%s: duplicate type name", name);
- slang_alloc_free (name);
- return 0;
- }
- spec->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (spec->_struct == NULL)
- {
- slang_alloc_free (name);
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_struct_construct_a (spec->_struct))
- {
- slang_alloc_free (spec->_struct);
- spec->_struct = NULL;
- slang_alloc_free (name);
- slang_info_log_memory (C->L);
- return 0;
- }
- spec->_struct->name = name;
- spec->_struct->structs->outer_scope = structs;
- }
- do
- {
- slang_type_specifier sp;
- slang_type_specifier_construct (&sp);
- if (!parse_type_specifier (C, &sp, spec->_struct->structs, scope, funcs))
- {
- slang_type_specifier_destruct (&sp);
- return 0;
- }
- do
- {
- slang_variable *var;
- spec->_struct->fields->variables = (slang_variable *) slang_alloc_realloc (
- spec->_struct->fields->variables,
- spec->_struct->fields->num_variables * sizeof (slang_variable),
- (spec->_struct->fields->num_variables + 1) * sizeof (slang_variable));
- if (spec->_struct->fields->variables == NULL)
- {
- slang_type_specifier_destruct (&sp);
- slang_info_log_memory (C->L);
- return 0;
- }
- var = spec->_struct->fields->variables + spec->_struct->fields->num_variables;
- spec->_struct->fields->num_variables++;
- slang_variable_construct (var);
- if (!slang_type_specifier_copy (&var->type.specifier, &sp))
- {
- slang_type_specifier_destruct (&sp);
- return 0;
- }
- if (!parse_identifier (C, &var->name))
- {
- slang_type_specifier_destruct (&sp);
- return 0;
- }
- switch (*C->I++)
- {
- case FIELD_NONE:
- break;
- case FIELD_ARRAY:
- var->array_size = (slang_operation *) slang_alloc_malloc (sizeof (
- slang_operation));
- if (var->array_size == NULL)
- {
- slang_type_specifier_destruct (&sp);
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct_a (var->array_size))
- {
- slang_alloc_free (var->array_size);
- var->array_size = NULL;
- slang_type_specifier_destruct (&sp);
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!parse_expression (C, var->array_size, scope, structs, funcs))
- {
- slang_type_specifier_destruct (&sp);
- return 0;
- }
- break;
- default:
- return 0;
- }
- }
- while (*C->I++ != FIELD_NONE);
- }
- while (*C->I++ != FIELD_NONE);
- if (*spec->_struct->name != '\0')
- {
- slang_struct *s;
- structs->structs = (slang_struct *) slang_alloc_realloc (structs->structs,
- structs->num_structs * sizeof (slang_struct),
- (structs->num_structs + 1) * sizeof (slang_struct));
- if (structs->structs == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- s = structs->structs + structs->num_structs;
- if (!slang_struct_construct_a (s))
- return 0;
- structs->num_structs++;
- if (!slang_struct_copy (s, spec->_struct))
- return 0;
- }
+ if (!parse_struct (C, O, &spec->_struct))
+ return 0;
break;
case TYPE_SPECIFIER_TYPENAME:
spec->type = slang_spec_struct;
{
- char *name;
+ slang_atom a_name;
slang_struct *stru;
- if (!parse_identifier (C, &name))
+
+ a_name = parse_identifier (C);
+ if (a_name == NULL)
return 0;
- stru = slang_struct_scope_find (structs, name, 1);
+
+ stru = slang_struct_scope_find (O->structs, a_name, 1);
if (stru == NULL)
{
- slang_info_log_error (C->L, "%s: undeclared type name", name);
- slang_alloc_free (name);
+ slang_info_log_error (C->L, "%s: undeclared type name",
+ slang_atom_pool_id (C->atoms, a_name));
return 0;
}
- slang_alloc_free (name);
+
spec->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
if (spec->_struct == NULL)
{
slang_info_log_memory (C->L);
return 0;
}
- if (!slang_struct_construct_a (spec->_struct))
+ if (!slang_struct_construct (spec->_struct))
{
slang_alloc_free (spec->_struct);
spec->_struct = NULL;
@@ -1077,12 +727,12 @@ static int parse_type_specifier (slang_parse_ctx *C, slang_type_specifier *spec,
return 1;
}
-static int parse_fully_specified_type (slang_parse_ctx *C, slang_fully_specified_type *type,
- slang_struct_scope *structs, slang_variable_scope *scope, slang_function_scope *funcs)
+static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O,
+ slang_fully_specified_type *type)
{
if (!parse_type_qualifier (C, &type->qualifier))
return 0;
- return parse_type_specifier (C, &type->specifier, structs, scope, funcs);
+ return parse_type_specifier (C, O, &type->specifier);
}
/* operation */
@@ -1149,9 +799,11 @@ static int parse_fully_specified_type (slang_parse_ctx *C, slang_fully_specified
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
-static int parse_child_operation (slang_parse_ctx *C, slang_operation *oper, int statement,
- slang_variable_scope *scope, slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_child_operation (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper,
+ int statement)
{
+ slang_operation *ch;
+
oper->children = (slang_operation *) slang_alloc_realloc (oper->children,
oper->num_children * sizeof (slang_operation),
(oper->num_children + 1) * sizeof (slang_operation));
@@ -1160,50 +812,60 @@ static int parse_child_operation (slang_parse_ctx *C, slang_operation *oper, int
slang_info_log_memory (C->L);
return 0;
}
- if (!slang_operation_construct_a (oper->children + oper->num_children))
+ ch = &oper->children[oper->num_children];
+ if (!slang_operation_construct (ch))
{
slang_info_log_memory (C->L);
return 0;
}
oper->num_children++;
if (statement)
- return parse_statement (C, oper->children + oper->num_children - 1, scope, structs, funcs);
- return parse_expression (C, oper->children + oper->num_children - 1, scope, structs, funcs);
+ return parse_statement (C, O, ch);
+ return parse_expression (C, O, ch);
}
-static int parse_declaration (slang_parse_ctx *C, slang_variable_scope *, slang_struct_scope *,
- slang_function_scope *);
+static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O);
-static int parse_statement (slang_parse_ctx *C, slang_operation *oper, slang_variable_scope *scope,
- slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_statement (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
{
- oper->locals->outer_scope = scope;
+ oper->locals->outer_scope = O->vars;
switch (*C->I++)
{
case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
+ /* parse child statements, do not create new variable scope */
oper->type = slang_oper_block_no_new_scope;
while (*C->I != OP_END)
- if (!parse_child_operation (C, oper, 1, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 1))
return 0;
C->I++;
break;
case OP_BLOCK_BEGIN_NEW_SCOPE:
- oper->type = slang_oper_block_new_scope;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
- C->I++;
+ /* parse child statements, create new variable scope */
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_block_new_scope;
+ o.vars = oper->locals;
+ while (*C->I != OP_END)
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ C->I++;
+ }
break;
case OP_DECLARE:
+ /* local variable declaration, individual declarators are stored as children identifiers */
oper->type = slang_oper_variable_decl;
{
- const unsigned int first_var = scope->num_variables;
- if (!parse_declaration (C, scope, structs, funcs))
+ const unsigned int first_var = O->vars->num_variables;
+
+ /* parse the declaration, note that there can be zero or more than one declarators */
+ if (!parse_declaration (C, O))
return 0;
- if (first_var < scope->num_variables)
+ if (first_var < O->vars->num_variables)
{
- const unsigned int num_vars = scope->num_variables - first_var;
+ const unsigned int num_vars = O->vars->num_variables - first_var;
unsigned int i;
+
oper->children = (slang_operation *) slang_alloc_malloc (num_vars * sizeof (
slang_operation));
if (oper->children == NULL)
@@ -1211,39 +873,31 @@ static int parse_statement (slang_parse_ctx *C, slang_operation *oper, slang_var
slang_info_log_memory (C->L);
return 0;
}
- for (i = 0; i < num_vars; i++)
- if (!slang_operation_construct_a (oper->children + i))
+ for (oper->num_children = 0; oper->num_children < num_vars; oper->num_children++)
+ if (!slang_operation_construct (&oper->children[oper->num_children]))
{
- unsigned int j;
- for (j = 0; j < i; j++)
- slang_operation_destruct (oper->children + j);
- slang_alloc_free (oper->children);
- oper->children = NULL;
slang_info_log_memory (C->L);
return 0;
}
- oper->num_children = num_vars;
- for (i = first_var; i < scope->num_variables; i++)
+ for (i = first_var; i < O->vars->num_variables; i++)
{
- slang_operation *o = oper->children + i - first_var;
+ slang_operation *o = &oper->children[i - first_var];
+
o->type = slang_oper_identifier;
- o->locals->outer_scope = scope;
- o->identifier = slang_string_duplicate (scope->variables[i].name);
- if (o->identifier == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
+ o->locals->outer_scope = O->vars;
+ o->a_id = O->vars->variables[i].a_name;
}
}
}
break;
case OP_ASM:
+ /* the __asm statement, parse the mnemonic and all its arguments as expressions */
oper->type = slang_oper_asm;
- if (!parse_identifier (C, &oper->identifier))
+ oper->a_id = parse_identifier (C);
+ if (oper->a_id == SLANG_ATOM_NULL)
return 0;
while (*C->I != OP_END)
- if (!parse_child_operation (C, oper, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 0))
return 0;
C->I++;
break;
@@ -1258,47 +912,57 @@ static int parse_statement (slang_parse_ctx *C, slang_operation *oper, slang_var
break;
case OP_RETURN:
oper->type = slang_oper_return;
- if (!parse_child_operation (C, oper, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 0))
return 0;
break;
case OP_EXPRESSION:
oper->type = slang_oper_expression;
- if (!parse_child_operation (C, oper, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 0))
return 0;
break;
case OP_IF:
oper->type = slang_oper_if;
- if (!parse_child_operation (C, oper, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 0))
return 0;
- if (!parse_child_operation (C, oper, 1, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 1))
return 0;
- if (!parse_child_operation (C, oper, 1, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 1))
return 0;
break;
case OP_WHILE:
- oper->type = slang_oper_while;
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_while;
+ o.vars = oper->locals;
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ }
break;
case OP_DO:
oper->type = slang_oper_do;
- if (!parse_child_operation (C, oper, 1, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 1))
return 0;
- if (!parse_child_operation (C, oper, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, oper, 0))
return 0;
break;
case OP_FOR:
- oper->type = slang_oper_for;
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
- if (!parse_child_operation (C, oper, 0, oper->locals, structs, funcs))
- return 0;
- if (!parse_child_operation (C, oper, 1, oper->locals, structs, funcs))
- return 0;
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_for;
+ o.vars = oper->locals;
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation (C, &o, oper, 0))
+ return 0;
+ if (!parse_child_operation (C, &o, oper, 1))
+ return 0;
+ }
break;
default:
return 0;
@@ -1306,70 +970,26 @@ static int parse_statement (slang_parse_ctx *C, slang_operation *oper, slang_var
return 1;
}
-static int handle_trinary_expression (slang_parse_ctx *C, slang_operation *op,
- slang_operation **ops, unsigned int *num_ops)
+static int handle_nary_expression (slang_parse_ctx *C, slang_operation *op, slang_operation **ops,
+ unsigned int *total_ops, unsigned int n)
{
- op->num_children = 3;
- op->children = (slang_operation *) slang_alloc_malloc (3 * sizeof (slang_operation));
- if (op->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op->children[0] = (*ops)[*num_ops - 4];
- op->children[1] = (*ops)[*num_ops - 3];
- op->children[2] = (*ops)[*num_ops - 2];
- (*ops)[*num_ops - 4] = (*ops)[*num_ops - 1];
- *num_ops -= 3;
- *ops = (slang_operation *) slang_alloc_realloc (*ops, (*num_ops + 3) * sizeof (slang_operation),
- *num_ops * sizeof (slang_operation));
- if (*ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- return 1;
-}
+ unsigned int i;
-static int handle_binary_expression (slang_parse_ctx *C, slang_operation *op,
- slang_operation **ops, unsigned int *num_ops)
-{
- op->num_children = 2;
- op->children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
+ op->children = (slang_operation *) slang_alloc_malloc (n * sizeof (slang_operation));
if (op->children == NULL)
{
slang_info_log_memory (C->L);
return 0;
}
- op->children[0] = (*ops)[*num_ops - 3];
- op->children[1] = (*ops)[*num_ops - 2];
- (*ops)[*num_ops - 3] = (*ops)[*num_ops - 1];
- *num_ops -= 2;
- *ops = (slang_operation *) slang_alloc_realloc (*ops, (*num_ops + 2) * sizeof (slang_operation),
- *num_ops * sizeof (slang_operation));
- if (*ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- return 1;
-}
+ op->num_children = n;
-static int handle_unary_expression (slang_parse_ctx *C, slang_operation *op,
- slang_operation **ops, unsigned int *num_ops)
-{
- op->num_children = 1;
- op->children = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (op->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op->children[0] = (*ops)[*num_ops - 2];
- (*ops)[*num_ops - 2] = (*ops)[*num_ops - 1];
- (*num_ops)--;
- *ops = (slang_operation *) slang_alloc_realloc (*ops, (*num_ops + 1) * sizeof (slang_operation),
- *num_ops * sizeof (slang_operation));
+ for (i = 0; i < n; i++)
+ op->children[i] = (*ops)[*total_ops - (n + 1 - i)];
+ (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1];
+ *total_ops -= n;
+
+ *ops = (slang_operation *) slang_alloc_realloc (*ops, (*total_ops + n) * sizeof (slang_operation),
+ *total_ops * sizeof (slang_operation));
if (*ops == NULL)
{
slang_info_log_memory (C->L);
@@ -1378,15 +998,14 @@ static int handle_unary_expression (slang_parse_ctx *C, slang_operation *op,
return 1;
}
-static int is_constructor_name (const char *name, slang_struct_scope *structs)
+static int is_constructor_name (const char *name, slang_atom a_name, slang_struct_scope *structs)
{
if (slang_type_specifier_type_from_string (name) != slang_spec_void)
return 1;
- return slang_struct_scope_find (structs, name, 1) != NULL;
+ return slang_struct_scope_find (structs, a_name, 1) != NULL;
}
-static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_variable_scope *scope,
- slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
{
slang_operation *ops = NULL;
unsigned int num_ops = 0;
@@ -1396,6 +1015,8 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
{
slang_operation *op;
const unsigned int op_code = *C->I++;
+
+ /* allocate default operation, becomes a no-op if not used */
ops = (slang_operation *) slang_alloc_realloc (ops,
num_ops * sizeof (slang_operation), (num_ops + 1) * sizeof (slang_operation));
if (ops == NULL)
@@ -1403,14 +1024,15 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
slang_info_log_memory (C->L);
return 0;
}
- op = ops + num_ops;
- if (!slang_operation_construct_a (op))
+ op = &ops[num_ops];
+ if (!slang_operation_construct (op))
{
slang_info_log_memory (C->L);
return 0;
}
num_ops++;
- op->locals->outer_scope = scope;
+ op->locals->outer_scope = O->vars;
+
switch (op_code)
{
case OP_PUSH_VOID:
@@ -1420,13 +1042,13 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
op->type = slang_oper_literal_bool;
if (!parse_number (C, &number))
return 0;
- op->literal = (float) number;
+ op->literal = (GLfloat) number;
break;
case OP_PUSH_INT:
op->type = slang_oper_literal_int;
if (!parse_number (C, &number))
return 0;
- op->literal = (float) number;
+ op->literal = (GLfloat) number;
break;
case OP_PUSH_FLOAT:
op->type = slang_oper_literal_float;
@@ -1435,37 +1057,38 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
break;
case OP_PUSH_IDENTIFIER:
op->type = slang_oper_identifier;
- if (!parse_identifier (C, &op->identifier))
+ op->a_id = parse_identifier (C);
+ if (op->a_id == SLANG_ATOM_NULL)
return 0;
break;
case OP_SEQUENCE:
op->type = slang_oper_sequence;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_ASSIGN:
op->type = slang_oper_assign;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_ADDASSIGN:
op->type = slang_oper_addassign;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_SUBASSIGN:
op->type = slang_oper_subassign;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_MULASSIGN:
op->type = slang_oper_mulassign;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_DIVASSIGN:
op->type = slang_oper_divassign;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
/*case OP_MODASSIGN:*/
@@ -1476,22 +1099,22 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
/*case OP_ANDASSIGN:*/
case OP_SELECT:
op->type = slang_oper_select;
- if (!handle_trinary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 3))
return 0;
break;
case OP_LOGICALOR:
op->type = slang_oper_logicalor;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_LOGICALXOR:
op->type = slang_oper_logicalxor;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_LOGICALAND:
op->type = slang_oper_logicaland;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
/*case OP_BITOR:*/
@@ -1499,119 +1122,125 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
/*case OP_BITAND:*/
case OP_EQUAL:
op->type = slang_oper_equal;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_NOTEQUAL:
op->type = slang_oper_notequal;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_LESS:
op->type = slang_oper_less;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_GREATER:
op->type = slang_oper_greater;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_LESSEQUAL:
op->type = slang_oper_lessequal;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_GREATEREQUAL:
op->type = slang_oper_greaterequal;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
/*case OP_LSHIFT:*/
/*case OP_RSHIFT:*/
case OP_ADD:
op->type = slang_oper_add;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_SUBTRACT:
op->type = slang_oper_subtract;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_MULTIPLY:
op->type = slang_oper_multiply;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_DIVIDE:
op->type = slang_oper_divide;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
/*case OP_MODULUS:*/
case OP_PREINCREMENT:
op->type = slang_oper_preincrement;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_PREDECREMENT:
op->type = slang_oper_predecrement;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_PLUS:
op->type = slang_oper_plus;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_MINUS:
op->type = slang_oper_minus;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_NOT:
op->type = slang_oper_not;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
/*case OP_COMPLEMENT:*/
case OP_SUBSCRIPT:
op->type = slang_oper_subscript;
- if (!handle_binary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
return 0;
break;
case OP_CALL:
op->type = slang_oper_call;
- if (!parse_identifier (C, &op->identifier))
+ op->a_id = parse_identifier (C);
+ if (op->a_id == SLANG_ATOM_NULL)
return 0;
while (*C->I != OP_END)
- if (!parse_child_operation (C, op, 0, scope, structs, funcs))
+ if (!parse_child_operation (C, O, op, 0))
return 0;
C->I++;
- if (!C->parsing_builtin &&
- !slang_function_scope_find_by_name (funcs, op->identifier, 1) &&
- !is_constructor_name (op->identifier, structs))
+ if (!C->parsing_builtin && !slang_function_scope_find_by_name (O->funs, op->a_id, 1))
{
- slang_info_log_error (C->L, "%s: undeclared function name", op->identifier);
- return 0;
+ const char *id;
+
+ id = slang_atom_pool_id (C->atoms, op->a_id);
+ if (!is_constructor_name (id, op->a_id, O->structs))
+ {
+ slang_info_log_error (C->L, "%s: undeclared function name", id);
+ return 0;
+ }
}
break;
case OP_FIELD:
op->type = slang_oper_field;
- if (!parse_identifier (C, &op->identifier))
+ op->a_id = parse_identifier (C);
+ if (op->a_id == SLANG_ATOM_NULL)
return 0;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_POSTINCREMENT:
op->type = slang_oper_postincrement;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
case OP_POSTDECREMENT:
op->type = slang_oper_postdecrement;
- if (!handle_unary_expression (C, op, &ops, &num_ops))
+ if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
return 0;
break;
default:
@@ -1619,6 +1248,7 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
}
}
C->I++;
+
*oper = *ops;
slang_alloc_free (ops);
return 1;
@@ -1633,10 +1263,11 @@ static int parse_expression (slang_parse_ctx *C, slang_operation *oper, slang_va
#define PARAMETER_ARRAY_NOT_PRESENT 0
#define PARAMETER_ARRAY_PRESENT 1
-static int parse_parameter_declaration (slang_parse_ctx *C, slang_variable *param,
- slang_struct_scope *structs, slang_variable_scope *scope, slang_function_scope *funcs)
+static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O,
+ slang_variable *param)
{
- slang_storage_aggregate agg;
+ /* parse and validate the parameter's type qualifiers (there can be two at most) because
+ * not all combinations are valid */
if (!parse_type_qualifier (C, &param->type.qualifier))
return 0;
switch (*C->I++)
@@ -1669,36 +1300,40 @@ static int parse_parameter_declaration (slang_parse_ctx *C, slang_variable *para
default:
return 0;
}
- if (!parse_type_specifier (C, &param->type.specifier, structs, scope, funcs))
+
+ /* parse parameter's type specifier and name */
+ if (!parse_type_specifier (C, O, &param->type.specifier))
return 0;
- if (!parse_identifier (C, &param->name))
+ param->a_name = parse_identifier (C);
+ if (param->a_name == SLANG_ATOM_NULL)
return 0;
+
+ /* if the parameter is an array, parse its size (the size must be explicitly defined */
if (*C->I++ == PARAMETER_ARRAY_PRESENT)
{
- param->array_size = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (param->array_size == NULL)
+ slang_type_specifier p;
+
+ slang_type_specifier_ctr (&p);
+ if (!slang_type_specifier_copy (&p, &param->type.specifier))
{
- slang_info_log_memory (C->L);
- return 0;
+ slang_type_specifier_dtr (&p);
+ return GL_FALSE;
}
- if (!slang_operation_construct_a (param->array_size))
+ if (!convert_to_array (C, param, &p))
{
- slang_alloc_free (param->array_size);
- param->array_size = NULL;
- slang_info_log_memory (C->L);
- return 0;
+ slang_type_specifier_dtr (&p);
+ return GL_FALSE;
}
- if (!parse_expression (C, param->array_size, scope, structs, funcs))
- return 0;
- }
- slang_storage_aggregate_construct (&agg);
- if (!_slang_aggregate_variable (&agg, &param->type.specifier, param->array_size, funcs,
- structs))
- {
- slang_storage_aggregate_destruct (&agg);
- return 0;
+ slang_type_specifier_dtr (&p);
+ if (!parse_array_len (C, O, &param->array_len))
+ return GL_FALSE;
}
- slang_storage_aggregate_destruct (&agg);
+
+ /* calculate the parameter size */
+ if (!calculate_var_size (C, O, param))
+ return GL_FALSE;
+
+ /* TODO: allocate the local address here? */
return 1;
}
@@ -1712,38 +1347,35 @@ static int parse_parameter_declaration (slang_parse_ctx *C, slang_variable *para
#define PARAMETER_NEXT 1
/* operator type */
-#define OPERATOR_ASSIGN 1
-#define OPERATOR_ADDASSIGN 2
-#define OPERATOR_SUBASSIGN 3
-#define OPERATOR_MULASSIGN 4
-#define OPERATOR_DIVASSIGN 5
-/*#define OPERATOR_MODASSIGN 6*/
-/*#define OPERATOR_LSHASSIGN 7*/
-/*#define OPERATOR_RSHASSIGN 8*/
-/*#define OPERATOR_ANDASSIGN 9*/
-/*#define OPERATOR_XORASSIGN 10*/
-/*#define OPERATOR_ORASSIGN 11*/
-#define OPERATOR_LOGICALXOR 12
-/*#define OPERATOR_BITOR 13*/
-/*#define OPERATOR_BITXOR 14*/
-/*#define OPERATOR_BITAND 15*/
-#define OPERATOR_EQUAL 16
-#define OPERATOR_NOTEQUAL 17
-#define OPERATOR_LESS 18
-#define OPERATOR_GREATER 19
-#define OPERATOR_LESSEQUAL 20
-#define OPERATOR_GREATEREQUAL 21
-/*#define OPERATOR_LSHIFT 22*/
-/*#define OPERATOR_RSHIFT 23*/
-#define OPERATOR_MULTIPLY 24
-#define OPERATOR_DIVIDE 25
-/*#define OPERATOR_MODULUS 26*/
-#define OPERATOR_INCREMENT 27
-#define OPERATOR_DECREMENT 28
-#define OPERATOR_PLUS 29
-#define OPERATOR_MINUS 30
-/*#define OPERATOR_COMPLEMENT 31*/
-#define OPERATOR_NOT 32
+#define OPERATOR_ADDASSIGN 1
+#define OPERATOR_SUBASSIGN 2
+#define OPERATOR_MULASSIGN 3
+#define OPERATOR_DIVASSIGN 4
+/*#define OPERATOR_MODASSIGN 5*/
+/*#define OPERATOR_LSHASSIGN 6*/
+/*#define OPERATOR_RSHASSIGN 7*/
+/*#define OPERATOR_ANDASSIGN 8*/
+/*#define OPERATOR_XORASSIGN 9*/
+/*#define OPERATOR_ORASSIGN 10*/
+#define OPERATOR_LOGICALXOR 11
+/*#define OPERATOR_BITOR 12*/
+/*#define OPERATOR_BITXOR 13*/
+/*#define OPERATOR_BITAND 14*/
+#define OPERATOR_LESS 15
+#define OPERATOR_GREATER 16
+#define OPERATOR_LESSEQUAL 17
+#define OPERATOR_GREATEREQUAL 18
+/*#define OPERATOR_LSHIFT 19*/
+/*#define OPERATOR_RSHIFT 20*/
+#define OPERATOR_MULTIPLY 21
+#define OPERATOR_DIVIDE 22
+/*#define OPERATOR_MODULUS 23*/
+#define OPERATOR_INCREMENT 24
+#define OPERATOR_DECREMENT 25
+#define OPERATOR_PLUS 26
+#define OPERATOR_MINUS 27
+/*#define OPERATOR_COMPLEMENT 28*/
+#define OPERATOR_NOT 29
static const struct {
unsigned int o_code;
@@ -1755,7 +1387,6 @@ static const struct {
{ OPERATOR_DECREMENT, "--" },
{ OPERATOR_SUBASSIGN, "-=" },
{ OPERATOR_MINUS, "-" },
- { OPERATOR_NOTEQUAL, "!=" },
{ OPERATOR_NOT, "!" },
{ OPERATOR_MULASSIGN, "*=" },
{ OPERATOR_MULTIPLY, "*" },
@@ -1769,8 +1400,6 @@ static const struct {
/*{ OPERATOR_RSHASSIGN, ">>=" },*/
/*{ OPERATOR_RSHIFT, ">>" },*/
{ OPERATOR_GREATER, ">" },
- { OPERATOR_EQUAL, "==" },
- { OPERATOR_ASSIGN, "=" },
/*{ OPERATOR_MODASSIGN, "%=" },*/
/*{ OPERATOR_MODULUS, "%" },*/
/*{ OPERATOR_ANDASSIGN, "&=" },*/
@@ -1779,47 +1408,51 @@ static const struct {
/*{ OPERATOR_BITOR, "|" },*/
/*{ OPERATOR_COMPLEMENT, "~" },*/
/*{ OPERATOR_XORASSIGN, "^=" },*/
- { OPERATOR_LOGICALXOR, "^^" }/*,*/
+ { OPERATOR_LOGICALXOR, "^^" },
/*{ OPERATOR_BITXOR, "^" }*/
};
-static int parse_operator_name (slang_parse_ctx *C, char **pname)
+static slang_atom parse_operator_name (slang_parse_ctx *C)
{
unsigned int i;
+
for (i = 0; i < sizeof (operator_names) / sizeof (*operator_names); i++)
+ {
if (operator_names[i].o_code == (unsigned int) (*C->I))
{
- *pname = slang_string_duplicate (operator_names[i].o_name);
- if (*pname == NULL)
+ slang_atom atom = slang_atom_pool_atom (C->atoms, operator_names[i].o_name);
+ if (atom == SLANG_ATOM_NULL)
{
slang_info_log_memory (C->L);
return 0;
}
C->I++;
- return 1;
+ return atom;
}
+ }
return 0;
}
-static int parse_function_prototype (slang_parse_ctx *C, slang_function *func,
- slang_struct_scope *structs, slang_variable_scope *scope, slang_function_scope *funcs)
+static int parse_function_prototype (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
{
- if (!parse_fully_specified_type (C, &func->header.type, structs, scope, funcs))
+ /* parse function type and name */
+ if (!parse_fully_specified_type (C, O, &func->header.type))
return 0;
switch (*C->I++)
{
case FUNCTION_ORDINARY:
func->kind = slang_func_ordinary;
- if (!parse_identifier (C, &func->header.name))
+ func->header.a_name = parse_identifier (C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
return 0;
break;
case FUNCTION_CONSTRUCTOR:
func->kind = slang_func_constructor;
if (func->header.type.specifier.type == slang_spec_struct)
return 0;
- func->header.name = slang_string_duplicate (
- type_specifier_type_names[func->header.type.specifier.type]);
- if (func->header.name == NULL)
+ func->header.a_name = slang_atom_pool_atom (C->atoms,
+ slang_type_specifier_type_to_string (func->header.type.specifier.type));
+ if (func->header.a_name == SLANG_ATOM_NULL)
{
slang_info_log_memory (C->L);
return 0;
@@ -1827,15 +1460,19 @@ static int parse_function_prototype (slang_parse_ctx *C, slang_function *func,
break;
case FUNCTION_OPERATOR:
func->kind = slang_func_operator;
- if (!parse_operator_name (C, &func->header.name))
+ func->header.a_name = parse_operator_name (C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
return 0;
break;
default:
return 0;
- }
- func->parameters->outer_scope = scope;
+ }
+
+ /* parse function parameters */
while (*C->I++ == PARAMETER_NEXT)
{
+ slang_variable *p;
+
func->parameters->variables = (slang_variable *) slang_alloc_realloc (
func->parameters->variables,
func->parameters->num_variables * sizeof (slang_variable),
@@ -1845,39 +1482,148 @@ static int parse_function_prototype (slang_parse_ctx *C, slang_function *func,
slang_info_log_memory (C->L);
return 0;
}
- slang_variable_construct (func->parameters->variables + func->parameters->num_variables);
+ p = &func->parameters->variables[func->parameters->num_variables];
+ if (!slang_variable_construct (p))
+ return 0;
func->parameters->num_variables++;
- if (!parse_parameter_declaration (C, func->parameters->variables +
- func->parameters->num_variables - 1, structs, scope, funcs))
+ if (!parse_parameter_declaration (C, O, p))
return 0;
}
+
+ /* function formal parameters and local variables share the same scope, so save
+ * the information about param count in a seperate place
+ * also link the scope to the global variable scope so when a given identifier is not
+ * found here, the search process continues in the global space */
func->param_count = func->parameters->num_variables;
+ func->parameters->outer_scope = O->vars;
return 1;
}
-static int parse_function_definition (slang_parse_ctx *C, slang_function *func,
- slang_struct_scope *structs, slang_variable_scope *scope, slang_function_scope *funcs)
+static int parse_function_definition (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
{
- if (!parse_function_prototype (C, func, structs, scope, funcs))
+ slang_output_ctx o = *O;
+
+ if (!parse_function_prototype (C, O, func))
return 0;
+
+ /* create function's body operation */
func->body = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
if (func->body == NULL)
{
slang_info_log_memory (C->L);
return 0;
}
- if (!slang_operation_construct_a (func->body))
+ if (!slang_operation_construct (func->body))
{
slang_alloc_free (func->body);
func->body = NULL;
slang_info_log_memory (C->L);
return 0;
}
- if (!parse_statement (C, func->body, func->parameters, structs, funcs))
+
+ /* to parse the body the parse context is modified in order to capture parsed variables
+ * into function's local variable scope */
+ C->global_scope = 0;
+ o.vars = func->parameters;
+ if (!parse_statement (C, &o, func->body))
return 0;
+ C->global_scope = 1;
return 1;
}
+static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var)
+{
+ slang_assembly_file_restore_point point;
+ slang_machine mach;
+ slang_assembly_local_info save_local = A->local;
+ slang_operation op_id, op_assign;
+ GLboolean result;
+
+ /* save the current assembly */
+ if (!slang_assembly_file_restore_point_save (A->file, &point))
+ return GL_FALSE;
+
+ /* setup the machine */
+ mach = *A->mach;
+ mach.ip = A->file->count;
+
+ /* allocate local storage for expression */
+ A->local.ret_size = 0;
+ A->local.addr_tmp = 0;
+ A->local.swizzle_tmp = 4;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_local_alloc, 20))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (A->file, slang_asm_enter, 20))
+ return GL_FALSE;
+
+ /* construct the left side of assignment */
+ if (!slang_operation_construct (&op_id))
+ return GL_FALSE;
+ op_id.type = slang_oper_identifier;
+ op_id.a_id = var->a_name;
+
+ /* put the variable into operation's scope */
+ op_id.locals->variables = (slang_variable *) slang_alloc_malloc (sizeof (slang_variable));
+ if (op_id.locals->variables == NULL)
+ {
+ slang_operation_destruct (&op_id);
+ return GL_FALSE;
+ }
+ op_id.locals->num_variables = 1;
+ op_id.locals->variables[0] = *var;
+
+ /* construct the assignment expression */
+ if (!slang_operation_construct (&op_assign))
+ {
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct (&op_id);
+ return GL_FALSE;
+ }
+ op_assign.type = slang_oper_assign;
+ op_assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
+ if (op_assign.children == NULL)
+ {
+ slang_operation_destruct (&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct (&op_id);
+ return GL_FALSE;
+ }
+ op_assign.num_children = 2;
+ op_assign.children[0] = op_id;
+ op_assign.children[1] = *var->initializer;
+
+ /* insert the actual expression */
+ result = _slang_assemble_operation (A, &op_assign, slang_ref_forbid);
+
+ /* carefully destroy the operations */
+ op_assign.num_children = 0;
+ slang_alloc_free (op_assign.children);
+ op_assign.children = NULL;
+ slang_operation_destruct (&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct (&op_id);
+
+ if (!result)
+ return GL_FALSE;
+ if (!slang_assembly_file_push (A->file, slang_asm_exit))
+ return GL_FALSE;
+
+ /* execute the expression */
+ if (!_slang_execute2 (A->file, &mach))
+ return GL_FALSE;
+
+ /* restore the old assembly */
+ if (!slang_assembly_file_restore_point_load (A->file, &point))
+ return GL_FALSE;
+ A->local = save_local;
+
+ /* now we copy the contents of the initialized variable back to the original machine */
+ _mesa_memcpy ((GLubyte *) A->mach->mem + var->address, (GLubyte *) mach.mem + var->address,
+ var->size);
+
+ return GL_TRUE;
+}
+
/* init declarator list */
#define DECLARATOR_NONE 0
#define DECLARATOR_NEXT 1
@@ -1889,34 +1635,45 @@ static int parse_function_definition (slang_parse_ctx *C, slang_function *func,
#define VARIABLE_ARRAY_EXPLICIT 3
#define VARIABLE_ARRAY_UNKNOWN 4
-static int parse_init_declarator (slang_parse_ctx *C, const slang_fully_specified_type *type,
- slang_variable_scope *vars, slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O,
+ const slang_fully_specified_type *type)
{
slang_variable *var;
+ /* empty init declatator (without name, e.g. "float ;") */
if (*C->I++ == VARIABLE_NONE)
return 1;
- vars->variables = (slang_variable *) slang_alloc_realloc (vars->variables,
- vars->num_variables * sizeof (slang_variable),
- (vars->num_variables + 1) * sizeof (slang_variable));
- if (vars->variables == NULL)
+
+ /* make room for the new variable and initialize it */
+ O->vars->variables = (slang_variable *) slang_alloc_realloc (O->vars->variables,
+ O->vars->num_variables * sizeof (slang_variable),
+ (O->vars->num_variables + 1) * sizeof (slang_variable));
+ if (O->vars->variables == NULL)
{
slang_info_log_memory (C->L);
return 0;
}
- var = vars->variables + vars->num_variables;
- vars->num_variables++;
- slang_variable_construct (var);
+ var = &O->vars->variables[O->vars->num_variables];
+ if (!slang_variable_construct (var))
+ return 0;
+ O->vars->num_variables++;
+
+ /* copy the declarator qualifier type, parse the identifier */
+ var->global = C->global_scope;
var->type.qualifier = type->qualifier;
- if (!parse_identifier (C, &var->name))
+ var->a_name = parse_identifier (C);
+ if (var->a_name == SLANG_ATOM_NULL)
return 0;
+
switch (*C->I++)
{
case VARIABLE_NONE:
+ /* simple variable declarator - just copy the specifier */
if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
return 0;
break;
case VARIABLE_INITIALIZER:
+ /* initialized variable - copy the specifier and parse the expression */
if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
return 0;
var->initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
@@ -1925,110 +1682,97 @@ static int parse_init_declarator (slang_parse_ctx *C, const slang_fully_specifie
slang_info_log_memory (C->L);
return 0;
}
- if (!slang_operation_construct_a (var->initializer))
+ if (!slang_operation_construct (var->initializer))
{
slang_alloc_free (var->initializer);
var->initializer = NULL;
slang_info_log_memory (C->L);
return 0;
}
- if (!parse_expression (C, var->initializer, vars, structs, funcs))
+ if (!parse_expression (C, O, var->initializer))
return 0;
break;
+#if 0
case VARIABLE_ARRAY_UNKNOWN:
- var->type.specifier.type = slang_spec_array;
- var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (
- slang_type_specifier));
- if (var->type.specifier._array == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- slang_type_specifier_construct (var->type.specifier._array);
- if (!slang_type_specifier_copy (var->type.specifier._array, &type->specifier))
- return 0;
+ /* unsized array - mark it as array and copy the specifier to the array element */
+ if (!convert_to_array (C, var, &type->specifier))
+ return GL_FALSE;
break;
+#endif
case VARIABLE_ARRAY_EXPLICIT:
- var->type.specifier.type = slang_spec_array;
- var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (
- slang_type_specifier));
- if (var->type.specifier._array == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- slang_type_specifier_construct (var->type.specifier._array);
- if (!slang_type_specifier_copy (var->type.specifier._array, &type->specifier))
- return 0;
- var->array_size = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (var->array_size == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct_a (var->array_size))
- {
- slang_alloc_free (var->array_size);
- var->array_size = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!parse_expression (C, var->array_size, vars, structs, funcs))
- return 0;
+ if (!convert_to_array (C, var, &type->specifier))
+ return GL_FALSE;
+ if (!parse_array_len (C, O, &var->array_len))
+ return GL_FALSE;
break;
default:
return 0;
}
- if (!(var->type.specifier.type == slang_spec_array && var->array_size == NULL))
+
+ /* allocate global address space for a variable with a known size */
+ if (C->global_scope && !(var->type.specifier.type == slang_spec_array && var->array_len == 0))
{
- slang_storage_aggregate agg;
+ if (!calculate_var_size (C, O, var))
+ return GL_FALSE;
+ var->address = slang_var_pool_alloc (O->global_pool, var->size);
+ }
- slang_storage_aggregate_construct (&agg);
- if (!_slang_aggregate_variable (&agg, &var->type.specifier, var->array_size, funcs,
- structs))
- {
- slang_storage_aggregate_destruct (&agg);
+ /* initialize global variable */
+ if (C->global_scope && var->initializer != NULL)
+ {
+ slang_assemble_ctx A;
+
+ A.file = O->assembly;
+ A.mach = O->machine;
+ A.atoms = C->atoms;
+ A.space.funcs = O->funs;
+ A.space.structs = O->structs;
+ A.space.vars = O->vars;
+ if (!initialize_global (&A, var))
return 0;
- }
- slang_storage_aggregate_destruct (&agg);
}
return 1;
}
-static int parse_init_declarator_list (slang_parse_ctx *C, slang_variable_scope *vars,
- slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_init_declarator_list (slang_parse_ctx *C, slang_output_ctx *O)
{
slang_fully_specified_type type;
- slang_fully_specified_type_construct (&type);
- if (!parse_fully_specified_type (C, &type, structs, vars, funcs))
+ /* parse the fully specified type, common to all declarators */
+ if (!slang_fully_specified_type_construct (&type))
+ return 0;
+ if (!parse_fully_specified_type (C, O, &type))
{
slang_fully_specified_type_destruct (&type);
return 0;
}
+
+ /* parse declarators, pass-in the parsed type */
do
{
- if (!parse_init_declarator (C, &type, vars, structs, funcs))
+ if (!parse_init_declarator (C, O, &type))
{
slang_fully_specified_type_destruct (&type);
return 0;
}
}
while (*C->I++ == DECLARATOR_NEXT);
+
slang_fully_specified_type_destruct (&type);
return 1;
}
-static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scope *structs,
- slang_function_scope *funcs, slang_variable_scope *scope, slang_function **parsed_func_ret)
+static int parse_function (slang_parse_ctx *C, slang_output_ctx *O, int definition,
+ slang_function **parsed_func_ret)
{
slang_function parsed_func, *found_func;
/* parse function definition/declaration */
- slang_function_construct (&parsed_func);
+ if (!slang_function_construct (&parsed_func))
+ return 0;
if (definition)
{
- if (!parse_function_definition (C, &parsed_func, structs, scope, funcs))
+ if (!parse_function_definition (C, O, &parsed_func))
{
slang_function_destruct (&parsed_func);
return 0;
@@ -2036,7 +1780,7 @@ static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scop
}
else
{
- if (!parse_function_prototype (C, &parsed_func, structs, scope, funcs))
+ if (!parse_function_prototype (C, O, &parsed_func))
{
slang_function_destruct (&parsed_func);
return 0;
@@ -2044,39 +1788,43 @@ static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scop
}
/* find a function with a prototype matching the parsed one - only the current scope
- is being searched to allow built-in function overriding */
- found_func = slang_function_scope_find (funcs, &parsed_func, 0);
+ * is being searched to allow built-in function overriding */
+ found_func = slang_function_scope_find (O->funs, &parsed_func, 0);
if (found_func == NULL)
{
/* add the parsed function to the function list */
- funcs->functions = (slang_function *) slang_alloc_realloc (funcs->functions,
- funcs->num_functions * sizeof (slang_function), (funcs->num_functions + 1) * sizeof (
- slang_function));
- if (funcs->functions == NULL)
+ O->funs->functions = (slang_function *) slang_alloc_realloc (O->funs->functions,
+ O->funs->num_functions * sizeof (slang_function),
+ (O->funs->num_functions + 1) * sizeof (slang_function));
+ if (O->funs->functions == NULL)
{
slang_info_log_memory (C->L);
slang_function_destruct (&parsed_func);
return 0;
}
- funcs->functions[funcs->num_functions] = parsed_func;
- funcs->num_functions++;
+ O->funs->functions[O->funs->num_functions] = parsed_func;
+ O->funs->num_functions++;
/* return the newly parsed function */
- *parsed_func_ret = funcs->functions + funcs->num_functions - 1;
+ *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1];
}
else
{
/* TODO: check function return type qualifiers and specifiers */
if (definition)
{
- /* destroy the existing function declaration and replace it with the new one */
if (found_func->body != NULL)
{
slang_info_log_error (C->L, "%s: function already has a body",
- parsed_func.header.name);
+ slang_atom_pool_id (C->atoms, parsed_func.header.a_name));
slang_function_destruct (&parsed_func);
return 0;
}
+
+ /* destroy the existing function declaration and replace it with the new one,
+ * remember to save the fixup table */
+ parsed_func.fixups = found_func->fixups;
+ slang_fixup_table_init (&found_func->fixups);
slang_function_destruct (found_func);
*found_func = parsed_func;
}
@@ -2091,22 +1839,17 @@ static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scop
}
/* assemble the parsed function */
- if (definition)
{
- slang_assembly_file file;
- slang_assembly_name_space space;
-
- slang_assembly_file_construct (&file);
- space.funcs = funcs;
- space.structs = structs;
- space.vars = scope;
+ slang_assemble_ctx A;
- (**parsed_func_ret).address = file.count;
- if (!_slang_assemble_function (&file, *parsed_func_ret, &space))
- {
- slang_assembly_file_destruct (&file);
+ A.file = O->assembly;
+ A.mach = O->machine;
+ A.atoms = C->atoms;
+ A.space.funcs = O->funs;
+ A.space.structs = O->structs;
+ A.space.vars = O->vars;
+ if (!_slang_assemble_function (&A, *parsed_func_ret))
return 0;
- }
}
return 1;
}
@@ -2115,20 +1858,21 @@ static int parse_function (slang_parse_ctx *C, int definition, slang_struct_scop
#define DECLARATION_FUNCTION_PROTOTYPE 1
#define DECLARATION_INIT_DECLARATOR_LIST 2
-static int parse_declaration (slang_parse_ctx *C, slang_variable_scope *scope,
- slang_struct_scope *structs, slang_function_scope *funcs)
+static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O)
{
- slang_function *dummy_func;
-
switch (*C->I++)
{
case DECLARATION_INIT_DECLARATOR_LIST:
- if (!parse_init_declarator_list (C, scope, structs, funcs))
+ if (!parse_init_declarator_list (C, O))
return 0;
break;
case DECLARATION_FUNCTION_PROTOTYPE:
- if (!parse_function (C, 0, structs, funcs, scope, &dummy_func))
- return 0;
+ {
+ slang_function *dummy_func;
+
+ if (!parse_function (C, O, 0, &dummy_func))
+ return 0;
+ }
break;
default:
return 0;
@@ -2143,18 +1887,31 @@ static int parse_declaration (slang_parse_ctx *C, slang_variable_scope *scope,
static int parse_translation_unit (slang_parse_ctx *C, slang_translation_unit *unit)
{
+ slang_output_ctx o;
+
+ /* setup output context */
+ o.funs = &unit->functions;
+ o.structs = &unit->structs;
+ o.vars = &unit->globals;
+ o.assembly = unit->assembly;
+ o.global_pool = unit->global_pool;
+ o.machine = unit->machine;
+
+ /* parse individual functions and declarations */
while (*C->I != EXTERNAL_NULL)
{
- slang_function *func;
-
switch (*C->I++)
{
case EXTERNAL_FUNCTION_DEFINITION:
- if (!parse_function (C, 1, &unit->structs, &unit->functions, &unit->globals, &func))
- return 0;
+ {
+ slang_function *func;
+
+ if (!parse_function (C, &o, 1, &func))
+ return 0;
+ }
break;
case EXTERNAL_DECLARATION:
- if (!parse_declaration (C, &unit->globals, &unit->structs, &unit->functions))
+ if (!parse_declaration (C, &o))
return 0;
break;
default:
@@ -2165,36 +1922,44 @@ static int parse_translation_unit (slang_parse_ctx *C, slang_translation_unit *u
return 1;
}
+#define BUILTIN_CORE 0
+#define BUILTIN_COMMON 1
+#define BUILTIN_TARGET 2
+#define BUILTIN_TOTAL 3
+
static int compile_binary (const byte *prod, slang_translation_unit *unit, slang_unit_type type,
- slang_info_log *log, slang_translation_unit *builtins)
+ slang_info_log *log, slang_translation_unit *builtins, slang_assembly_file *file,
+ slang_var_pool *pool, slang_machine *mach, slang_translation_unit *downlink,
+ slang_atom_pool *atoms)
{
slang_parse_ctx C;
+ /* create translation unit object */
+ if (file != NULL)
+ {
+ if (!slang_translation_unit_construct2 (unit, file, pool, mach, atoms))
+ return 0;
+ unit->type = type;
+ }
+
/* set-up parse context */
C.I = prod;
C.L = log;
C.parsing_builtin = builtins == NULL;
+ C.global_scope = 1;
+ C.atoms = unit->atom_pool;
if (!check_revision (&C))
+ {
+ slang_translation_unit_destruct (unit);
return 0;
+ }
- /* create translation unit object */
- slang_translation_unit_construct (unit);
- unit->type = type;
-
- if (builtins != NULL)
+ if (downlink != NULL)
{
- /* link to built-in functions */
- builtins[1].functions.outer_scope = &builtins[0].functions;
- builtins[2].functions.outer_scope = &builtins[1].functions;
- unit->functions.outer_scope = &builtins[2].functions;
-
- /* link to built-in variables - core unit does not define any */
- builtins[2].globals.outer_scope = &builtins[1].globals;
- unit->globals.outer_scope = &builtins[2].globals;
-
- /* link to built-in structure typedefs - only in common unit */
- unit->structs.outer_scope = &builtins[1].structs;
+ unit->functions.outer_scope = &downlink->functions;
+ unit->globals.outer_scope = &downlink->globals;
+ unit->structs.outer_scope = &downlink->structs;
}
/* parse translation unit */
@@ -2217,7 +1982,7 @@ static int compile_with_grammar (grammar id, const char *source, slang_translati
if (!_slang_preprocess_version (source, &version, &start, log))
return 0;
- /* check the syntax */
+ /* check the syntax and generate its binary representation */
if (!grammar_fast_check (id, (const byte *) source + start, &prod, &size, 65536))
{
char buf[1024];
@@ -2227,7 +1992,9 @@ static int compile_with_grammar (grammar id, const char *source, slang_translati
return 0;
}
- if (!compile_binary (prod, unit, type, log, builtins))
+ /* syntax is okay - translate it to internal representation */
+ if (!compile_binary (prod, unit, type, log, builtins, NULL, NULL, NULL,
+ &builtins[BUILTIN_TARGET], NULL))
{
grammar_alloc_free (prod);
return 0;
@@ -2255,95 +2022,127 @@ static const byte slang_fragment_builtin_gc[] = {
static const byte slang_vertex_builtin_gc[] = {
#include "library/slang_vertex_builtin_gc.h"
-};
-
-int compile (grammar *id, slang_translation_unit builtin_units[3], int compiled[3],
- const char *source, slang_translation_unit *unit, slang_unit_type type, slang_info_log *log)
-{
- slang_translation_unit *builtins = NULL;
-
- /* load slang grammar */
- *id = grammar_load_from_text ((const byte *) (slang_shader_syn));
- if (*id == 0)
- {
- byte buf[1024];
- int pos;
-
- grammar_get_last_error (buf, 1024, &pos);
- slang_info_log_error (log, (const char *) (buf));
- return 0;
- }
-
- /* set shader type - the syntax is slightly different for different shaders */
- if (type == slang_unit_fragment_shader || type == slang_unit_fragment_builtin)
- grammar_set_reg8 (*id, (const byte *) "shader_type", 1);
- else
- grammar_set_reg8 (*id, (const byte *) "shader_type", 2);
-
- /* enable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 1);
-
- /* if parsing user-specified shader, load built-in library */
- if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
- {
- if (!compile_binary (slang_core_gc, &builtin_units[0], slang_unit_fragment_builtin, log,
- NULL))
- return 0;
- compiled[0] = 1;
-
- if (!compile_binary (slang_common_builtin_gc, &builtin_units[1],
- slang_unit_fragment_builtin, log, NULL))
- return 0;
- compiled[1] = 1;
-
- if (type == slang_unit_fragment_shader)
- {
- if (!compile_binary (slang_fragment_builtin_gc, &builtin_units[2],
- slang_unit_fragment_builtin, log, NULL))
- return 0;
- }
- else if (type == slang_unit_vertex_shader)
- {
- if (!compile_binary (slang_vertex_builtin_gc, &builtin_units[2],
- slang_unit_vertex_builtin, log, NULL))
- return 0;
- }
- compiled[2] = 1;
-
- /* disable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 0);
- builtins = builtin_units;
- }
-
- /* compile the actual shader - pass-in built-in library for external shader */
- if (!compile_with_grammar (*id, source, unit, type, log, builtins))
- return 0;
-
- return 1;
+};
+
+static int compile (grammar *id, slang_translation_unit *builtin_units, int *compiled,
+ const char *source, slang_translation_unit *unit, slang_unit_type type, slang_info_log *log)
+{
+ slang_translation_unit *builtins = NULL;
+
+ /* load slang grammar */
+ *id = grammar_load_from_text ((const byte *) (slang_shader_syn));
+ if (*id == 0)
+ {
+ byte buf[1024];
+ int pos;
+
+ grammar_get_last_error (buf, 1024, &pos);
+ slang_info_log_error (log, (const char *) (buf));
+ return 0;
+ }
+
+ /* set shader type - the syntax is slightly different for different shaders */
+ if (type == slang_unit_fragment_shader || type == slang_unit_fragment_builtin)
+ grammar_set_reg8 (*id, (const byte *) "shader_type", 1);
+ else
+ grammar_set_reg8 (*id, (const byte *) "shader_type", 2);
+
+ /* enable language extensions */
+ grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 1);
+
+ /* if parsing user-specified shader, load built-in library */
+ if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
+ {
+ /* compile core functionality first */
+ if (!compile_binary (slang_core_gc, &builtin_units[BUILTIN_CORE],
+ slang_unit_fragment_builtin, log, NULL, unit->assembly, unit->global_pool,
+ unit->machine, NULL, unit->atom_pool))
+ return 0;
+ compiled[BUILTIN_CORE] = 1;
+
+ /* compile common functions and variables, link to core */
+ if (!compile_binary (slang_common_builtin_gc, &builtin_units[BUILTIN_COMMON],
+ slang_unit_fragment_builtin, log, NULL, unit->assembly, unit->global_pool,
+ unit->machine, &builtin_units[BUILTIN_CORE], unit->atom_pool))
+ return 0;
+ compiled[BUILTIN_COMMON] = 1;
+
+ /* compile target-specific functions and variables, link to common */
+ if (type == slang_unit_fragment_shader)
+ {
+ if (!compile_binary (slang_fragment_builtin_gc, &builtin_units[BUILTIN_TARGET],
+ slang_unit_fragment_builtin, log, NULL, unit->assembly, unit->global_pool,
+ unit->machine, &builtin_units[BUILTIN_COMMON], unit->atom_pool))
+ return 0;
+ }
+ else if (type == slang_unit_vertex_shader)
+ {
+ if (!compile_binary (slang_vertex_builtin_gc, &builtin_units[BUILTIN_TARGET],
+ slang_unit_vertex_builtin, log, NULL, unit->assembly, unit->global_pool,
+ unit->machine, &builtin_units[BUILTIN_COMMON], unit->atom_pool))
+ return 0;
+ }
+ compiled[BUILTIN_TARGET] = 1;
+
+ /* disable language extensions */
+ grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 0);
+ builtins = builtin_units;
+ }
+
+ /* compile the actual shader - pass-in built-in library for external shader */
+ if (!compile_with_grammar (*id, source, unit, type, log, builtins))
+ return 0;
+
+ return 1;
}
int _slang_compile (const char *source, slang_translation_unit *unit, slang_unit_type type,
slang_info_log *log)
-{
+{
int success;
grammar id = 0;
- slang_translation_unit builtin_units[3];
- int compiled[3] = { 0 };
+/* slang_translation_unit builtin_units[BUILTIN_TOTAL];*/
+ slang_translation_unit *builtin_units;
+ int compiled[BUILTIN_TOTAL] = { 0 };
+ /* create the main unit first */
+ if (!slang_translation_unit_construct (unit))
+ return 0;
+ unit->type = type;
+
+ builtin_units = (slang_translation_unit *) slang_alloc_malloc (BUILTIN_TOTAL * sizeof (slang_translation_unit));
success = compile (&id, builtin_units, compiled, source, unit, type, log);
/* destroy built-in library */
- if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
- {
- int i;
-
- for (i = 0; i < 3; i++)
+ /* XXX: free with the unit */
+ /*if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
+ {
+ int i;
+
+ for (i = 0; i < BUILTIN_TOTAL; i++)
if (compiled[i] != 0)
slang_translation_unit_destruct (&builtin_units[i]);
- }
+ }*/
if (id != 0)
- grammar_destroy (id);
+ grammar_destroy (id);
- return success;
+ if (!success)
+ return 0;
+
+ unit->exp_data.atoms = unit->atom_pool;
+ if (!_slang_build_export_data_table (&unit->exp_data, &unit->globals))
+ return 0;
+
+ unit->exp_code.atoms = unit->atom_pool;
+ if (!_slang_build_export_code_table (&unit->exp_code, &unit->functions, unit))
+ return 0;
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ /* XXX: lookup the @main label */
+ if (!_slang_x86_codegen (unit->machine, unit->assembly, unit->exp_code.entries[0].address))
+ return 0;
+#endif
+
+ return 1;
}
diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h
index a9a075c37f..cbf0bf907a 100644
--- a/src/mesa/shader/slang/slang_compile.h
+++ b/src/mesa/shader/slang/slang_compile.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -23,230 +23,53 @@
*/
#if !defined SLANG_COMPILE_H
-#define SLANG_COMPILE_H
+#define SLANG_COMPILE_H
+
+#include "slang_export.h"
+#include "slang_execute.h"
+#include "slang_compile_variable.h"
+#include "slang_compile_struct.h"
+#include "slang_compile_operation.h"
+#include "slang_compile_function.h"
#if defined __cplusplus
extern "C" {
#endif
-typedef enum slang_type_qualifier_
-{
- slang_qual_none,
- slang_qual_const,
- slang_qual_attribute,
- slang_qual_varying,
- slang_qual_uniform,
- slang_qual_out,
- slang_qual_inout,
- slang_qual_fixedoutput, /* internal */
- slang_qual_fixedinput /* internal */
-} slang_type_qualifier;
-
-typedef enum slang_type_specifier_type_
-{
- slang_spec_void,
- slang_spec_bool,
- slang_spec_bvec2,
- slang_spec_bvec3,
- slang_spec_bvec4,
- slang_spec_int,
- slang_spec_ivec2,
- slang_spec_ivec3,
- slang_spec_ivec4,
- slang_spec_float,
- slang_spec_vec2,
- slang_spec_vec3,
- slang_spec_vec4,
- slang_spec_mat2,
- slang_spec_mat3,
- slang_spec_mat4,
- slang_spec_sampler1D,
- slang_spec_sampler2D,
- slang_spec_sampler3D,
- slang_spec_samplerCube,
- slang_spec_sampler1DShadow,
- slang_spec_sampler2DShadow,
- slang_spec_struct,
- slang_spec_array
-} slang_type_specifier_type;
-
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
-
-typedef struct slang_type_specifier_
-{
- slang_type_specifier_type type;
- struct slang_struct_ *_struct; /* spec_struct */
- struct slang_type_specifier_ *_array; /* spec_array */
-} slang_type_specifier;
-
-void slang_type_specifier_construct (slang_type_specifier *);
-void slang_type_specifier_destruct (slang_type_specifier *);
-int slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
-int slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
-
-typedef struct slang_fully_specified_type_
-{
- slang_type_qualifier qualifier;
- slang_type_specifier specifier;
-} slang_fully_specified_type;
-
-typedef struct slang_variable_scope_
-{
- struct slang_variable_ *variables;
- unsigned int num_variables;
- struct slang_variable_scope_ *outer_scope;
-} slang_variable_scope;
-
-typedef enum slang_operation_type_
-{
- slang_oper_none,
- slang_oper_block_no_new_scope,
- slang_oper_block_new_scope,
- slang_oper_variable_decl,
- slang_oper_asm,
- slang_oper_break,
- slang_oper_continue,
- slang_oper_discard,
- slang_oper_return,
- slang_oper_expression,
- slang_oper_if,
- slang_oper_while,
- slang_oper_do,
- slang_oper_for,
- slang_oper_void,
- slang_oper_literal_bool,
- slang_oper_literal_int,
- slang_oper_literal_float,
- slang_oper_identifier,
- slang_oper_sequence,
- slang_oper_assign,
- slang_oper_addassign,
- slang_oper_subassign,
- slang_oper_mulassign,
- slang_oper_divassign,
- /*slang_oper_modassign,*/
- /*slang_oper_lshassign,*/
- /*slang_oper_rshassign,*/
- /*slang_oper_orassign,*/
- /*slang_oper_xorassign,*/
- /*slang_oper_andassign,*/
- slang_oper_select,
- slang_oper_logicalor,
- slang_oper_logicalxor,
- slang_oper_logicaland,
- /*slang_oper_bitor,*/
- /*slang_oper_bitxor,*/
- /*slang_oper_bitand,*/
- slang_oper_equal,
- slang_oper_notequal,
- slang_oper_less,
- slang_oper_greater,
- slang_oper_lessequal,
- slang_oper_greaterequal,
- /*slang_oper_lshift,*/
- /*slang_oper_rshift,*/
- slang_oper_add,
- slang_oper_subtract,
- slang_oper_multiply,
- slang_oper_divide,
- /*slang_oper_modulus,*/
- slang_oper_preincrement,
- slang_oper_predecrement,
- slang_oper_plus,
- slang_oper_minus,
- /*slang_oper_complement,*/
- slang_oper_not,
- slang_oper_subscript,
- slang_oper_call,
- slang_oper_field,
- slang_oper_postincrement,
- slang_oper_postdecrement
-} slang_operation_type;
-
-typedef struct slang_operation_
-{
- slang_operation_type type;
- struct slang_operation_ *children;
- unsigned int num_children;
- float literal; /* bool, literal_int, literal_float */
- char *identifier; /* asm, identifier, call, field */
- slang_variable_scope *locals;
-} slang_operation;
-
-int slang_operation_construct_a (slang_operation *);
-void slang_operation_destruct (slang_operation *);
-
-typedef struct slang_variable_
-{
- slang_fully_specified_type type;
- char *name;
- slang_operation *array_size; /* spec_array */
- slang_operation *initializer;
- unsigned int address;
-} slang_variable;
-
-slang_variable *_slang_locate_variable (slang_variable_scope *scope, const char *name, int all);
-
-typedef struct slang_struct_scope_
-{
- struct slang_struct_ *structs;
- unsigned int num_structs;
- struct slang_struct_scope_ *outer_scope;
-} slang_struct_scope;
-
-struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, const char *, int);
-
-typedef struct slang_struct_
-{
- char *name;
- slang_variable_scope *fields;
- slang_struct_scope *structs;
-} slang_struct;
-
-int slang_struct_construct_a (slang_struct *);
-int slang_struct_copy (slang_struct *, const slang_struct *);
-
-typedef enum slang_function_kind_
-{
- slang_func_ordinary,
- slang_func_constructor,
- slang_func_operator
-} slang_function_kind;
-
-typedef struct slang_function_
-{
- slang_function_kind kind;
- slang_variable header;
- slang_variable_scope *parameters;
- unsigned int param_count;
- slang_operation *body;
- unsigned int address;
-} slang_function;
-
-typedef struct slang_function_scope_
-{
- slang_function *functions;
- unsigned int num_functions;
- struct slang_function_scope_ *outer_scope;
-} slang_function_scope;
-
typedef enum slang_unit_type_
{
slang_unit_fragment_shader,
slang_unit_vertex_shader,
slang_unit_fragment_builtin,
slang_unit_vertex_builtin
-} slang_unit_type;
-
+} slang_unit_type;
+
+typedef struct slang_var_pool_
+{
+ GLuint next_addr;
+} slang_var_pool;
+
typedef struct slang_translation_unit_
{
slang_variable_scope globals;
slang_function_scope functions;
slang_struct_scope structs;
- slang_unit_type type;
+ slang_unit_type type;
+ slang_assembly_file *assembly;
+ int free_assembly;
+ slang_var_pool *global_pool;
+ int free_global_pool;
+ slang_machine *machine;
+ int free_machine;
+ slang_atom_pool *atom_pool;
+ int free_atom_pool;
+ slang_export_data_table exp_data;
+ slang_export_code_table exp_code;
} slang_translation_unit;
-void slang_translation_unit_construct (slang_translation_unit *);
+int slang_translation_unit_construct (slang_translation_unit *);
+int slang_translation_unit_construct2 (slang_translation_unit *, slang_assembly_file *,
+ slang_var_pool *, slang_machine *, slang_atom_pool *);
void slang_translation_unit_destruct (slang_translation_unit *);
typedef struct slang_info_log_
diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c
new file mode 100644
index 0000000000..60d9e3360b
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_function.c
@@ -0,0 +1,190 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_compile_function.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_fixup_table */
+
+void slang_fixup_table_init (slang_fixup_table *fix)
+{
+ fix->table = NULL;
+ fix->count = 0;
+}
+
+void slang_fixup_table_free (slang_fixup_table *fix)
+{
+ slang_alloc_free (fix->table);
+ slang_fixup_table_init (fix);
+}
+
+/* slang_function */
+
+int slang_function_construct (slang_function *func)
+{
+ func->kind = slang_func_ordinary;
+ if (!slang_variable_construct (&func->header))
+ return 0;
+ func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (func->parameters == NULL)
+ {
+ slang_variable_destruct (&func->header);
+ return 0;
+ }
+ if (!slang_variable_scope_construct (func->parameters))
+ {
+ slang_alloc_free (func->parameters);
+ slang_variable_destruct (&func->header);
+ return 0;
+ }
+ func->param_count = 0;
+ func->body = NULL;
+ func->address = ~0;
+ slang_fixup_table_init (&func->fixups);
+ return 1;
+}
+
+void slang_function_destruct (slang_function *func)
+{
+ slang_variable_destruct (&func->header);
+ slang_variable_scope_destruct (func->parameters);
+ slang_alloc_free (func->parameters);
+ if (func->body != NULL)
+ {
+ slang_operation_destruct (func->body);
+ slang_alloc_free (func->body);
+ }
+ slang_fixup_table_free (&func->fixups);
+}
+
+/* slang_function_scope */
+
+int slang_function_scope_construct (slang_function_scope *scope)
+{
+ scope->functions = NULL;
+ scope->num_functions = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_function_scope_destruct (slang_function_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_functions; i++)
+ slang_function_destruct (scope->functions + i);
+ slang_alloc_free (scope->functions);
+}
+
+int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ if (a_name == funcs->functions[i].header.a_name)
+ return 1;
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1);
+ return 0;
+}
+
+slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,
+ int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ {
+ slang_function *f = &funcs->functions[i];
+ unsigned int j;
+
+ if (fun->header.a_name != f->header.a_name)
+ continue;
+ if (fun->param_count != f->param_count)
+ continue;
+ for (j = 0; j < fun->param_count; j++)
+ {
+ if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,
+ &f->parameters->variables[j].type.specifier))
+ break;
+ }
+ if (j == fun->param_count)
+ return f;
+ }
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find (funcs->outer_scope, fun, 1);
+ return NULL;
+}
+
+/*
+ * _slang_build_export_code_table()
+ */
+
+GLboolean _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs,
+ slang_translation_unit *unit)
+{
+ slang_atom mainAtom;
+ GLuint i;
+
+ mainAtom = slang_atom_pool_atom (tbl->atoms, "main");
+ if (mainAtom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < funs->num_functions; i++)
+ {
+ if (funs->functions[i].header.a_name == mainAtom)
+ {
+ slang_function *fun = &funs->functions[i];
+ slang_export_code_entry *e;
+ slang_assemble_ctx A;
+
+ e = slang_export_code_table_add (tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ e->address = unit->assembly->count;
+ e->name = slang_atom_pool_atom (tbl->atoms, "@main");
+ if (e->name == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ A.file = unit->assembly;
+ A.mach = unit->machine;
+ A.atoms = unit->atom_pool;
+ A.space.funcs = &unit->functions;
+ A.space.structs = &unit->structs;
+ A.space.vars = &unit->globals;
+ slang_assembly_file_push_label (unit->assembly, slang_asm_local_alloc, 20);
+ slang_assembly_file_push_label (unit->assembly, slang_asm_enter, 20);
+ _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE);
+ slang_assembly_file_push (unit->assembly, slang_asm_exit);
+ }
+ }
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h
new file mode 100644
index 0000000000..0c88434539
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_function.h
@@ -0,0 +1,84 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_COMPILE_FUNCTION_H
+#define SLANG_COMPILE_FUNCTION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+struct slang_translation_unit_;
+
+typedef enum slang_function_kind_
+{
+ slang_func_ordinary,
+ slang_func_constructor,
+ slang_func_operator
+} slang_function_kind;
+
+typedef struct slang_fixup_table_
+{
+ GLuint *table;
+ GLuint count;
+} slang_fixup_table;
+
+void slang_fixup_table_init (slang_fixup_table *);
+void slang_fixup_table_free (slang_fixup_table *);
+
+typedef struct slang_function_
+{
+ slang_function_kind kind;
+ slang_variable header;
+ slang_variable_scope *parameters;
+ unsigned int param_count;
+ slang_operation *body;
+ unsigned int address;
+ slang_fixup_table fixups;
+} slang_function;
+
+int slang_function_construct (slang_function *);
+void slang_function_destruct (slang_function *);
+
+typedef struct slang_function_scope_
+{
+ slang_function *functions;
+ unsigned int num_functions;
+ struct slang_function_scope_ *outer_scope;
+} slang_function_scope;
+
+int slang_function_scope_construct (slang_function_scope *);
+void slang_function_scope_destruct (slang_function_scope *);
+int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int);
+slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int);
+
+GLboolean _slang_build_export_code_table (slang_export_code_table *, slang_function_scope *,
+ struct slang_translation_unit_ *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
new file mode 100644
index 0000000000..8af8d1f82b
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -0,0 +1,102 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_compile_operation.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_operation */
+
+int slang_operation_construct (slang_operation *oper)
+{
+ oper->type = slang_oper_none;
+ oper->children = NULL;
+ oper->num_children = 0;
+ oper->literal = (float) 0;
+ oper->a_id = SLANG_ATOM_NULL;
+ oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (oper->locals == NULL)
+ return 0;
+ if (!slang_variable_scope_construct (oper->locals))
+ {
+ slang_alloc_free (oper->locals);
+ return 0;
+ }
+ return 1;
+}
+
+void slang_operation_destruct (slang_operation *oper)
+{
+ unsigned int i;
+
+ for (i = 0; i < oper->num_children; i++)
+ slang_operation_destruct (oper->children + i);
+ slang_alloc_free (oper->children);
+ slang_variable_scope_destruct (oper->locals);
+ slang_alloc_free (oper->locals);
+}
+
+int slang_operation_copy (slang_operation *x, const slang_operation *y)
+{
+ slang_operation z;
+ unsigned int i;
+
+ if (!slang_operation_construct (&z))
+ return 0;
+ z.type = y->type;
+ z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation));
+ if (z.children == NULL)
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ for (z.num_children = 0; z.num_children < y->num_children; z.num_children++)
+ if (!slang_operation_construct (&z.children[z.num_children]))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_children; i++)
+ if (!slang_operation_copy (&z.children[i], &y->children[i]))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ z.literal = y->literal;
+ z.a_id = y->a_id;
+ if (!slang_variable_scope_copy (z.locals, y->locals))
+ {
+ slang_operation_destruct (&z);
+ return 0;
+ }
+ slang_operation_destruct (x);
+ *x = z;
+ return 1;
+}
+
diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h
new file mode 100644
index 0000000000..9e64848a0a
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_operation.h
@@ -0,0 +1,117 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_COMPILE_OPERATION_H
+#define SLANG_COMPILE_OPERATION_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef enum slang_operation_type_
+{
+ slang_oper_none,
+ slang_oper_block_no_new_scope,
+ slang_oper_block_new_scope,
+ slang_oper_variable_decl,
+ slang_oper_asm,
+ slang_oper_break,
+ slang_oper_continue,
+ slang_oper_discard,
+ slang_oper_return,
+ slang_oper_expression,
+ slang_oper_if,
+ slang_oper_while,
+ slang_oper_do,
+ slang_oper_for,
+ slang_oper_void,
+ slang_oper_literal_bool,
+ slang_oper_literal_int,
+ slang_oper_literal_float,
+ slang_oper_identifier,
+ slang_oper_sequence,
+ slang_oper_assign,
+ slang_oper_addassign,
+ slang_oper_subassign,
+ slang_oper_mulassign,
+ slang_oper_divassign,
+ /*slang_oper_modassign,*/
+ /*slang_oper_lshassign,*/
+ /*slang_oper_rshassign,*/
+ /*slang_oper_orassign,*/
+ /*slang_oper_xorassign,*/
+ /*slang_oper_andassign,*/
+ slang_oper_select,
+ slang_oper_logicalor,
+ slang_oper_logicalxor,
+ slang_oper_logicaland,
+ /*slang_oper_bitor,*/
+ /*slang_oper_bitxor,*/
+ /*slang_oper_bitand,*/
+ slang_oper_equal,
+ slang_oper_notequal,
+ slang_oper_less,
+ slang_oper_greater,
+ slang_oper_lessequal,
+ slang_oper_greaterequal,
+ /*slang_oper_lshift,*/
+ /*slang_oper_rshift,*/
+ slang_oper_add,
+ slang_oper_subtract,
+ slang_oper_multiply,
+ slang_oper_divide,
+ /*slang_oper_modulus,*/
+ slang_oper_preincrement,
+ slang_oper_predecrement,
+ slang_oper_plus,
+ slang_oper_minus,
+ /*slang_oper_complement,*/
+ slang_oper_not,
+ slang_oper_subscript,
+ slang_oper_call,
+ slang_oper_field,
+ slang_oper_postincrement,
+ slang_oper_postdecrement
+} slang_operation_type;
+
+typedef struct slang_operation_
+{
+ slang_operation_type type;
+ struct slang_operation_ *children;
+ unsigned int num_children;
+ float literal; /* type: bool, literal_int, literal_float */
+ slang_atom a_id; /* type: asm, identifier, call, field */
+ slang_variable_scope *locals;
+} slang_operation;
+
+int slang_operation_construct (slang_operation *);
+void slang_operation_destruct (slang_operation *);
+int slang_operation_copy (slang_operation *, const slang_operation *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c
new file mode 100644
index 0000000000..627f0597e1
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_struct.c
@@ -0,0 +1,178 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_compile_struct.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_struct_scope */
+
+int slang_struct_scope_construct (slang_struct_scope *scope)
+{
+ scope->structs = NULL;
+ scope->num_structs = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_struct_scope_destruct (slang_struct_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_structs; i++)
+ slang_struct_destruct (scope->structs + i);
+ slang_alloc_free (scope->structs);
+ /* do not free scope->outer_scope */
+}
+
+int slang_struct_scope_copy (slang_struct_scope *x, const slang_struct_scope *y)
+{
+ slang_struct_scope z;
+ unsigned int i;
+
+ if (!slang_struct_scope_construct (&z))
+ return 0;
+ z.structs = (slang_struct *) slang_alloc_malloc (y->num_structs * sizeof (slang_struct));
+ if (z.structs == NULL)
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ for (z.num_structs = 0; z.num_structs < y->num_structs; z.num_structs++)
+ if (!slang_struct_construct (&z.structs[z.num_structs]))
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_structs; i++)
+ if (!slang_struct_copy (&z.structs[i], &y->structs[i]))
+ {
+ slang_struct_scope_destruct (&z);
+ return 0;
+ }
+ z.outer_scope = y->outer_scope;
+ slang_struct_scope_destruct (x);
+ *x = z;
+ return 1;
+}
+
+slang_struct *slang_struct_scope_find (slang_struct_scope *stru, slang_atom a_name, int all_scopes)
+{
+ unsigned int i;
+
+ for (i = 0; i < stru->num_structs; i++)
+ if (a_name == stru->structs[i].a_name)
+ return &stru->structs[i];
+ if (all_scopes && stru->outer_scope != NULL)
+ return slang_struct_scope_find (stru->outer_scope, a_name, 1);
+ return NULL;
+}
+
+/* slang_struct */
+
+int slang_struct_construct (slang_struct *stru)
+{
+ stru->a_name = SLANG_ATOM_NULL;
+ stru->fields = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
+ if (stru->fields == NULL)
+ return 0;
+ if (!slang_variable_scope_construct (stru->fields))
+ {
+ slang_alloc_free (stru->fields);
+ return 0;
+ }
+ stru->structs = (slang_struct_scope *) slang_alloc_malloc (sizeof (slang_struct_scope));
+ if (stru->structs == NULL)
+ {
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ return 0;
+ }
+ if (!slang_struct_scope_construct (stru->structs))
+ {
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ slang_alloc_free (stru->structs);
+ return 0;
+ }
+ return 1;
+}
+
+void slang_struct_destruct (slang_struct *stru)
+{
+ slang_variable_scope_destruct (stru->fields);
+ slang_alloc_free (stru->fields);
+ slang_struct_scope_destruct (stru->structs);
+ slang_alloc_free (stru->structs);
+}
+
+int slang_struct_copy (slang_struct *x, const slang_struct *y)
+{
+ slang_struct z;
+
+ if (!slang_struct_construct (&z))
+ return 0;
+ z.a_name = y->a_name;
+ if (!slang_variable_scope_copy (z.fields, y->fields))
+ {
+ slang_struct_destruct (&z);
+ return 0;
+ }
+ if (!slang_struct_scope_copy (z.structs, y->structs))
+ {
+ slang_struct_destruct (&z);
+ return 0;
+ }
+ slang_struct_destruct (x);
+ *x = z;
+ return 1;
+}
+
+int slang_struct_equal (const slang_struct *x, const slang_struct *y)
+{
+ unsigned int i;
+
+ if (x->fields->num_variables != y->fields->num_variables)
+ return 0;
+ for (i = 0; i < x->fields->num_variables; i++)
+ {
+ slang_variable *varx = &x->fields->variables[i];
+ slang_variable *vary = &y->fields->variables[i];
+
+ if (varx->a_name != vary->a_name)
+ return 0;
+ if (!slang_type_specifier_equal (&varx->type.specifier, &vary->type.specifier))
+ return 0;
+ if (varx->type.specifier.type == slang_spec_array)
+ if (varx->array_len != vary->array_len)
+ return GL_FALSE;
+ }
+ return 1;
+}
+
diff --git a/src/mesa/shader/slang/slang_compile_struct.h b/src/mesa/shader/slang/slang_compile_struct.h
new file mode 100644
index 0000000000..4798b6042f
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_struct.h
@@ -0,0 +1,61 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_COMPILE_STRUCT_H
+#define SLANG_COMPILE_STRUCT_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef struct slang_struct_scope_
+{
+ struct slang_struct_ *structs;
+ unsigned int num_structs;
+ struct slang_struct_scope_ *outer_scope;
+} slang_struct_scope;
+
+int slang_struct_scope_construct (slang_struct_scope *);
+void slang_struct_scope_destruct (slang_struct_scope *);
+int slang_struct_scope_copy (slang_struct_scope *, const slang_struct_scope *);
+struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, slang_atom, int);
+
+typedef struct slang_struct_
+{
+ slang_atom a_name;
+ struct slang_variable_scope_ *fields;
+ slang_struct_scope *structs;
+} slang_struct;
+
+int slang_struct_construct (slang_struct *);
+void slang_struct_destruct (slang_struct *);
+int slang_struct_copy (slang_struct *, const slang_struct *);
+int slang_struct_equal (const slang_struct *, const slang_struct *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c
new file mode 100644
index 0000000000..0c8f6c5727
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_variable.c
@@ -0,0 +1,369 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_compile_variable.c
+ * slang front-end compiler
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_compile.h"
+
+/* slang_type_specifier_type */
+
+typedef struct
+{
+ const char *name;
+ slang_type_specifier_type type;
+} type_specifier_type_name;
+
+static type_specifier_type_name type_specifier_type_names[] = {
+ { "void", slang_spec_void },
+ { "bool", slang_spec_bool },
+ { "bvec2", slang_spec_bvec2 },
+ { "bvec3", slang_spec_bvec3 },
+ { "bvec4", slang_spec_bvec4 },
+ { "int", slang_spec_int },
+ { "ivec2", slang_spec_ivec2 },
+ { "ivec3", slang_spec_ivec3 },
+ { "ivec4", slang_spec_ivec4 },
+ { "float", slang_spec_float },
+ { "vec2", slang_spec_vec2 },
+ { "vec3", slang_spec_vec3 },
+ { "vec4", slang_spec_vec4 },
+ { "mat2", slang_spec_mat2 },
+ { "mat3", slang_spec_mat3 },
+ { "mat4", slang_spec_mat4 },
+ { "sampler1D", slang_spec_sampler1D },
+ { "sampler2D", slang_spec_sampler2D },
+ { "sampler3D", slang_spec_sampler3D },
+ { "samplerCube", slang_spec_samplerCube },
+ { "sampler1DShadow", slang_spec_sampler1DShadow },
+ { "sampler2DShadow", slang_spec_sampler2DShadow },
+ { NULL, slang_spec_void }
+};
+
+slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)
+{
+ type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL)
+ {
+ if (slang_string_compare (p->name, name) == 0)
+ break;
+ p++;
+ }
+ return p->type;
+}
+
+const char *slang_type_specifier_type_to_string (slang_type_specifier_type type)
+{
+ type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL)
+ {
+ if (p->type == type)
+ break;
+ p++;
+ }
+ return p->name;
+}
+
+/* slang_fully_specified_type */
+
+int slang_fully_specified_type_construct (slang_fully_specified_type *type)
+{
+ type->qualifier = slang_qual_none;
+ slang_type_specifier_ctr (&type->specifier);
+ return 1;
+}
+
+void slang_fully_specified_type_destruct (slang_fully_specified_type *type)
+{
+ slang_type_specifier_dtr (&type->specifier);
+}
+
+int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y)
+{
+ slang_fully_specified_type z;
+
+ if (!slang_fully_specified_type_construct (&z))
+ return 0;
+ z.qualifier = y->qualifier;
+ if (!slang_type_specifier_copy (&z.specifier, &y->specifier))
+ {
+ slang_fully_specified_type_destruct (&z);
+ return 0;
+ }
+ slang_fully_specified_type_destruct (x);
+ *x = z;
+ return 1;
+}
+
+/* slang_variable_scope */
+
+int slang_variable_scope_construct (slang_variable_scope *scope)
+{
+ scope->variables = NULL;
+ scope->num_variables = 0;
+ scope->outer_scope = NULL;
+ return 1;
+}
+
+void slang_variable_scope_destruct (slang_variable_scope *scope)
+{
+ unsigned int i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ slang_variable_destruct (scope->variables + i);
+ slang_alloc_free (scope->variables);
+ /* do not free scope->outer_scope */
+}
+
+int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)
+{
+ slang_variable_scope z;
+ unsigned int i;
+
+ if (!slang_variable_scope_construct (&z))
+ return 0;
+ z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable));
+ if (z.variables == NULL)
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++)
+ if (!slang_variable_construct (&z.variables[z.num_variables]))
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ for (i = 0; i < z.num_variables; i++)
+ if (!slang_variable_copy (&z.variables[i], &y->variables[i]))
+ {
+ slang_variable_scope_destruct (&z);
+ return 0;
+ }
+ z.outer_scope = y->outer_scope;
+ slang_variable_scope_destruct (x);
+ *x = z;
+ return 1;
+}
+
+/* slang_variable */
+
+int slang_variable_construct (slang_variable *var)
+{
+ if (!slang_fully_specified_type_construct (&var->type))
+ return 0;
+ var->a_name = SLANG_ATOM_NULL;
+ var->array_len = 0;
+ var->initializer = NULL;
+ var->address = ~0;
+ var->size = 0;
+ var->global = 0;
+ return 1;
+}
+
+void slang_variable_destruct (slang_variable *var)
+{
+ slang_fully_specified_type_destruct (&var->type);
+ if (var->initializer != NULL)
+ {
+ slang_operation_destruct (var->initializer);
+ slang_alloc_free (var->initializer);
+ }
+}
+
+int slang_variable_copy (slang_variable *x, const slang_variable *y)
+{
+ slang_variable z;
+
+ if (!slang_variable_construct (&z))
+ return 0;
+ if (!slang_fully_specified_type_copy (&z.type, &y->type))
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ z.a_name = y->a_name;
+ z.array_len = y->array_len;
+ if (y->initializer != NULL)
+ {
+ z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
+ if (z.initializer == NULL)
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ if (!slang_operation_construct (z.initializer))
+ {
+ slang_alloc_free (z.initializer);
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ if (!slang_operation_copy (z.initializer, y->initializer))
+ {
+ slang_variable_destruct (&z);
+ return 0;
+ }
+ }
+ z.address = y->address;
+ z.size = y->size;
+ z.global = y->global;
+ slang_variable_destruct (x);
+ *x = z;
+ return 1;
+}
+
+slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all)
+{
+ GLuint i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ if (a_name == scope->variables[i].a_name)
+ return &scope->variables[i];
+ if (all && scope->outer_scope != NULL)
+ return _slang_locate_variable (scope->outer_scope, a_name, 1);
+ return NULL;
+}
+
+/*
+ * _slang_build_export_data_table()
+ */
+
+static GLenum gl_type_from_specifier (const slang_type_specifier *type)
+{
+ switch (type->type)
+ {
+ case slang_spec_bool:
+ return GL_BOOL_ARB;
+ case slang_spec_bvec2:
+ return GL_BOOL_VEC2_ARB;
+ case slang_spec_bvec3:
+ return GL_BOOL_VEC3_ARB;
+ case slang_spec_bvec4:
+ return GL_BOOL_VEC4_ARB;
+ case slang_spec_int:
+ return GL_INT;
+ case slang_spec_ivec2:
+ return GL_INT_VEC2_ARB;
+ case slang_spec_ivec3:
+ return GL_INT_VEC3_ARB;
+ case slang_spec_ivec4:
+ return GL_INT_VEC4_ARB;
+ case slang_spec_float:
+ return GL_FLOAT;
+ case slang_spec_vec2:
+ return GL_FLOAT_VEC2_ARB;
+ case slang_spec_vec3:
+ return GL_FLOAT_VEC3_ARB;
+ case slang_spec_vec4:
+ return GL_FLOAT_VEC4_ARB;
+ case slang_spec_mat2:
+ return GL_FLOAT_MAT2_ARB;
+ case slang_spec_mat3:
+ return GL_FLOAT_MAT3_ARB;
+ case slang_spec_mat4:
+ return GL_FLOAT_MAT4_ARB;
+ case slang_spec_sampler1D:
+ return GL_SAMPLER_1D_ARB;
+ case slang_spec_sampler2D:
+ return GL_SAMPLER_2D_ARB;
+ case slang_spec_sampler3D:
+ return GL_SAMPLER_3D_ARB;
+ case slang_spec_samplerCube:
+ return GL_SAMPLER_CUBE_ARB;
+ case slang_spec_sampler1DShadow:
+ return GL_SAMPLER_1D_SHADOW_ARB;
+ case slang_spec_sampler2DShadow:
+ return GL_SAMPLER_2D_SHADOW_ARB;
+ case slang_spec_array:
+ return gl_type_from_specifier (type->_array);
+ default:
+ return GL_FLOAT;
+ }
+}
+
+static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var)
+{
+ slang_type_specifier *spec = &var->type.specifier;
+
+ q->name = var->a_name;
+ q->size = var->size;
+ if (spec->type == slang_spec_array)
+ {
+ q->array_len = var->array_len;
+ q->size /= var->array_len;
+ spec = spec->_array;
+ }
+ if (spec->type == slang_spec_struct)
+ {
+ GLuint i;
+
+ q->u.field_count = spec->_struct->fields->num_variables;
+ q->structure = (slang_export_data_quant *) slang_alloc_malloc (
+ q->u.field_count * sizeof (slang_export_data_quant));
+ if (q->structure == NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < q->u.field_count; i++)
+ slang_export_data_quant_ctr (&q->structure[i]);
+ for (i = 0; i < q->u.field_count; i++)
+ if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i]))
+ return GL_FALSE;
+ }
+ else
+ q->u.basic_type = gl_type_from_specifier (spec);
+ return GL_TRUE;
+}
+
+GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars)
+{
+ GLuint i;
+
+ for (i = 0; i < vars->num_variables; i++)
+ {
+ slang_variable *var = &vars->variables[i];
+ slang_export_data_entry *e;
+
+ e = slang_export_data_table_add (tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ if (!build_quant (&e->quant, var))
+ return GL_FALSE;
+ if (var->type.qualifier == slang_qual_uniform)
+ e->access = slang_exp_uniform;
+ else if (var->type.qualifier == slang_qual_attribute)
+ e->access = slang_exp_attribute;
+ else
+ e->access = slang_exp_varying;
+ e->address = var->address;
+ }
+
+ if (vars->outer_scope != NULL)
+ return _slang_build_export_data_table (tbl, vars->outer_scope);
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h
new file mode 100644
index 0000000000..6d2e23702f
--- /dev/null
+++ b/src/mesa/shader/slang/slang_compile_variable.h
@@ -0,0 +1,93 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_COMPILE_VARIABLE_H
+#define SLANG_COMPILE_VARIABLE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+typedef enum slang_type_qualifier_
+{
+ slang_qual_none,
+ slang_qual_const,
+ slang_qual_attribute,
+ slang_qual_varying,
+ slang_qual_uniform,
+ slang_qual_out,
+ slang_qual_inout,
+ slang_qual_fixedoutput, /* internal */
+ slang_qual_fixedinput /* internal */
+} slang_type_qualifier;
+
+slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
+const char *slang_type_specifier_type_to_string (slang_type_specifier_type);
+
+typedef struct slang_fully_specified_type_
+{
+ slang_type_qualifier qualifier;
+ slang_type_specifier specifier;
+} slang_fully_specified_type;
+
+int slang_fully_specified_type_construct (slang_fully_specified_type *);
+void slang_fully_specified_type_destruct (slang_fully_specified_type *);
+int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);
+
+typedef struct slang_variable_scope_
+{
+ struct slang_variable_ *variables;
+ unsigned int num_variables;
+ struct slang_variable_scope_ *outer_scope;
+} slang_variable_scope;
+
+int slang_variable_scope_construct (slang_variable_scope *);
+void slang_variable_scope_destruct (slang_variable_scope *);
+int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
+
+typedef struct slang_variable_
+{
+ slang_fully_specified_type type;
+ slang_atom a_name;
+ GLuint array_len; /* type: spec_array */
+ struct slang_operation_ *initializer;
+ unsigned int address;
+ unsigned int size;
+ int global;
+} slang_variable;
+
+int slang_variable_construct (slang_variable *);
+void slang_variable_destruct (slang_variable *);
+int slang_variable_copy (slang_variable *, const slang_variable *);
+
+slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
+
+GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c
index e4df832577..bed63d1e5b 100644
--- a/src/mesa/shader/slang/slang_execute.c
+++ b/src/mesa/shader/slang/slang_execute.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,12 +29,44 @@
*/
#include "imports.h"
-#include "slang_utility.h"
-#include "slang_assemble.h"
-#include "slang_storage.h"
#include "slang_execute.h"
+#include "slang_library_noise.h"
+#include "slang_library_texsample.h"
-#define DEBUG_SLANG 1
+#define DEBUG_SLANG 0
+
+GLvoid slang_machine_ctr (slang_machine *self)
+{
+ slang_machine_init (self);
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ self->x86.compiled_func = NULL;
+#endif
+}
+
+GLvoid slang_machine_dtr (slang_machine *self)
+{
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ if (self->x86.compiled_func != NULL)
+ _mesa_exec_free (self->x86.compiled_func);
+#endif
+}
+
+void slang_machine_init (slang_machine *mach)
+{
+ mach->ip = 0;
+ mach->sp = SLANG_MACHINE_STACK_SIZE;
+ mach->bp = 0;
+ mach->kill = 0;
+ mach->exit = 0;
+}
+
+int _slang_execute (const slang_assembly_file *file)
+{
+ slang_machine mach;
+
+ slang_machine_ctr (&mach);
+ return _slang_execute2 (file, &mach);
+}
#if DEBUG_SLANG
@@ -44,6 +76,7 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
switch (a->type)
{
+ /* core */
case slang_asm_none:
fprintf (f, "none");
break;
@@ -74,12 +107,48 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
case slang_asm_float_less:
fprintf (f, "float_less");
break;
- case slang_asm_float_equal:
+ case slang_asm_float_equal_exp:
+ fprintf (f, "float_equal");
+ break;
+ case slang_asm_float_equal_int:
fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]);
break;
case slang_asm_float_to_int:
fprintf (f, "float_to_int");
break;
+ case slang_asm_float_sine:
+ fprintf (f, "float_sine");
+ break;
+ case slang_asm_float_arcsine:
+ fprintf (f, "float_arcsine");
+ break;
+ case slang_asm_float_arctan:
+ fprintf (f, "float_arctan");
+ break;
+ case slang_asm_float_power:
+ fprintf (f, "float_power");
+ break;
+ case slang_asm_float_log2:
+ fprintf (f, "float_log2");
+ break;
+ case slang_asm_float_floor:
+ fprintf (f, "float_floor");
+ break;
+ case slang_asm_float_ceil:
+ fprintf (f, "float_ceil");
+ break;
+ case slang_asm_float_noise1:
+ fprintf (f, "float_noise1");
+ break;
+ case slang_asm_float_noise2:
+ fprintf (f, "float_noise2");
+ break;
+ case slang_asm_float_noise3:
+ fprintf (f, "float_noise3");
+ break;
+ case slang_asm_float_noise4:
+ fprintf (f, "float_noise4");
+ break;
case slang_asm_int_copy:
fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]);
break;
@@ -125,6 +194,24 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
case slang_asm_addr_multiply:
fprintf (f, "addr_multiply");
break;
+ case slang_asm_vec4_tex1d:
+ fprintf (f, "vec4_tex1d");
+ break;
+ case slang_asm_vec4_tex2d:
+ fprintf (f, "vec4_tex2d");
+ break;
+ case slang_asm_vec4_tex3d:
+ fprintf (f, "vec4_tex3d");
+ break;
+ case slang_asm_vec4_texcube:
+ fprintf (f, "vec4_texcube");
+ break;
+ case slang_asm_vec4_shad1d:
+ fprintf (f, "vec4_shad1d");
+ break;
+ case slang_asm_vec4_shad2d:
+ fprintf (f, "vec4_shad2d");
+ break;
case slang_asm_jump:
fprintf (f, "jump\t%u", a->param[0]);
break;
@@ -146,6 +233,9 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
case slang_asm_local_addr:
fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]);
break;
+ case slang_asm_global_addr:
+ fprintf (f, "global_addr\t%u", a->param[0]);
+ break;
case slang_asm_call:
fprintf (f, "call\t%u", a->param[0]);
break;
@@ -158,6 +248,16 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
case slang_asm_exit:
fprintf (f, "exit");
break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ fprintf (f, "float_print");
+ break;
+ case slang_asm_int_print:
+ fprintf (f, "int_print");
+ break;
+ case slang_asm_bool_print:
+ fprintf (f, "bool_print");
+ break;
default:
break;
}
@@ -186,11 +286,13 @@ static void dump (const slang_assembly_file *file)
#endif
-int _slang_execute (const slang_assembly_file *file)
+int _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
{
- slang_machine mach;
+ slang_machine_slot *stack;
-#ifdef DEBUG_SLANG
+#if DEBUG_SLANG
+ static unsigned int counter = 0;
+ char filename[256];
FILE *f;
#endif
@@ -198,162 +300,260 @@ int _slang_execute (const slang_assembly_file *file)
static_assert(sizeof (GLfloat) == 4);
static_assert(sizeof (GLuint) == 4);
- mach.ip = 0;
- mach.sp = SLANG_MACHINE_STACK_SIZE;
- mach.bp = 0;
- mach.kill = 0;
- mach.exit = 0;
- mach.global = mach.mem;
- mach.stack = mach.global + SLANG_MACHINE_GLOBAL_SIZE;
-
#if DEBUG_SLANG
dump (file);
- f = fopen ("~mesa-slang-assembly-execution.txt", "w");
+ counter++;
+ _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
+ f = fopen (filename, "w");
#endif
- while (!mach.exit)
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ if (mach->x86.compiled_func != NULL)
{
- slang_assembly *a;
+ mach->x86.compiled_func (mach);
+ return 1;
+ }
+#endif
+
+ stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
+
+ while (!mach->exit)
+ {
+ slang_assembly *a = &file->code[mach->ip];
#if DEBUG_SLANG
- if (f != NULL)
+ if (f != NULL && a->type != slang_asm_none)
{
unsigned int i;
- dump_instruction (f, file->code + mach.ip, mach.ip);
- fprintf (f, "\t\tsp=%u bp=%u\n", mach.sp, mach.bp);
- for (i = mach.sp; i < SLANG_MACHINE_STACK_SIZE; i++)
- fprintf (f, "\t%.5u\t%6f\t%u\n", i, mach.stack[i]._float, mach.stack[i]._addr);
+ dump_instruction (f, file->code + mach->ip, mach->ip);
+ fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
+ for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
+ fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr);
fflush (f);
}
#endif
- a = file->code + mach.ip;
- mach.ip++;
+ mach->ip++;
switch (a->type)
{
+ /* core */
case slang_asm_none:
break;
case slang_asm_float_copy:
case slang_asm_int_copy:
case slang_asm_bool_copy:
- mach.mem[mach.stack[mach.sp + a->param[0] / 4]._addr + a->param[1] / 4]._float =
- mach.stack[mach.sp]._float;
- mach.sp++;
+ mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float =
+ stack[mach->sp]._float;
+ mach->sp++;
break;
case slang_asm_float_move:
case slang_asm_int_move:
case slang_asm_bool_move:
- mach.stack[mach.sp + a->param[0] / 4]._float =
- mach.stack[mach.sp + (mach.stack[mach.sp]._addr + a->param[1]) / 4]._float;
+ stack[mach->sp + a->param[0] / 4]._float =
+ stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float;
break;
case slang_asm_float_push:
case slang_asm_int_push:
case slang_asm_bool_push:
- mach.sp--;
- mach.stack[mach.sp]._float = a->literal;
+ mach->sp--;
+ stack[mach->sp]._float = a->literal;
break;
case slang_asm_float_deref:
case slang_asm_int_deref:
case slang_asm_bool_deref:
- mach.stack[mach.sp]._float = mach.mem[mach.stack[mach.sp]._addr]._float;
+ stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
break;
case slang_asm_float_add:
- mach.stack[mach.sp + 1]._float += mach.stack[mach.sp]._float;
- mach.sp++;
+ stack[mach->sp + 1]._float += stack[mach->sp]._float;
+ mach->sp++;
break;
case slang_asm_float_multiply:
- mach.stack[mach.sp + 1]._float *= mach.stack[mach.sp]._float;
- mach.sp++;
+ stack[mach->sp + 1]._float *= stack[mach->sp]._float;
+ mach->sp++;
break;
case slang_asm_float_divide:
- mach.stack[mach.sp + 1]._float /= mach.stack[mach.sp]._float;
- mach.sp++;
+ stack[mach->sp + 1]._float /= stack[mach->sp]._float;
+ mach->sp++;
break;
case slang_asm_float_negate:
- mach.stack[mach.sp]._float = -mach.stack[mach.sp]._float;
+ stack[mach->sp]._float = -stack[mach->sp]._float;
break;
case slang_asm_float_less:
- mach.stack[mach.sp + 1]._float =
- mach.stack[mach.sp + 1]._float < mach.stack[mach.sp]._float ? 1.0f : 0.0f;
- mach.sp++;
+ stack[mach->sp + 1]._float =
+ stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_exp:
+ stack[mach->sp + 1]._float =
+ stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
break;
- case slang_asm_float_equal:
- mach.sp--;
- mach.stack[mach.sp]._float = mach.stack[mach.sp + 1 + a->param[0] / 4]._float ==
- mach.stack[mach.sp + 1 + a->param[1] / 4]._float ? 1.0f : 0.0f;
+ case slang_asm_float_equal_int:
+ mach->sp--;
+ stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float ==
+ stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0;
break;
case slang_asm_float_to_int:
- mach.stack[mach.sp]._float = (GLfloat) (GLint) mach.stack[mach.sp]._float;
+ stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_float_sine:
+ stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arcsine:
+ stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arctan:
+ stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_power:
+ stack[mach->sp + 1]._float =
+ (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_log2:
+ stack[mach->sp]._float = LOG2 (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_floor:
+ stack[mach->sp]._float = FLOORF (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_ceil:
+ stack[mach->sp]._float = CEILF (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise1:
+ stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise2:
+ stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_noise3:
+ stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float, stack[mach->sp + 2]._float);
+ mach->sp += 2;
+ break;
+ case slang_asm_float_noise4:
+ stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float,
+ stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float);
+ mach->sp += 3;
break;
case slang_asm_int_to_float:
break;
case slang_asm_int_to_addr:
- mach.stack[mach.sp]._addr = (GLuint) (GLint) mach.stack[mach.sp]._float;
+ stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
break;
case slang_asm_addr_copy:
- mach.mem[mach.stack[mach.sp + 1]._addr]._addr = mach.stack[mach.sp]._addr;
- mach.sp++;
+ mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr;
+ mach->sp++;
break;
case slang_asm_addr_push:
- mach.sp--;
- mach.stack[mach.sp]._addr = a->param[0];
+ case slang_asm_global_addr:
+ mach->sp--;
+ stack[mach->sp]._addr = a->param[0];
break;
case slang_asm_addr_deref:
- mach.stack[mach.sp]._addr = mach.mem[mach.stack[mach.sp]._addr]._addr;
+ stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
break;
case slang_asm_addr_add:
- mach.stack[mach.sp + 1]._addr += mach.stack[mach.sp]._addr;
- mach.sp++;
+ stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
+ mach->sp++;
break;
case slang_asm_addr_multiply:
- mach.stack[mach.sp + 1]._addr *= mach.stack[mach.sp]._addr;
- mach.sp++;
+ stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_vec4_tex1d:
+ _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_vec4_tex2d:
+ _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,
+ &mach->mem[stack[mach->sp + 4]._addr / 4]._float);
+ mach->sp += 4;
+ break;
+ case slang_asm_vec4_tex3d:
+ _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_texcube:
+ _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad1d:
+ _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad2d:
+ _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
+ mach->sp += 5;
break;
case slang_asm_jump:
- mach.ip = a->param[0];
+ mach->ip = a->param[0];
break;
case slang_asm_jump_if_zero:
- if (mach.stack[mach.sp]._float == 0.0f)
- mach.ip = a->param[0];
- mach.sp++;
+ if (stack[mach->sp]._float == 0.0f)
+ mach->ip = a->param[0];
+ mach->sp++;
break;
case slang_asm_enter:
- mach.sp--;
- mach.stack[mach.sp]._addr = mach.bp;
- mach.bp = mach.sp + a->param[0] / 4;
+ mach->sp--;
+ stack[mach->sp]._addr = mach->bp;
+ mach->bp = mach->sp + a->param[0] / 4;
break;
case slang_asm_leave:
- mach.bp = mach.stack[mach.sp]._addr;
- mach.sp++;
+ mach->bp = stack[mach->sp]._addr;
+ mach->sp++;
break;
case slang_asm_local_alloc:
- mach.sp -= a->param[0] / 4;
+ mach->sp -= a->param[0] / 4;
break;
case slang_asm_local_free:
- mach.sp += a->param[0] / 4;
+ mach->sp += a->param[0] / 4;
break;
case slang_asm_local_addr:
- mach.sp--;
- mach.stack[mach.sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach.bp * 4 -
+ mach->sp--;
+ stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 -
(a->param[0] + a->param[1]) + 4;
break;
case slang_asm_call:
- mach.sp--;
- mach.stack[mach.sp]._addr = mach.ip;
- mach.ip = a->param[0];
+ mach->sp--;
+ stack[mach->sp]._addr = mach->ip;
+ mach->ip = a->param[0];
break;
case slang_asm_return:
- mach.ip = mach.stack[mach.sp]._addr;
- mach.sp++;
+ mach->ip = stack[mach->sp]._addr;
+ mach->sp++;
break;
case slang_asm_discard:
- mach.kill = 1;
+ mach->kill = 1;
break;
case slang_asm_exit:
- mach.exit = 1;
+ mach->exit = 1;
+ break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ _mesa_printf ("slang print: %f\n", stack[mach->sp]._float);
+ break;
+ case slang_asm_int_print:
+ _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float);
+ break;
+ case slang_asm_bool_print:
+ _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false");
break;
+ default:
+ assert (0);
}
}
@@ -362,6 +562,6 @@ int _slang_execute (const slang_assembly_file *file)
fclose (f);
#endif
- return 0;
+ return 1;
}
diff --git a/src/mesa/shader/slang/slang_execute.h b/src/mesa/shader/slang/slang_execute.h
index f911574b15..99be0fff8e 100644
--- a/src/mesa/shader/slang/slang_execute.h
+++ b/src/mesa/shader/slang/slang_execute.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,8 @@
#if !defined SLANG_EXECUTE_H
#define SLANG_EXECUTE_H
+#include "slang_assemble.h"
+
#if defined __cplusplus
extern "C" {
#endif
@@ -39,6 +41,16 @@ typedef union slang_machine_slot_
#define SLANG_MACHINE_STACK_SIZE 1024
#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+typedef struct
+{
+ GLvoid (* compiled_func) (struct slang_machine_ *);
+ GLuint esp_restore;
+ GLshort fpucntl_rnd_neg;
+ GLshort fpucntl_restore;
+} slang_machine_x86;
+#endif
+
typedef struct slang_machine_
{
GLuint ip; /* instruction pointer, for flow control */
@@ -47,11 +59,22 @@ typedef struct slang_machine_
GLuint kill; /* discard the fragment */
GLuint exit; /* terminate the shader */
slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
- slang_machine_slot *global;
- slang_machine_slot *stack;
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ slang_machine_x86 x86;
+#endif
} slang_machine;
+GLvoid slang_machine_ctr (slang_machine *);
+GLvoid slang_machine_dtr (slang_machine *);
+
+void slang_machine_init (slang_machine *);
+
int _slang_execute (const slang_assembly_file *);
+int _slang_execute2 (const slang_assembly_file *, slang_machine *);
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
+#endif
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_execute_x86.c b/src/mesa/shader/slang/slang_execute_x86.c
new file mode 100644
index 0000000000..eabe368596
--- /dev/null
+++ b/src/mesa/shader/slang/slang_execute_x86.c
@@ -0,0 +1,546 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_execute_x86.c
+ * x86 back end compiler
+ * \author Michal Krol, Keith Whitwell
+ */
+
+#include "imports.h"
+#include "slang_execute.h"
+#include "slang_library_noise.h"
+#include "slang_library_texsample.h"
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+
+#include "x86/rtasm/x86sse.h"
+
+typedef struct
+{
+ GLuint index;
+ GLubyte *csr;
+} fixup;
+
+typedef struct
+{
+ struct x86_function f;
+ struct x86_reg r_eax;
+ struct x86_reg r_ecx;
+ struct x86_reg r_edx;
+ struct x86_reg r_esp;
+ struct x86_reg r_ebp;
+ struct x86_reg r_st0;
+ struct x86_reg r_st1;
+ struct x86_reg r_st2;
+ struct x86_reg r_st3;
+ fixup *fixups;
+ GLuint fixup_count;
+ GLubyte **labels;
+ slang_machine *mach;
+ GLubyte *l_discard;
+ GLubyte *l_exit;
+ GLshort fpucntl;
+} codegen_ctx;
+
+static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
+{
+ G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup),
+ (G->fixup_count + 1) * sizeof (fixup));
+ G->fixups[G->fixup_count].index = index;
+ G->fixups[G->fixup_count].csr = csr;
+ G->fixup_count++;
+}
+
+#ifdef NO_FAST_MATH
+#define RESTORE_FPU (DEFAULT_X86_FPU)
+#define RND_NEG_FPU (DEFAULT_X86_FPU | 0x400)
+#else
+#define RESTORE_FPU (FAST_X86_FPU)
+#define RND_NEG_FPU (FAST_X86_FPU | 0x400)
+#endif
+
+static void set_fpu_round_neg_inf (codegen_ctx *G)
+{
+ if (G->fpucntl != RND_NEG_FPU)
+ {
+ G->fpucntl = RND_NEG_FPU;
+ x87_fnclex (&G->f);
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg);
+ x87_fldcw (&G->f, x86_deref (G->r_eax));
+ }
+}
+
+static void emit_x87_ex2 (codegen_ctx *G)
+{
+ set_fpu_round_neg_inf (G);
+
+ x87_fld (&G->f, G->r_st0); /* a a */
+ x87_fprndint (&G->f); /* int(a) a */
+ x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */
+ x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/
+ x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */
+ x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/
+ x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/
+ x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */
+ x87_fscale (&G->f); /* 2^a */
+}
+
+static GLfloat do_ceilf (GLfloat x)
+{
+ return CEILF (x);
+}
+
+static GLfloat do_floorf (GLfloat x)
+{
+ return FLOORF (x);
+}
+
+static GLvoid do_print_float (GLfloat x)
+{
+ _mesa_printf ("slang print: %f\n", x);
+}
+
+static GLvoid do_print_int (GLfloat x)
+{
+ _mesa_printf ("slang print: %d\n", (GLint) x);
+}
+
+static GLvoid do_print_bool (GLfloat x)
+{
+ _mesa_printf ("slang print: %s\n", (GLint) x ? "true" : "false");
+}
+
+#define FLOAT_ONE 0x3f800000
+#define FLOAT_ZERO 0
+
+static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a)
+{
+ GLint disp;
+
+ switch (a->type)
+ {
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
+ x86_pop (&G->f, G->r_ecx);
+ x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1]));
+ x86_add (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
+ x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax);
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal));
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ case slang_asm_addr_deref:
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_float_add:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_faddp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_multiply:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fmulp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_divide:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fdivp (&G->f, G->r_st1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_negate:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fchs (&G->f);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_less:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fcomp (&G->f, x86_deref (G->r_esp));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x100);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_exp:
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fcomp (&G->f, x86_deref (G->r_esp));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_int:
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
+ x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4));
+ x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4));
+ x87_fnstsw (&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
+ x86_test (&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_E);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward (&G->f);
+ x86_fixup_fwd_jump (&G->f, lab0);
+ x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump (&G->f, lab1);
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_to_int:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fistp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_sine:
+ /* TODO: use fsin */
+ x86_call (&G->f, (GLubyte *) _mesa_sinf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_arcsine:
+ /* TODO: use fpatan (?) */
+ x86_call (&G->f, (GLubyte *) _mesa_asinf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_arctan:
+ /* TODO: use fpatan */
+ x86_call (&G->f, (GLubyte *) _mesa_atanf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_power:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
+ x87_fyl2x (&G->f);
+ emit_x87_ex2 (G);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_log2:
+ x87_fld1 (&G->f);
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fyl2x (&G->f);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_floor:
+ x86_call (&G->f, (GLubyte *) do_floorf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_ceil:
+ x86_call (&G->f, (GLubyte *) do_ceilf);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise1:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise1);
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise2:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise2);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise3:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_float_noise4:
+ x86_call (&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
+ x87_fstp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ x87_fld (&G->f, x86_deref (G->r_esp));
+ x87_fistp (&G->f, x86_deref (G->r_esp));
+ break;
+ case slang_asm_addr_copy:
+ x86_pop (&G->f, G->r_eax);
+ x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp));
+ x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax);
+ break;
+ case slang_asm_addr_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]);
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_addr_add:
+ x86_pop (&G->f, G->r_eax);
+ x86_add (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_addr_multiply:
+ x86_pop (&G->f, G->r_ecx);
+ x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mul (&G->f, G->r_ecx);
+ x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
+ break;
+ case slang_asm_vec4_tex1d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex1d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
+ break;
+ case slang_asm_vec4_tex2d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex2d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ break;
+ case slang_asm_vec4_tex3d:
+ x86_call (&G->f, (GLubyte *) _slang_library_tex3d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_texcube:
+ x86_call (&G->f, (GLubyte *) _slang_library_texcube);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad1d:
+ x86_call (&G->f, (GLubyte *) _slang_library_shad1d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad2d:
+ x86_call (&G->f, (GLubyte *) _slang_library_shad2d);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
+ break;
+ case slang_asm_jump:
+ add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
+ break;
+ case slang_asm_jump_if_zero:
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_xor (&G->f, G->r_eax, G->r_eax);
+ x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4));
+ {
+ GLubyte *lab0;
+
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward (&G->f, cc_NE);
+ add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
+ x86_fixup_fwd_jump (&G->f, lab0);
+ }
+ break;
+ case slang_asm_enter:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_push (&G->f, G->r_ebp);
+ x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_leave:
+ x86_pop (&G->f, G->r_ebp);
+ break;
+ case slang_asm_local_alloc:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0]));
+ break;
+ case slang_asm_local_free:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert (a->param[0] != 0);
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_local_addr:
+ disp = -(GLint) (a->param[0] + a->param[1]) + 4;
+ if (disp != 0)
+ {
+ x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp));
+ x86_push (&G->f, G->r_eax);
+ }
+ else
+ x86_push (&G->f, G->r_ebp);
+ break;
+ case slang_asm_global_addr:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]);
+ x86_push (&G->f, G->r_eax);
+ break;
+ case slang_asm_call:
+ add_fixup (G, a->param[0], x86_call_forward (&G->f));
+ break;
+ case slang_asm_return:
+ x86_ret (&G->f);
+ break;
+ case slang_asm_discard:
+ x86_jmp (&G->f, G->l_discard);
+ break;
+ case slang_asm_exit:
+ x86_jmp (&G->f, G->l_exit);
+ break;
+ /* mesa-specific extensions */
+ case slang_asm_float_print:
+ x86_call (&G->f, (GLubyte *) do_print_float);
+ break;
+ case slang_asm_int_print:
+ x86_call (&G->f, (GLubyte *) do_print_int);
+ break;
+ case slang_asm_bool_print:
+ x86_call (&G->f, (GLubyte *) do_print_bool);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start)
+{
+ codegen_ctx G;
+ GLubyte *j_body, *j_exit;
+ GLuint i;
+
+ /*
+ * We need as much as 1M because *all* assembly, including built-in library, is
+ * being translated to x86.
+ * The built-in library occupies 450K, so we can be safe for now.
+ * It is going to change in the future, when we get assembly analysis running.
+ */
+ x86_init_func_size (&G.f, 1048576);
+ G.r_eax = x86_make_reg (file_REG32, reg_AX);
+ G.r_ecx = x86_make_reg (file_REG32, reg_CX);
+ G.r_edx = x86_make_reg (file_REG32, reg_DX);
+ G.r_esp = x86_make_reg (file_REG32, reg_SP);
+ G.r_ebp = x86_make_reg (file_REG32, reg_BP);
+ G.r_st0 = x86_make_reg (file_x87, 0);
+ G.r_st1 = x86_make_reg (file_x87, 1);
+ G.r_st2 = x86_make_reg (file_x87, 2);
+ G.r_st3 = x86_make_reg (file_x87, 3);
+ G.fixups = NULL;
+ G.fixup_count = 0;
+ G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *));
+ G.mach = mach;
+ G.fpucntl = RESTORE_FPU;
+
+ mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
+ mach->x86.fpucntl_restore = RESTORE_FPU;
+
+ /* prepare stack and jump to start */
+ x86_push (&G.f, G.r_ebp);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
+ x86_push (&G.f, G.r_esp);
+ x86_pop (&G.f, G.r_ecx);
+ x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
+ j_body = x86_jmp_forward (&G.f);
+
+ /* "discard" instructions jump to this label */
+ G.l_discard = x86_get_label (&G.f);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);
+ x86_mov_reg_imm (&G.f, G.r_ecx, 1);
+ x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
+ G.l_exit = x86_get_label (&G.f);
+ j_exit = x86_jmp_forward (&G.f);
+
+ for (i = 0; i < file->count; i++)
+ {
+ G.labels[i] = x86_get_label (&G.f);
+ if (i == start)
+ x86_fixup_fwd_jump (&G.f, j_body);
+ codegen_assem (&G, &file->code[i]);
+ }
+
+ /*
+ * Restore stack and return.
+ * This must be handled this way, because "discard" can be invoked from any
+ * place in the code.
+ */
+ x86_fixup_fwd_jump (&G.f, j_exit);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
+ x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));
+ x86_pop (&G.f, G.r_ebp);
+ if (G.fpucntl != RESTORE_FPU)
+ {
+ x87_fnclex (&G.f);
+ x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore);
+ x87_fldcw (&G.f, x86_deref (G.r_eax));
+ }
+ x86_ret (&G.f);
+
+ /* fixup forward labels */
+ for (i = 0; i < G.fixup_count; i++)
+ {
+ G.f.csr = G.labels[G.fixups[i].index];
+ x86_fixup_fwd_jump (&G.f, G.fixups[i].csr);
+ }
+
+ slang_alloc_free (G.fixups);
+ slang_alloc_free (G.labels);
+
+ /* install new code */
+ if (mach->x86.compiled_func != NULL)
+ _mesa_exec_free (mach->x86.compiled_func);
+ mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);
+
+ return GL_TRUE;
+}
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_export.c b/src/mesa/shader/slang/slang_export.c
new file mode 100644
index 0000000000..43ce35de49
--- /dev/null
+++ b/src/mesa/shader/slang/slang_export.c
@@ -0,0 +1,341 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_export.c
+ * interface between assembly code and the application
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_export.h"
+
+/*
+ * slang_export_data_quant
+ */
+
+GLvoid slang_export_data_quant_ctr (slang_export_data_quant *self)
+{
+ self->name = SLANG_ATOM_NULL;
+ self->size = 0;
+ self->array_len = 0;
+ self->structure = NULL;
+ self->u.basic_type = GL_FLOAT;
+}
+
+GLvoid slang_export_data_quant_dtr (slang_export_data_quant *self)
+{
+ if (self->structure != NULL)
+ {
+ GLuint i;
+
+ for (i = 0; i < self->u.field_count; i++)
+ slang_export_data_quant_dtr (&self->structure[i]);
+ slang_alloc_free (self->structure);
+ }
+}
+
+slang_export_data_quant *slang_export_data_quant_add_field (slang_export_data_quant *self)
+{
+ const GLuint n = self->u.field_count;
+
+ self->structure = (slang_export_data_quant *) slang_alloc_realloc (self->structure,
+ n * sizeof (slang_export_data_quant), (n + 1) * sizeof (slang_export_data_quant));
+ if (self->structure == NULL)
+ return NULL;
+ slang_export_data_quant_ctr (&self->structure[n]);
+ self->u.field_count++;
+ return &self->structure[n];
+}
+
+/*
+ * slang_export_data_entry
+ */
+
+GLvoid slang_export_data_entry_ctr (slang_export_data_entry *self)
+{
+ slang_export_data_quant_ctr (&self->quant);
+ self->access = slang_exp_uniform;
+ self->address = ~0;
+}
+
+GLvoid slang_export_data_entry_dtr (slang_export_data_entry *self)
+{
+ slang_export_data_quant_dtr (&self->quant);
+}
+
+/*
+ * slang_export_data_table
+ */
+
+GLvoid slang_export_data_table_ctr (slang_export_data_table *self)
+{
+ self->entries = NULL;
+ self->count = 0;
+ self->atoms = NULL;
+}
+
+GLvoid slang_export_data_table_dtr (slang_export_data_table *self)
+{
+ if (self->entries != NULL)
+ {
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ slang_export_data_entry_dtr (&self->entries[i]);
+ slang_alloc_free (self->entries);
+ }
+}
+
+slang_export_data_entry *slang_export_data_table_add (slang_export_data_table *self)
+{
+ const GLuint n = self->count;
+
+ self->entries = (slang_export_data_entry *) slang_alloc_realloc (self->entries,
+ n * sizeof (slang_export_data_entry), (n + 1) * sizeof (slang_export_data_entry));
+ if (self->entries == NULL)
+ return NULL;
+ slang_export_data_entry_ctr (&self->entries[n]);
+ self->count++;
+ return &self->entries[n];
+}
+
+/*
+ * slang_export_code_entry
+ */
+
+static GLvoid slang_export_code_entry_ctr (slang_export_code_entry *self)
+{
+ self->name = SLANG_ATOM_NULL;
+ self->address = ~0;
+}
+
+static GLvoid slang_export_code_entry_dtr (slang_export_code_entry *self)
+{
+}
+
+/*
+ * slang_export_code_table
+ */
+
+GLvoid slang_export_code_table_ctr (slang_export_code_table *self)
+{
+ self->entries = NULL;
+ self->count = 0;
+ self->atoms = NULL;
+}
+
+GLvoid slang_export_code_table_dtr (slang_export_code_table *self)
+{
+ if (self->entries != NULL)
+ {
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ slang_export_code_entry_dtr (&self->entries[i]);
+ slang_alloc_free (self->entries);
+ }
+}
+
+slang_export_code_entry *slang_export_code_table_add (slang_export_code_table *self)
+{
+ const GLuint n = self->count;
+
+ self->entries = (slang_export_code_entry *) slang_alloc_realloc (self->entries,
+ n * sizeof (slang_export_code_entry), (n + 1) * sizeof (slang_export_code_entry));
+ if (self->entries == NULL)
+ return NULL;
+ slang_export_code_entry_ctr (&self->entries[n]);
+ self->count++;
+ return &self->entries[n];
+}
+
+/*
+ * _slang_find_exported_data()
+ */
+
+#define EXTRACT_ERROR 0
+#define EXTRACT_BASIC 1
+#define EXTRACT_ARRAY 2
+#define EXTRACT_STRUCT 3
+#define EXTRACT_STRUCT_ARRAY 4
+
+#define EXTRACT_MAXLEN 255
+
+static GLuint extract_name (const char *name, char *parsed, GLuint *element, const char **end)
+{
+ GLuint i;
+
+ if ((name[0] >= 'a' && name[0] <= 'z') || (name[0] >= 'A' && name[0] <= 'Z') || name[0] == '_')
+ {
+ parsed[0] = name[0];
+
+ for (i = 1; i < EXTRACT_MAXLEN; i++)
+ {
+ if ((name[i] >= 'a' && name[i] <= 'z') || (name[i] >= 'A' && name[i] <= 'Z') ||
+ (name[i] >= '0' && name[i] <= '9') || name[0] == '_')
+ {
+ parsed[i] = name[i];
+ }
+ else
+ {
+ if (name[i] == '\0')
+ {
+ parsed[i] = '\0';
+ return EXTRACT_BASIC;
+ }
+ if (name[i] == '.')
+ {
+ parsed[i] = '\0';
+ *end = &name[i + 1];
+ return EXTRACT_STRUCT;
+ }
+ if (name[i] == '[')
+ {
+ parsed[i] = '\0';
+ i++;
+ if (name[i] >= '0' && name[i] <= '9')
+ {
+ *element = name[i] - '0';
+ for (i++; ; i++)
+ {
+ if (name[i] >= '0' && name[i] <= '9')
+ *element = *element * 10 + (name[i] - '0');
+ else
+ {
+ if (name[i] == ']')
+ {
+ i++;
+ if (name[i] == '.')
+ {
+ *end = &name[i + 1];
+ return EXTRACT_STRUCT_ARRAY;
+ }
+ *end = &name[i];
+ return EXTRACT_ARRAY;
+ }
+ break;
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ return EXTRACT_ERROR;
+}
+
+static GLboolean validate_extracted (slang_export_data_quant *q, GLuint element, GLuint extr)
+{
+ switch (extr)
+ {
+ case EXTRACT_BASIC:
+ return GL_TRUE;
+ case EXTRACT_ARRAY:
+ return element < q->array_len;
+ case EXTRACT_STRUCT:
+ return q->structure != NULL;
+ case EXTRACT_STRUCT_ARRAY:
+ return q->structure != NULL && element < q->array_len;
+ }
+ return GL_FALSE;
+}
+
+static GLuint calculate_offset (slang_export_data_quant *q, GLuint element)
+{
+ if (q->array_len != 0)
+ return element * q->size;
+ return 0;
+}
+
+static GLboolean find_exported_data (slang_export_data_quant *q, const char *name,
+ slang_export_data_quant **quant, GLuint *offset, slang_atom_pool *atoms)
+{
+ char parsed[EXTRACT_MAXLEN];
+ GLuint result, element, i;
+ const char *end;
+ slang_atom atom;
+
+ result = extract_name (name, parsed, &element, &end);
+ if (result == EXTRACT_ERROR)
+ return GL_FALSE;
+
+ atom = slang_atom_pool_atom (atoms, parsed);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < q->u.field_count; i++)
+ if (q->structure[i].name == atom)
+ {
+ if (!validate_extracted (&q->structure[i], element, result))
+ return GL_FALSE;
+ *offset += calculate_offset (&q->structure[i], element);
+ if (result == EXTRACT_BASIC || result == EXTRACT_ARRAY)
+ {
+ if (*end != '\0')
+ return GL_FALSE;
+ *quant = &q->structure[i];
+ return GL_TRUE;
+ }
+ return find_exported_data (&q->structure[i], end, quant, offset, atoms);
+ }
+ return GL_FALSE;
+}
+
+GLboolean _slang_find_exported_data (slang_export_data_table *table, const char *name,
+ slang_export_data_entry **entry, slang_export_data_quant **quant, GLuint *offset)
+{
+ char parsed[EXTRACT_MAXLEN];
+ GLuint result, element, i;
+ const char *end;
+ slang_atom atom;
+
+ result = extract_name (name, parsed, &element, &end);
+ if (result == EXTRACT_ERROR)
+ return GL_FALSE;
+
+ atom = slang_atom_pool_atom (table->atoms, parsed);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < table->count; i++)
+ if (table->entries[i].quant.name == atom)
+ {
+ if (!validate_extracted (&table->entries[i].quant, element, result))
+ return GL_FALSE;
+ *entry = &table->entries[i];
+ *offset = calculate_offset (&table->entries[i].quant, element);
+ if (result == EXTRACT_BASIC || result == EXTRACT_ARRAY)
+ {
+ if (*end != '\0')
+ return GL_FALSE;
+ *quant = &table->entries[i].quant;
+ return GL_TRUE;
+ }
+ return find_exported_data (&table->entries[i].quant, end, quant, offset, table->atoms);
+ }
+ return GL_FALSE;
+}
+
diff --git a/src/mesa/shader/slang/slang_export.h b/src/mesa/shader/slang/slang_export.h
new file mode 100644
index 0000000000..88a74fe26b
--- /dev/null
+++ b/src/mesa/shader/slang/slang_export.h
@@ -0,0 +1,141 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_EXPORT_H
+#define SLANG_EXPORT_H
+
+#include "slang_utility.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Basic data quantity to transfer between application and assembly.
+ * The <size> is the actual size of the data quantity including padding, if any. It is
+ * used to calculate offsets from the beginning of the data.
+ * The <array_len> is not 0, the data quantity is an array of <array_len> size.
+ * If the <structure> is not NULL, the data quantity is a struct. The <basic_type> is
+ * invalid and the <field_count> holds the size of the <structure> array.
+ * The <basic_type> values match those of <type> parameter for glGetActiveUniformARB.
+ */
+
+typedef struct slang_export_data_quant_
+{
+ slang_atom name;
+ GLuint size;
+ GLuint array_len;
+ struct slang_export_data_quant_ *structure;
+ union
+ {
+ GLenum basic_type;
+ GLuint field_count;
+ } u;
+} slang_export_data_quant;
+
+GLvoid slang_export_data_quant_ctr (slang_export_data_quant *);
+GLvoid slang_export_data_quant_dtr (slang_export_data_quant *);
+slang_export_data_quant *slang_export_data_quant_add_field (slang_export_data_quant *);
+
+/*
+ * Data access pattern. Specifies how data is accessed at what frequency.
+ */
+
+typedef enum
+{
+ slang_exp_uniform,
+ slang_exp_varying,
+ slang_exp_attribute
+} slang_export_data_access;
+
+/*
+ * Data export entry. Holds the data type information, access pattern and base address.
+ */
+
+typedef struct
+{
+ slang_export_data_quant quant;
+ slang_export_data_access access;
+ GLuint address;
+} slang_export_data_entry;
+
+GLvoid slang_export_data_entry_ctr (slang_export_data_entry *);
+GLvoid slang_export_data_entry_dtr (slang_export_data_entry *);
+
+/*
+ * Data export table.
+ */
+
+typedef struct
+{
+ slang_export_data_entry *entries;
+ GLuint count;
+ slang_atom_pool *atoms;
+} slang_export_data_table;
+
+GLvoid slang_export_data_table_ctr (slang_export_data_table *);
+GLvoid slang_export_data_table_dtr (slang_export_data_table *);
+slang_export_data_entry *slang_export_data_table_add (slang_export_data_table *);
+
+/*
+ * Code export entry. Contains label name and its entry point (label, address).
+ */
+
+typedef struct
+{
+ slang_atom name;
+ GLuint address;
+} slang_export_code_entry;
+
+/*
+ * Code export table.
+ */
+
+typedef struct
+{
+ slang_export_code_entry *entries;
+ GLuint count;
+ slang_atom_pool *atoms;
+} slang_export_code_table;
+
+GLvoid slang_export_code_table_ctr (slang_export_code_table *);
+GLvoid slang_export_code_table_dtr (slang_export_code_table *);
+slang_export_code_entry *slang_export_code_table_add (slang_export_code_table *);
+
+/*
+ * _slang_find_exported_data()
+ *
+ * Parses the name string and returns corresponding data entry, data quantity and offset.
+ * Returns GL_TRUE if the data is found, returns GL_FALSE otherwise.
+ */
+
+GLboolean _slang_find_exported_data (slang_export_data_table *, const char *,
+ slang_export_data_entry **, slang_export_data_quant **, GLuint *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_library_noise.c b/src/mesa/shader/slang/slang_library_noise.c
new file mode 100644
index 0000000000..d0081c542a
--- /dev/null
+++ b/src/mesa/shader/slang/slang_library_noise.c
@@ -0,0 +1,501 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * SimplexNoise1234
+ * Copyright © 2003-2005, Stefan Gustavson
+ *
+ * Contact: stegu@itn.liu.se
+ */
+
+/** \file
+ \brief C implementation of Perlin Simplex Noise over 1,2,3, and 4 dimensions.
+ \author Stefan Gustavson (stegu@itn.liu.se)
+*/
+
+/*
+ * This implementation is "Simplex Noise" as presented by
+ * Ken Perlin at a relatively obscure and not often cited course
+ * session "Real-Time Shading" at Siggraph 2001 (before real
+ * time shading actually took on), under the title "hardware noise".
+ * The 3D function is numerically equivalent to his Java reference
+ * code available in the PDF course notes, although I re-implemented
+ * it from scratch to get more readable code. The 1D, 2D and 4D cases
+ * were implemented from scratch by me from Ken Perlin's text.
+ *
+ * This file has no dependencies on any other file, not even its own
+ * header file. The header file is made for use by external code only.
+ */
+
+
+#include "imports.h"
+#include "slang_library_noise.h"
+
+#define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )
+
+/*
+ * ---------------------------------------------------------------------
+ * Static data
+ */
+
+/*
+ * Permutation table. This is just a random jumble of all numbers 0-255,
+ * repeated twice to avoid wrapping the index at 255 for each lookup.
+ * This needs to be exactly the same for all instances on all platforms,
+ * so it's easiest to just keep it as static explicit data.
+ * This also removes the need for any initialisation of this class.
+ *
+ * Note that making this an int[] instead of a char[] might make the
+ * code run faster on platforms with a high penalty for unaligned single
+ * byte addressing. Intel x86 is generally single-byte-friendly, but
+ * some other CPUs are faster with 4-aligned reads.
+ * However, a char[] is smaller, which avoids cache trashing, and that
+ * is probably the most important aspect on most architectures.
+ * This array is accessed a *lot* by the noise functions.
+ * A vector-valued noise over 3D accesses it 96 times, and a
+ * float-valued 4D noise 64 times. We want this to fit in the cache!
+ */
+unsigned char perm[512] = {151,160,137,91,90,15,
+ 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+ 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+ 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+ 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+ 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+ 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+ 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+ 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+ 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+ 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+ 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+ 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,
+ 151,160,137,91,90,15,
+ 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+ 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+ 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+ 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+ 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+ 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+ 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+ 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+ 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+ 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+ 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+ 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180
+};
+
+/*
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * Helper functions to compute gradients-dot-residualvectors (1D to 4D)
+ * Note that these generate gradients of more than unit length. To make
+ * a close match with the value range of classic Perlin noise, the final
+ * noise values need to be rescaled to fit nicely within [-1,1].
+ * (The simplex noise functions as such also have different scaling.)
+ * Note also that these noise functions are the most practical and useful
+ * signed version of Perlin noise. To return values according to the
+ * RenderMan specification from the SL noise() and pnoise() functions,
+ * the noise values need to be scaled and offset to [0,1], like this:
+ * float SLnoise = (SimplexNoise1234::noise(x,y,z) + 1.0) * 0.5;
+ */
+
+static float grad1( int hash, float x ) {
+ int h = hash & 15;
+ float grad = 1.0f + (h & 7); /* Gradient value 1.0, 2.0, ..., 8.0 */
+ if (h&8) grad = -grad; /* Set a random sign for the gradient */
+ return ( grad * x ); /* Multiply the gradient with the distance */
+}
+
+static float grad2( int hash, float x, float y ) {
+ int h = hash & 7; /* Convert low 3 bits of hash code */
+ float u = h<4 ? x : y; /* into 8 simple gradient directions, */
+ float v = h<4 ? y : x; /* and compute the dot product with (x,y). */
+ return ((h&1)? -u : u) + ((h&2)? -2.0f*v : 2.0f*v);
+}
+
+static float grad3( int hash, float x, float y , float z ) {
+ int h = hash & 15; /* Convert low 4 bits of hash code into 12 simple */
+ float u = h<8 ? x : y; /* gradient directions, and compute dot product. */
+ float v = h<4 ? y : h==12||h==14 ? x : z; /* Fix repeats at h = 12 to 15 */
+ return ((h&1)? -u : u) + ((h&2)? -v : v);
+}
+
+static float grad4( int hash, float x, float y, float z, float t ) {
+ int h = hash & 31; /* Convert low 5 bits of hash code into 32 simple */
+ float u = h<24 ? x : y; /* gradient directions, and compute dot product. */
+ float v = h<16 ? y : z;
+ float w = h<8 ? z : t;
+ return ((h&1)? -u : u) + ((h&2)? -v : v) + ((h&4)? -w : w);
+}
+
+ /* A lookup table to traverse the simplex around a given point in 4D. */
+ /* Details can be found where this table is used, in the 4D noise method. */
+ /* TODO: This should not be required, backport it from Bill's GLSL code! */
+ static unsigned char simplex[64][4] = {
+ {0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0},
+ {0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0},
+ {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
+ {1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0},
+ {1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0},
+ {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
+ {2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0},
+ {2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}};
+
+/* 1D simplex noise */
+GLfloat _slang_library_noise1 (GLfloat x)
+{
+ int i0 = FASTFLOOR(x);
+ int i1 = i0 + 1;
+ float x0 = x - i0;
+ float x1 = x0 - 1.0f;
+ float t1 = 1.0f - x1*x1;
+ float n0, n1;
+
+ float t0 = 1.0f - x0*x0;
+/* if(t0 < 0.0f) t0 = 0.0f; // this never happens for the 1D case */
+ t0 *= t0;
+ n0 = t0 * t0 * grad1(perm[i0 & 0xff], x0);
+
+/* if(t1 < 0.0f) t1 = 0.0f; // this never happens for the 1D case */
+ t1 *= t1;
+ n1 = t1 * t1 * grad1(perm[i1 & 0xff], x1);
+ /* The maximum value of this noise is 8*(3/4)^4 = 2.53125 */
+ /* A factor of 0.395 would scale to fit exactly within [-1,1], but */
+ /* we want to match PRMan's 1D noise, so we scale it down some more. */
+ return 0.25f * (n0 + n1);
+}
+
+/* 2D simplex noise */
+GLfloat _slang_library_noise2 (GLfloat x, GLfloat y)
+{
+#define F2 0.366025403f /* F2 = 0.5*(sqrt(3.0)-1.0) */
+#define G2 0.211324865f /* G2 = (3.0-Math.sqrt(3.0))/6.0 */
+
+ float n0, n1, n2; /* Noise contributions from the three corners */
+
+ /* Skew the input space to determine which simplex cell we're in */
+ float s = (x+y)*F2; /* Hairy factor for 2D */
+ float xs = x + s;
+ float ys = y + s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+
+ float t = (float)(i+j)*G2;
+ float X0 = i-t; /* Unskew the cell origin back to (x,y) space */
+ float Y0 = j-t;
+ float x0 = x-X0; /* The x,y distances from the cell origin */
+ float y0 = y-Y0;
+
+ float x1, y1, x2, y2;
+ int ii, jj;
+ float t0, t1, t2;
+
+ /* For the 2D case, the simplex shape is an equilateral triangle. */
+ /* Determine which simplex we are in. */
+ int i1, j1; /* Offsets for second (middle) corner of simplex in (i,j) coords */
+ if(x0>y0) {i1=1; j1=0;} /* lower triangle, XY order: (0,0)->(1,0)->(1,1) */
+ else {i1=0; j1=1;} /* upper triangle, YX order: (0,0)->(0,1)->(1,1) */
+
+ /* A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and */
+ /* a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where */
+ /* c = (3-sqrt(3))/6 */
+
+ x1 = x0 - i1 + G2; /* Offsets for middle corner in (x,y) unskewed coords */
+ y1 = y0 - j1 + G2;
+ x2 = x0 - 1.0f + 2.0f * G2; /* Offsets for last corner in (x,y) unskewed coords */
+ y2 = y0 - 1.0f + 2.0f * G2;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+
+ /* Calculate the contribution from the three corners */
+ t0 = 0.5f - x0*x0-y0*y0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad2(perm[ii+perm[jj]], x0, y0);
+ }
+
+ t1 = 0.5f - x1*x1-y1*y1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad2(perm[ii+i1+perm[jj+j1]], x1, y1);
+ }
+
+ t2 = 0.5f - x2*x2-y2*y2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad2(perm[ii+1+perm[jj+1]], x2, y2);
+ }
+
+ /* Add contributions from each corner to get the final noise value. */
+ /* The result is scaled to return values in the interval [-1,1]. */
+ return 40.0f * (n0 + n1 + n2); /* TODO: The scale factor is preliminary! */
+}
+
+/* 3D simplex noise */
+GLfloat _slang_library_noise3 (GLfloat x, GLfloat y, GLfloat z)
+{
+/* Simple skewing factors for the 3D case */
+#define F3 0.333333333f
+#define G3 0.166666667f
+
+ float n0, n1, n2, n3; /* Noise contributions from the four corners */
+
+ /* Skew the input space to determine which simplex cell we're in */
+ float s = (x+y+z)*F3; /* Very nice and simple skew factor for 3D */
+ float xs = x+s;
+ float ys = y+s;
+ float zs = z+s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+ int k = FASTFLOOR(zs);
+
+ float t = (float)(i+j+k)*G3;
+ float X0 = i-t; /* Unskew the cell origin back to (x,y,z) space */
+ float Y0 = j-t;
+ float Z0 = k-t;
+ float x0 = x-X0; /* The x,y,z distances from the cell origin */
+ float y0 = y-Y0;
+ float z0 = z-Z0;
+
+ float x1, y1, z1, x2, y2, z2, x3, y3, z3;
+ int ii, jj, kk;
+ float t0, t1, t2, t3;
+
+ /* For the 3D case, the simplex shape is a slightly irregular tetrahedron. */
+ /* Determine which simplex we are in. */
+ int i1, j1, k1; /* Offsets for second corner of simplex in (i,j,k) coords */
+ int i2, j2, k2; /* Offsets for third corner of simplex in (i,j,k) coords */
+
+/* This code would benefit from a backport from the GLSL version! */
+ if(x0>=y0) {
+ if(y0>=z0)
+ { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } /* X Y Z order */
+ else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } /* X Z Y order */
+ else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } /* Z X Y order */
+ }
+ else { /* x0<y0 */
+ if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } /* Z Y X order */
+ else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } /* Y Z X order */
+ else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } /* Y X Z order */
+ }
+
+ /* A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), */
+ /* a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and */
+ /* a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where */
+ /* c = 1/6. */
+
+ x1 = x0 - i1 + G3; /* Offsets for second corner in (x,y,z) coords */
+ y1 = y0 - j1 + G3;
+ z1 = z0 - k1 + G3;
+ x2 = x0 - i2 + 2.0f*G3; /* Offsets for third corner in (x,y,z) coords */
+ y2 = y0 - j2 + 2.0f*G3;
+ z2 = z0 - k2 + 2.0f*G3;
+ x3 = x0 - 1.0f + 3.0f*G3; /* Offsets for last corner in (x,y,z) coords */
+ y3 = y0 - 1.0f + 3.0f*G3;
+ z3 = z0 - 1.0f + 3.0f*G3;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+ kk = k % 256;
+
+ /* Calculate the contribution from the four corners */
+ t0 = 0.6f - x0*x0 - y0*y0 - z0*z0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad3(perm[ii+perm[jj+perm[kk]]], x0, y0, z0);
+ }
+
+ t1 = 0.6f - x1*x1 - y1*y1 - z1*z1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad3(perm[ii+i1+perm[jj+j1+perm[kk+k1]]], x1, y1, z1);
+ }
+
+ t2 = 0.6f - x2*x2 - y2*y2 - z2*z2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad3(perm[ii+i2+perm[jj+j2+perm[kk+k2]]], x2, y2, z2);
+ }
+
+ t3 = 0.6f - x3*x3 - y3*y3 - z3*z3;
+ if(t3<0.0f) n3 = 0.0f;
+ else {
+ t3 *= t3;
+ n3 = t3 * t3 * grad3(perm[ii+1+perm[jj+1+perm[kk+1]]], x3, y3, z3);
+ }
+
+ /* Add contributions from each corner to get the final noise value. */
+ /* The result is scaled to stay just inside [-1,1] */
+ return 32.0f * (n0 + n1 + n2 + n3); /* TODO: The scale factor is preliminary! */
+}
+
+/* 4D simplex noise */
+GLfloat _slang_library_noise4 (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ /* The skewing and unskewing factors are hairy again for the 4D case */
+#define F4 0.309016994f /* F4 = (Math.sqrt(5.0)-1.0)/4.0 */
+#define G4 0.138196601f /* G4 = (5.0-Math.sqrt(5.0))/20.0 */
+
+ float n0, n1, n2, n3, n4; /* Noise contributions from the five corners */
+
+ /* Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in */
+ float s = (x + y + z + w) * F4; /* Factor for 4D skewing */
+ float xs = x + s;
+ float ys = y + s;
+ float zs = z + s;
+ float ws = w + s;
+ int i = FASTFLOOR(xs);
+ int j = FASTFLOOR(ys);
+ int k = FASTFLOOR(zs);
+ int l = FASTFLOOR(ws);
+
+ float t = (i + j + k + l) * G4; /* Factor for 4D unskewing */
+ float X0 = i - t; /* Unskew the cell origin back to (x,y,z,w) space */
+ float Y0 = j - t;
+ float Z0 = k - t;
+ float W0 = l - t;
+
+ float x0 = x - X0; /* The x,y,z,w distances from the cell origin */
+ float y0 = y - Y0;
+ float z0 = z - Z0;
+ float w0 = w - W0;
+
+ /* For the 4D case, the simplex is a 4D shape I won't even try to describe. */
+ /* To find out which of the 24 possible simplices we're in, we need to */
+ /* determine the magnitude ordering of x0, y0, z0 and w0. */
+ /* The method below is a good way of finding the ordering of x,y,z,w and */
+ /* then find the correct traversal order for the simplex we’re in. */
+ /* First, six pair-wise comparisons are performed between each possible pair */
+ /* of the four coordinates, and the results are used to add up binary bits */
+ /* for an integer index. */
+ int c1 = (x0 > y0) ? 32 : 0;
+ int c2 = (x0 > z0) ? 16 : 0;
+ int c3 = (y0 > z0) ? 8 : 0;
+ int c4 = (x0 > w0) ? 4 : 0;
+ int c5 = (y0 > w0) ? 2 : 0;
+ int c6 = (z0 > w0) ? 1 : 0;
+ int c = c1 + c2 + c3 + c4 + c5 + c6;
+
+ int i1, j1, k1, l1; /* The integer offsets for the second simplex corner */
+ int i2, j2, k2, l2; /* The integer offsets for the third simplex corner */
+ int i3, j3, k3, l3; /* The integer offsets for the fourth simplex corner */
+
+ float x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4;
+ int ii, jj, kk, ll;
+ float t0, t1, t2, t3, t4;
+
+ /* simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. */
+ /* Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w */
+ /* impossible. Only the 24 indices which have non-zero entries make any sense. */
+ /* We use a thresholding to set the coordinates in turn from the largest magnitude. */
+ /* The number 3 in the "simplex" array is at the position of the largest coordinate. */
+ i1 = simplex[c][0]>=3 ? 1 : 0;
+ j1 = simplex[c][1]>=3 ? 1 : 0;
+ k1 = simplex[c][2]>=3 ? 1 : 0;
+ l1 = simplex[c][3]>=3 ? 1 : 0;
+ /* The number 2 in the "simplex" array is at the second largest coordinate. */
+ i2 = simplex[c][0]>=2 ? 1 : 0;
+ j2 = simplex[c][1]>=2 ? 1 : 0;
+ k2 = simplex[c][2]>=2 ? 1 : 0;
+ l2 = simplex[c][3]>=2 ? 1 : 0;
+ /* The number 1 in the "simplex" array is at the second smallest coordinate. */
+ i3 = simplex[c][0]>=1 ? 1 : 0;
+ j3 = simplex[c][1]>=1 ? 1 : 0;
+ k3 = simplex[c][2]>=1 ? 1 : 0;
+ l3 = simplex[c][3]>=1 ? 1 : 0;
+ /* The fifth corner has all coordinate offsets = 1, so no need to look that up. */
+
+ x1 = x0 - i1 + G4; /* Offsets for second corner in (x,y,z,w) coords */
+ y1 = y0 - j1 + G4;
+ z1 = z0 - k1 + G4;
+ w1 = w0 - l1 + G4;
+ x2 = x0 - i2 + 2.0f*G4; /* Offsets for third corner in (x,y,z,w) coords */
+ y2 = y0 - j2 + 2.0f*G4;
+ z2 = z0 - k2 + 2.0f*G4;
+ w2 = w0 - l2 + 2.0f*G4;
+ x3 = x0 - i3 + 3.0f*G4; /* Offsets for fourth corner in (x,y,z,w) coords */
+ y3 = y0 - j3 + 3.0f*G4;
+ z3 = z0 - k3 + 3.0f*G4;
+ w3 = w0 - l3 + 3.0f*G4;
+ x4 = x0 - 1.0f + 4.0f*G4; /* Offsets for last corner in (x,y,z,w) coords */
+ y4 = y0 - 1.0f + 4.0f*G4;
+ z4 = z0 - 1.0f + 4.0f*G4;
+ w4 = w0 - 1.0f + 4.0f*G4;
+
+ /* Wrap the integer indices at 256, to avoid indexing perm[] out of bounds */
+ ii = i % 256;
+ jj = j % 256;
+ kk = k % 256;
+ ll = l % 256;
+
+ /* Calculate the contribution from the five corners */
+ t0 = 0.6f - x0*x0 - y0*y0 - z0*z0 - w0*w0;
+ if(t0 < 0.0f) n0 = 0.0f;
+ else {
+ t0 *= t0;
+ n0 = t0 * t0 * grad4(perm[ii+perm[jj+perm[kk+perm[ll]]]], x0, y0, z0, w0);
+ }
+
+ t1 = 0.6f - x1*x1 - y1*y1 - z1*z1 - w1*w1;
+ if(t1 < 0.0f) n1 = 0.0f;
+ else {
+ t1 *= t1;
+ n1 = t1 * t1 * grad4(perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]], x1, y1, z1, w1);
+ }
+
+ t2 = 0.6f - x2*x2 - y2*y2 - z2*z2 - w2*w2;
+ if(t2 < 0.0f) n2 = 0.0f;
+ else {
+ t2 *= t2;
+ n2 = t2 * t2 * grad4(perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]], x2, y2, z2, w2);
+ }
+
+ t3 = 0.6f - x3*x3 - y3*y3 - z3*z3 - w3*w3;
+ if(t3 < 0.0f) n3 = 0.0f;
+ else {
+ t3 *= t3;
+ n3 = t3 * t3 * grad4(perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]], x3, y3, z3, w3);
+ }
+
+ t4 = 0.6f - x4*x4 - y4*y4 - z4*z4 - w4*w4;
+ if(t4 < 0.0f) n4 = 0.0f;
+ else {
+ t4 *= t4;
+ n4 = t4 * t4 * grad4(perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]], x4, y4, z4, w4);
+ }
+
+ /* Sum up and scale the result to cover the range [-1,1] */
+ return 27.0f * (n0 + n1 + n2 + n3 + n4); /* TODO: The scale factor is preliminary! */
+}
+
diff --git a/src/mesa/shader/slang/slang_library_noise.h b/src/mesa/shader/slang/slang_library_noise.h
new file mode 100644
index 0000000000..e4f419d8db
--- /dev/null
+++ b/src/mesa/shader/slang/slang_library_noise.h
@@ -0,0 +1,42 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_LIBRARY_NOISE_H
+#define SLANG_LIBRARY_NOISE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLfloat _slang_library_noise1 (GLfloat);
+GLfloat _slang_library_noise2 (GLfloat, GLfloat);
+GLfloat _slang_library_noise3 (GLfloat, GLfloat, GLfloat);
+GLfloat _slang_library_noise4 (GLfloat, GLfloat, GLfloat, GLfloat);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_library_texsample.c b/src/mesa/shader/slang/slang_library_texsample.c
new file mode 100644
index 0000000000..d26b767f88
--- /dev/null
+++ b/src/mesa/shader/slang/slang_library_texsample.c
@@ -0,0 +1,142 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_library_texsample.c
+ * built-in library functions for texture and shadow sampling
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "context.h"
+#include "colormac.h"
+#include "swrast/s_context.h"
+#include "slang_library_texsample.h"
+
+GLvoid _slang_library_tex1d (GLfloat bias, GLfloat s, GLfloat sampler, GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, 0.0f, 0.0f, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_tex2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat sampler, GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, 0.0f, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_tex3d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_texcube (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_shad1d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
+GLvoid _slang_library_shad2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,
+ GLfloat *color)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint unit = (GLuint) sampler;
+ GLfloat texcoord[4] = { s, t, r, 1.0f };
+ GLfloat lambda = bias;
+ GLchan rgba[4];
+
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);
+ color[0] = CHAN_TO_FLOAT(rgba[0]);
+ color[1] = CHAN_TO_FLOAT(rgba[1]);
+ color[2] = CHAN_TO_FLOAT(rgba[2]);
+ color[3] = CHAN_TO_FLOAT(rgba[3]);
+}
+
diff --git a/src/mesa/shader/slang/slang_library_texsample.h b/src/mesa/shader/slang/slang_library_texsample.h
new file mode 100644
index 0000000000..3aea76fd8d
--- /dev/null
+++ b/src/mesa/shader/slang/slang_library_texsample.h
@@ -0,0 +1,44 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_LIBRARY_TEXSAMPLE_H
+#define SLANG_LIBRARY_TEXSAMPLE_H
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+GLvoid _slang_library_tex1d (GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_tex2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_tex3d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_texcube (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_shad1d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+GLvoid _slang_library_shad2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
new file mode 100644
index 0000000000..58d17c1558
--- /dev/null
+++ b/src/mesa/shader/slang/slang_link.c
@@ -0,0 +1,437 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file slang_link.c
+ * slang linker
+ * \author Michal Krol
+ */
+
+#include "imports.h"
+#include "slang_link.h"
+#include "slang_analyse.h"
+
+/*
+ * slang_uniform_bindings
+ */
+
+static GLvoid slang_uniform_bindings_ctr (slang_uniform_bindings *self)
+{
+ self->table = NULL;
+ self->count = 0;
+}
+
+static GLvoid slang_uniform_bindings_dtr (slang_uniform_bindings *self)
+{
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ slang_alloc_free (self->table[i].name);
+ slang_alloc_free (self->table);
+}
+
+static GLboolean slang_uniform_bindings_add (slang_uniform_bindings *self, slang_export_data_quant *q,
+ const char *name, GLuint index, GLuint address)
+{
+ const GLuint n = self->count;
+ GLuint i;
+
+ for (i = 0; i < n; i++)
+ if (slang_string_compare (self->table[i].name, name) == 0)
+ {
+ self->table[i].address[index] = address;
+ return GL_TRUE;
+ }
+
+ self->table = (slang_uniform_binding *) slang_alloc_realloc (self->table,
+ n * sizeof (slang_uniform_binding), (n + 1) * sizeof (slang_uniform_binding));
+ if (self->table == NULL)
+ return GL_FALSE;
+ self->table[n].quant = q;
+ self->table[n].name = slang_string_duplicate (name);
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ self->table[n].address[i] = ~0;
+ self->table[n].address[index] = address;
+ if (self->table[n].name == NULL)
+ return GL_FALSE;
+ self->count++;
+ return GL_TRUE;
+}
+
+static GLboolean insert_binding (slang_uniform_bindings *bind, slang_export_data_quant *q,
+ char *name, slang_atom_pool *atoms, GLuint index, GLuint addr)
+{
+ GLuint count, i;
+
+ slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
+
+ if (q->array_len == 0)
+ count = 1;
+ else
+ count = q->array_len;
+
+ for (i = 0; i < count; i++)
+ {
+ GLuint save;
+
+ save = slang_string_length (name);
+ if (q->array_len != 0)
+ _mesa_sprintf (name + slang_string_length (name), "[%d]", i);
+
+ if (q->structure != NULL)
+ {
+ GLuint save, i;
+
+ slang_string_concat (name, ".");
+ save = slang_string_length (name);
+
+ for (i = 0; i < q->u.field_count; i++)
+ {
+ if (!insert_binding (bind, &q->structure[i], name, atoms, index, addr))
+ return GL_FALSE;
+ name[save] = '\0';
+ addr += q->structure[i].size;
+ }
+ }
+ else
+ {
+ if (!slang_uniform_bindings_add (bind, q, name, index, addr))
+ return GL_FALSE;
+ addr += q->size;
+ }
+ name[save] = '\0';
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean gather_uniform_bindings (slang_uniform_bindings *bind, slang_export_data_table *tbl,
+ GLuint index)
+{
+ GLuint i;
+
+ for (i = 0; i < tbl->count; i++)
+ if (tbl->entries[i].access == slang_exp_uniform)
+ {
+ char name[1024] = "";
+
+ if (!insert_binding (bind, &tbl->entries[i].quant, name, tbl->atoms, index,
+ tbl->entries[i].address))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/*
+ * slang_active_uniforms
+ */
+
+static GLvoid slang_active_uniforms_ctr (slang_active_uniforms *self)
+{
+ self->table = NULL;
+ self->count = 0;
+}
+
+static GLvoid slang_active_uniforms_dtr (slang_active_uniforms *self)
+{
+ GLuint i;
+
+ for (i = 0; i < self->count; i++)
+ slang_alloc_free (self->table[i].name);
+ slang_alloc_free (self->table);
+}
+
+static GLboolean slang_active_uniforms_add (slang_active_uniforms *self, slang_export_data_quant *q,
+ const char *name)
+{
+ const GLuint n = self->count;
+
+ self->table = (slang_active_uniform *) slang_alloc_realloc (self->table,
+ n * sizeof (slang_active_uniform), (n + 1) * sizeof (slang_active_uniform));
+ if (self->table == NULL)
+ return GL_FALSE;
+ self->table[n].quant = q;
+ self->table[n].name = slang_string_duplicate (name);
+ if (self->table[n].name == NULL)
+ return GL_FALSE;
+ self->count++;
+ return GL_TRUE;
+}
+
+static GLboolean insert_uniform (slang_active_uniforms *u, slang_export_data_quant *q, char *name,
+ slang_atom_pool *atoms)
+{
+ slang_string_concat (name, slang_atom_pool_id (atoms, q->name));
+ if (q->array_len != 0)
+ slang_string_concat (name, "[0]");
+
+ if (q->structure != NULL)
+ {
+ GLuint save, i;
+
+ slang_string_concat (name, ".");
+ save = slang_string_length (name);
+
+ for (i = 0; i < q->u.field_count; i++)
+ {
+ if (!insert_uniform (u, &q->structure[i], name, atoms))
+ return GL_FALSE;
+ name[save] = '\0';
+ }
+
+ return GL_TRUE;
+ }
+
+ return slang_active_uniforms_add (u, q, name);
+}
+
+static GLboolean gather_active_uniforms (slang_active_uniforms *u, slang_export_data_table *tbl)
+{
+ GLuint i;
+
+ for (i = 0; i < tbl->count; i++)
+ if (tbl->entries[i].access == slang_exp_uniform)
+ {
+ char name[1024] = "";
+
+ if (!insert_uniform (u, &tbl->entries[i].quant, name, tbl->atoms))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/*
+ * slang_texture_bindings
+ */
+
+GLvoid slang_texture_usages_ctr (slang_texture_usages *self)
+{
+ self->table = NULL;
+ self->count = 0;
+}
+
+GLvoid slang_texture_usages_dtr (slang_texture_usages *self)
+{
+ slang_alloc_free (self->table);
+}
+
+/*
+ * slang_program
+ */
+
+GLvoid slang_program_ctr (slang_program *self)
+{
+ GLuint i;
+
+ slang_uniform_bindings_ctr (&self->uniforms);
+ slang_active_uniforms_ctr (&self->active_uniforms);
+ slang_texture_usages_ctr (&self->texture_usage);
+ for (i = 0; i < SLANG_SHADER_MAX; i++)
+ {
+ GLuint j;
+
+ for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)
+ self->common_fixed_entries[i][j] = ~0;
+ for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)
+ self->code[i][j] = ~0;
+ self->machines[i] = NULL;
+ self->assemblies[i] = NULL;
+ }
+ for (i = 0; i < SLANG_VERTEX_FIXED_MAX; i++)
+ self->vertex_fixed_entries[i] = ~0;
+ for (i = 0; i < SLANG_FRAGMENT_FIXED_MAX; i++)
+ self->fragment_fixed_entries[i] = ~0;
+}
+
+GLvoid slang_program_dtr (slang_program *self)
+{
+ slang_uniform_bindings_dtr (&self->uniforms);
+ slang_active_uniforms_dtr (&self->active_uniforms);
+ slang_texture_usages_dtr (&self->texture_usage);
+}
+
+/*
+ * _slang_link()
+ */
+
+static GLuint gd (slang_export_data_table *tbl, const char *name)
+{
+ slang_atom atom;
+ GLuint i;
+
+ atom = slang_atom_pool_atom (tbl->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return ~0;
+
+ for (i = 0; i < tbl->count; i++)
+ if (atom == tbl->entries[i].quant.name)
+ return tbl->entries[i].address;
+ return ~0;
+}
+
+static GLvoid resolve_common_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX] = gd (tbl, "gl_ModelViewProjectionMatrix");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIX] = gd (tbl, "gl_TextureMatrix");
+ e[SLANG_COMMON_FIXED_NORMALMATRIX] = gd (tbl, "gl_NormalMatrix");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE] = gd (tbl, "gl_ModelViewMatrixInverse");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE] = gd (tbl, "gl_ProjectionMatrixInverse");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE] =
+ gd (tbl, "gl_ModelViewProjectionMatrixInverse");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE] = gd (tbl, "gl_TextureMatrixInverse");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE] = gd (tbl, "gl_ModelViewMatrixTranspose");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE] = gd (tbl, "gl_ProjectionMatrixTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE] =
+ gd (tbl, "gl_ModelViewProjectionMatrixTranspose");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE] = gd (tbl, "gl_TextureMatrixTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE] =
+ gd (tbl, "gl_ModelViewMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE] =
+ gd (tbl, "gl_ProjectionMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE] =
+ gd (tbl, "gl_ModelViewProjectionMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE] =
+ gd (tbl, "gl_TextureMatrixInverseTranspose");
+ e[SLANG_COMMON_FIXED_NORMALSCALE] = gd (tbl, "gl_NormalScale");
+ e[SLANG_COMMON_FIXED_DEPTHRANGE] = gd (tbl, "gl_DepthRange");
+ e[SLANG_COMMON_FIXED_CLIPPLANE] = gd (tbl, "gl_ClipPlane");
+ e[SLANG_COMMON_FIXED_POINT] = gd (tbl, "gl_Point");
+ e[SLANG_COMMON_FIXED_FRONTMATERIAL] = gd (tbl, "gl_FrontMaterial");
+ e[SLANG_COMMON_FIXED_BACKMATERIAL] = gd (tbl, "gl_BackMaterial");
+ e[SLANG_COMMON_FIXED_LIGHTSOURCE] = gd (tbl, "gl_LightSource");
+ e[SLANG_COMMON_FIXED_LIGHTMODEL] = gd (tbl, "gl_LightModel");
+ e[SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT] = gd (tbl, "gl_FrontLightModelProduct");
+ e[SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT] = gd (tbl, "gl_BackLightModelProduct");
+ e[SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT] = gd (tbl, "gl_FrontLightProduct");
+ e[SLANG_COMMON_FIXED_BACKLIGHTPRODUCT] = gd (tbl, "gl_BackLightProduct");
+ e[SLANG_COMMON_FIXED_TEXTUREENVCOLOR] = gd (tbl, "gl_TextureEnvColor");
+ e[SLANG_COMMON_FIXED_EYEPLANES] = gd (tbl, "gl_EyePlaneS");
+ e[SLANG_COMMON_FIXED_EYEPLANET] = gd (tbl, "gl_EyePlaneT");
+ e[SLANG_COMMON_FIXED_EYEPLANER] = gd (tbl, "gl_EyePlaneR");
+ e[SLANG_COMMON_FIXED_EYEPLANEQ] = gd (tbl, "gl_EyePlaneQ");
+ e[SLANG_COMMON_FIXED_OBJECTPLANES] = gd (tbl, "gl_ObjectPlaneS");
+ e[SLANG_COMMON_FIXED_OBJECTPLANET] = gd (tbl, "gl_ObjectPlaneT");
+ e[SLANG_COMMON_FIXED_OBJECTPLANER] = gd (tbl, "gl_ObjectPlaneR");
+ e[SLANG_COMMON_FIXED_OBJECTPLANEQ] = gd (tbl, "gl_ObjectPlaneQ");
+ e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog");
+}
+
+static GLvoid resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position");
+ e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize");
+ e[SLANG_VERTEX_FIXED_CLIPVERTEX] = gd (tbl, "gl_ClipVertex");
+ e[SLANG_VERTEX_FIXED_COLOR] = gd (tbl, "gl_Color");
+ e[SLANG_VERTEX_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
+ e[SLANG_VERTEX_FIXED_NORMAL] = gd (tbl, "gl_Normal");
+ e[SLANG_VERTEX_FIXED_VERTEX] = gd (tbl, "gl_Vertex");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD0] = gd (tbl, "gl_MultiTexCoord0");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD1] = gd (tbl, "gl_MultiTexCoord1");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD2] = gd (tbl, "gl_MultiTexCoord2");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD3] = gd (tbl, "gl_MultiTexCoord3");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD4] = gd (tbl, "gl_MultiTexCoord4");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD5] = gd (tbl, "gl_MultiTexCoord5");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD6] = gd (tbl, "gl_MultiTexCoord6");
+ e[SLANG_VERTEX_FIXED_MULTITEXCOORD7] = gd (tbl, "gl_MultiTexCoord7");
+ e[SLANG_VERTEX_FIXED_FOGCOORD] = gd (tbl, "gl_FogCoord");
+ e[SLANG_VERTEX_FIXED_FRONTCOLOR] = gd (tbl, "gl_FrontColor");
+ e[SLANG_VERTEX_FIXED_BACKCOLOR] = gd (tbl, "gl_BackColor");
+ e[SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR] = gd (tbl, "gl_FrontSecondaryColor");
+ e[SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR] = gd (tbl, "gl_BackSecondaryColor");
+ e[SLANG_VERTEX_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
+ e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
+}
+
+static GLvoid resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl)
+{
+ e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord");
+ e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing");
+ e[SLANG_FRAGMENT_FIXED_FRAGCOLOR] = gd (tbl, "gl_FragColor");
+ e[SLANG_FRAGMENT_FIXED_FRAGDATA] = gd (tbl, "gl_FragData");
+ e[SLANG_FRAGMENT_FIXED_FRAGDEPTH] = gd (tbl, "gl_FragDepth");
+ e[SLANG_FRAGMENT_FIXED_COLOR] = gd (tbl, "gl_Color");
+ e[SLANG_FRAGMENT_FIXED_SECONDARYCOLOR] = gd (tbl, "gl_SecondaryColor");
+ e[SLANG_FRAGMENT_FIXED_TEXCOORD] = gd (tbl, "gl_TexCoord");
+ e[SLANG_FRAGMENT_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");
+}
+
+static GLuint gc (slang_export_code_table *tbl, const char *name)
+{
+ slang_atom atom;
+ GLuint i;
+
+ atom = slang_atom_pool_atom (tbl->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return ~0;
+
+ for (i = 0; i < tbl->count; i++)
+ if (atom == tbl->entries[i].name)
+ return tbl->entries[i].address;
+ return ~0;
+}
+
+static GLvoid resolve_common_code (GLuint code[], slang_export_code_table *tbl)
+{
+ code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main");
+}
+
+GLboolean _slang_link (slang_program *prog, slang_translation_unit **units, GLuint count)
+{
+ GLuint i;
+
+ for (i = 0; i < count; i++)
+ {
+ GLuint index;
+
+ if (units[i]->type == slang_unit_fragment_shader)
+ {
+ index = SLANG_SHADER_FRAGMENT;
+ resolve_fragment_fixed (prog->fragment_fixed_entries, &units[i]->exp_data);
+ }
+ else
+ {
+ index = SLANG_SHADER_VERTEX;
+ resolve_vertex_fixed (prog->vertex_fixed_entries, &units[i]->exp_data);
+ }
+
+ if (!gather_uniform_bindings (&prog->uniforms, &units[i]->exp_data, index))
+ return GL_FALSE;
+ if (!gather_active_uniforms (&prog->active_uniforms, &units[i]->exp_data))
+ return GL_FALSE;
+ resolve_common_fixed (prog->common_fixed_entries[index], &units[i]->exp_data);
+ resolve_common_code (prog->code[index], &units[i]->exp_code);
+ prog->machines[index] = units[i]->machine;
+ prog->assemblies[index] = units[i]->assembly;
+ }
+
+ if (!_slang_analyse_texture_usage (prog))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
new file mode 100644
index 0000000000..1592aefe2e
--- /dev/null
+++ b/src/mesa/shader/slang/slang_link.h
@@ -0,0 +1,195 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if !defined SLANG_LINK_H
+#define SLANG_LINK_H
+
+#include "slang_compile.h"
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+enum
+{
+ SLANG_SHADER_VERTEX,
+ SLANG_SHADER_FRAGMENT,
+ SLANG_SHADER_MAX
+};
+
+typedef struct
+{
+ slang_export_data_quant *quant;
+ char *name;
+ GLuint address[SLANG_SHADER_MAX];
+} slang_uniform_binding;
+
+typedef struct
+{
+ slang_uniform_binding *table;
+ GLuint count;
+} slang_uniform_bindings;
+
+typedef struct
+{
+ slang_export_data_quant *quant;
+ char *name;
+} slang_active_uniform;
+
+typedef struct
+{
+ slang_active_uniform *table;
+ GLuint count;
+} slang_active_uniforms;
+
+typedef struct
+{
+ slang_export_data_quant *quant;
+ GLuint frag_address;
+} slang_texture_usage;
+
+typedef struct
+{
+ slang_texture_usage *table;
+ GLuint count;
+} slang_texture_usages;
+
+GLvoid slang_texture_usages_ctr (slang_texture_usages *);
+GLvoid slang_texture_usages_dtr (slang_texture_usages *);
+
+enum
+{
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_NORMALMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_NORMALSCALE,
+ SLANG_COMMON_FIXED_DEPTHRANGE,
+ SLANG_COMMON_FIXED_CLIPPLANE,
+ SLANG_COMMON_FIXED_POINT,
+ SLANG_COMMON_FIXED_FRONTMATERIAL,
+ SLANG_COMMON_FIXED_BACKMATERIAL,
+ SLANG_COMMON_FIXED_LIGHTSOURCE,
+ SLANG_COMMON_FIXED_LIGHTMODEL,
+ SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
+ SLANG_COMMON_FIXED_EYEPLANES,
+ SLANG_COMMON_FIXED_EYEPLANET,
+ SLANG_COMMON_FIXED_EYEPLANER,
+ SLANG_COMMON_FIXED_EYEPLANEQ,
+ SLANG_COMMON_FIXED_OBJECTPLANES,
+ SLANG_COMMON_FIXED_OBJECTPLANET,
+ SLANG_COMMON_FIXED_OBJECTPLANER,
+ SLANG_COMMON_FIXED_OBJECTPLANEQ,
+ SLANG_COMMON_FIXED_FOG,
+ SLANG_COMMON_FIXED_MAX
+};
+
+enum
+{
+ SLANG_VERTEX_FIXED_POSITION,
+ SLANG_VERTEX_FIXED_POINTSIZE,
+ SLANG_VERTEX_FIXED_CLIPVERTEX,
+ SLANG_VERTEX_FIXED_COLOR,
+ SLANG_VERTEX_FIXED_SECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_NORMAL,
+ SLANG_VERTEX_FIXED_VERTEX,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD0,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD1,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD2,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD3,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD4,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD5,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD6,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD7,
+ SLANG_VERTEX_FIXED_FOGCOORD,
+ SLANG_VERTEX_FIXED_FRONTCOLOR,
+ SLANG_VERTEX_FIXED_BACKCOLOR,
+ SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_TEXCOORD,
+ SLANG_VERTEX_FIXED_FOGFRAGCOORD,
+ SLANG_VERTEX_FIXED_MAX
+};
+
+enum
+{
+ SLANG_FRAGMENT_FIXED_FRAGCOORD,
+ SLANG_FRAGMENT_FIXED_FRONTFACING,
+ SLANG_FRAGMENT_FIXED_FRAGCOLOR,
+ SLANG_FRAGMENT_FIXED_FRAGDATA,
+ SLANG_FRAGMENT_FIXED_FRAGDEPTH,
+ SLANG_FRAGMENT_FIXED_COLOR,
+ SLANG_FRAGMENT_FIXED_SECONDARYCOLOR,
+ SLANG_FRAGMENT_FIXED_TEXCOORD,
+ SLANG_FRAGMENT_FIXED_FOGFRAGCOORD,
+ SLANG_FRAGMENT_FIXED_MAX
+};
+
+enum
+{
+ SLANG_COMMON_CODE_MAIN,
+ SLANG_COMMON_CODE_MAX
+};
+
+typedef struct
+{
+ slang_uniform_bindings uniforms;
+ slang_active_uniforms active_uniforms;
+ slang_texture_usages texture_usage;
+ GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];
+ GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
+ GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
+ GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
+ slang_machine *machines[SLANG_SHADER_MAX];
+ slang_assembly_file *assemblies[SLANG_SHADER_MAX];
+} slang_program;
+
+GLvoid slang_program_ctr (slang_program *);
+GLvoid slang_program_dtr (slang_program *);
+
+GLboolean _slang_link (slang_program *, slang_translation_unit **, GLuint);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c
index b1f62ded3d..0be167e2ed 100644
--- a/src/mesa/shader/slang/slang_preprocess.c
+++ b/src/mesa/shader/slang/slang_preprocess.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -30,7 +30,6 @@
#include "imports.h"
#include "grammar_mesa.h"
-#include "slang_compile.h"
#include "slang_preprocess.h"
static const char *slang_version_syn =
diff --git a/src/mesa/shader/slang/slang_preprocess.h b/src/mesa/shader/slang/slang_preprocess.h
index 7901e78580..c27556d67e 100644
--- a/src/mesa/shader/slang/slang_preprocess.h
+++ b/src/mesa/shader/slang/slang_preprocess.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,8 @@
#if !defined SLANG_PREPROCESS_H
#define SLANG_PREPROCESS_H
+#include "slang_compile.h"
+
#if defined __cplusplus
extern "C" {
#endif
diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c
index 3b2fda415b..946dc2e6fc 100644
--- a/src/mesa/shader/slang/slang_storage.c
+++ b/src/mesa/shader/slang/slang_storage.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -29,20 +29,19 @@
*/
#include "imports.h"
-#include "slang_utility.h"
#include "slang_storage.h"
-#include "slang_assemble.h"
/* slang_storage_array */
-void slang_storage_array_construct (slang_storage_array *arr)
+GLboolean slang_storage_array_construct (slang_storage_array *arr)
{
arr->type = slang_stor_aggregate;
arr->aggregate = NULL;
- arr->length = 0;
+ arr->length = 0;
+ return GL_TRUE;
}
-void slang_storage_array_destruct (slang_storage_array *arr)
+GLvoid slang_storage_array_destruct (slang_storage_array *arr)
{
if (arr->aggregate != NULL)
{
@@ -53,15 +52,17 @@ void slang_storage_array_destruct (slang_storage_array *arr)
/* slang_storage_aggregate */
-void slang_storage_aggregate_construct (slang_storage_aggregate *agg)
+GLboolean slang_storage_aggregate_construct (slang_storage_aggregate *agg)
{
agg->arrays = NULL;
- agg->count = 0;
+ agg->count = 0;
+ return GL_TRUE;
}
-void slang_storage_aggregate_destruct (slang_storage_aggregate *agg)
+GLvoid slang_storage_aggregate_destruct (slang_storage_aggregate *agg)
{
- unsigned int i;
+ GLuint i;
+
for (i = 0; i < agg->count; i++)
slang_storage_array_destruct (agg->arrays + i);
slang_alloc_free (agg->arrays);
@@ -69,13 +70,15 @@ void slang_storage_aggregate_destruct (slang_storage_aggregate *agg)
static slang_storage_array *slang_storage_aggregate_push_new (slang_storage_aggregate *agg)
{
- slang_storage_array *arr = NULL;
+ slang_storage_array *arr = NULL;
+
agg->arrays = (slang_storage_array *) slang_alloc_realloc (agg->arrays, agg->count * sizeof (
slang_storage_array), (agg->count + 1) * sizeof (slang_storage_array));
if (agg->arrays != NULL)
{
arr = agg->arrays + agg->count;
- slang_storage_array_construct (arr);
+ if (!slang_storage_array_construct (arr))
+ return NULL;
agg->count++;
}
return arr;
@@ -83,48 +86,106 @@ static slang_storage_array *slang_storage_aggregate_push_new (slang_storage_aggr
/* _slang_aggregate_variable() */
-static int aggregate_vector (slang_storage_aggregate *agg, slang_storage_type basic_type,
- unsigned int row_count)
+static GLboolean aggregate_vector (slang_storage_aggregate *agg, slang_storage_type basic_type,
+ GLuint row_count)
{
slang_storage_array *arr = slang_storage_aggregate_push_new (agg);
if (arr == NULL)
- return 0;
+ return GL_FALSE;
arr->type = basic_type;
arr->length = row_count;
- return 1;
+ return GL_TRUE;
}
-static int aggregate_matrix (slang_storage_aggregate *agg, slang_storage_type basic_type,
- unsigned int dimension)
+static GLboolean aggregate_matrix (slang_storage_aggregate *agg, slang_storage_type basic_type,
+ GLuint dimension)
{
- slang_storage_array *arr = slang_storage_aggregate_push_new (agg);
+ slang_storage_array *arr = slang_storage_aggregate_push_new (agg);
if (arr == NULL)
- return 0;
+ return GL_FALSE;
arr->type = slang_stor_aggregate;
arr->length = dimension;
- arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (
- slang_storage_aggregate));
+ arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (slang_storage_aggregate));
if (arr->aggregate == NULL)
- return 0;
- slang_storage_aggregate_construct (arr->aggregate);
+ return GL_FALSE;
+ if (!slang_storage_aggregate_construct (arr->aggregate))
+ {
+ slang_alloc_free (arr->aggregate);
+ arr->aggregate = NULL;
+ return GL_FALSE;
+ }
if (!aggregate_vector (arr->aggregate, basic_type, dimension))
- return 0;
- return 1;
+ return GL_FALSE;
+ return GL_TRUE;
}
-static int aggregate_variables (slang_storage_aggregate *agg, const slang_variable_scope *vars,
- slang_function_scope *funcs, slang_struct_scope *structs)
+static GLboolean aggregate_variables (slang_storage_aggregate *agg, slang_variable_scope *vars,
+ slang_function_scope *funcs, slang_struct_scope *structs, slang_variable_scope *globals,
+ slang_machine *mach, slang_assembly_file *file, slang_atom_pool *atoms)
{
- unsigned int i;
+ GLuint i;
+
for (i = 0; i < vars->num_variables; i++)
if (!_slang_aggregate_variable (agg, &vars->variables[i].type.specifier,
- vars->variables[i].array_size, funcs, structs))
- return 0;
- return 1;
+ vars->variables[i].array_len, funcs, structs, globals, mach, file, atoms))
+ return GL_FALSE;
+ return GL_TRUE;
}
+
+GLboolean _slang_evaluate_int (slang_assembly_file *file, slang_machine *pmach,
+ slang_assembly_name_space *space, slang_operation *array_size, GLuint *pint,
+ slang_atom_pool *atoms)
+{
+ slang_assembly_file_restore_point point;
+ slang_machine mach;
+ slang_assemble_ctx A;
+
+ A.file = file;
+ A.mach = pmach;
+ A.atoms = atoms;
+ A.space = *space;
+ A.local.ret_size = 0;
+ A.local.addr_tmp = 0;
+ A.local.swizzle_tmp = 4;
+
+ /* save the current assembly */
+ if (!slang_assembly_file_restore_point_save (file, &point))
+ return GL_FALSE;
+
+ /* setup the machine */
+ mach = *pmach;
+ mach.ip = file->count;
+
+ /* allocate local storage for expression */
+ if (!slang_assembly_file_push_label (file, slang_asm_local_alloc, 20))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label (file, slang_asm_enter, 20))
+ return GL_FALSE;
+
+ /* insert the actual expression */
+ if (!_slang_assemble_operation (&A, array_size, slang_ref_forbid))
+ return GL_FALSE;
+ if (!slang_assembly_file_push (file, slang_asm_exit))
+ return GL_FALSE;
+
+ /* execute the expression */
+ if (!_slang_execute2 (file, &mach))
+ return GL_FALSE;
+
+ /* the evaluated expression is on top of the stack */
+ *pint = (GLuint) mach.mem[mach.sp + SLANG_MACHINE_GLOBAL_SIZE]._float;
+
+ /* restore the old assembly */
+ if (!slang_assembly_file_restore_point_load (file, &point))
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
-int _slang_aggregate_variable (slang_storage_aggregate *agg, slang_type_specifier *spec,
- slang_operation *array_size, slang_function_scope *funcs, slang_struct_scope *structs)
+GLboolean _slang_aggregate_variable (slang_storage_aggregate *agg, slang_type_specifier *spec,
+ GLuint array_len, slang_function_scope *funcs, slang_struct_scope *structs,
+ slang_variable_scope *vars, slang_machine *mach, slang_assembly_file *file,
+ slang_atom_pool *atoms)
{
switch (spec->type)
{
@@ -166,55 +227,47 @@ int _slang_aggregate_variable (slang_storage_aggregate *agg, slang_type_specifie
case slang_spec_sampler2DShadow:
return aggregate_vector (agg, slang_stor_int, 1);
case slang_spec_struct:
- return aggregate_variables (agg, spec->_struct->fields, funcs, structs);
+ return aggregate_variables (agg, spec->_struct->fields, funcs, structs, vars, mach,
+ file, atoms);
case slang_spec_array:
{
- slang_storage_array *arr;
- slang_assembly_file file;
- slang_assembly_flow_control flow;
- slang_assembly_name_space space;
- slang_assembly_local_info info;
- slang_assembly_stack_info stk;
+ slang_storage_array *arr;
arr = slang_storage_aggregate_push_new (agg);
if (arr == NULL)
- return 0;
+ return GL_FALSE;
arr->type = slang_stor_aggregate;
- arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (
- slang_storage_aggregate));
+ arr->aggregate = (slang_storage_aggregate *) slang_alloc_malloc (sizeof (slang_storage_aggregate));
if (arr->aggregate == NULL)
- return 0;
- slang_storage_aggregate_construct (arr->aggregate);
- if (!_slang_aggregate_variable (arr->aggregate, spec->_array, NULL, funcs, structs))
- return 0;
- slang_assembly_file_construct (&file);
- space.funcs = funcs;
- space.structs = structs;
- /* XXX: vars! */
- space.vars = NULL;
- if (!_slang_assemble_operation (&file, array_size, 0, &flow, &space, &info, &stk))
- {
- slang_assembly_file_destruct (&file);
- return 0;
+ return GL_FALSE;
+ if (!slang_storage_aggregate_construct (arr->aggregate))
+ {
+ slang_alloc_free (arr->aggregate);
+ arr->aggregate = NULL;
+ return GL_FALSE;
}
- /* TODO: evaluate array size */
- slang_assembly_file_destruct (&file);
- arr->length = 256;
+ if (!_slang_aggregate_variable (arr->aggregate, spec->_array, 0, funcs, structs,
+ vars, mach, file, atoms))
+ return GL_FALSE;
+ arr->length = array_len;
+ /* TODO: check if 0 < arr->length <= 65535 */
}
- return 1;
+ return GL_TRUE;
default:
- return 0;
+ return GL_FALSE;
}
}
/* _slang_sizeof_aggregate() */
-unsigned int _slang_sizeof_aggregate (const slang_storage_aggregate *agg)
+GLuint _slang_sizeof_aggregate (const slang_storage_aggregate *agg)
{
- unsigned int i, size = 0;
+ GLuint i, size = 0;
+
for (i = 0; i < agg->count; i++)
{
- unsigned int element_size;
+ GLuint element_size;
+
if (agg->arrays[i].type == slang_stor_aggregate)
element_size = _slang_sizeof_aggregate (agg->arrays[i].aggregate);
else
@@ -226,30 +279,33 @@ unsigned int _slang_sizeof_aggregate (const slang_storage_aggregate *agg)
/* _slang_flatten_aggregate () */
-int _slang_flatten_aggregate (slang_storage_aggregate *flat, const slang_storage_aggregate *agg)
+GLboolean _slang_flatten_aggregate (slang_storage_aggregate *flat, const slang_storage_aggregate *agg)
{
- unsigned int i;
+ GLuint i;
+
for (i = 0; i < agg->count; i++)
{
- unsigned int j;
+ GLuint j;
+
for (j = 0; j < agg->arrays[i].length; j++)
{
if (agg->arrays[i].type == slang_stor_aggregate)
{
if (!_slang_flatten_aggregate (flat, agg->arrays[i].aggregate))
- return 0;
+ return GL_FALSE;
}
else
{
- slang_storage_array *arr;
+ slang_storage_array *arr;
+
arr = slang_storage_aggregate_push_new (flat);
if (arr == NULL)
- return 0;
+ return GL_FALSE;
arr->type = agg->arrays[i].type;
arr->length = 1;
}
}
}
- return 1;
+ return GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_storage.h b/src/mesa/shader/slang/slang_storage.h
index 77962c1986..532ea638ee 100644
--- a/src/mesa/shader/slang/slang_storage.h
+++ b/src/mesa/shader/slang/slang_storage.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -26,20 +26,22 @@
#define SLANG_STORAGE_H
#include "slang_compile.h"
+#include "slang_assemble.h"
+#include "slang_execute.h"
#if defined __cplusplus
extern "C" {
#endif
/*
- Program variable data storage is kept completely transparent to the front-end compiler. It is
- up to the back-end how the data is actually allocated. The slang_storage_type enum
- provides the basic information about how the memory is interpreted. This abstract piece
- of memory is called a data slot. A data slot of a particular type has a fixed size.
-
- For now, only the three basic types are supported, that is bool, int and float. Other built-in
- types like vector or matrix can easily be decomposed into a series of basic types.
-*/
+ * Program variable data storage is kept completely transparent to the front-end compiler. It is
+ * up to the back-end how the data is actually allocated. The slang_storage_type enum
+ * provides the basic information about how the memory is interpreted. This abstract piece
+ * of memory is called a data slot. A data slot of a particular type has a fixed size.
+ *
+ * For now, only the three basic types are supported, that is bool, int and float. Other built-in
+ * types like vector or matrix can easily be decomposed into a series of basic types.
+ */
typedef enum slang_storage_type_
{
slang_stor_aggregate,
@@ -49,57 +51,73 @@ typedef enum slang_storage_type_
} slang_storage_type;
/*
- The slang_storage_array structure groups data slots of the same type into an array. This
- array has a fixed length. Arrays are required to have a size equal to the sum of sizes of its
- elements. They are also required to support indirect addressing. That is, if B references
- first data slot in the array, S is the size of the data slot and I is the integral index that
- is not known at compile time, B+I*S references I-th data slot.
-
- This structure is also used to break down built-in data types that are not supported directly.
- Vectors, like vec3, are constructed from arrays of their basic types. Matrices are formed of
- an array of column vectors, which are in turn processed as other vectors.
-*/
+ * The slang_storage_array structure groups data slots of the same type into an array. This
+ * array has a fixed length. Arrays are required to have a size equal to the sum of sizes of its
+ * elements. They are also required to support indirect addressing. That is, if B references
+ * first data slot in the array, S is the size of the data slot and I is the integral index that
+ * is not known at compile time, B+I*S references I-th data slot.
+ *
+ * This structure is also used to break down built-in data types that are not supported directly.
+ * Vectors, like vec3, are constructed from arrays of their basic types. Matrices are formed of
+ * an array of column vectors, which are in turn processed as other vectors.
+ */
typedef struct slang_storage_array_
{
slang_storage_type type;
struct slang_storage_aggregate_ *aggregate; /* slang_stor_aggregate */
- unsigned int length;
+ GLuint length;
} slang_storage_array;
-void slang_storage_array_construct (slang_storage_array *);
-void slang_storage_array_destruct (slang_storage_array *);
+GLboolean slang_storage_array_construct (slang_storage_array *);
+GLvoid slang_storage_array_destruct (slang_storage_array *);
/*
- The slang_storage_aggregate structure relaxes the indirect addressing requirement for
- slang_storage_array structure. Aggregates are always accessed statically - its member
- addresses are well-known at compile time. For example, user-defined types are implemented as
- aggregates. Aggregates can collect data of a different type.
-*/
+ * The slang_storage_aggregate structure relaxes the indirect addressing requirement for
+ * slang_storage_array structure. Aggregates are always accessed statically - its member
+ * addresses are well-known at compile time. For example, user-defined types are implemented as
+ * aggregates. Aggregates can collect data of a different type.
+ */
typedef struct slang_storage_aggregate_
{
slang_storage_array *arrays;
- unsigned int count;
+ GLuint count;
} slang_storage_aggregate;
-void slang_storage_aggregate_construct (slang_storage_aggregate *);
-void slang_storage_aggregate_destruct (slang_storage_aggregate *);
-
-int _slang_aggregate_variable (slang_storage_aggregate *, struct slang_type_specifier_ *,
- struct slang_operation_ *, struct slang_function_scope_ *, slang_struct_scope *);
+GLboolean slang_storage_aggregate_construct (slang_storage_aggregate *);
+GLvoid slang_storage_aggregate_destruct (slang_storage_aggregate *);
+
+extern GLboolean
+_slang_aggregate_variable(slang_storage_aggregate *agg,
+ slang_type_specifier *spec,
+ GLuint array_len,
+ slang_function_scope *funcs,
+ slang_struct_scope *structs,
+ slang_variable_scope *vars,
+ slang_machine *mach,
+ slang_assembly_file *file,
+ slang_atom_pool *atoms);
+
+extern GLboolean
+_slang_evaluate_int(slang_assembly_file *file,
+ slang_machine *pmach,
+ slang_assembly_name_space *space,
+ slang_operation *array_size,
+ GLuint *pint,
+ slang_atom_pool *atoms);
/*
- returns total size (in machine units) of the given aggregate
- returns 0 on error
-*/
-unsigned int _slang_sizeof_aggregate (const slang_storage_aggregate *);
+ * Returns total size (in machine units) of the given aggregate.
+ * Returns 0 on error.
+ */
+GLuint _slang_sizeof_aggregate (const slang_storage_aggregate *);
/*
- converts structured aggregate to a flat one, with arrays of generic type being
- one-element long
- returns 1 on success
- returns 0 otherwise
-*/
-int _slang_flatten_aggregate (slang_storage_aggregate *, const slang_storage_aggregate *);
+ * Converts structured aggregate to a flat one, with arrays of generic type being
+ * one-element long.
+ * Returns GL_TRUE on success.
+ * Returns GL_FALSE otherwise.
+ */
+GLboolean _slang_flatten_aggregate (slang_storage_aggregate *, const slang_storage_aggregate *);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c
index c07e161c8d..5075832a92 100644
--- a/src/mesa/shader/slang/slang_utility.c
+++ b/src/mesa/shader/slang/slang_utility.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,43 +31,82 @@
#include "imports.h"
#include "slang_utility.h"
-void slang_alloc_free (void *ptr)
+char *slang_string_concat (char *dst, const char *src)
{
- _mesa_free (ptr);
+ return _mesa_strcpy (dst + _mesa_strlen (dst), src);
}
-void *slang_alloc_malloc (unsigned int size)
-{
- return _mesa_malloc (size);
-}
+/* slang_atom_pool */
-void *slang_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
+void slang_atom_pool_construct (slang_atom_pool *pool)
{
- return _mesa_realloc (ptr, old_size, size);
-}
+ GLuint i;
-int slang_string_compare (const char *str1, const char *str2)
-{
- return _mesa_strcmp (str1, str2);
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ pool->entries[i] = NULL;
}
-char *slang_string_copy (char *dst, const char *src)
+void slang_atom_pool_destruct (slang_atom_pool *pool)
{
- return _mesa_strcpy (dst, src);
-}
+ GLuint i;
-char *slang_string_concat (char *dst, const char *src)
-{
- return _mesa_strcpy (dst + _mesa_strlen (dst), src);
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ {
+ slang_atom_entry *entry;
+
+ entry = pool->entries[i];
+ while (entry != NULL)
+ {
+ slang_atom_entry *next;
+
+ next = entry->next;
+ slang_alloc_free (entry->id);
+ slang_alloc_free (entry);
+ entry = next;
+ }
+ }
}
-char *slang_string_duplicate (const char *src)
+slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id)
{
- return _mesa_strdup (src);
+ GLuint hash;
+ const char *p = id;
+ slang_atom_entry **entry;
+
+ hash = 0;
+ while (*p != '\0')
+ {
+ GLuint g;
+
+ hash = (hash << 4) + (GLuint) *p++;
+ g = hash & 0xf0000000;
+ if (g != 0)
+ hash ^= g >> 24;
+ hash &= ~g;
+ }
+ hash %= SLANG_ATOM_POOL_SIZE;
+
+ entry = &pool->entries[hash];
+ while (*entry != NULL)
+ {
+ if (slang_string_compare ((**entry).id, id) == 0)
+ return (slang_atom) (**entry).id;
+ entry = &(**entry).next;
+ }
+
+ *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry));
+ if (*entry == NULL)
+ return SLANG_ATOM_NULL;
+
+ (**entry).next = NULL;
+ (**entry).id = slang_string_duplicate (id);
+ if ((**entry).id == NULL)
+ return SLANG_ATOM_NULL;
+ return (slang_atom) (**entry).id;
}
-unsigned int slang_string_length (const char *str)
+const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom)
{
- return _mesa_strlen (str);
+ return (const char *) atom;
}
diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h
index 2b040a4446..346ce6b657 100644
--- a/src/mesa/shader/slang/slang_utility.h
+++ b/src/mesa/shader/slang/slang_utility.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,16 +32,39 @@ extern "C" {
/* Compile-time assertions. If the expression is zero, try to declare an
* array of size [-1] to cause compilation error.
*/
-#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; _array[0]; } while (0)
+#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0)
+
+#define slang_alloc_free(ptr) _mesa_free (ptr)
+#define slang_alloc_malloc(size) _mesa_malloc (size)
+#define slang_alloc_realloc(ptr, old_size, size) _mesa_realloc (ptr, old_size, size)
+#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2)
+#define slang_string_copy(dst, src) _mesa_strcpy (dst, src)
+#define slang_string_duplicate(src) _mesa_strdup (src)
+#define slang_string_length(str) _mesa_strlen (str)
-void slang_alloc_free (void *);
-void *slang_alloc_malloc (unsigned int);
-void *slang_alloc_realloc (void *, unsigned int, unsigned int);
-int slang_string_compare (const char *, const char *);
-char *slang_string_copy (char *, const char *);
char *slang_string_concat (char *, const char *);
-char *slang_string_duplicate (const char *);
-unsigned int slang_string_length (const char *);
+
+typedef GLvoid *slang_atom;
+
+#define SLANG_ATOM_NULL ((slang_atom) 0)
+
+typedef struct slang_atom_entry_
+{
+ char *id;
+ struct slang_atom_entry_ *next;
+} slang_atom_entry;
+
+#define SLANG_ATOM_POOL_SIZE 1023
+
+typedef struct slang_atom_pool_
+{
+ slang_atom_entry *entries[SLANG_ATOM_POOL_SIZE];
+} slang_atom_pool;
+
+GLvoid slang_atom_pool_construct (slang_atom_pool *);
+GLvoid slang_atom_pool_destruct (slang_atom_pool *);
+slang_atom slang_atom_pool_atom (slang_atom_pool *, const char *);
+const char *slang_atom_pool_id (slang_atom_pool *, slang_atom);
#ifdef __cplusplus
}
diff --git a/src/mesa/sources b/src/mesa/sources
index bd3af92cbc..70ca49be44 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -84,9 +84,11 @@ SWRAST_SOURCES = \
swrast/s_aatriangle.c \
swrast/s_accum.c \
swrast/s_alpha.c \
+ swrast/s_arbshader.c \
swrast/s_atifragshader.c \
swrast/s_bitmap.c \
swrast/s_blend.c \
+ swrast/s_blit.c \
swrast/s_buffers.c \
swrast/s_copypix.c \
swrast/s_context.c \
@@ -123,6 +125,7 @@ TNL_SOURCES = \
tnl/t_save_playback.c \
tnl/t_vb_arbprogram.c \
tnl/t_vb_arbprogram_sse.c \
+ tnl/t_vb_arbshader.c\
tnl/t_vb_program.c \
tnl/t_vb_render.c \
tnl/t_vb_texgen.c \
@@ -187,13 +190,22 @@ SLANG_CPP_SOURCES = \
shader/slang/OSDependent/Linux/ossource.cpp
SLANG_SOURCES = \
+ shader/slang/slang_analyse.c \
shader/slang/slang_assemble.c \
shader/slang/slang_assemble_assignment.c \
shader/slang/slang_assemble_conditional.c \
shader/slang/slang_assemble_constructor.c \
shader/slang/slang_assemble_typeinfo.c \
shader/slang/slang_compile.c \
+ shader/slang/slang_compile_function.c \
+ shader/slang/slang_compile_operation.c \
+ shader/slang/slang_compile_struct.c \
+ shader/slang/slang_compile_variable.c \
shader/slang/slang_execute.c \
+ shader/slang/slang_export.c \
+ shader/slang/slang_library_noise.c \
+ shader/slang/slang_library_texsample.c \
+ shader/slang/slang_link.c \
shader/slang/slang_preprocess.c \
shader/slang/slang_storage.c \
shader/slang/slang_utility.c
@@ -206,7 +218,8 @@ ASM_C_SOURCES = \
x86/rtasm/x86sse.c \
sparc/sparc.c \
ppc/common_ppc.c \
- x86-64/x86-64.c
+ x86-64/x86-64.c \
+ shader/slang/slang_execute_x86.c
X86_SOURCES = \
x86/common_x86_asm.S \
diff --git a/src/mesa/swrast/descrip.mms b/src/mesa/swrast/descrip.mms
index 25b6c90ccb..4d49673b5d 100644
--- a/src/mesa/swrast/descrip.mms
+++ b/src/mesa/swrast/descrip.mms
@@ -1,6 +1,6 @@
# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 23 March 2004
+# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
+# Last revision : 21 February 2006
.first
define gl [---.include.gl]
@@ -14,24 +14,26 @@
VPATH = RCS
-INCDIR = [---.include],[-.main],[-.glapi],[-.shader]
+INCDIR = [---.include],[-.main],[-.glapi],[-.shader],[-.shader.slang]
LIBDIR = [---.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = s_aaline.c s_aatriangle.c s_accum.c s_alpha.c \
- s_bitmap.c s_blend.c s_buffers.c s_context.c s_copypix.c s_depth.c \
+ s_bitmap.c s_blend.c s_blit.c s_buffers.c s_context.c \
+ s_copypix.c s_depth.c \
s_drawpix.c s_feedback.c s_fog.c s_imaging.c s_lines.c s_logic.c \
s_masking.c s_nvfragprog.c s_points.c s_readpix.c \
s_span.c s_stencil.c s_texstore.c s_texcombine.c s_texfilter.c \
- s_triangle.c s_zoom.c s_atifragshader.c
+ s_triangle.c s_zoom.c s_atifragshader.c s_arbshader.c
OBJECTS = s_aaline.obj,s_aatriangle.obj,s_accum.obj,s_alpha.obj,\
- s_bitmap.obj,s_blend.obj,\
+ s_bitmap.obj,s_blend.obj,s_blit.obj,s_arbshader.obj,\
s_buffers.obj,s_context.obj,s_atifragshader.obj,\
s_copypix.obj,s_depth.obj,s_drawpix.obj,s_feedback.obj,s_fog.obj,\
s_imaging.obj,s_lines.obj,s_logic.obj,s_masking.obj,s_nvfragprog.obj,\
s_points.obj,s_readpix.obj,s_span.obj,s_stencil.obj,\
- s_texstore.obj,s_texcombine.obj,s_texfilter.obj,s_triangle.obj,s_zoom.obj
+ s_texstore.obj,s_texcombine.obj,s_texfilter.obj,s_triangle.obj,\
+ s_zoom.obj
##### RULES #####
@@ -53,6 +55,7 @@ s_accum.obj : s_accum.c
s_alpha.obj : s_alpha.c
s_bitmap.obj : s_bitmap.c
s_blend.obj : s_blend.c
+s_blit.obj : s_blit.c
s_buffers.obj : s_buffers.c
s_context.obj : s_context.c
s_copypix.obj : s_copypix.c
@@ -74,3 +77,4 @@ s_texcombine.obj : s_texcombine.c
s_texfilter.obj : s_texfilter.c
s_triangle.obj : s_triangle.c
s_zoom.obj : s_zoom.c
+s_arbshader.obj : s_arbshader.c
diff --git a/src/mesa/swrast/s_arbshader.c b/src/mesa/swrast/s_arbshader.c
new file mode 100644
index 0000000000..ba146dd1bb
--- /dev/null
+++ b/src/mesa/swrast/s_arbshader.c
@@ -0,0 +1,99 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Michal Krol
+ */
+
+#include "glheader.h"
+#include "context.h"
+#include "colormac.h"
+#include "s_arbshader.h"
+#include "s_context.h"
+#include "shaderobjects.h"
+#include "shaderobjects_3dlabs.h"
+#include "slang_utility.h"
+#include "slang_link.h"
+
+void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span)
+{
+ struct gl2_program_intf **pro;
+ GLuint i;
+
+ if (!ctx->ShaderObjects._FragmentShaderPresent)
+ return;
+ pro = ctx->ShaderObjects.CurrentProgram;
+ if (!ctx->ShaderObjects._VertexShaderPresent)
+ (**pro).UpdateFixedUniforms (pro);
+
+ for (i = span->start; i < span->end; i++)
+ {
+ /* only run shader on active fragments */
+ if (span->array->mask[i]) {
+ GLfloat vec[4];
+ GLuint j;
+ GLboolean discard;
+
+ vec[0] = (GLfloat) span->x + i;
+ vec[1] = (GLfloat) span->y;
+ vec[2] = (GLfloat) span->array->z[i] / ctx->DrawBuffer->_DepthMaxF;
+ vec[3] = span->w + span->dwdx * i;
+ (**pro).UpdateFixedVarying (pro, SLANG_FRAGMENT_FIXED_FRAGCOORD, vec, 0,
+ 4 * sizeof (GLfloat), GL_TRUE);
+ vec[0] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]);
+ vec[1] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]);
+ vec[2] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]);
+ vec[3] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]);
+ (**pro).UpdateFixedVarying (pro, SLANG_FRAGMENT_FIXED_COLOR, vec, 0, 4 * sizeof (GLfloat),
+ GL_TRUE);
+ for (j = 0; j < ctx->Const.MaxTextureCoordUnits; j++)
+ {
+ vec[0] = span->array->texcoords[j][i][0];
+ vec[1] = span->array->texcoords[j][i][1];
+ vec[2] = span->array->texcoords[j][i][2];
+ vec[3] = span->array->texcoords[j][i][3];
+ (**pro).UpdateFixedVarying (pro, SLANG_FRAGMENT_FIXED_TEXCOORD, vec, j,
+ 4 * sizeof (GLfloat), GL_TRUE);
+ }
+
+ _slang_exec_fragment_shader (pro);
+
+ _slang_fetch_discard (pro, &discard);
+ if (discard)
+ {
+ span->array->mask[i] = GL_FALSE;
+ span->writeAll = GL_FALSE;
+ }
+ else
+ {
+ (**pro).UpdateFixedVarying (pro, SLANG_FRAGMENT_FIXED_FRAGCOLOR, vec, 0,
+ 4 * sizeof (GLfloat), GL_FALSE);
+ UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][RCOMP], vec[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][GCOMP], vec[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], vec[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], vec[3]);
+ }
+ }
+ }
+}
+
diff --git a/src/mesa/swrast/s_arbshader.h b/src/mesa/swrast/s_arbshader.h
new file mode 100644
index 0000000000..7a99ad725e
--- /dev/null
+++ b/src/mesa/swrast/s_arbshader.h
@@ -0,0 +1,34 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 David Airlie 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
+ * DAVID AIRLIE 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 S_ARBSHADER_H
+#define S_ARBSHADER_H
+
+#include "s_context.h"
+
+extern void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span);
+
+#endif
+
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 36ada5fa30..08640e146b 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -593,10 +593,11 @@ _swrast_exec_fragment_shader(GLcontext * ctx, struct sw_span *span)
if (span->array->mask[i]) {
init_machine(ctx, &ctx->ATIFragmentShader.Machine,
ctx->ATIFragmentShader.Current, span, i);
-
- if (execute_shader(ctx, shader, ~0,
+ /* can't really happen... */
+ if (!execute_shader(ctx, shader, ~0,
&ctx->ATIFragmentShader.Machine, span, i)) {
span->array->mask[i] = GL_FALSE;
+ span->writeAll = GL_FALSE;
}
{
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
new file mode 100644
index 0000000000..5aec4aad03
--- /dev/null
+++ b/src/mesa/swrast/s_blit.c
@@ -0,0 +1,790 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "macros.h"
+#include "s_context.h"
+
+
+#define ABS(X) ((X) < 0 ? -(X) : (X))
+
+
+/**
+ * Generate a row resampler function for GL_NEAREST mode.
+ */
+#define RESAMPLE(NAME, PIXELTYPE, SIZE) \
+static void \
+NAME(GLint srcWidth, GLint dstWidth, \
+ const GLvoid *srcBuffer, GLvoid *dstBuffer, \
+ GLboolean flip) \
+{ \
+ const PIXELTYPE *src = (const PIXELTYPE *) srcBuffer;\
+ PIXELTYPE *dst = (PIXELTYPE *) dstBuffer; \
+ GLint dstCol; \
+ \
+ if (flip) { \
+ for (dstCol = 0; dstCol < dstWidth; dstCol++) { \
+ GLint srcCol = (dstCol * srcWidth) / dstWidth; \
+ ASSERT(srcCol >= 0); \
+ ASSERT(srcCol < srcWidth); \
+ srcCol = srcWidth - 1 - srcCol; /* flip */ \
+ if (SIZE == 1) { \
+ dst[dstCol] = src[srcCol]; \
+ } \
+ else if (SIZE == 2) { \
+ dst[dstCol*2+0] = src[srcCol*2+0]; \
+ dst[dstCol*2+1] = src[srcCol*2+1]; \
+ } \
+ else if (SIZE == 4) { \
+ dst[dstCol*4+0] = src[srcCol*4+0]; \
+ dst[dstCol*4+1] = src[srcCol*4+1]; \
+ dst[dstCol*4+2] = src[srcCol*4+2]; \
+ dst[dstCol*4+3] = src[srcCol*4+3]; \
+ } \
+ } \
+ } \
+ else { \
+ for (dstCol = 0; dstCol < dstWidth; dstCol++) { \
+ GLint srcCol = (dstCol * srcWidth) / dstWidth; \
+ ASSERT(srcCol >= 0); \
+ ASSERT(srcCol < srcWidth); \
+ if (SIZE == 1) { \
+ dst[dstCol] = src[srcCol]; \
+ } \
+ else if (SIZE == 2) { \
+ dst[dstCol*2+0] = src[srcCol*2+0]; \
+ dst[dstCol*2+1] = src[srcCol*2+1]; \
+ } \
+ else if (SIZE == 4) { \
+ dst[dstCol*4+0] = src[srcCol*4+0]; \
+ dst[dstCol*4+1] = src[srcCol*4+1]; \
+ dst[dstCol*4+2] = src[srcCol*4+2]; \
+ dst[dstCol*4+3] = src[srcCol*4+3]; \
+ } \
+ } \
+ } \
+}
+
+/**
+ * Resamplers for 1, 2, 4, 8 and 16-byte pixels.
+ */
+RESAMPLE(resample_row_1, GLubyte, 1)
+RESAMPLE(resample_row_2, GLushort, 1)
+RESAMPLE(resample_row_4, GLuint, 1)
+RESAMPLE(resample_row_8, GLuint, 2)
+RESAMPLE(resample_row_16, GLuint, 4)
+
+
+/**
+ * Blit color, depth or stencil with GL_NEAREST filtering.
+ */
+static void
+blit_nearest(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLenum buffer)
+{
+ struct gl_renderbuffer *readRb, *drawRb;
+
+ const GLint srcWidth = ABS(srcX1 - srcX0);
+ const GLint dstWidth = ABS(dstX1 - dstX0);
+ const GLint srcHeight = ABS(srcY1 - srcY0);
+ const GLint dstHeight = ABS(dstY1 - dstY0);
+
+ const GLint srcXpos = MIN2(srcX0, srcX1);
+ const GLint srcYpos = MIN2(srcY0, srcY1);
+ const GLint dstXpos = MIN2(dstX0, dstX1);
+ const GLint dstYpos = MIN2(dstY0, dstY1);
+
+ const GLboolean invertX = (srcX1 < srcX0) ^ (dstX1 < dstX0);
+ const GLboolean invertY = (srcY1 < srcY0) ^ (dstY1 < dstY0);
+
+ GLint dstRow;
+
+ GLint comps, pixelSize;
+ GLvoid *srcBuffer, *dstBuffer;
+ GLint prevY = -1;
+
+ typedef void (*resample_func)(GLint srcWidth, GLint dstWidth,
+ const GLvoid *srcBuffer, GLvoid *dstBuffer,
+ GLboolean flip);
+ resample_func resampleRow;
+
+ switch (buffer) {
+ case GL_COLOR_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_ColorReadBuffer;
+ drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ comps = 4;
+ break;
+ case GL_DEPTH_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_DepthBuffer;
+ drawRb = ctx->DrawBuffer->_DepthBuffer;
+ comps = 1;
+ break;
+ case GL_STENCIL_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_StencilBuffer;
+ drawRb = ctx->DrawBuffer->_StencilBuffer;
+ comps = 1;
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected buffer in blit_nearest()");
+ return;
+ }
+
+ switch (readRb->DataType) {
+ case GL_UNSIGNED_BYTE:
+ pixelSize = comps * sizeof(GLubyte);
+ break;
+ case GL_UNSIGNED_SHORT:
+ pixelSize = comps * sizeof(GLushort);
+ break;
+ case GL_UNSIGNED_INT:
+ pixelSize = comps * sizeof(GLuint);
+ break;
+ case GL_FLOAT:
+ pixelSize = comps * sizeof(GLfloat);
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected buffer type (0x%x) in blit_nearest",
+ readRb->DataType);
+ return;
+ }
+
+ /* choose row resampler */
+ switch (pixelSize) {
+ case 1:
+ resampleRow = resample_row_1;
+ break;
+ case 2:
+ resampleRow = resample_row_2;
+ break;
+ case 4:
+ resampleRow = resample_row_4;
+ break;
+ case 8:
+ resampleRow = resample_row_8;
+ break;
+ case 16:
+ resampleRow = resample_row_16;
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected pixel size (%d) in blit_nearest",
+ pixelSize);
+ return;
+ }
+
+ /* allocate the src/dst row buffers */
+ srcBuffer = _mesa_malloc(pixelSize * srcWidth);
+ if (!srcBuffer) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+ dstBuffer = _mesa_malloc(pixelSize * dstWidth);
+ if (!dstBuffer) {
+ _mesa_free(srcBuffer);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+
+ for (dstRow = 0; dstRow < dstHeight; dstRow++) {
+ const GLint dstY = dstYpos + dstRow;
+ GLint srcRow = (dstRow * srcHeight) / dstHeight;
+ GLint srcY;
+
+ ASSERT(srcRow >= 0);
+ ASSERT(srcRow < srcHeight);
+
+ if (invertY) {
+ srcRow = srcHeight - 1 - srcRow;
+ }
+
+ srcY = srcYpos + srcRow;
+
+ /* get pixel row from source and resample to match dest width */
+ if (prevY != srcY) {
+ readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY, srcBuffer);
+ (*resampleRow)(srcWidth, dstWidth, srcBuffer, dstBuffer, invertX);
+ prevY = srcY;
+ }
+
+ /* store pixel row in destination */
+ drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL);
+ }
+
+ _mesa_free(srcBuffer);
+ _mesa_free(dstBuffer);
+}
+
+
+
+#define LERP(T, A, B) ( (A) + (T) * ((B) - (A)) )
+
+static INLINE GLfloat
+lerp_2d(GLfloat a, GLfloat b,
+ GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11)
+{
+ const GLfloat temp0 = LERP(a, v00, v10);
+ const GLfloat temp1 = LERP(a, v01, v11);
+ return LERP(b, temp0, temp1);
+}
+
+
+/**
+ * Bilinear interpolation of two source rows.
+ * GLubyte pixels.
+ */
+static void
+resample_linear_row_ub(GLint srcWidth, GLint dstWidth,
+ const GLvoid *srcBuffer0, const GLvoid *srcBuffer1,
+ GLvoid *dstBuffer, GLboolean flip, GLfloat rowWeight)
+{
+ const GLubyte (*srcColor0)[4] = (const GLubyte (*)[4]) srcBuffer0;
+ const GLubyte (*srcColor1)[4] = (const GLubyte (*)[4]) srcBuffer1;
+ GLubyte (*dstColor)[4] = (GLubyte (*)[4]) dstBuffer;
+ const GLfloat dstWidthF = (GLfloat) dstWidth;
+ GLint dstCol;
+
+ for (dstCol = 0; dstCol < dstWidth; dstCol++) {
+ const GLfloat srcCol = (dstCol * srcWidth) / dstWidthF;
+ GLint srcCol0 = IFLOOR(srcCol);
+ GLint srcCol1 = srcCol0 + 1;
+ GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */
+ GLfloat red, green, blue, alpha;
+
+ ASSERT(srcCol0 >= 0);
+ ASSERT(srcCol0 < srcWidth);
+ ASSERT(srcCol1 <= srcWidth);
+
+ if (srcCol1 == srcWidth) {
+ /* last column fudge */
+ srcCol1--;
+ colWeight = 0.0;
+ }
+
+ if (flip) {
+ srcCol0 = srcWidth - 1 - srcCol0;
+ srcCol1 = srcWidth - 1 - srcCol1;
+ }
+
+ red = lerp_2d(colWeight, rowWeight,
+ srcColor0[srcCol0][RCOMP], srcColor0[srcCol1][RCOMP],
+ srcColor1[srcCol0][RCOMP], srcColor1[srcCol1][RCOMP]);
+ green = lerp_2d(colWeight, rowWeight,
+ srcColor0[srcCol0][GCOMP], srcColor0[srcCol1][GCOMP],
+ srcColor1[srcCol0][GCOMP], srcColor1[srcCol1][GCOMP]);
+ blue = lerp_2d(colWeight, rowWeight,
+ srcColor0[srcCol0][BCOMP], srcColor0[srcCol1][BCOMP],
+ srcColor1[srcCol0][BCOMP], srcColor1[srcCol1][BCOMP]);
+ alpha = lerp_2d(colWeight, rowWeight,
+ srcColor0[srcCol0][ACOMP], srcColor0[srcCol1][ACOMP],
+ srcColor1[srcCol0][ACOMP], srcColor1[srcCol1][ACOMP]);
+
+ dstColor[dstCol][RCOMP] = IFLOOR(red);
+ dstColor[dstCol][GCOMP] = IFLOOR(green);
+ dstColor[dstCol][BCOMP] = IFLOOR(blue);
+ dstColor[dstCol][ACOMP] = IFLOOR(alpha);
+ }
+}
+
+
+
+/**
+ * Bilinear filtered blit (color only).
+ */
+static void
+blit_linear(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1)
+{
+ struct gl_renderbuffer *readRb = ctx->ReadBuffer->_ColorReadBuffer;
+ struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+
+ const GLint srcWidth = ABS(srcX1 - srcX0);
+ const GLint dstWidth = ABS(dstX1 - dstX0);
+ const GLint srcHeight = ABS(srcY1 - srcY0);
+ const GLint dstHeight = ABS(dstY1 - dstY0);
+ const GLfloat dstHeightF = (GLfloat) dstHeight;
+
+ const GLint srcXpos = MIN2(srcX0, srcX1);
+ const GLint srcYpos = MIN2(srcY0, srcY1);
+ const GLint dstXpos = MIN2(dstX0, dstX1);
+ const GLint dstYpos = MIN2(dstY0, dstY1);
+
+ const GLboolean invertX = (srcX1 < srcX0) ^ (dstX1 < dstX0);
+ const GLboolean invertY = (srcY1 < srcY0) ^ (dstY1 < dstY0);
+
+ GLint dstRow;
+
+ GLint pixelSize;
+ GLvoid *srcBuffer0, *srcBuffer1;
+ GLint srcBufferY0 = -1, srcBufferY1 = -1;
+ GLvoid *dstBuffer;
+
+ switch (readRb->DataType) {
+ case GL_UNSIGNED_BYTE:
+ pixelSize = 4 * sizeof(GLubyte);
+ break;
+ case GL_UNSIGNED_SHORT:
+ pixelSize = 4 * sizeof(GLushort);
+ break;
+ case GL_UNSIGNED_INT:
+ pixelSize = 4 * sizeof(GLuint);
+ break;
+ case GL_FLOAT:
+ pixelSize = 4 * sizeof(GLfloat);
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected buffer type (0x%x) in blit_nearest",
+ readRb->DataType);
+ return;
+ }
+
+ /* Allocate the src/dst row buffers.
+ * Keep two adjacent src rows around for bilinear sampling.
+ */
+ srcBuffer0 = _mesa_malloc(pixelSize * srcWidth);
+ if (!srcBuffer0) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+ srcBuffer1 = _mesa_malloc(pixelSize * srcWidth);
+ if (!srcBuffer1) {
+ _mesa_free(srcBuffer0);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+ dstBuffer = _mesa_malloc(pixelSize * dstWidth);
+ if (!dstBuffer) {
+ _mesa_free(srcBuffer0);
+ _mesa_free(srcBuffer1);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+
+ for (dstRow = 0; dstRow < dstHeight; dstRow++) {
+ const GLint dstY = dstYpos + dstRow;
+ const GLfloat srcRow = (dstRow * srcHeight) / dstHeightF;
+ GLint srcRow0 = IFLOOR(srcRow);
+ GLint srcRow1 = srcRow0 + 1;
+ GLfloat rowWeight = srcRow - srcRow0; /* fractional part of srcRow */
+
+ ASSERT(srcRow >= 0);
+ ASSERT(srcRow < srcHeight);
+
+ if (srcRow1 == srcHeight) {
+ /* last row fudge */
+ srcRow1 = srcRow0;
+ rowWeight = 0.0;
+ }
+
+ if (invertY) {
+ srcRow0 = srcHeight - 1 - srcRow0;
+ srcRow1 = srcHeight - 1 - srcRow1;
+ }
+
+ srcY0 = srcYpos + srcRow0;
+ srcY1 = srcYpos + srcRow1;
+
+ /* get the two source rows */
+ if (srcY0 == srcBufferY0 && srcY1 == srcBufferY1) {
+ /* use same source row buffers again */
+ }
+ else if (srcY0 == srcBufferY1) {
+ /* move buffer1 into buffer0 by swapping pointers */
+ GLvoid *tmp = srcBuffer0;
+ srcBuffer0 = srcBuffer1;
+ srcBuffer1 = tmp;
+ /* get y1 row */
+ readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY1, srcBuffer1);
+ srcBufferY0 = srcY0;
+ srcBufferY1 = srcY1;
+ }
+ else {
+ /* get both new rows */
+ readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY0, srcBuffer0);
+ readRb->GetRow(ctx, readRb, srcWidth, srcXpos, srcY1, srcBuffer1);
+ srcBufferY0 = srcY0;
+ srcBufferY1 = srcY1;
+ }
+
+ if (readRb->DataType == GL_UNSIGNED_BYTE) {
+ resample_linear_row_ub(srcWidth, dstWidth, srcBuffer0, srcBuffer1,
+ dstBuffer, invertX, rowWeight);
+ }
+ else {
+ _mesa_problem(ctx, "Unsupported color channel type in sw blit");
+ break;
+ }
+
+ /* store pixel row in destination */
+ drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL);
+ }
+
+ _mesa_free(srcBuffer0);
+ _mesa_free(srcBuffer1);
+ _mesa_free(dstBuffer);
+}
+
+
+/**
+ * Simple case: Blit color, depth or stencil with no scaling or flipping.
+ * XXX we could easily support vertical flipping here.
+ */
+static void
+simple_blit(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLenum buffer)
+{
+ struct gl_renderbuffer *readRb, *drawRb;
+ const GLint width = srcX1 - srcX0;
+ const GLint height = srcY1 - srcY0;
+ GLint row, srcY, dstY, yStep;
+ GLint comps, bytesPerRow;
+ void *rowBuffer;
+
+ /* only one buffer */
+ ASSERT(_mesa_bitcount(buffer) == 1);
+ /* no flipping checks */
+ ASSERT(srcX0 < srcX1);
+ ASSERT(srcY0 < srcY1);
+ ASSERT(dstX0 < dstX1);
+ ASSERT(dstY0 < dstY1);
+ /* size checks */
+ ASSERT(srcX1 - srcX0 == dstX1 - dstX0);
+ ASSERT(srcY1 - srcY0 == dstY1 - dstY0);
+
+ /* determine if copy should be bottom-to-top or top-to-bottom */
+ if (srcY0 > dstY0) {
+ /* src above dst: copy bottom-to-top */
+ yStep = 1;
+ srcY = srcY0;
+ dstY = dstY0;
+ }
+ else {
+ /* src below dst: copy top-to-bottom */
+ yStep = -1;
+ srcY = srcY1 - 1;
+ dstY = dstY1 - 1;
+ }
+
+ switch (buffer) {
+ case GL_COLOR_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_ColorReadBuffer;
+ drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ comps = 4;
+ break;
+ case GL_DEPTH_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_DepthBuffer;
+ drawRb = ctx->DrawBuffer->_DepthBuffer;
+ comps = 1;
+ break;
+ case GL_STENCIL_BUFFER_BIT:
+ readRb = ctx->ReadBuffer->_StencilBuffer;
+ drawRb = ctx->DrawBuffer->_StencilBuffer;
+ comps = 1;
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected buffer in simple_blit()");
+ return;
+ }
+
+ ASSERT(readRb->DataType == drawRb->DataType);
+
+ /* compute bytes per row */
+ switch (readRb->DataType) {
+ case GL_UNSIGNED_BYTE:
+ bytesPerRow = comps * width * sizeof(GLubyte);
+ break;
+ case GL_UNSIGNED_SHORT:
+ bytesPerRow = comps * width * sizeof(GLushort);
+ break;
+ case GL_UNSIGNED_INT:
+ bytesPerRow = comps * width * sizeof(GLuint);
+ break;
+ case GL_FLOAT:
+ bytesPerRow = comps * width * sizeof(GLfloat);
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected buffer type in simple_blit");
+ return;
+ }
+
+ /* allocate the row buffer */
+ rowBuffer = _mesa_malloc(bytesPerRow);
+ if (!rowBuffer) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
+ return;
+ }
+
+ for (row = 0; row < height; row++) {
+ readRb->GetRow(ctx, readRb, width, srcX0, srcY, rowBuffer);
+ drawRb->PutRow(ctx, drawRb, width, dstX0, dstY, rowBuffer, NULL);
+ srcY += yStep;
+ dstY += yStep;
+ }
+
+ _mesa_free(rowBuffer);
+}
+
+
+/**
+ * Clip dst coords against Xmax (or Ymax).
+ */
+static INLINE void
+clip_right_or_top(GLint *srcX0, GLint *srcX1,
+ GLint *dstX0, GLint *dstX1,
+ GLint maxValue)
+{
+ GLfloat t, bias;
+
+ if (*dstX1 > maxValue) {
+ /* X1 outside right edge */
+ ASSERT(*dstX0 < maxValue); /* X0 should be inside right edge */
+ t = (GLfloat) (maxValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0);
+ /* chop off [t, 1] part */
+ ASSERT(t >= 0.0 && t <= 1.0);
+ *dstX1 = maxValue;
+ bias = (*srcX0 < *srcX1) ? 0.5 : -0.5;
+ *srcX1 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias);
+ }
+ else if (*dstX0 > maxValue) {
+ /* X0 outside right edge */
+ ASSERT(*dstX1 < maxValue); /* X1 should be inside right edge */
+ t = (GLfloat) (maxValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1);
+ /* chop off [t, 1] part */
+ ASSERT(t >= 0.0 && t <= 1.0);
+ *dstX0 = maxValue;
+ bias = (*srcX0 < *srcX1) ? -0.5 : 0.5;
+ *srcX0 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias);
+ }
+}
+
+
+/**
+ * Clip dst coords against Xmin (or Ymin).
+ */
+static INLINE void
+clip_left_or_bottom(GLint *srcX0, GLint *srcX1,
+ GLint *dstX0, GLint *dstX1,
+ GLint minValue)
+{
+ GLfloat t, bias;
+
+ if (*dstX0 < minValue) {
+ /* X0 outside left edge */
+ ASSERT(*dstX1 > minValue); /* X1 should be inside left edge */
+ t = (GLfloat) (minValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0);
+ /* chop off [0, t] part */
+ ASSERT(t >= 0.0 && t <= 1.0);
+ *dstX0 = minValue;
+ bias = (*srcX0 < *srcX1) ? 0.5 : -0.5; /* flipped??? */
+ *srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias);
+ }
+ else if (*dstX1 < minValue) {
+ /* X1 outside left edge */
+ ASSERT(*dstX0 > minValue); /* X0 should be inside left edge */
+ t = (GLfloat) (minValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1);
+ /* chop off [0, t] part */
+ ASSERT(t >= 0.0 && t <= 1.0);
+ *dstX1 = minValue;
+ bias = (*srcX0 < *srcX1) ? 0.5 : -0.5;
+ *srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias);
+ }
+}
+
+
+/**
+ * Do clipping of blit src/dest rectangles.
+ * The dest rect is clipped against both the buffer bounds and scissor bounds.
+ * The src rect is just clipped against the buffer bounds.
+ *
+ * When either the src or dest rect is clipped, the other is also clipped
+ * proportionately!
+ *
+ * Note that X0 need not be less than X1 (same for Y) for either the source
+ * and dest rects. That makes the clipping a little trickier.
+ *
+ * \return GL_TRUE if anything is left to draw, GL_FALSE if totally clipped
+ */
+static GLboolean
+clip_blit(GLcontext *ctx,
+ GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1,
+ GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1)
+{
+ const GLint srcXmin = 0;
+ const GLint srcXmax = ctx->ReadBuffer->Width;
+ const GLint srcYmin = 0;
+ const GLint srcYmax = ctx->ReadBuffer->Height;
+
+ /* these include scissor bounds */
+ const GLint dstXmin = ctx->DrawBuffer->_Xmin;
+ const GLint dstXmax = ctx->DrawBuffer->_Xmax;
+ const GLint dstYmin = ctx->DrawBuffer->_Ymin;
+ const GLint dstYmax = ctx->DrawBuffer->_Ymax;
+
+ /*
+ printf("PreClipX: src: %d .. %d dst: %d .. %d\n",
+ *srcX0, *srcX1, *dstX0, *dstX1);
+ printf("PreClipY: src: %d .. %d dst: %d .. %d\n",
+ *srcY0, *srcY1, *dstY0, *dstY1);
+ */
+
+ /* trivial rejection tests */
+ if (*dstX0 == *dstX1)
+ return GL_FALSE; /* no width */
+ if (*dstX0 <= dstXmin && *dstX1 <= dstXmin)
+ return GL_FALSE; /* totally out (left) of bounds */
+ if (*dstX0 >= dstXmax && *dstX1 >= dstXmax)
+ return GL_FALSE; /* totally out (right) of bounds */
+
+ if (*dstY0 == *dstY1)
+ return GL_FALSE;
+ if (*dstY0 <= dstYmin && *dstY1 <= dstYmin)
+ return GL_FALSE;
+ if (*dstY0 >= dstYmax && *dstY1 >= dstYmax)
+ return GL_FALSE;
+
+ if (*srcX0 == *srcX1)
+ return GL_FALSE;
+ if (*srcX0 <= srcXmin && *srcX1 <= srcXmin)
+ return GL_FALSE;
+ if (*srcX0 >= srcXmax && *srcX1 >= srcXmax)
+ return GL_FALSE;
+
+ if (*srcY0 == *srcY1)
+ return GL_FALSE;
+ if (*srcY0 <= srcYmin && *srcY1 <= srcYmin)
+ return GL_FALSE;
+ if (*srcY0 >= srcYmax && *srcY1 >= srcYmax)
+ return GL_FALSE;
+
+ /*
+ * dest clip
+ */
+ clip_right_or_top(srcX0, srcX1, dstX0, dstX1, dstXmax);
+ clip_right_or_top(srcY0, srcY1, dstY0, dstY1, dstYmax);
+ clip_left_or_bottom(srcX0, srcX1, dstX0, dstX1, dstXmin);
+ clip_left_or_bottom(srcY0, srcY1, dstY0, dstY1, dstYmin);
+
+ /*
+ * src clip (just swap src/dst values from above)
+ */
+ clip_right_or_top(dstX0, dstX1, srcX0, srcX1, srcXmax);
+ clip_right_or_top(dstY0, dstY1, srcY0, srcY1, srcYmax);
+ clip_left_or_bottom(dstX0, dstX1, srcX0, srcX1, srcXmin);
+ clip_left_or_bottom(dstY0, dstY1, srcY0, srcY1, srcYmin);
+
+ /*
+ printf("PostClipX: src: %d .. %d dst: %d .. %d\n",
+ *srcX0, *srcX1, *dstX0, *dstX1);
+ printf("PostClipY: src: %d .. %d dst: %d .. %d\n",
+ *srcY0, *srcY1, *dstY0, *dstY1);
+ */
+
+ ASSERT(*dstX0 >= dstXmin);
+ ASSERT(*dstX0 <= dstXmax);
+ ASSERT(*dstX1 >= dstXmin);
+ ASSERT(*dstX1 <= dstXmax);
+
+ ASSERT(*dstY0 >= dstYmin);
+ ASSERT(*dstY0 <= dstYmax);
+ ASSERT(*dstY1 >= dstYmin);
+ ASSERT(*dstY1 <= dstYmax);
+
+ ASSERT(*srcX0 >= srcXmin);
+ ASSERT(*srcX0 <= srcXmax);
+ ASSERT(*srcX1 >= srcXmin);
+ ASSERT(*srcX1 <= srcXmax);
+
+ ASSERT(*srcY0 >= srcYmin);
+ ASSERT(*srcY0 <= srcYmax);
+ ASSERT(*srcY1 >= srcYmin);
+ ASSERT(*srcY1 <= srcYmax);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Software fallback for glBlitFramebufferEXT().
+ */
+void
+_swrast_BlitFramebuffer(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ static const GLint buffers[3] = {
+ GL_COLOR_BUFFER_BIT,
+ GL_DEPTH_BUFFER_BIT,
+ GL_STENCIL_BUFFER_BIT
+ };
+ GLint i;
+
+ if (!clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1,
+ &dstX0, &dstY0, &dstX1, &dstY1)) {
+ return;
+ }
+
+ RENDER_START(swrast, ctx);
+
+ if (srcX1 - srcX0 == dstX1 - dstX0 &&
+ srcY1 - srcY0 == dstY1 - dstY0 &&
+ srcX0 < srcX1 &&
+ srcY0 < srcY1 &&
+ dstX0 < dstX1 &&
+ dstY0 < dstY1) {
+ /* no stretching or flipping.
+ * filter doesn't matter.
+ */
+ for (i = 0; i < 3; i++) {
+ if (mask & buffers[i]) {
+ simple_blit(ctx, srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1, buffers[i]);
+ }
+ }
+ }
+ else {
+ if (filter == GL_NEAREST) {
+ for (i = 0; i < 3; i++) {
+ if (mask & buffers[i]) {
+ blit_nearest(ctx, srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1, buffers[i]);
+ }
+ }
+ }
+ else {
+ ASSERT(filter == GL_LINEAR);
+ if (mask & GL_COLOR_BUFFER_BIT) { /* depth/stencil not allowed */
+ blit_linear(ctx, srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1);
+ }
+ }
+ }
+
+ RENDER_FINISH(swrast, ctx);
+}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 9eb81832dd..ea283a1943 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -102,6 +102,10 @@ _swrast_update_rasterflags( GLcontext *ctx )
rasterMask |= FRAGPROG_BIT;
}
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ rasterMask |= FRAGPROG_BIT;
+ }
+
if (ctx->ATIFragmentShader._Enabled) {
rasterMask |= ATIFRAGSHADER_BIT;
}
@@ -470,13 +474,13 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state )
new_state = ~0;
}
- if (new_state & swrast->invalidate_triangle)
+ if (new_state & swrast->InvalidateTriangleMask)
swrast->Triangle = _swrast_validate_triangle;
- if (new_state & swrast->invalidate_line)
+ if (new_state & swrast->InvalidateLineMask)
swrast->Line = _swrast_validate_line;
- if (new_state & swrast->invalidate_point)
+ if (new_state & swrast->InvalidatePointMask)
swrast->Point = _swrast_validate_point;
if (new_state & _SWRAST_NEW_BLEND_FUNC)
@@ -651,9 +655,9 @@ _swrast_CreateContext( GLcontext *ctx )
swrast->choose_line = _swrast_choose_line;
swrast->choose_triangle = _swrast_choose_triangle;
- swrast->invalidate_point = _SWRAST_NEW_POINT;
- swrast->invalidate_line = _SWRAST_NEW_LINE;
- swrast->invalidate_triangle = _SWRAST_NEW_TRIANGLE;
+ swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
+ swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
+ swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
swrast->Point = _swrast_validate_point;
swrast->Line = _swrast_validate_line;
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 821faa6281..5d9a35043b 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -304,23 +304,32 @@ typedef struct
GLuint StateChanges;
GLenum Primitive; /* current primitive being drawn (ala glBegin) */
- /** Mechanism to allow driver (like X11) to register further
- * software rasterization routines.
+ void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
+
+ /**
+ * When the NewState mask intersects these masks, we invalidate the
+ * Point/Line/Triangle function pointers below.
+ */
+ /*@{*/
+ GLbitfield InvalidatePointMask;
+ GLbitfield InvalidateLineMask;
+ GLbitfield InvalidateTriangleMask;
+ /*@}*/
+
+ /**
+ * Device drivers plug in functions for these callbacks.
+ * Will be called when the GL state change mask intersects the above masks.
*/
/*@{*/
void (*choose_point)( GLcontext * );
void (*choose_line)( GLcontext * );
void (*choose_triangle)( GLcontext * );
-
- GLbitfield invalidate_point;
- GLbitfield invalidate_line;
- GLbitfield invalidate_triangle;
/*@}*/
- /** Function pointers for dispatch behind public entrypoints. */
+ /**
+ * Current point, line and triangle drawing functions.
+ */
/*@{*/
- void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
-
swrast_point_func Point;
swrast_line_func Line;
swrast_tri_func Triangle;
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 681d4eba11..02901a7ed9 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -37,7 +37,8 @@
#include "imports.h"
#include "s_atifragshader.h"
-#include "s_alpha.h"
+#include "s_alpha.h"
+#include "s_arbshader.h"
#include "s_blend.h"
#include "s_context.h"
#include "s_depth.h"
@@ -1083,7 +1084,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
const GLbitfield origArrayMask = span->arrayMask;
const GLboolean deferredTexture = !(ctx->Color.AlphaEnabled ||
ctx->FragmentProgram._Active ||
- ctx->ATIFragmentShader._Enabled);
+ ctx->ShaderObjects._FragmentShaderPresent);
ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE ||
span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
@@ -1154,8 +1155,13 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
if (span->interpMask & SPAN_FOG)
interpolate_fog(ctx, span);
- /* Compute fragment colors with fragment program or texture lookups */
- if (ctx->FragmentProgram._Active) {
+ /* Compute fragment colors with fragment program or texture lookups */
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ if (span->interpMask & SPAN_Z)
+ _swrast_span_interpolate_z (ctx, span);
+ _swrast_exec_arbshader (ctx, span);
+ }
+ else if (ctx->FragmentProgram._Active) {
/* frag prog may need Z values */
if (span->interpMask & SPAN_Z)
_swrast_span_interpolate_z(ctx, span);
@@ -1167,9 +1173,11 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
_swrast_texture_span( ctx, span );
/* Do the alpha test */
- if (!_swrast_alpha_test(ctx, span)) {
- span->arrayMask = origArrayMask;
- return;
+ if (ctx->Color.AlphaEnabled) {
+ if (!_swrast_alpha_test(ctx, span)) {
+ span->arrayMask = origArrayMask;
+ return;
+ }
}
}
@@ -1232,7 +1240,12 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
if (span->interpMask & SPAN_FOG)
interpolate_fog(ctx, span);
- if (ctx->FragmentProgram._Active)
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ if (span->interpMask & SPAN_Z)
+ _swrast_span_interpolate_z (ctx, span);
+ _swrast_exec_arbshader (ctx, span);
+ }
+ else if (ctx->FragmentProgram._Active)
_swrast_exec_fragment_program( ctx, span );
else if (ctx->ATIFragmentShader._Enabled)
_swrast_exec_fragment_shader( ctx, span );
diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c
index a3e695549e..d6b98acf9d 100644
--- a/src/mesa/swrast/s_texstore.c
+++ b/src/mesa/swrast/s_texstore.c
@@ -148,11 +148,12 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y,
}
}
else {
- GLuint z16[MAX_WIDTH];
+ GLushort z16[MAX_WIDTH];
ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT);
for (i = 0; i < height; i++) {
GLint j;
_swrast_get_row(ctx, depthRb, width, x, y + i, z16, sizeof(GLushort));
+ /* convert GLushorts to GLuints */
for (j = 0; j < width; j++) {
dst[j] = z16[j];
}
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 0587df3127..4422195a52 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -123,6 +123,12 @@ _swrast_ReadPixels( GLcontext *ctx,
GLvoid *pixels );
extern void
+_swrast_BlitFramebuffer(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter);
+
+extern void
_swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height );
diff --git a/src/mesa/tnl/descrip.mms b/src/mesa/tnl/descrip.mms
index 70c1606853..91e32bf978 100644
--- a/src/mesa/tnl/descrip.mms
+++ b/src/mesa/tnl/descrip.mms
@@ -1,6 +1,6 @@
# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-# Last revision : 13 June 2005
+# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
+# Last revision : 21 February 2006
.first
define gl [---.include.gl]
@@ -14,7 +14,7 @@
VPATH = RCS
-INCDIR = [---.include],[-.main],[-.glapi],[-.shader]
+INCDIR = [---.include],[-.main],[-.glapi],[-.shader],[-.shader.slang]
LIBDIR = [---.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
@@ -24,7 +24,7 @@ SOURCES = t_array_api.c t_array_import.c t_context.c \
t_vb_render.c t_vb_texgen.c t_vb_texmat.c t_vb_vertex.c \
t_vtx_eval.c t_vtx_exec.c t_save_playback.c t_save_loopback.c \
t_vertex.c t_vtx_generic.c t_vtx_x86.c t_vertex_generic.c \
- t_vb_arbprogram.c t_vp_build.c
+ t_vb_arbprogram.c t_vp_build.c t_vb_arbshader.c
OBJECTS = t_array_api.obj,t_array_import.obj,t_context.obj,\
t_pipeline.obj,t_vb_fog.obj,t_vb_light.obj,t_vb_normals.obj,\
@@ -32,7 +32,7 @@ OBJECTS = t_array_api.obj,t_array_import.obj,t_context.obj,\
t_vb_texmat.obj,t_vb_vertex.obj,t_save_api.obj,t_vtx_api.obj,\
t_vtx_eval.obj,t_vtx_exec.obj,t_save_playback.obj,t_save_loopback.obj,\
t_vertex.obj,t_vtx_generic.obj,t_vtx_x86.obj,t_vertex_generic.obj,\
- t_vb_arbprogram.obj,t_vp_build.obj
+ t_vb_arbprogram.obj,t_vp_build.obj,t_vb_arbshader.obj
##### RULES #####
@@ -72,3 +72,4 @@ t_vtx_generic.obj : t_vtx_generic.c
t_vertex_generic.obj : t_vertex_generic.c
t_vb_arbprogram.obj : t_vb_arbprogram.c
t_vp_build.obj : t_vp_build.c
+t_vb_arbshader.obj : t_vb_arbshader.c
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c
index 2a87f950ce..0b579a7b24 100644
--- a/src/mesa/tnl/t_pipeline.c
+++ b/src/mesa/tnl/t_pipeline.c
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -211,6 +211,9 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = {
&_tnl_arb_vertex_program_stage,
&_tnl_vertex_program_stage,
#endif
+#if FEATURE_ARB_vertex_shader
+ &_tnl_arb_vertex_shader_stage,
+#endif
&_tnl_render_stage,
NULL
};
diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h
index 6c7a0814c5..e5622c9d56 100644
--- a/src/mesa/tnl/t_pipeline.h
+++ b/src/mesa/tnl/t_pipeline.h
@@ -1,9 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -54,6 +54,7 @@ extern const struct tnl_pipeline_stage _tnl_texture_transform_stage;
extern const struct tnl_pipeline_stage _tnl_point_attenuation_stage;
extern const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage;
extern const struct tnl_pipeline_stage _tnl_vertex_program_stage;
+extern const struct tnl_pipeline_stage _tnl_arb_vertex_shader_stage;
extern const struct tnl_pipeline_stage _tnl_render_stage;
/* Shorthand to plug in the default pipeline:
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 4bd8e8c8be..11a5b654fc 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1257,15 +1257,17 @@ static INLINE void call_func( struct tnl_compiled_program *p,
static GLboolean
run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
- struct vertex_program *program = (ctx->VertexProgram._Enabled ?
- ctx->VertexProgram.Current :
- ctx->_TnlProgram);
+ struct vertex_program *program;
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct arb_vp_machine *m = ARB_VP_MACHINE(stage);
struct tnl_compiled_program *p;
GLuint i, j;
GLbitfield outputs;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
+ program = (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : ctx->_TnlProgram);
if (!program || program->IsNVProgram)
return GL_TRUE;
@@ -1280,7 +1282,8 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
m->nr_inputs = m->nr_outputs = 0;
for (i = 0; i < _TNL_ATTRIB_MAX; i++) {
- if (program->Base.InputsRead & (1<<i)) {
+ if (program->Base.InputsRead & (1<<i) ||
+ (i == VERT_ATTRIB_POS && program->IsPositionInvariant)) {
GLuint j = m->nr_inputs++;
m->input[j].idx = i;
m->input[j].data = (GLfloat *)m->VB->AttribPtr[i]->data;
@@ -1291,7 +1294,8 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
}
for (i = 0; i < VERT_RESULT_MAX; i++) {
- if (program->Base.OutputsWritten & (1 << i)) {
+ if (program->Base.OutputsWritten & (1 << i) ||
+ (i == VERT_RESULT_HPOS && program->IsPositionInvariant)) {
GLuint j = m->nr_outputs++;
m->output[j].idx = i;
m->output[j].data = (GLfloat *)m->attribs[i].data;
@@ -1314,6 +1318,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
STRIDE_F(m->input[j].data, m->input[j].stride);
}
+
if (p->compiled_func) {
call_func( p, m );
}
@@ -1324,6 +1329,15 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
}
}
+ /* If the program is position invariant, multiply the input position
+ * by the MVP matrix and store in the vertex position result register.
+ */
+ if (program->IsPositionInvariant) {
+ TRANSFORM_POINT( m->File[0][REG_OUT0+0],
+ ctx->_ModelProjectMatrix.m,
+ m->File[0][REG_IN0+0]);
+ }
+
for (j = 0; j < m->nr_outputs; j++) {
GLuint idx = REG_OUT0 + m->output[j].idx;
m->output[j].data[0] = m->File[0][idx][0];
@@ -1332,6 +1346,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
m->output[j].data[3] = m->File[0][idx][3];
m->output[j].data += 4;
}
+
}
/* Setup the VB pointers so that the next pipeline stages get
@@ -1348,6 +1363,8 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
VB->ClipPtr->count = VB->Count;
outputs = program->Base.OutputsWritten;
+ if (program->IsPositionInvariant)
+ outputs |= (1<<VERT_RESULT_HPOS);
if (outputs & (1<<VERT_RESULT_COL0)) {
VB->ColorPtr[0] = &m->attribs[VERT_RESULT_COL0];
@@ -1408,9 +1425,12 @@ static void
validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage )
{
struct arb_vp_machine *m = ARB_VP_MACHINE(stage);
- struct vertex_program *program =
- (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : 0);
+ struct vertex_program *program;
+
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return;
+ program = (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : 0);
if (!program && ctx->_MaintainTnlProgram) {
program = ctx->_TnlProgram;
}
@@ -1450,7 +1470,7 @@ static GLboolean init_vertex_program( GLcontext *ctx,
const GLuint size = VB->Size;
GLuint i;
- stage->privatePtr = _mesa_malloc(sizeof(*m));
+ stage->privatePtr = _mesa_calloc(sizeof(*m));
m = ARB_VP_MACHINE(stage);
if (!m)
return GL_FALSE;
@@ -1471,7 +1491,7 @@ static GLboolean init_vertex_program( GLcontext *ctx,
ASSIGN_4V(m->File[0][REG_LIT2], 1, .5, .2, 1); /* debug value */
if (_mesa_getenv("MESA_EXPERIMENTAL"))
- m->try_codegen = 1;
+ m->try_codegen = GL_TRUE;
/* Allocate arrays of vertex output values */
for (i = 0; i < VERT_RESULT_MAX; i++) {
diff --git a/src/mesa/tnl/t_vb_arbprogram_sse.c b/src/mesa/tnl/t_vb_arbprogram_sse.c
index c5da430dd3..19061c0d8d 100644
--- a/src/mesa/tnl/t_vb_arbprogram_sse.c
+++ b/src/mesa/tnl/t_vb_arbprogram_sse.c
@@ -43,6 +43,7 @@
#include "mtypes.h"
#include "arbprogparse.h"
#include "program.h"
+#include "program_instruction.h"
#include "math/m_matrix.h"
#include "math/m_translate.h"
#include "t_context.h"
@@ -1076,33 +1077,73 @@ static GLboolean (* const emit_func[])(struct compilation *, union instruction)
{
emit_ABS,
emit_ADD,
- emit_NOP,
+ emit_NOP, /* ARA */
+ emit_NOP, /* ARL */
+ emit_NOP, /* ARL_NV */
+ emit_NOP, /* ARR */
+ emit_NOP, /* BRA */
+ emit_NOP, /* CAL */
+ emit_NOP, /* CMP */
+ emit_NOP, /* COS */
+ emit_NOP, /* DDX */
+ emit_NOP, /* DDY */
emit_DP3,
emit_DP4,
emit_DPH,
emit_DST,
- emit_NOP,
+ emit_NOP, /* END */
emit_EX2,
emit_EXP,
emit_FLR,
emit_FRC,
+ emit_NOP, /* KIL */
+ emit_NOP, /* KIL_NV */
emit_LG2,
emit_LIT,
emit_LOG,
- emit_NOP,
+ emit_NOP, /* LRP */
+ emit_NOP, /* MAD */
emit_MAX,
emit_MIN,
emit_MOV,
emit_MUL,
+ emit_NOP, /* PK2H */
+ emit_NOP, /* PK2US */
+ emit_NOP, /* PK4B */
+ emit_NOP, /* PK4UB */
emit_POW,
+ emit_NOP, /* POPA */
emit_PRT,
- emit_NOP,
+ emit_NOP, /* PUSHA */
+ emit_NOP, /* RCC */
emit_RCP,
+ emit_NOP, /* RET */
+ emit_NOP, /* RFL */
emit_RSQ,
+ emit_NOP, /* SCS */
+ emit_NOP, /* SEQ */
+ emit_NOP, /* SFL */
emit_SGE,
+ emit_NOP, /* SGT */
+ emit_NOP, /* SIN */
+ emit_NOP, /* SLE */
emit_SLT,
+ emit_NOP, /* SNE */
+ emit_NOP, /* SSG */
+ emit_NOP, /* STR */
emit_SUB,
- emit_RSW,
+ emit_RSW, /* SWZ */
+ emit_NOP, /* TEX */
+ emit_NOP, /* TXB */
+ emit_NOP, /* TXD */
+ emit_NOP, /* TXL */
+ emit_NOP, /* TXP */
+ emit_NOP, /* TXP_NV */
+ emit_NOP, /* UP2H */
+ emit_NOP, /* UP2US */
+ emit_NOP, /* UP4B */
+ emit_NOP, /* UP4UB */
+ emit_NOP, /* X2D */
emit_XPD,
emit_RSW,
emit_MSK,
@@ -1181,6 +1222,11 @@ _tnl_sse_codegen_vertex_program(struct tnl_compiled_program *p)
{
struct compilation cp;
+ /* sanity checks */
+ assert(emit_func[OPCODE_ABS] == emit_ABS);
+ assert(emit_func[OPCODE_MUL] == emit_MUL);
+ assert(emit_func[OPCODE_XPD] == emit_XPD);
+
_mesa_memset(&cp, 0, sizeof(cp));
cp.p = p;
cp.have_sse2 = 1;
diff --git a/src/mesa/tnl/t_vb_arbshader.c b/src/mesa/tnl/t_vb_arbshader.c
new file mode 100644
index 0000000000..a2e6b37cd3
--- /dev/null
+++ b/src/mesa/tnl/t_vb_arbshader.c
@@ -0,0 +1,262 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Michal Krol
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "macros.h"
+#include "shaderobjects.h"
+#include "shaderobjects_3dlabs.h"
+#include "t_pipeline.h"
+#include "slang_utility.h"
+#include "slang_link.h"
+
+typedef struct
+{
+ GLvector4f outputs[VERT_RESULT_MAX];
+ GLvector4f ndc_coords;
+ GLubyte *clipmask;
+ GLubyte ormask;
+ GLubyte andmask;
+} arbvs_stage_data;
+
+#define ARBVS_STAGE_DATA(stage) ((arbvs_stage_data *) stage->privatePtr)
+
+static GLboolean construct_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stage *stage)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *vb = &tnl->vb;
+ arbvs_stage_data *store;
+ GLuint size = vb->Size;
+ GLuint i;
+
+ stage->privatePtr = _mesa_malloc (sizeof (arbvs_stage_data));
+ store = ARBVS_STAGE_DATA(stage);
+ if (store == NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < VERT_RESULT_MAX; i++)
+ {
+ _mesa_vector4f_alloc (&store->outputs[i], 0, size, 32);
+ store->outputs[i].size = 4;
+ }
+ _mesa_vector4f_alloc (&store->ndc_coords, 0, size, 32);
+ store->clipmask = (GLubyte *) ALIGN_MALLOC (size, 32);
+
+ return GL_TRUE;
+}
+
+static void destruct_arb_vertex_shader (struct tnl_pipeline_stage *stage)
+{
+ arbvs_stage_data *store = ARBVS_STAGE_DATA(stage);
+
+ if (store != NULL)
+ {
+ GLuint i;
+
+ for (i = 0; i < VERT_RESULT_MAX; i++)
+ _mesa_vector4f_free (&store->outputs[i]);
+ _mesa_vector4f_free (&store->ndc_coords);
+ ALIGN_FREE (store->clipmask);
+
+ _mesa_free (store);
+ stage->privatePtr = NULL;
+ }
+}
+
+static void validate_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stage *stage)
+{
+}
+
+static GLvoid fetch_input_float (struct gl2_program_intf **pro, GLuint index, GLuint attr, GLuint i,
+ struct vertex_buffer *vb)
+{
+ const GLubyte *ptr = (const GLubyte *) vb->AttribPtr[attr]->data;
+ const GLuint stride = vb->AttribPtr[attr]->stride;
+ const GLfloat *data = (const GLfloat *) (ptr + stride * i);
+ GLfloat vec[1];
+
+ vec[0] = data[0];
+ (**pro).UpdateFixedAttribute (pro, index, vec, 0, sizeof (GLfloat), GL_TRUE);
+}
+
+static GLvoid fetch_input_vec3 (struct gl2_program_intf **pro, GLuint index, GLuint attr, GLuint i,
+ struct vertex_buffer *vb)
+{
+ const GLubyte *ptr = (const GLubyte *) vb->AttribPtr[attr]->data;
+ const GLuint stride = vb->AttribPtr[attr]->stride;
+ const GLfloat *data = (const GLfloat *) (ptr + stride * i);
+ GLfloat vec[3];
+
+ vec[0] = data[0];
+ vec[1] = data[1];
+ vec[2] = data[2];
+ (**pro).UpdateFixedAttribute (pro, index, vec, 0, 3 * sizeof (GLfloat), GL_TRUE);
+}
+
+static void fetch_input_vec4 (struct gl2_program_intf **pro, GLuint index, GLuint attr, GLuint i,
+ struct vertex_buffer *vb)
+{
+ const GLubyte *ptr = (const GLubyte *) vb->AttribPtr[attr]->data;
+ const GLuint size = vb->AttribPtr[attr]->size;
+ const GLuint stride = vb->AttribPtr[attr]->stride;
+ const GLfloat *data = (const GLfloat *) (ptr + stride * i);
+ GLfloat vec[4];
+
+ switch (size)
+ {
+ case 2:
+ vec[0] = data[0];
+ vec[1] = data[1];
+ vec[2] = 0.0f;
+ vec[3] = 1.0f;
+ break;
+ case 3:
+ vec[0] = data[0];
+ vec[1] = data[1];
+ vec[2] = data[2];
+ vec[3] = 1.0f;
+ break;
+ case 4:
+ vec[0] = data[0];
+ vec[1] = data[1];
+ vec[2] = data[2];
+ vec[3] = data[3];
+ break;
+ }
+ (**pro).UpdateFixedAttribute (pro, index, vec, 0, 4 * sizeof (GLfloat), GL_TRUE);
+}
+
+static GLvoid fetch_output_float (struct gl2_program_intf **pro, GLuint index, GLuint attr, GLuint i,
+ arbvs_stage_data *store)
+{
+ (**pro).UpdateFixedAttribute (pro, index, &store->outputs[attr].data[i], 0, sizeof (GLfloat),
+ GL_FALSE);
+}
+
+static void fetch_output_vec4 (struct gl2_program_intf **pro, GLuint index, GLuint attr, GLuint i,
+ GLuint offset, arbvs_stage_data *store)
+{
+ (**pro).UpdateFixedAttribute (pro, index, &store->outputs[attr].data[i], offset,
+ 4 * sizeof (GLfloat), GL_FALSE);
+}
+
+static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stage *stage)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *vb = &tnl->vb;
+ arbvs_stage_data *store = ARBVS_STAGE_DATA(stage);
+ struct gl2_program_intf **pro;
+ GLsizei i, j;
+
+ if (!ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
+ pro = ctx->ShaderObjects.CurrentProgram;
+ (**pro).UpdateFixedUniforms (pro);
+
+ for (i = 0; i < vb->Count; i++)
+ {
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_VERTEX, _TNL_ATTRIB_POS, i, vb);
+ fetch_input_vec3 (pro, SLANG_VERTEX_FIXED_NORMAL, _TNL_ATTRIB_NORMAL, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_COLOR, _TNL_ATTRIB_COLOR0, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_SECONDARYCOLOR, _TNL_ATTRIB_COLOR1, i, vb);
+ fetch_input_float (pro, SLANG_VERTEX_FIXED_FOGCOORD, _TNL_ATTRIB_FOG, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD0, _TNL_ATTRIB_TEX0, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD1, _TNL_ATTRIB_TEX1, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD2, _TNL_ATTRIB_TEX2, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD3, _TNL_ATTRIB_TEX3, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD4, _TNL_ATTRIB_TEX4, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD5, _TNL_ATTRIB_TEX5, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD6, _TNL_ATTRIB_TEX6, i, vb);
+ fetch_input_vec4 (pro, SLANG_VERTEX_FIXED_MULTITEXCOORD7, _TNL_ATTRIB_TEX7, i, vb);
+
+ _slang_exec_vertex_shader (pro);
+
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_POSITION, VERT_RESULT_HPOS, i, 0, store);
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_FRONTCOLOR, VERT_RESULT_COL0, i, 0, store);
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR, VERT_RESULT_COL1, i, 0, store);
+ fetch_output_float (pro, SLANG_VERTEX_FIXED_FOGFRAGCOORD, VERT_RESULT_FOGC, i, store);
+ for (j = 0; j < 8; j++)
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_TEXCOORD, VERT_RESULT_TEX0 + j, i, j, store);
+ fetch_output_float (pro, SLANG_VERTEX_FIXED_POINTSIZE, VERT_RESULT_PSIZ, i, store);
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_BACKCOLOR, VERT_RESULT_BFC0, i, 0, store);
+ fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR, VERT_RESULT_BFC1, i, 0, store);
+ /* XXX: fetch output SLANG_VERTEX_FIXED_CLIPVERTEX */
+ }
+
+ vb->ClipPtr = &store->outputs[VERT_RESULT_HPOS];
+ vb->ClipPtr->count = vb->Count;
+ vb->ColorPtr[0] = &store->outputs[VERT_RESULT_COL0];
+ vb->SecondaryColorPtr[0] = &store->outputs[VERT_RESULT_COL1];
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ vb->TexCoordPtr[i] = &store->outputs[VERT_RESULT_TEX0 + i];
+ vb->ColorPtr[1] = &store->outputs[VERT_RESULT_BFC0];
+ vb->SecondaryColorPtr[1] = &store->outputs[VERT_RESULT_BFC1];
+ vb->FogCoordPtr = &store->outputs[VERT_RESULT_FOGC];
+ vb->PointSizePtr = &store->outputs[VERT_RESULT_PSIZ];
+
+ vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0];
+ vb->AttribPtr[VERT_ATTRIB_COLOR1] = vb->SecondaryColorPtr[0];
+ vb->AttribPtr[VERT_ATTRIB_FOG] = vb->FogCoordPtr;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = vb->TexCoordPtr[i];
+ vb->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->outputs[VERT_RESULT_PSIZ];
+
+ store->ormask = 0;
+ store->andmask = CLIP_ALL_BITS;
+
+ if (tnl->NeedNdcCoords)
+ {
+ vb->NdcPtr = _mesa_clip_tab[vb->ClipPtr->size] (vb->ClipPtr, &store->ndc_coords,
+ store->clipmask, &store->ormask, &store->andmask);
+ }
+ else
+ {
+ vb->NdcPtr = NULL;
+ _mesa_clip_np_tab[vb->ClipPtr->size] (vb->ClipPtr, NULL, store->clipmask, &store->ormask,
+ &store->andmask);
+ }
+
+ if (store->andmask)
+ return GL_FALSE;
+
+ vb->ClipAndMask = store->andmask;
+ vb->ClipOrMask = store->ormask;
+ vb->ClipMask = store->clipmask;
+
+ return GL_TRUE;
+}
+
+const struct tnl_pipeline_stage _tnl_arb_vertex_shader_stage = {
+ "ARB_vertex_shader",
+ NULL,
+ construct_arb_vertex_shader,
+ destruct_arb_vertex_shader,
+ validate_arb_vertex_shader,
+ run_arb_vertex_shader
+};
+
diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c
index 3f12945707..b5ba68dc86 100644
--- a/src/mesa/tnl/t_vb_cull.c
+++ b/src/mesa/tnl/t_vb_cull.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -57,6 +57,9 @@ static GLboolean run_cull_stage( GLcontext *ctx,
GLuint count = VB->Count;
GLuint i;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (ctx->VertexProgram._Enabled ||
!ctx->Transform.CullVertexFlag)
return GL_TRUE;
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index f1d01bc47f..bbee44ebea 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -148,6 +148,9 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
GLvector4f *input;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (!ctx->Fog.Enabled || ctx->VertexProgram._Enabled)
return GL_TRUE;
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index 1deab4d43a..4d360007a4 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -203,6 +203,9 @@ static GLboolean run_lighting( GLcontext *ctx,
GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
GLuint idx;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled)
return GL_TRUE;
@@ -261,6 +264,9 @@ static void validate_lighting( GLcontext *ctx,
{
light_func *tab;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return;
+
if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled)
return;
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c
index 7ac33f8bec..edcb4de6e9 100644
--- a/src/mesa/tnl/t_vb_normals.c
+++ b/src/mesa/tnl/t_vb_normals.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -95,6 +95,11 @@ validate_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
+ if (ctx->ShaderObjects._VertexShaderPresent) {
+ store->NormalTransform = NULL;
+ return;
+ }
+
if (ctx->VertexProgram._Enabled ||
(!ctx->Light.Enabled &&
!(ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS))) {
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index 47c37930d5..0ad3607917 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -47,6 +47,9 @@ struct point_stage_data {
static GLboolean
run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (ctx->Point._Attenuated && !ctx->VertexProgram._Enabled) {
struct point_stage_data *store = POINT_STAGE_DATA(stage);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index 297b731b1d..06789b97ba 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -80,6 +80,9 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
struct vertex_program *program = ctx->VertexProgram.Current;
GLuint i;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (!ctx->VertexProgram._Enabled ||
!program->IsNVProgram)
return GL_TRUE;
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c
index 1af8e2ba48..bfb7a50369 100644
--- a/src/mesa/tnl/t_vb_texgen.c
+++ b/src/mesa/tnl/t_vb_texgen.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -488,6 +488,9 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
GLuint i;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled)
return GL_TRUE;
@@ -513,6 +516,9 @@ static void validate_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
GLuint i;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return;
+
if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled)
return;
diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c
index 2347530385..1feb0b750e 100644
--- a/src/mesa/tnl/t_vb_texmat.c
+++ b/src/mesa/tnl/t_vb_texmat.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -61,6 +61,9 @@ static GLboolean run_texmat_stage( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLuint i;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Enabled)
return GL_TRUE;
diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c
index b3defaad05..e0a58aaaf3 100644
--- a/src/mesa/tnl/t_vb_vertex.c
+++ b/src/mesa/tnl/t_vb_vertex.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -126,6 +126,9 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
+ if (ctx->ShaderObjects._VertexShaderPresent)
+ return GL_TRUE;
+
if (ctx->VertexProgram._Enabled)
return GL_TRUE;
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index e94d83dbbc..34433510c5 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -30883,6 +30883,59 @@ GL_PREFIX(GetQueryObjectui64vEXT):
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryObjectui64vEXT), .-GL_PREFIX(GetQueryObjectui64vEXT)
+ .p2align 4,,15
+ .globl GL_PREFIX(BlitFramebufferEXT)
+ .type GL_PREFIX(BlitFramebufferEXT), @function
+GL_PREFIX(BlitFramebufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlitFramebufferEXT), .-GL_PREFIX(BlitFramebufferEXT)
+
.globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
.globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
.globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index de23b501b7..1a46e5567e 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -959,6 +959,7 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8)
GL_STUB(GetQueryObjecti64vEXT, _gloffset_GetQueryObjecti64vEXT, GetQueryObjecti64vEXT@12)
GL_STUB(GetQueryObjectui64vEXT, _gloffset_GetQueryObjectui64vEXT, GetQueryObjectui64vEXT@12)
+ GL_STUB(BlitFramebufferEXT, _gloffset_BlitFramebufferEXT, BlitFramebufferEXT@40)
GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c
index 0c9ffe25fa..82a18f012a 100644
--- a/src/mesa/x86/rtasm/x86sse.c
+++ b/src/mesa/x86/rtasm/x86sse.c
@@ -1,4 +1,4 @@
-#if defined(USE_X86_ASM)
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
#include "imports.h"
#include "x86sse.h"
@@ -85,10 +85,10 @@ static void emit_modrm( struct x86_function *p,
case mod_INDIRECT:
break;
case mod_DISP8:
- emit_1b(p, regmem.disp);
+ emit_1b(p, regmem.disp);
break;
case mod_DISP32:
- emit_1i(p, regmem.disp);
+ emit_1i(p, regmem.disp);
break;
default:
assert(0);
@@ -142,8 +142,8 @@ static void emit_op_modrm( struct x86_function *p,
/* Create and manipulate registers and regmem values:
*/
-struct x86_reg x86_make_reg( GLuint file,
- GLuint idx )
+struct x86_reg x86_make_reg( enum x86_reg_file file,
+ enum x86_reg_name idx )
{
struct x86_reg reg;
@@ -198,7 +198,7 @@ GLubyte *x86_get_label( struct x86_function *p )
void x86_jcc( struct x86_function *p,
- GLuint cc,
+ enum x86_cc cc,
GLubyte *label )
{
GLint offset = label - (x86_get_label(p) + 2);
@@ -217,11 +217,25 @@ void x86_jcc( struct x86_function *p,
/* Always use a 32bit offset for forward jumps:
*/
GLubyte *x86_jcc_forward( struct x86_function *p,
- GLuint cc )
+ enum x86_cc cc )
{
emit_2ub(p, 0x0f, 0x80 + cc);
emit_1i(p, 0);
return x86_get_label(p);
+}
+
+GLubyte *x86_jmp_forward( struct x86_function *p)
+{
+ emit_1ub(p, 0xe9);
+ emit_1i(p, 0);
+ return x86_get_label(p);
+}
+
+GLubyte *x86_call_forward( struct x86_function *p)
+{
+ emit_1ub(p, 0xe8);
+ emit_1i(p, 0);
+ return x86_get_label(p);
}
/* Fixup offset from forward jump:
@@ -230,6 +244,29 @@ void x86_fixup_fwd_jump( struct x86_function *p,
GLubyte *fixup )
{
*(int *)(fixup - 4) = x86_get_label(p) - fixup;
+}
+
+void x86_jmp( struct x86_function *p, GLubyte *label)
+{
+ emit_1ub(p, 0xe9);
+ emit_1i(p, label - x86_get_label(p) - 4);
+}
+
+void x86_call( struct x86_function *p, GLubyte *label)
+{
+ emit_1ub(p, 0xe8);
+ emit_1i(p, label - x86_get_label(p) - 4);
+}
+
+/* michal:
+ * Temporary. As I need immediate operands, and dont want to mess with the codegen,
+ * I load the immediate into general purpose register and use it.
+ */
+void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, GLint imm )
+{
+ assert(dst.mod == mod_REG);
+ emit_1ub(p, 0xb8 + dst.idx);
+ emit_1i(p, imm);
}
void x86_push( struct x86_function *p,
@@ -307,6 +344,27 @@ void x86_test( struct x86_function *p,
{
emit_1ub(p, 0x85);
emit_modrm( p, dst, src );
+}
+
+void x86_add( struct x86_function *p,
+ struct x86_reg dst,
+ struct x86_reg src )
+{
+ emit_op_modrm(p, 0x03, 0x01, dst, src );
+}
+
+void x86_mul( struct x86_function *p,
+ struct x86_reg src )
+{
+ assert (src.file == file_REG32 && src.mod == mod_REG);
+ emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src );
+}
+
+void x86_sub( struct x86_function *p,
+ struct x86_reg dst,
+ struct x86_reg src )
+{
+ emit_op_modrm(p, 0x2b, 0x29, dst, src );
}
@@ -971,8 +1029,13 @@ struct x86_reg x86_fn_arg( struct x86_function *p,
void x86_init_func( struct x86_function *p )
{
- p->store = _mesa_exec_malloc(1024);
- p->csr = p->store;
+ x86_init_func_size(p, 1024);
+}
+
+void x86_init_func_size( struct x86_function *p, GLuint code_size )
+{
+ p->store = _mesa_exec_malloc(code_size);
+ p->csr = p->store;
}
void x86_release_func( struct x86_function *p )
@@ -985,7 +1048,7 @@ void (*x86_get_func( struct x86_function *p ))(void)
{
if (DISASSEM)
_mesa_printf("disassemble %p %p\n", p->store, p->csr);
- return (void (*)())p->store;
+ return (void (*)(void))p->store;
}
#else
diff --git a/src/mesa/x86/rtasm/x86sse.h b/src/mesa/x86/rtasm/x86sse.h
index 611d01e1cb..55a98564af 100644
--- a/src/mesa/x86/rtasm/x86sse.h
+++ b/src/mesa/x86/rtasm/x86sse.h
@@ -2,7 +2,7 @@
#ifndef _X86SSE_H_
#define _X86SSE_H_
-#if defined(USE_X86_ASM)
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
#include "glheader.h"
@@ -80,7 +80,8 @@ enum sse_cc {
*/
-void x86_init_func( struct x86_function *p );
+void x86_init_func( struct x86_function *p );
+void x86_init_func_size( struct x86_function *p, GLuint code_size );
void x86_release_func( struct x86_function *p );
void (*x86_get_func( struct x86_function *p ))( void );
@@ -108,10 +109,24 @@ void x86_jcc( struct x86_function *p,
GLubyte *label );
GLubyte *x86_jcc_forward( struct x86_function *p,
- enum x86_cc cc );
+ enum x86_cc cc );
+
+GLubyte *x86_jmp_forward( struct x86_function *p);
+
+GLubyte *x86_call_forward( struct x86_function *p);
void x86_fixup_fwd_jump( struct x86_function *p,
- GLubyte *fixup );
+ GLubyte *fixup );
+
+void x86_jmp( struct x86_function *p, GLubyte *label );
+
+void x86_call( struct x86_function *p, GLubyte *label );
+
+/* michal:
+ * Temporary. As I need immediate operands, and dont want to mess with the codegen,
+ * I load the immediate into general purpose register and use it.
+ */
+void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, GLint imm );
/* Macro for sse_shufps() and sse2_pshufd():
@@ -153,15 +168,18 @@ void sse_mulps( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
void sse_subps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse_rsqrtss( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, GLubyte shuf );
-
+
+void x86_add( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_cmp( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_dec( struct x86_function *p, struct x86_reg reg );
void x86_inc( struct x86_function *p, struct x86_reg reg );
void x86_lea( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
-void x86_mov( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
+void x86_mov( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
+void x86_mul( struct x86_function *p, struct x86_reg src );
void x86_pop( struct x86_function *p, struct x86_reg reg );
void x86_push( struct x86_function *p, struct x86_reg reg );
-void x86_ret( struct x86_function *p );
+void x86_ret( struct x86_function *p );
+void x86_sub( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_test( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_xor( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_sahf( struct x86_function *p );