diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-01-31 05:36:33 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-01-31 05:36:33 +0000 |
commit | bee9964b29b2428ee75e2d1efc0e1d2c2518a417 (patch) | |
tree | fd733f886743b31f2ac2727e57f05d1a0918a977 /src/mesa | |
parent | 36a0819ff4ede1af91dcf909106cf20659856384 (diff) | |
parent | 12eb32e34244db9923cacaaed9ba951b7ac274a4 (diff) |
Merge remote branch 'origin/master' into lp-binning
Conflicts:
Makefile
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/llvmpipe/lp_flush.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_surface.c
src/gallium/drivers/llvmpipe/lp_tex_cache.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/llvmpipe/lp_tile_cache.c
src/mesa/state_tracker/st_cb_condrender.c
Diffstat (limited to 'src/mesa')
394 files changed, 22354 insertions, 8526 deletions
diff --git a/src/mesa/SConscript b/src/mesa/SConscript index bdcfffed4b..ea5bad2825 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -251,6 +251,7 @@ if env['platform'] != 'winddk': 'main/dispatch.c', 'glapi/glapi.c', 'glapi/glapi_getproc.c', + 'glapi/glapi_nop.c', 'glapi/glthread.c', ] diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 447f3d15b9..c152226902 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -400,7 +400,7 @@ # define READ_RGBA( rgba, _x, _y ) \ do { \ GLuint p = GET_VALUE(_x, _y); \ - *((uint32_t *) rgba) = (t << 8) | 0xff; \ + *((uint32_t *) rgba) = (p << 8) | 0xff; \ } while (0) # else # define READ_RGBA( rgba, _x, _y ) \ diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index b272eb74ea..81d026a697 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -34,7 +34,6 @@ #include "main/mtypes.h" #include "main/cpuinfo.h" #include "main/extensions.h" -#include "glapi/dispatch.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile index cf9b3a8556..848e2041e2 100644 --- a/src/mesa/drivers/dri/fb/Makefile +++ b/src/mesa/drivers/dri/fb/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = fb_dri.so -ifeq ($(USING_EGL), 1) -EGL_SOURCES = server/radeon_egl.c -endif DRIVER_SOURCES = \ fb_dri.c \ diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c deleted file mode 100644 index 02e44bb8ee..0000000000 --- a/src/mesa/drivers/dri/fb/fb_egl.c +++ /dev/null @@ -1,881 +0,0 @@ -/* - * Test egl driver for fb_dri.so - */ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <dirent.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <linux/fb.h> - -#include "utils.h" -#include "buffers.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/tcontext.h" -#include "tnl/t_pipeline.h" -#include "drivers/common/driverfuncs.h" -#include "drirenderbuffer.h" - -#include "eglconfig.h" -#include "eglmain/context.h" -#include "egldisplay.h" -#include "egldriver.h" -#include "eglglobals.h" -#include "eglmode.h" -#include "eglscreen.h" -#include "eglsurface.h" - -extern void -fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis); - -/** - * fb driver-specific driver class derived from _EGLDriver - */ -typedef struct fb_driver -{ - _EGLDriver Base; /* base class/object */ - GLuint fbStuff; -} fbDriver; - -/** - * fb display-specific driver class derived from _EGLDisplay - */ -typedef struct fb_display -{ - _EGLDisplay Base; /* base class/object */ - void *pFB; -} fbDisplay; - -/** - * fb driver-specific screen class derived from _EGLScreen - */ -typedef struct fb_screen -{ - _EGLScreen Base; - char fb[NAME_MAX]; -} fbScreen; - - -/** - * fb driver-specific surface class derived from _EGLSurface - */ -typedef struct fb_surface -{ - _EGLSurface Base; /* base class/object */ - struct gl_framebuffer *mesa_framebuffer; -} fbSurface; - - -/** - * fb driver-specific context class derived from _EGLContext - */ -typedef struct fb_context -{ - _EGLContext Base; /* base class/object */ - GLcontext *glCtx; - struct { - __DRIcontext *context; - __DRIscreen *screen; - __DRIdrawable *drawable; /* drawable bound to this ctx */ - } dri; -} fbContext, *fbContextPtr; - -#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx)) - - -static EGLBoolean -fbFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer) { - _EGLConfig *configs; - _EGLConfig *c; - unsigned int i, num_configs; - unsigned int depth_buffer_factor; - unsigned int back_buffer_factor; - GLenum fb_format; - GLenum fb_type; - - /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy - * enough to add support. Basically, if a context is created with an - * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping - * will never be used. - */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ - }; - - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; - - depth_bits_array[0] = 0; - depth_bits_array[1] = depth_bits; - - /* Just like with the accumulation buffer, always provide some modes - * with a stencil buffer. It will be a sw fallback, but some apps won't - * care about that. - */ - stencil_bits_array[0] = 0; - stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; - - depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; - back_buffer_factor = (have_back_buffer) ? 2 : 1; - - num_configs = depth_buffer_factor * back_buffer_factor * 2; - - if (pixel_bits == 16) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } else { - fb_format = GL_RGBA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - configs = calloc(sizeof(*configs), num_configs); - c = configs; - if (!_eglFillInConfigs(c, fb_format, fb_type, - depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_TRUE_COLOR)) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", - __func__, __LINE__); - return EGL_FALSE; - } - - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for (i = 0, c = configs; i < num_configs; i++, c++) { - int stencil = GET_CONFIG_ATTRIB(c, EGL_STENCIL_SIZE); - if ((stencil != 0) && (stencil != stencil_bits)) { - SET_CONFIG_ATTRIB(c, EGL_CONFIG_CAVEAT, EGL_SLOW_CONFIG); - } - } - - for (i = 0, c = configs; i < num_configs; i++, c++) - _eglAddConfig(disp, c); - - free(configs); - - return EGL_TRUE; -} - -static EGLBoolean -fbSetupFramebuffer(fbDisplay *disp, char *fbdev) -{ - int fd; - char dev[20]; - struct fb_var_screeninfo varInfo; - struct fb_fix_screeninfo fixedInfo; - - snprintf(dev, sizeof(dev), "/dev/%s", fbdev); - - /* open the framebuffer device */ - fd = open(dev, O_RDWR); - if (fd < 0) { - fprintf(stderr, "Error opening %s: %s\n", fbdev, strerror(errno)); - return EGL_FALSE; - } - - /* get the original variable screen info */ - if (ioctl(fd, FBIOGET_VSCREENINFO, &varInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - return EGL_FALSE; - } - - /* Turn off hw accels (otherwise mmap of mmio region will be - * refused) - */ - if (varInfo.accel_flags) { - varInfo.accel_flags = 0; - if (ioctl(fd, FBIOPUT_VSCREENINFO, &varInfo)) { - fprintf(stderr, "error: ioctl(FBIOPUT_VSCREENINFO) failed: %s\n", - strerror(errno)); - return EGL_FALSE; - } - } - - /* Get the fixed screen info */ - if (ioctl(fd, FBIOGET_FSCREENINFO, &fixedInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - return EGL_FALSE; - } - - if (fixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { - struct fb_cmap cmap; - unsigned short red[256], green[256], blue[256]; - int rcols = 1 << varInfo.red.length; - int gcols = 1 << varInfo.green.length; - int bcols = 1 << varInfo.blue.length; - int i; - - cmap.start = 0; - cmap.len = gcols; - cmap.red = red; - cmap.green = green; - cmap.blue = blue; - cmap.transp = NULL; - - for (i = 0; i < rcols ; i++) - red[i] = (65536/(rcols-1)) * i; - - for (i = 0; i < gcols ; i++) - green[i] = (65536/(gcols-1)) * i; - - for (i = 0; i < bcols ; i++) - blue[i] = (65536/(bcols-1)) * i; - - if (ioctl(fd, FBIOPUTCMAP, (void *) &cmap) < 0) { - fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); - exit(1); - } - } - - /* mmap the framebuffer into our address space */ - if (!disp->pFB) - disp->pFB = (caddr_t)mmap(0, /* start */ - fixedInfo.smem_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - fd, /* fd */ - 0); /* offset */ - if (disp->pFB == (caddr_t)-1) { - fprintf(stderr, "error: unable to mmap framebuffer: %s\n", - strerror(errno)); - return EGL_FALSE; - } - - return EGL_TRUE; -} - -const char *sysfs = "/sys/class/graphics"; - -static EGLBoolean -fbInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor) -{ - _EGLDisplay *disp = _eglLookupDisplay(dpy); - fbDisplay *display; - fbScreen *s; - _EGLScreen *scrn; - char c; - unsigned int x, y, r; - DIR *dir; - FILE *file; - struct dirent *dirent; - char path[NAME_MAX]; - - /* Switch display structure to one with our private fields */ - display = calloc(1, sizeof(*display)); - display->Base = *disp; - _eglHashInsert(_eglGlobal.Displays, disp->Handle, display); - free(disp); - - *major = 1; - *minor = 0; - - dir = opendir(sysfs); - if (!dir) { - printf("EGL - %s framebuffer device not found.", sysfs); - return EGL_FALSE; - } - - while ((dirent = readdir(dir))) { /* assignment! */ - - if (dirent->d_name[0] != 'f') - continue; - if (dirent->d_name[1] != 'b') - continue; - - if (fbSetupFramebuffer(display, dirent->d_name) == EGL_FALSE) - continue; - - /* Create a screen */ - s = (fbScreen *) calloc(1, sizeof(fbScreen)); - if (!s) - return EGL_FALSE; - - strncpy(s->fb, dirent->d_name, NAME_MAX); - scrn = &s->Base; - _eglInitScreen(scrn); - _eglAddScreen(&display->Base, scrn); - - snprintf(path, sizeof(path), "%s/%s/modes", sysfs, s->fb); - file = fopen(path, "r"); - while (fgets(path, sizeof(path), file)) { - sscanf(path, "%c:%ux%u-%u", &c, &x, &y, &r); - _eglAddMode(scrn, x, y, r * 1000, path); - } - fclose(file); - - fbFillInConfigs(&display->Base, 32, 24, 8, 1); - - } - closedir(dir); - - drv->Initialized = EGL_TRUE; - return EGL_TRUE; -} - - -static fbDisplay * -Lookup_fbDisplay(EGLDisplay dpy) -{ - _EGLDisplay *d = _eglLookupDisplay(dpy); - return (fbDisplay *) d; -} - - -static fbScreen * -Lookup_fbScreen(EGLDisplay dpy, EGLScreenMESA screen) -{ - _EGLScreen *s = _eglLookupScreen(dpy, screen); - return (fbScreen *) s; -} - - -static fbContext * -Lookup_fbContext(EGLContext ctx) -{ - _EGLContext *c = _eglLookupContext(ctx); - return (fbContext *) c; -} - - -static fbSurface * -Lookup_fbSurface(EGLSurface surf) -{ - _EGLSurface *s = _eglLookupSurface(surf); - return (fbSurface *) s; -} - - -static EGLBoolean -fbTerminate(_EGLDriver *drv, EGLDisplay dpy) -{ - fbDisplay *display = Lookup_fbDisplay(dpy); - _eglCleanupDisplay(&display->Base); - free(display); - free(drv); - return EGL_TRUE; -} - - -static const GLubyte * -get_string(GLcontext *ctx, GLenum pname) -{ - (void) ctx; - switch (pname) { - case GL_RENDERER: - return (const GLubyte *) "Mesa dumb framebuffer"; - default: - return NULL; - } -} - - -static void -update_state( GLcontext *ctx, GLuint new_state ) -{ - /* not much to do here - pass it on */ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); -} - - -/** - * Called by ctx->Driver.GetBufferSize from in core Mesa to query the - * current framebuffer size. - */ -static void -get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - *width = buffer->Width; - *height = buffer->Height; -} - - -static void -updateFramebufferSize(GLcontext *ctx) -{ - fbContextPtr fbmesa = FB_CONTEXT(ctx); - struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; - if (fbmesa->dri.drawable->w != fb->Width || - fbmesa->dri.drawable->h != fb->Height) { - driUpdateFramebufferSize(ctx, fbmesa->dri.drawable); - } -} - -static void -viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - /* XXX this should be called after we acquire the DRI lock, not here */ - updateFramebufferSize(ctx); -} - - -static void -init_core_functions( struct dd_function_table *functions ) -{ - functions->GetString = get_string; - functions->UpdateState = update_state; - functions->GetBufferSize = get_buffer_size; - functions->Viewport = viewport; - - functions->Clear = _swrast_Clear; /* could accelerate with blits */ -} - - -static EGLContext -fbCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) -{ - GLcontext *ctx; - _EGLConfig *conf; - fbContext *c; - _EGLDisplay *disp = _eglLookupDisplay(dpy); - struct dd_function_table functions; - GLvisual vis; - int i; - - conf = _eglLookupConfig(drv, dpy, config); - if (!conf) { - _eglError(EGL_BAD_CONFIG, "eglCreateContext"); - return EGL_NO_CONTEXT; - } - - for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { - switch (attrib_list[i]) { - /* no attribs defined for now */ - default: - _eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext"); - return EGL_NO_CONTEXT; - } - } - - c = (fbContext *) calloc(1, sizeof(fbContext)); - if (!c) - return EGL_NO_CONTEXT; - - _eglInitContext(&c->Base); - c->Base.Display = disp; - c->Base.Config = conf; - c->Base.DrawSurface = EGL_NO_SURFACE; - c->Base.ReadSurface = EGL_NO_SURFACE; - - /* link to display */ - _eglLinkContext(&c->Base, disp); - assert(c->Base.Handle); - - /* Init default driver functions then plug in our FBdev-specific functions - */ - _mesa_init_driver_functions(&functions); - init_core_functions(&functions); - - _eglConfigToContextModesRec(conf, &vis); - - ctx = c->glCtx = _mesa_create_context(&vis, NULL, &functions, (void *)c); - if (!c->glCtx) { - _mesa_free(c); - return GL_FALSE; - } - - /* Create module contexts */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - _swsetup_Wakeup( ctx ); - - - /* use default TCL pipeline */ - { - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - } - - _mesa_enable_sw_extensions(ctx); - - return c->Base.Handle; -} - - -static EGLSurface -fbCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list) -{ - int i; - for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { - switch (attrib_list[i]) { - /* no attribs at this time */ - default: - _eglError(EGL_BAD_ATTRIBUTE, "eglCreateWindowSurface"); - return EGL_NO_SURFACE; - } - } - printf("eglCreateWindowSurface()\n"); - /* XXX unfinished */ - - return EGL_NO_SURFACE; -} - - -static EGLSurface -fbCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list) -{ - _EGLConfig *conf; - EGLint i; - - conf = _eglLookupConfig(drv, dpy, config); - if (!conf) { - _eglError(EGL_BAD_CONFIG, "eglCreatePixmapSurface"); - return EGL_NO_SURFACE; - } - - for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { - switch (attrib_list[i]) { - /* no attribs at this time */ - default: - _eglError(EGL_BAD_ATTRIBUTE, "eglCreatePixmapSurface"); - return EGL_NO_SURFACE; - } - } - - if (conf->Attrib[EGL_SURFACE_TYPE - FIRST_ATTRIB] == 0) { - _eglError(EGL_BAD_MATCH, "eglCreatePixmapSurface"); - return EGL_NO_SURFACE; - } - - printf("eglCreatePixmapSurface()\n"); - return EGL_NO_SURFACE; -} - - -static EGLSurface -fbCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) -{ - fbSurface *surf; - - surf = (fbSurface *) calloc(1, sizeof(fbSurface)); - if (!surf) { - return EGL_NO_SURFACE; - } - - if (_eglInitPbufferSurface(&surf->Base, drv, dpy, config, attrib_list) == EGL_NO_SURFACE) { - free(surf); - return EGL_NO_SURFACE; - } - - /* create software-based pbuffer */ - { - GLcontext *ctx = NULL; /* this _should_ be OK */ - GLvisual vis; - _EGLConfig *conf = _eglLookupConfig(drv, dpy, config); - assert(conf); /* bad config should be caught earlier */ - _eglConfigToContextModesRec(conf, &vis); - - surf->mesa_framebuffer = _mesa_create_framebuffer(&vis); - _mesa_add_soft_renderbuffers(surf->mesa_framebuffer, - GL_TRUE, /* color bufs */ - vis.haveDepthBuffer, - vis.haveStencilBuffer, - vis.haveAccumBuffer, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */ ); - - /* set pbuffer/framebuffer size */ - _mesa_resize_framebuffer(ctx, surf->mesa_framebuffer, - surf->Base.Width, surf->Base.Height); - } - - return surf->Base.Handle; -} - - -static EGLBoolean -fbDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface) -{ - fbSurface *fs = Lookup_fbSurface(surface); - _eglUnlinkSurface(&fs->Base); - if (!_eglIsSurfaceBound(&fs->Base)) - free(fs); - return EGL_TRUE; -} - - -static EGLBoolean -fbDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context) -{ - fbContext *fc = Lookup_fbContext(context); - _eglUnlinkContext(&fc->Base); - if (!_eglIsContextBound(&fc->Base)) - free(fc); - return EGL_TRUE; -} - - -static EGLBoolean -fbMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context) -{ - fbSurface *readSurf = Lookup_fbSurface(read); - fbSurface *drawSurf = Lookup_fbSurface(draw); - fbContext *ctx = Lookup_fbContext(context); - EGLBoolean b; - - b = _eglMakeCurrent(drv, dpy, draw, read, context); - if (!b) - return EGL_FALSE; - - if (ctx) { - _mesa_make_current( ctx->glCtx, - drawSurf->mesa_framebuffer, - readSurf->mesa_framebuffer); - } else - _mesa_make_current( NULL, NULL, NULL ); - - return EGL_TRUE; -} - - -/** - * Create a drawing surface which can be directly displayed on a screen. - */ -static EGLSurface -fbCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg, - const EGLint *attrib_list) -{ - _EGLConfig *config = _eglLookupConfig(drv, dpy, cfg); - fbDisplay *display = Lookup_fbDisplay(dpy); - fbSurface *surface; - EGLSurface surf; - GLvisual vis; - GLcontext *ctx = NULL; /* this should be OK */ - int origin, bytesPerPixel; - int width, height, stride; - - surface = (fbSurface *) malloc(sizeof(*surface)); - if (!surface) { - return EGL_NO_SURFACE; - } - - /* init base class, error check, etc. */ - surf = _eglInitScreenSurface(&surface->Base, drv, dpy, cfg, attrib_list); - if (surf == EGL_NO_SURFACE) { - free(surface); - return EGL_NO_SURFACE; - } - - /* convert EGLConfig to GLvisual */ - _eglConfigToContextModesRec(config, &vis); - - /* create Mesa framebuffer */ - surface->mesa_framebuffer = _mesa_create_framebuffer(&vis); - if (!surface->mesa_framebuffer) { - free(surface); - _eglUnlinkSurface(&surface->Base); - return EGL_NO_SURFACE; - } - - width = surface->Base.Width; - height = surface->Base.Height; - bytesPerPixel = vis.rgbBits / 8; - stride = width * bytesPerPixel; - origin = 0; - - /* front color renderbuffer */ - { - driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, display->pFB, - bytesPerPixel, - origin, stride, NULL); - fbSetSpanFunctions(drb, &vis); - _mesa_add_renderbuffer(surface->mesa_framebuffer, - BUFFER_FRONT_LEFT, &drb->Base); - } - - /* back color renderbuffer */ - if (vis.doubleBufferMode) { - GLubyte *backBuf = _mesa_malloc(stride * height); - driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, backBuf, - bytesPerPixel, - origin, stride, NULL); - fbSetSpanFunctions(drb, &vis); - _mesa_add_renderbuffer(surface->mesa_framebuffer, - BUFFER_BACK_LEFT, &drb->Base); - } - - /* other renderbuffers- software based */ - _mesa_add_soft_renderbuffers(surface->mesa_framebuffer, - GL_FALSE, /* color */ - vis.haveDepthBuffer, - vis.haveStencilBuffer, - vis.haveAccumBuffer, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - - _mesa_resize_framebuffer(ctx, surface->mesa_framebuffer, width, height); - - return surf; -} - - -/** - * Show the given surface on the named screen. - * If surface is EGL_NO_SURFACE, disable the screen's output. - */ -static EGLBoolean -fbShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, - EGLSurface surface, EGLModeMESA m) -{ - fbDisplay *display = Lookup_fbDisplay(dpy); - fbScreen *scrn = Lookup_fbScreen(dpy, screen); - fbSurface *surf = Lookup_fbSurface(surface); - FILE *file; - char buffer[NAME_MAX]; - _EGLMode *mode = _eglLookupMode(dpy, m); - int bits; - - if (!_eglShowSurfaceMESA(drv, dpy, screen, surface, m)) - return EGL_FALSE; - - snprintf(buffer, sizeof(buffer), "%s/%s/blank", sysfs, scrn->fb); - - file = fopen(buffer, "r+"); - if (!file) { -err: - printf("chown all fb sysfs attrib to allow write - %s\n", buffer); - return EGL_FALSE; - } - snprintf(buffer, sizeof(buffer), "%d", (m == EGL_NO_MODE_MESA ? VESA_POWERDOWN : VESA_VSYNC_SUSPEND)); - fputs(buffer, file); - fclose(file); - - if (m == EGL_NO_MODE_MESA) - return EGL_TRUE; - - snprintf(buffer, sizeof(buffer), "%s/%s/mode", sysfs, scrn->fb); - - file = fopen(buffer, "r+"); - if (!file) - goto err; - fputs(mode->Name, file); - fclose(file); - - snprintf(buffer, sizeof(buffer), "%s/%s/bits_per_pixel", sysfs, scrn->fb); - - file = fopen(buffer, "r+"); - if (!file) - goto err; - bits = GET_CONFIG_ATTRIB(surf->Base.Config, EGL_BUFFER_SIZE); - snprintf(buffer, sizeof(buffer), "%d", bits); - fputs(buffer, file); - fclose(file); - - fbSetupFramebuffer(display, scrn->fb); - - snprintf(buffer, sizeof(buffer), "%s/%s/blank", sysfs, scrn->fb); - - file = fopen(buffer, "r+"); - if (!file) - goto err; - - snprintf(buffer, sizeof(buffer), "%d", VESA_NO_BLANKING); - fputs(buffer, file); - fclose(file); - - return EGL_TRUE; -} - - -/* If the backbuffer is on a videocard, this is extraordinarily slow! - */ -static EGLBoolean -fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw) -{ - fbContext *context = (fbContext *)_eglGetCurrentContext(); - fbSurface *fs = Lookup_fbSurface(draw); - struct gl_renderbuffer * front_renderbuffer = fs->mesa_framebuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; - void *frontBuffer = front_renderbuffer->Data; - int currentPitch = ((driRenderbuffer *)front_renderbuffer)->pitch; - void *backBuffer = fs->mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data; - - if (!_eglSwapBuffers(drv, dpy, draw)) - return EGL_FALSE; - - if (context) { - GLcontext *ctx = context->glCtx; - - if (ctx->Visual.doubleBufferMode) { - int i; - int offset = 0; - char *tmp = _mesa_malloc(currentPitch); - - _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ - - ASSERT(frontBuffer); - ASSERT(backBuffer); - - for (i = 0; i < fs->Base.Height; i++) { - _mesa_memcpy(tmp, (char *) backBuffer + offset, - currentPitch); - _mesa_memcpy((char *) frontBuffer + offset, tmp, - currentPitch); - offset += currentPitch; - } - - _mesa_free(tmp); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n"); - return EGL_FALSE; - } - return EGL_TRUE; -} - - -/** - * The bootstrap function. Return a new fbDriver object and - * plug in API functions. - */ -_EGLDriver * -_eglMain(_EGLDisplay *dpy) -{ - fbDriver *fb; - - fb = (fbDriver *) calloc(1, sizeof(fbDriver)); - if (!fb) { - return NULL; - } - - /* First fill in the dispatch table with defaults */ - _eglInitDriverFallbacks(&fb->Base); - - /* then plug in our fb-specific functions */ - fb->Base.Initialize = fbInitialize; - fb->Base.Terminate = fbTerminate; - fb->Base.CreateContext = fbCreateContext; - fb->Base.MakeCurrent = fbMakeCurrent; - fb->Base.CreateWindowSurface = fbCreateWindowSurface; - fb->Base.CreatePixmapSurface = fbCreatePixmapSurface; - fb->Base.CreatePbufferSurface = fbCreatePbufferSurface; - fb->Base.DestroySurface = fbDestroySurface; - fb->Base.DestroyContext = fbDestroyContext; - fb->Base.CreateScreenSurfaceMESA = fbCreateScreenSurfaceMESA; - fb->Base.ShowSurfaceMESA = fbShowSurfaceMESA; - fb->Base.SwapBuffers = fbSwapBuffers; - - /* enable supported extensions */ - fb->Base.MESA_screen_surface = EGL_TRUE; - fb->Base.MESA_copy_context = EGL_TRUE; - - return &fb->Base; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.c b/src/mesa/drivers/dri/ffb/ffb_bitmap.c index 611afddfaf..b71a552c9d 100644 --- a/src/mesa/drivers/dri/ffb/ffb_bitmap.c +++ b/src/mesa/drivers/dri/ffb/ffb_bitmap.c @@ -30,7 +30,6 @@ #include "ffb_lock.h" #include "ffb_bitmap.h" #include "swrast/swrast.h" -#include "main/image.h" #include "main/macros.h" /* Compute ceiling of integer quotient of A divided by B: */ diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c index dfe60f36f2..aa3fa0a86c 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ b/src/mesa/drivers/dri/ffb/ffb_clear.c @@ -26,15 +26,12 @@ */ #include "main/mtypes.h" -#include "main/extensions.h" #include "main/mm.h" #include "ffb_dd.h" #include "ffb_span.h" -#include "ffb_depth.h" #include "ffb_context.h" #include "ffb_vb.h" -#include "ffb_tris.h" #include "ffb_clear.h" #include "ffb_lock.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.c b/src/mesa/drivers/dri/ffb/ffb_dd.c index cf83b91f0d..91b6d3153a 100644 --- a/src/mesa/drivers/dri/ffb/ffb_dd.c +++ b/src/mesa/drivers/dri/ffb/ffb_dd.c @@ -27,13 +27,9 @@ #include "main/mtypes.h" #include "main/mm.h" -#include "main/extensions.h" #include "ffb_dd.h" #include "ffb_span.h" -#include "ffb_depth.h" #include "ffb_context.h" -#include "ffb_vb.h" -#include "ffb_tris.h" #include "ffb_clear.h" #include "ffb_lock.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.c b/src/mesa/drivers/dri/ffb/ffb_depth.c index 5d509ff696..d19385b776 100644 --- a/src/mesa/drivers/dri/ffb/ffb_depth.c +++ b/src/mesa/drivers/dri/ffb/ffb_depth.c @@ -26,7 +26,6 @@ */ #include "main/mtypes.h" -#include "swrast/swrast.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_context.h" diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.c b/src/mesa/drivers/dri/ffb/ffb_lines.c index 19dff50935..6dca4edd29 100644 --- a/src/mesa/drivers/dri/ffb/ffb_lines.c +++ b/src/mesa/drivers/dri/ffb/ffb_lines.c @@ -27,15 +27,11 @@ #include "main/mtypes.h" #include "main/mm.h" -#include "main/extensions.h" #include "ffb_dd.h" #include "ffb_span.h" -#include "ffb_depth.h" #include "ffb_context.h" #include "ffb_vb.h" #include "ffb_lines.h" -#include "ffb_tris.h" -#include "ffb_lock.h" #undef FFB_LINE_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_points.c b/src/mesa/drivers/dri/ffb/ffb_points.c index 9c37a47aeb..5bf4f8f070 100644 --- a/src/mesa/drivers/dri/ffb/ffb_points.c +++ b/src/mesa/drivers/dri/ffb/ffb_points.c @@ -30,8 +30,6 @@ #include "ffb_context.h" #include "ffb_vb.h" #include "ffb_points.h" -#include "ffb_tris.h" -#include "ffb_lock.h" #undef FFB_POINT_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_span.c b/src/mesa/drivers/dri/ffb/ffb_span.c index 8ec33a11bc..61901cccad 100644 --- a/src/mesa/drivers/dri/ffb/ffb_span.c +++ b/src/mesa/drivers/dri/ffb/ffb_span.c @@ -31,8 +31,6 @@ #include "ffb_context.h" #include "ffb_lock.h" -#include "swrast/swrast.h" - #define DBG 0 #define HW_LOCK() \ diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c index 6f8a46d1fc..c09d2fef83 100644 --- a/src/mesa/drivers/dri/ffb/ffb_state.c +++ b/src/mesa/drivers/dri/ffb/ffb_state.c @@ -27,8 +27,6 @@ #include "main/mtypes.h" #include "main/colormac.h" -#include "main/mm.h" -#include "main/extensions.h" #include "main/enums.h" #include "vbo/vbo.h" @@ -39,12 +37,9 @@ #include "ffb_dd.h" #include "ffb_span.h" -#include "ffb_depth.h" #include "ffb_context.h" -#include "ffb_vb.h" #include "ffb_tris.h" #include "ffb_state.h" -#include "ffb_lock.h" #undef STATE_TRACE diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.c b/src/mesa/drivers/dri/ffb/ffb_stencil.c index ce8ef43c91..10cdfbc616 100644 --- a/src/mesa/drivers/dri/ffb/ffb_stencil.c +++ b/src/mesa/drivers/dri/ffb/ffb_stencil.c @@ -32,8 +32,6 @@ #include "ffb_stencil.h" #include "ffb_lock.h" -#include "swrast/swrast.h" - #undef STENCIL_TRACE static void FFBWriteStencilSpan( GLcontext *ctx, diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c index f9c6fd1f31..ca8ffb2721 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vb.c +++ b/src/mesa/drivers/dri/ffb/ffb_vb.c @@ -30,8 +30,6 @@ #include "ffb_vb.h" #include "main/imports.h" #include "tnl/t_context.h" -#include "swrast_setup/swrast_setup.h" -#include "math/m_translate.h" #undef VB_DEBUG diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 88285f454e..6a84651479 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -28,7 +28,6 @@ #include "ffb_xmesa.h" #include "main/context.h" #include "main/framebuffer.h" -#include "main/matrix.h" #include "main/renderbuffer.h" #include "main/simple_list.h" #include "main/imports.h" @@ -52,7 +51,6 @@ #include "ffb_lines.h" #include "ffb_points.h" #include "ffb_state.h" -#include "ffb_tex.h" #include "ffb_lock.h" #include "ffb_vtxfmt.h" #include "ffb_bitmap.h" diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index bd9cfe5c0f..34e34606b4 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -34,10 +34,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/glheader.h" #include "main/context.h" -#include "main/matrix.h" #include "main/simple_list.h" -#include "main/extensions.h" -#include "main/framebuffer.h" #include "main/imports.h" #include "main/points.h" diff --git a/src/mesa/drivers/dri/i810/i810render.c b/src/mesa/drivers/dri/i810/i810render.c index 1d98e00688..b543d4f012 100644 --- a/src/mesa/drivers/dri/i810/i810render.c +++ b/src/mesa/drivers/dri/i810/i810render.c @@ -44,7 +44,6 @@ #include "i810context.h" #include "i810tris.h" -#include "i810state.h" #include "i810vb.h" #include "i810ioctl.h" diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 2a30782afd..476c801358 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -36,8 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/imports.h" #include "main/context.h" #include "main/framebuffer.h" -#include "main/fbobject.h" -#include "main/matrix.h" #include "main/renderbuffer.h" #include "main/simple_list.h" #include "utils.h" @@ -48,8 +46,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i810state.h" #include "i810tex.h" #include "i810span.h" -#include "i810tris.h" -#include "i810ioctl.h" #include "GL/internal/dri_interface.h" diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 642245c61c..0c68e120b0 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -20,8 +20,6 @@ #include "i810context.h" #include "i810state.h" #include "i810tex.h" -#include "i810vb.h" -#include "i810tris.h" #include "i810ioctl.h" diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index e764644a6c..2ccb9562e9 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -33,7 +33,6 @@ #include "main/colormac.h" #include "main/texobj.h" #include "main/mm.h" -#include "swrast/swrast.h" #include "texmem.h" @@ -42,7 +41,6 @@ #include "i810context.h" #include "i810tex.h" -#include "i810state.h" #include "i810ioctl.h" diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index d93afbf9ef..bb426a4112 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -35,7 +35,6 @@ #include "i810_dri.h" #include "i810context.h" #include "i810tex.h" -#include "i810state.h" #include "i810ioctl.h" diff --git a/src/mesa/drivers/dri/i810/i810vb.c b/src/mesa/drivers/dri/i810/i810vb.c index 30890dc9b7..09a772258c 100644 --- a/src/mesa/drivers/dri/i810/i810vb.c +++ b/src/mesa/drivers/dri/i810/i810vb.c @@ -38,7 +38,6 @@ #include "i810context.h" #include "i810vb.h" #include "i810ioctl.h" -#include "i810tris.h" #include "i810state.h" diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index cf32476f40..dc15ae425c 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -8,7 +8,6 @@ MINIGLX_SOURCES = server/intel_dri.c DRIVER_SOURCES = \ i830_context.c \ - i830_metaops.c \ i830_state.c \ i830_texblend.c \ i830_texstate.c \ @@ -40,7 +39,6 @@ DRIVER_SOURCES = \ i915_debug.c \ i915_debug_fp.c \ i915_fragprog.c \ - i915_metaops.c \ i915_program.c \ i915_state.c \ i915_vtbl.c \ diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 4cb6305988..ebe8b15ca7 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -28,14 +28,11 @@ #include "i830_context.h" #include "main/imports.h" #include "texmem.h" -#include "intel_tex.h" #include "tnl/tnl.h" #include "tnl/t_vertex.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" -#include "utils.h" #include "intel_span.h" -#include "intel_pixel.h" #include "intel_tris.h" /*************************************** @@ -108,7 +105,6 @@ i830CreateContext(const __GLcontextModes * mesaVis, intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf; i830InitState(i830); - i830InitMetaFuncs(i830); _tnl_allow_vertex_fog(ctx, 1); _tnl_allow_pixel_fog(ctx, 0); diff --git a/src/mesa/drivers/dri/i915/i830_context.h b/src/mesa/drivers/dri/i915/i830_context.h index 592ae53976..b755d48678 100644 --- a/src/mesa/drivers/dri/i915/i830_context.h +++ b/src/mesa/drivers/dri/i915/i830_context.h @@ -144,7 +144,7 @@ struct i830_context GLuint lodbias_tm0s3[MAX_TEXTURE_UNITS]; DECLARE_RENDERINPUTS(last_index_bitset); - struct i830_hw_state meta, initial, state, *current; + struct i830_hw_state state; }; @@ -206,10 +206,6 @@ extern void i830EmitState(struct i830_context *i830); extern void i830InitState(struct i830_context *i830); extern void i830_update_provoking_vertex(GLcontext *ctx); -/* i830_metaops.c - */ -extern void i830InitMetaFuncs(struct i830_context *i830); - /*====================================================================== * Inline conversion functions. These are better-typed than the * macros used previously: diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c deleted file mode 100644 index 2cce661c86..0000000000 --- a/src/mesa/drivers/dri/i915/i830_metaops.c +++ /dev/null @@ -1,456 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, 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 TUNGSTEN GRAPHICS 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. - * - **************************************************************************/ - -#include "main/glheader.h" -#include "main/enums.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "utils.h" - -#include "intel_screen.h" -#include "intel_batchbuffer.h" -#include "intel_regions.h" - -#include "i830_context.h" -#include "i830_reg.h" - -/* A large amount of state doesn't need to be uploaded. - */ -#define ACTIVE (I830_UPLOAD_INVARIENT | \ - I830_UPLOAD_CTX | \ - I830_UPLOAD_BUFFERS | \ - I830_UPLOAD_STIPPLE | \ - I830_UPLOAD_TEXBLEND(0) | \ - I830_UPLOAD_TEX(0)) - - -#define SET_STATE( i830, STATE ) \ -do { \ - i830->current->emitted &= ~ACTIVE; \ - i830->current = &i830->STATE; \ - i830->current->emitted &= ~ACTIVE; \ -} while (0) - - -static void -set_no_stencil_write(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE ) - */ - i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE; - i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE; - - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - -static void -set_no_depth_write(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) - */ - i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; - i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE; - - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - -/* Set depth unit to replace. - */ -static void -set_depth_replace(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) - * ctx->Driver.DepthMask( ctx, GL_TRUE ) - */ - i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; - i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE; - - /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS ) - */ - i830->meta.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK; - i830->meta.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC | - DEPTH_TEST_FUNC - (COMPAREFUNC_ALWAYS)); - - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - - -/* Set stencil unit to replace always with the reference value. - */ -static void -set_stencil_replace(struct intel_context *intel, - GLuint s_mask, GLuint s_clear) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE ) - */ - i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE; - - /* ctx->Driver.StencilMask( ctx, s_mask ) - */ - i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; - i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | - STENCIL_WRITE_MASK((s_mask & - 0xff))); - - /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE ) - */ - i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK); - i830->meta.Ctx[I830_CTXREG_STENCILTST] |= - (ENABLE_STENCIL_PARMS | - STENCIL_FAIL_OP(STENCILOP_REPLACE) | - STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) | - STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE)); - - /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_clear, ~0 ) - */ - i830->meta.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; - i830->meta.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | - STENCIL_TEST_MASK(0xff)); - - i830->meta.Ctx[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK | - ENABLE_STENCIL_TEST_FUNC_MASK); - i830->meta.Ctx[I830_CTXREG_STENCILTST] |= - (ENABLE_STENCIL_REF_VALUE | - ENABLE_STENCIL_TEST_FUNC | - STENCIL_REF_VALUE((s_clear & 0xff)) | - STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS)); - - - - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - - -static void -set_color_mask(struct intel_context *intel, GLboolean state) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - const GLuint mask = ((1 << WRITEMASK_RED_SHIFT) | - (1 << WRITEMASK_GREEN_SHIFT) | - (1 << WRITEMASK_BLUE_SHIFT) | - (1 << WRITEMASK_ALPHA_SHIFT)); - - i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~mask; - - if (state) { - i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= - (i830->state.Ctx[I830_CTXREG_ENABLES_2] & mask); - } - - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - -/* Installs a one-stage passthrough texture blend pipeline. Is there - * more that can be done to turn off texturing? - */ -static void -set_no_texture(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - static const struct gl_tex_env_combine_state comb = { - GL_NONE, GL_NONE, - {GL_TEXTURE, 0, 0,}, {GL_TEXTURE, 0, 0,}, - {GL_SRC_COLOR, 0, 0}, {GL_SRC_ALPHA, 0, 0}, - 0, 0, 0, 0 - }; - - i830->meta.TexBlendWordsUsed[0] = - i830SetTexEnvCombine(i830, &comb, 0, TEXBLENDARG_TEXEL0, - i830->meta.TexBlend[0], NULL); - - i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE; - i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0); -} - -/* Set up a single element blend stage for 'replace' texturing with no - * funny ops. - */ -static void -set_texture_blend_replace(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - static const struct gl_tex_env_combine_state comb = { - GL_REPLACE, GL_REPLACE, - {GL_TEXTURE, GL_TEXTURE, GL_TEXTURE,}, {GL_TEXTURE, GL_TEXTURE, - GL_TEXTURE,}, - {GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_COLOR}, {GL_SRC_ALPHA, GL_SRC_ALPHA, - GL_SRC_ALPHA}, - 0, 0, 1, 1 - }; - - i830->meta.TexBlendWordsUsed[0] = - i830SetTexEnvCombine(i830, &comb, 0, TEXBLENDARG_TEXEL0, - i830->meta.TexBlend[0], NULL); - - i830->meta.TexBlend[0][0] |= TEXOP_LAST_STAGE; - i830->meta.emitted &= ~I830_UPLOAD_TEXBLEND(0); - -/* fprintf(stderr, "%s: TexBlendWordsUsed[0]: %d\n", */ -/* __FUNCTION__, i830->meta.TexBlendWordsUsed[0]); */ -} - - - -/* Set up an arbitary piece of memory as a rectangular texture - * (including the front or back buffer). - */ -static GLboolean -set_tex_rect_source(struct intel_context *intel, - dri_bo *buffer, - GLuint offset, - GLuint pitch, GLuint height, GLenum format, GLenum type) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - GLuint *setup = i830->meta.Tex[0]; - GLint numLevels = 1; - GLuint textureFormat; - GLuint cpp; - - /* A full implementation of this would do the upload through - * glTexImage2d, and get all the conversion operations at that - * point. We are restricted, but still at least have access to the - * fragment program swizzle. - */ - switch (format) { - case GL_BGRA: - switch (type) { - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_BYTE: - textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888); - cpp = 4; - break; - default: - return GL_FALSE; - } - break; - case GL_RGBA: - switch (type) { - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_BYTE: - textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888); - cpp = 4; - break; - default: - return GL_FALSE; - } - break; - case GL_BGR: - switch (type) { - case GL_UNSIGNED_SHORT_5_6_5_REV: - textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); - cpp = 2; - break; - default: - return GL_FALSE; - } - break; - case GL_RGB: - switch (type) { - case GL_UNSIGNED_SHORT_5_6_5: - textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); - cpp = 2; - break; - default: - return GL_FALSE; - } - break; - - default: - return GL_FALSE; - } - - i830->meta.tex_buffer[0] = buffer; - i830->meta.tex_offset[0] = offset; - - setup[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 | - (LOAD_TEXTURE_MAP0 << 0) | 4); - setup[I830_TEXREG_TM0S1] = (((height - 1) << TM0S1_HEIGHT_SHIFT) | - ((pitch - 1) << TM0S1_WIDTH_SHIFT) | - textureFormat); - setup[I830_TEXREG_TM0S2] = - (((((pitch * cpp) / 4) - - 1) << TM0S2_PITCH_SHIFT) | TM0S2_CUBE_FACE_ENA_MASK); - - setup[I830_TEXREG_TM0S3] = - ((((numLevels - - 1) * - 4) << TM0S3_MIN_MIP_SHIFT) | (FILTER_NEAREST << - TM0S3_MIN_FILTER_SHIFT) | - (MIPFILTER_NONE << TM0S3_MIP_FILTER_SHIFT) | (FILTER_NEAREST << - TM0S3_MAG_FILTER_SHIFT)); - - setup[I830_TEXREG_CUBE] = (_3DSTATE_MAP_CUBE | MAP_UNIT(0)); - - setup[I830_TEXREG_MCS] = (_3DSTATE_MAP_COORD_SET_CMD | - MAP_UNIT(0) | - ENABLE_TEXCOORD_PARAMS | - TEXCOORDS_ARE_IN_TEXELUNITS | - TEXCOORDTYPE_CARTESIAN | - ENABLE_ADDR_V_CNTL | - TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) | - ENABLE_ADDR_U_CNTL | - TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP)); - - i830->meta.emitted &= ~I830_UPLOAD_TEX(0); - return GL_TRUE; -} - - -static void -set_vertex_format(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - i830->meta.Ctx[I830_CTXREG_VF] = (_3DSTATE_VFT0_CMD | - VFT0_TEX_COUNT(1) | - VFT0_DIFFUSE | VFT0_XYZ); - i830->meta.Ctx[I830_CTXREG_VF2] = (_3DSTATE_VFT1_CMD | - VFT1_TEX0_FMT(TEXCOORDFMT_2D) | - VFT1_TEX1_FMT(TEXCOORDFMT_2D) | - VFT1_TEX2_FMT(TEXCOORDFMT_2D) | - VFT1_TEX3_FMT(TEXCOORDFMT_2D)); - i830->meta.emitted &= ~I830_UPLOAD_CTX; -} - - -static void -meta_import_pixel_state(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - i830->meta.Ctx[I830_CTXREG_STATE1] = i830->state.Ctx[I830_CTXREG_STATE1]; - i830->meta.Ctx[I830_CTXREG_STATE2] = i830->state.Ctx[I830_CTXREG_STATE2]; - i830->meta.Ctx[I830_CTXREG_STATE3] = i830->state.Ctx[I830_CTXREG_STATE3]; - i830->meta.Ctx[I830_CTXREG_STATE4] = i830->state.Ctx[I830_CTXREG_STATE4]; - i830->meta.Ctx[I830_CTXREG_STATE5] = i830->state.Ctx[I830_CTXREG_STATE5]; - i830->meta.Ctx[I830_CTXREG_IALPHAB] = i830->state.Ctx[I830_CTXREG_IALPHAB]; - i830->meta.Ctx[I830_CTXREG_STENCILTST] = - i830->state.Ctx[I830_CTXREG_STENCILTST]; - i830->meta.Ctx[I830_CTXREG_ENABLES_1] = - i830->state.Ctx[I830_CTXREG_ENABLES_1]; - i830->meta.Ctx[I830_CTXREG_ENABLES_2] = - i830->state.Ctx[I830_CTXREG_ENABLES_2]; - i830->meta.Ctx[I830_CTXREG_AA] = i830->state.Ctx[I830_CTXREG_AA]; - i830->meta.Ctx[I830_CTXREG_FOGCOLOR] = - i830->state.Ctx[I830_CTXREG_FOGCOLOR]; - i830->meta.Ctx[I830_CTXREG_BLENDCOLOR0] = - i830->state.Ctx[I830_CTXREG_BLENDCOLOR0]; - i830->meta.Ctx[I830_CTXREG_BLENDCOLOR1] = - i830->state.Ctx[I830_CTXREG_BLENDCOLOR1]; - i830->meta.Ctx[I830_CTXREG_MCSB0] = i830->state.Ctx[I830_CTXREG_MCSB0]; - i830->meta.Ctx[I830_CTXREG_MCSB1] = i830->state.Ctx[I830_CTXREG_MCSB1]; - - - i830->meta.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK; - i830->meta.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE; - i830->meta.emitted &= ~I830_UPLOAD_CTX; - - - i830->meta.Buffer[I830_DESTREG_SENABLE] = - i830->state.Buffer[I830_DESTREG_SENABLE]; - i830->meta.Buffer[I830_DESTREG_SR1] = i830->state.Buffer[I830_DESTREG_SR1]; - i830->meta.Buffer[I830_DESTREG_SR2] = i830->state.Buffer[I830_DESTREG_SR2]; - i830->meta.emitted &= ~I830_UPLOAD_BUFFERS; -} - - - -/* Select between front and back draw buffers. - */ -static void -meta_draw_region(struct intel_context *intel, - struct intel_region *color_region, - struct intel_region *depth_region) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - - i830_state_draw_region(intel, &i830->meta, color_region, depth_region); -} - - -/* Operations where the 3D engine is decoupled temporarily from the - * current GL state and used for other purposes than simply rendering - * incoming triangles. - */ -static void -install_meta_state(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - memcpy(&i830->meta, &i830->initial, sizeof(i830->meta)); - - i830->meta.active = ACTIVE; - i830->meta.emitted = 0; - - SET_STATE(i830, meta); - set_vertex_format(intel); - set_no_texture(intel); -} - -static void -leave_meta_state(struct intel_context *intel) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - intel_region_release(&i830->meta.draw_region); - intel_region_release(&i830->meta.depth_region); -/* intel_region_release(intel, &i830->meta.tex_region[0]); */ - SET_STATE(i830, state); -} - - - -void -i830InitMetaFuncs(struct i830_context *i830) -{ - i830->intel.vtbl.install_meta_state = install_meta_state; - i830->intel.vtbl.leave_meta_state = leave_meta_state; - i830->intel.vtbl.meta_no_depth_write = set_no_depth_write; - i830->intel.vtbl.meta_no_stencil_write = set_no_stencil_write; - i830->intel.vtbl.meta_stencil_replace = set_stencil_replace; - i830->intel.vtbl.meta_depth_replace = set_depth_replace; - i830->intel.vtbl.meta_color_mask = set_color_mask; - i830->intel.vtbl.meta_no_texture = set_no_texture; - i830->intel.vtbl.meta_texture_blend_replace = set_texture_blend_replace; - i830->intel.vtbl.meta_tex_rect_source = set_tex_rect_source; - i830->intel.vtbl.meta_draw_region = meta_draw_region; - i830->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; -} diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index acda7e70de..3b9b3ae329 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -1127,9 +1127,6 @@ i830InitState(struct i830_context *i830) _mesa_init_driver_state(ctx); - memcpy(&i830->initial, &i830->state, sizeof(i830->state)); - - i830->current = &i830->state; i830->state.emitted = 0; i830->state.active = (I830_UPLOAD_INVARIENT | I830_UPLOAD_RASTER_RULES | diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 4471ca2bbb..a8df77c600 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -25,8 +25,6 @@ * **************************************************************************/ -#include "glapi/glapi.h" - #include "i830_context.h" #include "i830_reg.h" #include "intel_batchbuffer.h" @@ -237,8 +235,8 @@ static GLboolean i830_check_vertex_size(struct intel_context *intel, GLuint expected) { struct i830_context *i830 = i830_context(&intel->ctx); - int vft0 = i830->current->Ctx[I830_CTXREG_VF]; - int vft1 = i830->current->Ctx[I830_CTXREG_VF2]; + int vft0 = i830->state.Ctx[I830_CTXREG_VF]; + int vft1 = i830->state.Ctx[I830_CTXREG_VF2]; int nrtex = (vft0 & VFT0_TEX_COUNT_MASK) >> VFT0_TEX_COUNT_SHIFT; int i, sz = 0; @@ -414,7 +412,7 @@ static void i830_emit_state(struct intel_context *intel) { struct i830_context *i830 = i830_context(&intel->ctx); - struct i830_hw_state *state = i830->current; + struct i830_hw_state *state = &i830->state; int i, count; GLuint dirty; dri_bo *aper_array[3 + I830_TEX_UNITS]; @@ -543,10 +541,6 @@ i830_emit_state(struct intel_context *intel) I915_GEM_DOMAIN_SAMPLER, 0, state->tex_offset[i]); } - else if (state == &i830->meta) { - assert(i == 0); - OUT_BATCH(0); - } else { OUT_BATCH(state->tex_offset[i]); } @@ -581,10 +575,6 @@ i830_destroy_context(struct intel_context *intel) intel_region_release(&i830->state.draw_region); intel_region_release(&i830->state.depth_region); - intel_region_release(&i830->meta.draw_region); - intel_region_release(&i830->meta.depth_region); - intel_region_release(&i830->initial.draw_region); - intel_region_release(&i830->initial.depth_region); for (i = 0; i < I830_TEX_UNITS; i++) { if (i830->state.tex_buffer[i] != NULL) { @@ -596,24 +586,22 @@ i830_destroy_context(struct intel_context *intel) _tnl_free_vertices(&intel->ctx); } - -void -i830_state_draw_region(struct intel_context *intel, - struct i830_hw_state *state, - struct intel_region *color_region, - struct intel_region *depth_region) +static void +i830_set_draw_region(struct intel_context *intel, + struct intel_region *color_regions[], + struct intel_region *depth_region, + GLuint num_regions) { struct i830_context *i830 = i830_context(&intel->ctx); GLcontext *ctx = &intel->ctx; struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; struct intel_renderbuffer *irb = intel_renderbuffer(rb); GLuint value; + struct i830_hw_state *state = &i830->state; - ASSERT(state == &i830->state || state == &i830->meta); - - if (state->draw_region != color_region) { + if (state->draw_region != color_regions[0]) { intel_region_release(&state->draw_region); - intel_region_reference(&state->draw_region, color_region); + intel_region_reference(&state->draw_region, color_regions[0]); } if (state->depth_region != depth_region) { intel_region_release(&state->depth_region); @@ -624,7 +612,7 @@ i830_state_draw_region(struct intel_context *intel, * Set stride/cpp values */ i915_set_buf_info_for_region(&state->Buffer[I830_DESTREG_CBUFADDR0], - color_region, BUF_3D_ID_COLOR_BACK); + color_regions[0], BUF_3D_ID_COLOR_BACK); i915_set_buf_info_for_region(&state->Buffer[I830_DESTREG_DBUFADDR0], depth_region, BUF_3D_ID_DEPTH); @@ -674,19 +662,6 @@ i830_state_draw_region(struct intel_context *intel, state->Buffer[I830_DESTREG_DRAWRECT5] = 0; I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); - - -} - - -static void -i830_set_draw_region(struct intel_context *intel, - struct intel_region *color_regions[], - struct intel_region *depth_region, - GLuint num_regions) -{ - struct i830_context *i830 = i830_context(&intel->ctx); - i830_state_draw_region(intel, &i830->state, color_regions[0], depth_region); } /* This isn't really handled at the moment. @@ -702,8 +677,7 @@ static void i830_assert_not_dirty( struct intel_context *intel ) { struct i830_context *i830 = i830_context(&intel->ctx); - struct i830_hw_state *state = i830->current; - assert(!get_dirty(state)); + assert(!get_dirty(&i830->state)); } static void diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 7c7711da09..ed9a44ff24 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -28,7 +28,6 @@ #include "i915_context.h" #include "main/imports.h" #include "main/macros.h" -#include "intel_tex.h" #include "intel_tris.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" @@ -38,15 +37,11 @@ #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "utils.h" #include "i915_reg.h" #include "i915_program.h" -#include "intel_regions.h" -#include "intel_batchbuffer.h" #include "intel_tris.h" #include "intel_span.h" -#include "intel_pixel.h" /*************************************** * Mesa's Driver Functions @@ -116,7 +111,6 @@ i915CreateContext(const __GLcontextModes * mesaVis, _mesa_printf("\ntexmem-0-3 branch\n\n"); i915InitVtbl(i915); - i915InitMetaFuncs(i915); i915InitDriverFunctions(&functions); diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index f55b551139..60b357ec28 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -259,7 +259,7 @@ struct i915_context struct i915_fragment_program *current_program; - struct i915_hw_state meta, initial, state, *current; + struct i915_hw_state state; }; @@ -346,12 +346,6 @@ extern void i915UpdateTextureState(struct intel_context *intel); extern void i915InitTextureFuncs(struct dd_function_table *functions); /*====================================================================== - * i915_metaops.c - */ -void i915InitMetaFuncs(struct i915_context *i915); - - -/*====================================================================== * i915_fragprog.c */ extern void i915ValidateFragmentProgram(struct i915_context *i915); diff --git a/src/mesa/drivers/dri/i915/i915_debug_fp.c b/src/mesa/drivers/dri/i915/i915_debug_fp.c index 84347a01ef..bf500e54fa 100644 --- a/src/mesa/drivers/dri/i915/i915_debug_fp.c +++ b/src/mesa/drivers/dri/i915/i915_debug_fp.c @@ -30,9 +30,6 @@ #include "i915_reg.h" #include "i915_debug.h" #include "main/imports.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_print.h" #define PRINTF( ... ) _mesa_printf( __VA_ARGS__ ) diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c deleted file mode 100644 index 90a78c6082..0000000000 --- a/src/mesa/drivers/dri/i915/i915_metaops.c +++ /dev/null @@ -1,507 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, 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 TUNGSTEN GRAPHICS 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. - * - **************************************************************************/ - -#include "main/glheader.h" -#include "main/enums.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "utils.h" - -#include "intel_screen.h" -#include "intel_batchbuffer.h" -#include "intel_regions.h" - -#include "i915_context.h" -#include "i915_reg.h" - -/* We touch almost everything: - */ -#define ACTIVE (I915_UPLOAD_INVARIENT | \ - I915_UPLOAD_CTX | \ - I915_UPLOAD_BUFFERS | \ - I915_UPLOAD_STIPPLE | \ - I915_UPLOAD_PROGRAM | \ - I915_UPLOAD_FOG | \ - I915_UPLOAD_TEX(0)) - -#define SET_STATE( i915, STATE ) \ -do { \ - i915->current->emitted &= ~ACTIVE; \ - i915->current = &i915->STATE; \ - i915->current->emitted &= ~ACTIVE; \ -} while (0) - - -static void -meta_no_stencil_write(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE ) - */ - i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_TEST_ENABLE | - S5_STENCIL_WRITE_ENABLE); - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - -static void -meta_no_depth_write(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE ) - */ - i915->meta.Ctx[I915_CTXREG_LIS6] &= ~(S6_DEPTH_TEST_ENABLE | - S6_DEPTH_WRITE_ENABLE); - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - -static void -meta_depth_replace(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE ) - * ctx->Driver.DepthMask( ctx, GL_TRUE ) - */ - i915->meta.Ctx[I915_CTXREG_LIS6] |= (S6_DEPTH_TEST_ENABLE | - S6_DEPTH_WRITE_ENABLE); - - /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS ) - */ - i915->meta.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK; - i915->meta.Ctx[I915_CTXREG_LIS6] |= - COMPAREFUNC_ALWAYS << S6_DEPTH_TEST_FUNC_SHIFT; - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - - -/* Set stencil unit to replace always with the reference value. - */ -static void -meta_stencil_replace(struct intel_context *intel, - GLuint s_mask, GLuint s_clear) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - GLuint op = STENCILOP_REPLACE; - GLuint func = COMPAREFUNC_ALWAYS; - - /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_TRUE ) - */ - i915->meta.Ctx[I915_CTXREG_LIS5] |= (S5_STENCIL_TEST_ENABLE | - S5_STENCIL_WRITE_ENABLE); - - /* ctx->Driver.StencilMask( ctx, s_mask ) - */ - i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; - - i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | - STENCIL_WRITE_MASK(s_mask)); - - /* ctx->Driver.StencilOp( ctx, GL_REPLACE, GL_REPLACE, GL_REPLACE ) - */ - i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_FAIL_MASK | - S5_STENCIL_PASS_Z_FAIL_MASK | - S5_STENCIL_PASS_Z_PASS_MASK); - - i915->meta.Ctx[I915_CTXREG_LIS5] |= ((op << S5_STENCIL_FAIL_SHIFT) | - (op << S5_STENCIL_PASS_Z_FAIL_SHIFT) | - (op << S5_STENCIL_PASS_Z_PASS_SHIFT)); - - - /* ctx->Driver.StencilFunc( ctx, GL_ALWAYS, s_ref, ~0 ) - */ - i915->meta.Ctx[I915_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; - i915->meta.Ctx[I915_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | - STENCIL_TEST_MASK(0xff)); - - i915->meta.Ctx[I915_CTXREG_LIS5] &= ~(S5_STENCIL_REF_MASK | - S5_STENCIL_TEST_FUNC_MASK); - - i915->meta.Ctx[I915_CTXREG_LIS5] |= ((s_clear << S5_STENCIL_REF_SHIFT) | - (func << S5_STENCIL_TEST_FUNC_SHIFT)); - - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - - -static void -meta_color_mask(struct intel_context *intel, GLboolean state) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - const GLuint mask = (S5_WRITEDISABLE_RED | - S5_WRITEDISABLE_GREEN | - S5_WRITEDISABLE_BLUE | S5_WRITEDISABLE_ALPHA); - - /* Copy colormask state from "regular" hw context. - */ - if (state) { - i915->meta.Ctx[I915_CTXREG_LIS5] &= ~mask; - i915->meta.Ctx[I915_CTXREG_LIS5] |= - (i915->state.Ctx[I915_CTXREG_LIS5] & mask); - } - else - i915->meta.Ctx[I915_CTXREG_LIS5] |= mask; - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - - - -static void -meta_import_pixel_state(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - memcpy(i915->meta.Fog, i915->state.Fog, I915_FOG_SETUP_SIZE * 4); - - i915->meta.Ctx[I915_CTXREG_LIS5] = i915->state.Ctx[I915_CTXREG_LIS5]; - i915->meta.Ctx[I915_CTXREG_LIS6] = i915->state.Ctx[I915_CTXREG_LIS6]; - i915->meta.Ctx[I915_CTXREG_STATE4] = i915->state.Ctx[I915_CTXREG_STATE4]; - i915->meta.Ctx[I915_CTXREG_BLENDCOLOR1] = - i915->state.Ctx[I915_CTXREG_BLENDCOLOR1]; - i915->meta.Ctx[I915_CTXREG_IAB] = i915->state.Ctx[I915_CTXREG_IAB]; - - i915->meta.Buffer[I915_DESTREG_SENABLE] = - i915->state.Buffer[I915_DESTREG_SENABLE]; - i915->meta.Buffer[I915_DESTREG_SR1] = i915->state.Buffer[I915_DESTREG_SR1]; - i915->meta.Buffer[I915_DESTREG_SR2] = i915->state.Buffer[I915_DESTREG_SR2]; - - i915->meta.emitted &= ~I915_UPLOAD_FOG; - i915->meta.emitted &= ~I915_UPLOAD_BUFFERS; - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - - - - -#define REG( type, nr ) (((type)<<5)|(nr)) - -#define REG_R(x) REG(REG_TYPE_R, x) -#define REG_T(x) REG(REG_TYPE_T, x) -#define REG_CONST(x) REG(REG_TYPE_CONST, x) -#define REG_S(x) REG(REG_TYPE_S, x) -#define REG_OC REG(REG_TYPE_OC, 0) -#define REG_OD REG(REG_TYPE_OD, 0) -#define REG_U(x) REG(REG_TYPE_U, x) - -#define REG_T_DIFFUSE REG(REG_TYPE_T, T_DIFFUSE) -#define REG_T_SPECULAR REG(REG_TYPE_T, T_SPECULAR) -#define REG_T_FOG_W REG(REG_TYPE_T, T_FOG_W) -#define REG_T_TEX(x) REG(REG_TYPE_T, x) - - -#define A0_DEST_REG( reg ) ( (reg) << A0_DEST_NR_SHIFT ) -#define A0_SRC0_REG( reg ) ( (reg) << A0_SRC0_NR_SHIFT ) -#define A1_SRC1_REG( reg ) ( (reg) << A1_SRC1_NR_SHIFT ) -#define A1_SRC2_REG( reg ) ( (reg) << A1_SRC2_NR_SHIFT ) -#define A2_SRC2_REG( reg ) ( (reg) << A2_SRC2_NR_SHIFT ) -#define D0_DECL_REG( reg ) ( (reg) << D0_NR_SHIFT ) -#define T0_DEST_REG( reg ) ( (reg) << T0_DEST_NR_SHIFT ) - -#define T0_SAMPLER( unit ) ((unit)<<T0_SAMPLER_NR_SHIFT) - -#define T1_ADDRESS_REG( type, nr ) (((type)<<T1_ADDRESS_REG_TYPE_SHIFT)| \ - ((nr)<<T1_ADDRESS_REG_NR_SHIFT)) - - -#define A1_SRC0_XYZW ((SRC_X << A1_SRC0_CHANNEL_X_SHIFT) | \ - (SRC_Y << A1_SRC0_CHANNEL_Y_SHIFT) | \ - (SRC_Z << A1_SRC0_CHANNEL_Z_SHIFT) | \ - (SRC_W << A1_SRC0_CHANNEL_W_SHIFT)) - -#define A1_SRC1_XY ((SRC_X << A1_SRC1_CHANNEL_X_SHIFT) | \ - (SRC_Y << A1_SRC1_CHANNEL_Y_SHIFT)) - -#define A2_SRC1_ZW ((SRC_Z << A2_SRC1_CHANNEL_Z_SHIFT) | \ - (SRC_W << A2_SRC1_CHANNEL_W_SHIFT)) - -#define A2_SRC2_XYZW ((SRC_X << A2_SRC2_CHANNEL_X_SHIFT) | \ - (SRC_Y << A2_SRC2_CHANNEL_Y_SHIFT) | \ - (SRC_Z << A2_SRC2_CHANNEL_Z_SHIFT) | \ - (SRC_W << A2_SRC2_CHANNEL_W_SHIFT)) - - - - - -static void -meta_no_texture(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - static const GLuint prog[] = { - _3DSTATE_PIXEL_SHADER_PROGRAM, - - /* Declare incoming diffuse color: - */ - (D0_DCL | D0_DECL_REG(REG_T_DIFFUSE) | D0_CHANNEL_ALL), - D1_MBZ, - D2_MBZ, - - /* output-color = mov(t_diffuse) - */ - (A0_MOV | - A0_DEST_REG(REG_OC) | - A0_DEST_CHANNEL_ALL | A0_SRC0_REG(REG_T_DIFFUSE)), - (A1_SRC0_XYZW), - 0, - }; - - - memcpy(i915->meta.Program, prog, sizeof(prog)); - i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog); - i915->meta.Program[0] |= i915->meta.ProgramSize - 2; - i915->meta.emitted &= ~I915_UPLOAD_PROGRAM; -} - -static void -meta_texture_blend_replace(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - static const GLuint prog[] = { - _3DSTATE_PIXEL_SHADER_PROGRAM, - - /* Declare the sampler: - */ - (D0_DCL | D0_DECL_REG(REG_S(0)) | D0_SAMPLE_TYPE_2D | D0_CHANNEL_NONE), - D1_MBZ, - D2_MBZ, - - /* Declare the interpolated texture coordinate: - */ - (D0_DCL | D0_DECL_REG(REG_T_TEX(0)) | D0_CHANNEL_ALL), - D1_MBZ, - D2_MBZ, - - /* output-color = texld(sample0, texcoord0) - */ - (T0_TEXLD | T0_DEST_REG(REG_OC) | T0_SAMPLER(0)), - T1_ADDRESS_REG(REG_TYPE_T, 0), - T2_MBZ - }; - - memcpy(i915->meta.Program, prog, sizeof(prog)); - i915->meta.ProgramSize = sizeof(prog) / sizeof(*prog); - i915->meta.Program[0] |= i915->meta.ProgramSize - 2; - i915->meta.emitted &= ~I915_UPLOAD_PROGRAM; -} - - - - - -/* Set up an arbitary piece of memory as a rectangular texture - * (including the front or back buffer). - */ -static GLboolean -meta_tex_rect_source(struct intel_context *intel, - dri_bo *buffer, - GLuint offset, - GLuint pitch, GLuint height, GLenum format, GLenum type) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - GLuint unit = 0; - GLint numLevels = 1; - GLuint *state = i915->meta.Tex[0]; - GLuint textureFormat; - GLuint cpp; - - /* A full implementation of this would do the upload through - * glTexImage2d, and get all the conversion operations at that - * point. We are restricted, but still at least have access to the - * fragment program swizzle. - */ - switch (format) { - case GL_BGRA: - switch (type) { - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_BYTE: - textureFormat = (MAPSURF_32BIT | MT_32BIT_ARGB8888); - cpp = 4; - break; - default: - return GL_FALSE; - } - break; - case GL_RGBA: - switch (type) { - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_BYTE: - textureFormat = (MAPSURF_32BIT | MT_32BIT_ABGR8888); - cpp = 4; - break; - default: - return GL_FALSE; - } - break; - case GL_BGR: - switch (type) { - case GL_UNSIGNED_SHORT_5_6_5_REV: - textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); - cpp = 2; - break; - default: - return GL_FALSE; - } - break; - case GL_RGB: - switch (type) { - case GL_UNSIGNED_SHORT_5_6_5: - textureFormat = (MAPSURF_16BIT | MT_16BIT_RGB565); - cpp = 2; - break; - default: - return GL_FALSE; - } - break; - - default: - return GL_FALSE; - } - - - if ((pitch * cpp) & 3) { - _mesa_printf("%s: texture is not dword pitch\n", __FUNCTION__); - return GL_FALSE; - } - -/* intel_region_release(&i915->meta.tex_region[0]); */ -/* intel_region_reference(&i915->meta.tex_region[0], region); */ - i915->meta.tex_buffer[0] = buffer; - i915->meta.tex_offset[0] = offset; - - state[I915_TEXREG_MS3] = (((height - 1) << MS3_HEIGHT_SHIFT) | - ((pitch - 1) << MS3_WIDTH_SHIFT) | - textureFormat | MS3_USE_FENCE_REGS); - - state[I915_TEXREG_MS4] = (((((pitch * cpp) / 4) - 1) << MS4_PITCH_SHIFT) | - MS4_CUBE_FACE_ENA_MASK | - ((((numLevels - 1) * 4)) << MS4_MAX_LOD_SHIFT)); - - state[I915_TEXREG_SS2] = ((FILTER_NEAREST << SS2_MIN_FILTER_SHIFT) | - (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT) | - (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT)); - - state[I915_TEXREG_SS3] = ((TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT) | - (TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT) | - (TEXCOORDMODE_WRAP << SS3_TCZ_ADDR_MODE_SHIFT) | - (unit << SS3_TEXTUREMAP_INDEX_SHIFT)); - - state[I915_TEXREG_SS4] = 0; - - i915->meta.emitted &= ~I915_UPLOAD_TEX(0); - return GL_TRUE; -} - - -/** - * Set the color and depth drawing region for meta ops. - */ -static void -meta_draw_region(struct intel_context *intel, - struct intel_region *color_region, - struct intel_region *depth_region) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - i915_state_draw_region(intel, &i915->meta, color_region, depth_region); -} - - -static void -set_vertex_format(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - - i915->meta.Ctx[I915_CTXREG_LIS2] = - (S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D) | - S2_TEXCOORD_FMT(1, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(2, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(3, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(4, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(5, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(6, TEXCOORDFMT_NOT_PRESENT) | - S2_TEXCOORD_FMT(7, TEXCOORDFMT_NOT_PRESENT)); - - i915->meta.Ctx[I915_CTXREG_LIS4] &= ~S4_VFMT_MASK; - - i915->meta.Ctx[I915_CTXREG_LIS4] |= (S4_VFMT_COLOR | S4_VFMT_XYZ); - - i915->meta.emitted &= ~I915_UPLOAD_CTX; -} - - - -/* Operations where the 3D engine is decoupled temporarily from the - * current GL state and used for other purposes than simply rendering - * incoming triangles. - */ -static void -install_meta_state(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - memcpy(&i915->meta, &i915->initial, sizeof(i915->meta)); - i915->meta.active = ACTIVE; - i915->meta.emitted = 0; - - SET_STATE(i915, meta); - set_vertex_format(intel); - meta_no_texture(intel); -} - -static void -leave_meta_state(struct intel_context *intel) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - intel_region_release(&i915->meta.draw_region); - intel_region_release(&i915->meta.depth_region); -/* intel_region_release(&i915->meta.tex_region[0]); */ - SET_STATE(i915, state); -} - - - -void -i915InitMetaFuncs(struct i915_context *i915) -{ - i915->intel.vtbl.install_meta_state = install_meta_state; - i915->intel.vtbl.leave_meta_state = leave_meta_state; - i915->intel.vtbl.meta_no_depth_write = meta_no_depth_write; - i915->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write; - i915->intel.vtbl.meta_stencil_replace = meta_stencil_replace; - i915->intel.vtbl.meta_depth_replace = meta_depth_replace; - i915->intel.vtbl.meta_color_mask = meta_color_mask; - i915->intel.vtbl.meta_no_texture = meta_no_texture; - i915->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; - i915->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; - i915->intel.vtbl.meta_draw_region = meta_draw_region; - i915->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; -} diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 9d7a9e1dfe..7275617a6f 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -1157,7 +1157,4 @@ i915InitState(struct i915_context *i915) i915_init_packets(i915); _mesa_init_driver_state(ctx); - - memcpy(&i915->initial, &i915->state, sizeof(i915->state)); - i915->current = &i915->state; } diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 266e6848c3..392126b7dc 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -37,17 +37,13 @@ #include "tnl/t_vertex.h" #include "intel_batchbuffer.h" -#include "intel_tex.h" #include "intel_regions.h" #include "intel_tris.h" #include "intel_fbo.h" -#include "intel_chipset.h" #include "i915_reg.h" #include "i915_context.h" -#include "glapi/glapi.h" - static void i915_render_prevalidate(struct intel_context *intel) { @@ -100,8 +96,8 @@ static GLboolean i915_check_vertex_size(struct intel_context *intel, GLuint expected) { struct i915_context *i915 = i915_context(&intel->ctx); - int lis2 = i915->current->Ctx[I915_CTXREG_LIS2]; - int lis4 = i915->current->Ctx[I915_CTXREG_LIS4]; + int lis2 = i915->state.Ctx[I915_CTXREG_LIS2]; + int lis4 = i915->state.Ctx[I915_CTXREG_LIS4]; int i, sz = 0; switch (lis4 & S4_VFMT_XYZW_MASK) { @@ -287,7 +283,7 @@ static void i915_emit_state(struct intel_context *intel) { struct i915_context *i915 = i915_context(&intel->ctx); - struct i915_hw_state *state = i915->current; + struct i915_hw_state *state = &i915->state; int i, count, aper_count; GLuint dirty; dri_bo *aper_array[3 + I915_TEX_UNITS]; @@ -443,10 +439,6 @@ i915_emit_state(struct intel_context *intel) I915_GEM_DOMAIN_SAMPLER, 0, state->tex_offset[i]); } - else if (state == &i915->meta) { - assert(i == 0); - OUT_BATCH(0); - } else { OUT_BATCH(state->tex_offset[i]); } @@ -500,10 +492,6 @@ i915_destroy_context(struct intel_context *intel) intel_region_release(&i915->state.draw_region); intel_region_release(&i915->state.depth_region); - intel_region_release(&i915->meta.draw_region); - intel_region_release(&i915->meta.depth_region); - intel_region_release(&i915->initial.draw_region); - intel_region_release(&i915->initial.depth_region); for (i = 0; i < I915_TEX_UNITS; i++) { if (i915->state.tex_buffer[i] != NULL) { @@ -533,29 +521,22 @@ i915_set_buf_info_for_region(uint32_t *state, struct intel_region *region, } } -/** - * Set the drawing regions for the color and depth/stencil buffers. - * This involves setting the pitch, cpp and buffer ID/location. - * Also set pixel format for color and Z rendering - * Used for setting both regular and meta state. - */ -void -i915_state_draw_region(struct intel_context *intel, - struct i915_hw_state *state, - struct intel_region *color_region, - struct intel_region *depth_region) +static void +i915_set_draw_region(struct intel_context *intel, + struct intel_region *color_regions[], + struct intel_region *depth_region, + GLuint num_regions) { struct i915_context *i915 = i915_context(&intel->ctx); GLcontext *ctx = &intel->ctx; struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; struct intel_renderbuffer *irb = intel_renderbuffer(rb); GLuint value; + struct i915_hw_state *state = &i915->state; - ASSERT(state == &i915->state || state == &i915->meta); - - if (state->draw_region != color_region) { + if (state->draw_region != color_regions[0]) { intel_region_release(&state->draw_region); - intel_region_reference(&state->draw_region, color_region); + intel_region_reference(&state->draw_region, color_regions[0]); } if (state->depth_region != depth_region) { intel_region_release(&state->depth_region); @@ -566,7 +547,7 @@ i915_state_draw_region(struct intel_context *intel, * Set stride/cpp values */ i915_set_buf_info_for_region(&state->Buffer[I915_DESTREG_CBUFADDR0], - color_region, BUF_3D_ID_COLOR_BACK); + color_regions[0], BUF_3D_ID_COLOR_BACK); i915_set_buf_info_for_region(&state->Buffer[I915_DESTREG_DBUFADDR0], depth_region, BUF_3D_ID_DEPTH); @@ -627,17 +608,6 @@ i915_state_draw_region(struct intel_context *intel, } -static void -i915_set_draw_region(struct intel_context *intel, - struct intel_region *color_regions[], - struct intel_region *depth_region, - GLuint num_regions) -{ - struct i915_context *i915 = i915_context(&intel->ctx); - i915_state_draw_region(intel, &i915->state, color_regions[0], depth_region); -} - - static void i915_new_batch(struct intel_context *intel) @@ -655,8 +625,7 @@ static void i915_assert_not_dirty( struct intel_context *intel ) { struct i915_context *i915 = i915_context(&intel->ctx); - struct i915_hw_state *state = i915->current; - GLuint dirty = get_dirty(state); + GLuint dirty = get_dirty(&i915->state); assert(!dirty); } diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index e99baf8e0e..6d498c5654 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -52,8 +52,6 @@ #include "intel_buffers.h" #include "intel_reg.h" #include "intel_span.h" -#include "intel_tex.h" -#include "intel_chipset.h" #include "i830_context.h" #include "i830_reg.h" diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index bac1c3a49c..fa2d394b22 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -34,9 +34,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" -#include "intel_fbo.h" #include "main/macros.h" -#include "main/enums.h" static void prepare_cc_vp( struct brw_context *brw ) { @@ -295,8 +293,7 @@ cc_unit_create_from_key(struct brw_context *brw, struct brw_cc_unit_key *key) bo = brw_upload_cache(&brw->cache, BRW_CC_UNIT, key, sizeof(*key), &brw->cc.vp_bo, 1, - &cc, sizeof(cc), - NULL, NULL); + &cc, sizeof(cc)); /* Emit CC viewport relocation */ dri_bo_emit_reloc(bo, diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index af1d975de9..d3275c7a89 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -130,13 +130,14 @@ static void compile_clip_prog( struct brw_context *brw, /* Upload */ dri_bo_unreference(brw->clip.prog_bo); - brw->clip.prog_bo = brw_upload_cache( &brw->cache, - BRW_CLIP_PROG, - &c.key, sizeof(c.key), - NULL, 0, - program, program_size, - &c.prog_data, - &brw->clip.prog_data ); + brw->clip.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, + BRW_CLIP_PROG, + &c.key, sizeof(c.key), + NULL, 0, + program, program_size, + &c.prog_data, + sizeof(c.prog_data), + &brw->clip.prog_data); } /* Calculate interpolants for triangle and line rasterization. diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c index afc0b11049..ceb62a3116 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_line.c +++ b/src/mesa/drivers/dri/i965/brw_clip_line.c @@ -39,7 +39,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_clip.h" diff --git a/src/mesa/drivers/dri/i965/brw_clip_point.c b/src/mesa/drivers/dri/i965/brw_clip_point.c index 8458f61c5a..7f47634dca 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_point.c +++ b/src/mesa/drivers/dri/i965/brw_clip_point.c @@ -39,7 +39,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_clip.h" diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index c8f24a94e4..424c9a1f19 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -32,7 +32,6 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "main/macros.h" struct brw_clip_unit_key { unsigned int total_grf; @@ -143,8 +142,7 @@ clip_unit_create_from_key(struct brw_context *brw, bo = brw_upload_cache(&brw->cache, BRW_CLIP_UNIT, key, sizeof(*key), &brw->clip.prog_bo, 1, - &clip, sizeof(clip), - NULL, NULL); + &clip, sizeof(clip)); /* Emit clip program relocation */ assert(brw->clip.prog_bo); diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c index cfbb8f2686..815211acc2 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c @@ -39,7 +39,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_clip.h" static void release_tmps( struct brw_clip_compile *c ) diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c index ad1bfa435f..f36d22fdbf 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c +++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c @@ -39,7 +39,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_clip.h" diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index 86fed59fa4..14bc889b0f 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -40,7 +40,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_clip.h" diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 7bb15956b5..65f51be341 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -33,7 +33,6 @@ #include "main/imports.h" #include "main/api_noop.h" #include "main/macros.h" -#include "main/vtxfmt.h" #include "main/simple_list.h" #include "shader/shader_api.h" @@ -41,16 +40,9 @@ #include "brw_defines.h" #include "brw_draw.h" #include "brw_state.h" -#include "brw_vs.h" -#include "intel_tex.h" -#include "intel_blit.h" -#include "intel_batchbuffer.h" -#include "intel_pixel.h" #include "intel_span.h" #include "tnl/t_pipeline.h" -#include "utils.h" - /*************************************** * Mesa's Driver Functions diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 0dd3087143..79818b92b7 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -131,7 +131,6 @@ struct brw_context; #define BRW_NEW_WM_INPUT_DIMENSIONS 0x100 #define BRW_NEW_PSP 0x800 #define BRW_NEW_WM_SURFACES 0x1000 -#define BRW_NEW_FENCE 0x2000 #define BRW_NEW_INDICES 0x4000 #define BRW_NEW_VERTICES 0x8000 /** @@ -332,7 +331,6 @@ struct brw_cache { struct brw_cache_item **items; GLuint size, n_items; - GLuint aux_size[BRW_MAX_CACHE]; char *name[BRW_MAX_CACHE]; /* Record of the last BOs chosen for each cache_id. Used to set @@ -583,6 +581,7 @@ struct brw_context struct { struct brw_vs_prog_data *prog_data; + int8_t *constant_map; /* variable array following prog_data */ dri_bo *prog_bo; dri_bo *state_bo; diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 190310afbb..22e3e732f4 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -256,13 +256,24 @@ static void prepare_constant_buffer(struct brw_context *brw) */ _mesa_load_state_parameters(ctx, vp->program.Base.Parameters); - /* XXX just use a memcpy here */ - for (i = 0; i < nr; i++) { - const GLfloat *value = vp->program.Base.Parameters->ParameterValues[i]; - buf[offset + i * 4 + 0] = value[0]; - buf[offset + i * 4 + 1] = value[1]; - buf[offset + i * 4 + 2] = value[2]; - buf[offset + i * 4 + 3] = value[3]; + if (vp->use_const_buffer) { + /* Load the subset of push constants that will get used when + * we also have a pull constant buffer. + */ + for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) { + if (brw->vs.constant_map[i] != -1) { + assert(brw->vs.constant_map[i] <= nr); + memcpy(buf + offset + brw->vs.constant_map[i] * 4, + vp->program.Base.Parameters->ParameterValues[i], + 4 * sizeof(float)); + } + } + } else { + for (i = 0; i < nr; i++) { + memcpy(buf + offset + i * 4, + vp->program.Base.Parameters->ParameterValues[i], + 4 * sizeof(float)); + } } } diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index df281b27d5..d510d767f9 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -39,10 +39,8 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_state.h" -#include "brw_fallback.h" #include "intel_batchbuffer.h" -#include "intel_buffer_objects.h" #define FILE_DEBUG_FLAG DEBUG_BATCH diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index c773b71507..c46b9ba89c 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -29,19 +29,15 @@ #include "main/glheader.h" #include "main/bufferobj.h" #include "main/context.h" -#include "main/state.h" -#include "main/api_validate.h" #include "main/enums.h" #include "brw_draw.h" #include "brw_defines.h" #include "brw_context.h" #include "brw_state.h" -#include "brw_fallback.h" #include "intel_batchbuffer.h" #include "intel_buffer_objects.h" -#include "intel_tex.h" static GLuint double_types[5] = { 0, @@ -59,6 +55,14 @@ static GLuint float_types[5] = { BRW_SURFACEFORMAT_R32G32B32A32_FLOAT }; +static GLuint half_float_types[5] = { + 0, + BRW_SURFACEFORMAT_R16_FLOAT, + BRW_SURFACEFORMAT_R16G16_FLOAT, + 0, /* can't seem to render this one */ + BRW_SURFACEFORMAT_R16G16B16A16_FLOAT +}; + static GLuint uint_types_norm[5] = { 0, BRW_SURFACEFORMAT_R32_UNORM, @@ -172,6 +176,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, switch (type) { case GL_DOUBLE: return double_types[size]; case GL_FLOAT: return float_types[size]; + case GL_HALF_FLOAT: return half_float_types[size]; case GL_INT: return int_types_norm[size]; case GL_SHORT: return short_types_norm[size]; case GL_BYTE: return byte_types_norm[size]; @@ -194,6 +199,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, switch (type) { case GL_DOUBLE: return double_types[size]; case GL_FLOAT: return float_types[size]; + case GL_HALF_FLOAT: return half_float_types[size]; case GL_INT: return int_types_scale[size]; case GL_SHORT: return short_types_scale[size]; case GL_BYTE: return byte_types_scale[size]; @@ -211,6 +217,7 @@ static GLuint get_size( GLenum type ) switch (type) { case GL_DOUBLE: return sizeof(GLdouble); case GL_FLOAT: return sizeof(GLfloat); + case GL_HALF_FLOAT: return sizeof(GLhalfARB); case GL_INT: return sizeof(GLint); case GL_SHORT: return sizeof(GLshort); case GL_BYTE: return sizeof(GLbyte); diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index fe5c1ae279..ba401c215c 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -36,13 +36,9 @@ #include "swrast/swrast.h" #include "tnl/tnl.h" #include "brw_context.h" -#include "brw_fallback.h" -#include "intel_chipset.h" #include "intel_fbo.h" #include "intel_regions.h" -#include "glapi/glapi.h" - #define FILE_DEBUG_FLAG DEBUG_FALLBACKS static GLboolean do_check_fallback(struct brw_context *brw) diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 1bc3eccf49..7261b316c1 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -125,12 +125,13 @@ static void compile_gs_prog( struct brw_context *brw, /* Upload */ dri_bo_unreference(brw->gs.prog_bo); - brw->gs.prog_bo = brw_upload_cache( &brw->cache, BRW_GS_PROG, - &c.key, sizeof(c.key), - NULL, 0, - program, program_size, - &c.prog_data, - &brw->gs.prog_data ); + brw->gs.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, BRW_GS_PROG, + &c.key, sizeof(c.key), + NULL, 0, + program, program_size, + &c.prog_data, + sizeof(c.prog_data), + &brw->gs.prog_data); } static const GLenum gs_prim[GL_POLYGON+1] = { diff --git a/src/mesa/drivers/dri/i965/brw_gs_emit.c b/src/mesa/drivers/dri/i965/brw_gs_emit.c index a81b972ef4..dd7b057d62 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_gs_emit.c @@ -40,7 +40,6 @@ #include "brw_defines.h" #include "brw_context.h" #include "brw_eu.h" -#include "brw_util.h" #include "brw_gs.h" static void brw_gs_alloc_regs( struct brw_gs_compile *c, diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c index 1af5790a67..d8ad5cecf3 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_state.c @@ -34,7 +34,6 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "main/macros.h" struct brw_gs_unit_key { unsigned int total_grf; @@ -108,8 +107,7 @@ gs_unit_create_from_key(struct brw_context *brw, struct brw_gs_unit_key *key) bo = brw_upload_cache(&brw->cache, BRW_GS_UNIT, key, sizeof(*key), &brw->gs.prog_bo, 1, - &gs, sizeof(gs), - NULL, NULL); + &gs, sizeof(gs)); if (key->prog_active) { /* Emit GS program relocation */ diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 7b70f787b7..f708ee0063 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -327,7 +327,7 @@ const struct brw_tracked_state brw_polygon_stipple = { static void upload_polygon_stipple_offset(struct brw_context *brw) { - __DRIdrawable *dPriv = brw->intel.driDrawable; + GLcontext *ctx = &brw->intel.ctx; struct brw_polygon_stipple_offset bpso; memset(&bpso, 0, sizeof(bpso)); @@ -343,8 +343,8 @@ static void upload_polygon_stipple_offset(struct brw_context *brw) * worry about. */ if (brw->intel.ctx.DrawBuffer->Name == 0) { - bpso.bits0.x_offset = (32 - (dPriv->x & 31)) & 31; - bpso.bits0.y_offset = (32 - ((dPriv->y + dPriv->h) & 31)) & 31; + bpso.bits0.x_offset = 0; + bpso.bits0.y_offset = (32 - (ctx->DrawBuffer->Height & 31)) & 31; } else { bpso.bits0.y_offset = 0; diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index bac69187c1..e3b6fccc49 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -37,7 +37,6 @@ #include "tnl/tnl.h" #include "brw_context.h" -#include "brw_util.h" #include "brw_wm.h" static void brwBindProgram( GLcontext *ctx, diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 968890f7fb..8e6839b812 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -117,12 +117,13 @@ static void compile_sf_prog( struct brw_context *brw, /* Upload */ dri_bo_unreference(brw->sf.prog_bo); - brw->sf.prog_bo = brw_upload_cache( &brw->cache, BRW_SF_PROG, - &c.key, sizeof(c.key), - NULL, 0, - program, program_size, - &c.prog_data, - &brw->sf.prog_data ); + brw->sf.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, BRW_SF_PROG, + &c.key, sizeof(c.key), + NULL, 0, + program, program_size, + &c.prog_data, + sizeof(c.prog_data), + &brw->sf.prog_data); } /* Calculate interpolants for triangle and line rasterization. diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 09223b7cfb..847c886279 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -35,7 +35,6 @@ #include "brw_state.h" #include "brw_defines.h" #include "main/macros.h" -#include "intel_fbo.h" static void upload_sf_vp(struct brw_context *brw) { @@ -70,9 +69,9 @@ static void upload_sf_vp(struct brw_context *brw) * for DrawBuffer->_[XY]{min,max} */ - /* The scissor only needs to handle the intersection of drawable and - * scissor rect. Clipping to the boundaries of static shared buffers - * for front/back/depth is covered by looping over cliprects in brw_draw.c. + /* The scissor only needs to handle the intersection of drawable + * and scissor rect, since there are no longer cliprects for shared + * buffers with DRI2. * * Note that the hardware's coordinates are inclusive, while Mesa's min is * inclusive but max is exclusive. @@ -309,8 +308,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, bo = brw_upload_cache(&brw->cache, BRW_SF_UNIT, key, sizeof(*key), reloc_bufs, 2, - &sf, sizeof(sf), - NULL, NULL); + &sf, sizeof(sf)); /* STATE_PREFETCH command description describes this state as being * something loaded through the GPE (L2 ISC), so it's INSTRUCTION domain. diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 9c9d145c4b..536fe8b249 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -124,16 +124,26 @@ dri_bo *brw_cache_data(struct brw_cache *cache, dri_bo **reloc_bufs, GLuint nr_reloc_bufs); -dri_bo *brw_upload_cache( struct brw_cache *cache, - enum brw_cache_id cache_id, - const void *key, - GLuint key_sz, - dri_bo **reloc_bufs, - GLuint nr_reloc_bufs, - const void *data, - GLuint data_sz, - const void *aux, - void *aux_return ); +drm_intel_bo *brw_upload_cache(struct brw_cache *cache, + enum brw_cache_id cache_id, + const void *key, + GLuint key_sz, + dri_bo **reloc_bufs, + GLuint nr_reloc_bufs, + const void *data, + GLuint data_sz); + +drm_intel_bo *brw_upload_cache_with_auxdata(struct brw_cache *cache, + enum brw_cache_id cache_id, + const void *key, + GLuint key_sz, + dri_bo **reloc_bufs, + GLuint nr_reloc_bufs, + const void *data, + GLuint data_sz, + const void *aux, + GLuint aux_sz, + void *aux_return); dri_bo *brw_search_cache( struct brw_cache *cache, enum brw_cache_id cache_id, diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index e4c9ba7d87..5fc47b0420 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -71,25 +71,23 @@ static GLuint -hash_key(const void *key, GLuint key_size, - dri_bo **reloc_bufs, GLuint nr_reloc_bufs) +hash_key(struct brw_cache_item *item) { - GLuint *ikey = (GLuint *)key; - GLuint hash = 0, i; + GLuint *ikey = (GLuint *)item->key; + GLuint hash = item->cache_id, i; - assert(key_size % 4 == 0); + assert(item->key_size % 4 == 0); /* I'm sure this can be improved on: */ - for (i = 0; i < key_size/4; i++) { + for (i = 0; i < item->key_size/4; i++) { hash ^= ikey[i]; hash = (hash << 5) | (hash >> 27); } /* Include the BO pointers as key data as well */ - ikey = (GLuint *)reloc_bufs; - key_size = nr_reloc_bufs * sizeof(dri_bo *); - for (i = 0; i < key_size/4; i++) { + ikey = (GLuint *)item->reloc_bufs; + for (i = 0; i < item->nr_reloc_bufs * sizeof(drm_intel_bo *) / 4; i++) { hash ^= ikey[i]; hash = (hash << 5) | (hash >> 27); } @@ -114,11 +112,22 @@ update_cache_last(struct brw_cache *cache, enum brw_cache_id cache_id, cache->brw->state.dirty.cache |= 1 << cache_id; } +static int +brw_cache_item_equals(const struct brw_cache_item *a, + const struct brw_cache_item *b) +{ + return a->cache_id == b->cache_id && + a->hash == b->hash && + a->key_size == b->key_size && + (memcmp(a->key, b->key, a->key_size) == 0) && + a->nr_reloc_bufs == b->nr_reloc_bufs && + (memcmp(a->reloc_bufs, b->reloc_bufs, + a->nr_reloc_bufs * sizeof(dri_bo *)) == 0); +} static struct brw_cache_item * -search_cache(struct brw_cache *cache, enum brw_cache_id cache_id, - GLuint hash, const void *key, GLuint key_size, - dri_bo **reloc_bufs, GLuint nr_reloc_bufs) +search_cache(struct brw_cache *cache, GLuint hash, + struct brw_cache_item *lookup) { struct brw_cache_item *c; @@ -133,13 +142,7 @@ search_cache(struct brw_cache *cache, enum brw_cache_id cache_id, #endif for (c = cache->items[hash % cache->size]; c; c = c->next) { - if (c->cache_id == cache_id && - c->hash == hash && - c->key_size == key_size && - memcmp(c->key, key, key_size) == 0 && - c->nr_reloc_bufs == nr_reloc_bufs && - memcmp(c->reloc_bufs, reloc_bufs, - nr_reloc_bufs * sizeof(dri_bo *)) == 0) + if (brw_cache_item_equals(lookup, c)) return c; } @@ -182,10 +185,18 @@ brw_search_cache(struct brw_cache *cache, void *aux_return) { struct brw_cache_item *item; - GLuint hash = hash_key(key, key_size, reloc_bufs, nr_reloc_bufs); + struct brw_cache_item lookup; + GLuint hash; - item = search_cache(cache, cache_id, hash, key, key_size, - reloc_bufs, nr_reloc_bufs); + lookup.cache_id = cache_id; + lookup.key = key; + lookup.key_size = key_size; + lookup.reloc_bufs = reloc_bufs; + lookup.nr_reloc_bufs = nr_reloc_bufs; + hash = hash_key(&lookup); + lookup.hash = hash; + + item = search_cache(cache, hash, &lookup); if (item == NULL) return NULL; @@ -200,26 +211,34 @@ brw_search_cache(struct brw_cache *cache, } -dri_bo * -brw_upload_cache( struct brw_cache *cache, - enum brw_cache_id cache_id, - const void *key, - GLuint key_size, - dri_bo **reloc_bufs, - GLuint nr_reloc_bufs, - const void *data, - GLuint data_size, - const void *aux, - void *aux_return ) +drm_intel_bo * +brw_upload_cache_with_auxdata(struct brw_cache *cache, + enum brw_cache_id cache_id, + const void *key, + GLuint key_size, + dri_bo **reloc_bufs, + GLuint nr_reloc_bufs, + const void *data, + GLuint data_size, + const void *aux, + GLuint aux_size, + void *aux_return) { struct brw_cache_item *item = CALLOC_STRUCT(brw_cache_item); - GLuint hash = hash_key(key, key_size, reloc_bufs, nr_reloc_bufs); + GLuint hash; GLuint relocs_size = nr_reloc_bufs * sizeof(dri_bo *); - GLuint aux_size = cache->aux_size[cache_id]; void *tmp; dri_bo *bo; int i; + item->cache_id = cache_id; + item->key = key; + item->key_size = key_size; + item->reloc_bufs = reloc_bufs; + item->nr_reloc_bufs = nr_reloc_bufs; + hash = hash_key(item); + item->hash = hash; + /* Create the buffer object to contain the data */ bo = dri_bo_alloc(cache->brw->intel.bufmgr, cache->name[cache_id], data_size, 1 << 6); @@ -229,19 +248,15 @@ brw_upload_cache( struct brw_cache *cache, tmp = _mesa_malloc(key_size + aux_size + relocs_size); memcpy(tmp, key, key_size); - memcpy(tmp + key_size, aux, cache->aux_size[cache_id]); + memcpy(tmp + key_size, aux, aux_size); memcpy(tmp + key_size + aux_size, reloc_bufs, relocs_size); for (i = 0; i < nr_reloc_bufs; i++) { if (reloc_bufs[i] != NULL) dri_bo_reference(reloc_bufs[i]); } - item->cache_id = cache_id; item->key = tmp; - item->hash = hash; - item->key_size = key_size; item->reloc_bufs = tmp + key_size + aux_size; - item->nr_reloc_bufs = nr_reloc_bufs; item->bo = bo; dri_bo_reference(bo); @@ -255,7 +270,6 @@ brw_upload_cache( struct brw_cache *cache, cache->n_items++; if (aux_return) { - assert(cache->aux_size[cache_id]); *(void **)aux_return = (void *)((char *)item->key + item->key_size); } @@ -272,6 +286,23 @@ brw_upload_cache( struct brw_cache *cache, return bo; } +drm_intel_bo * +brw_upload_cache(struct brw_cache *cache, + enum brw_cache_id cache_id, + const void *key, + GLuint key_size, + dri_bo **reloc_bufs, + GLuint nr_reloc_bufs, + const void *data, + GLuint data_size) +{ + return brw_upload_cache_with_auxdata(cache, cache_id, + key, key_size, + reloc_bufs, nr_reloc_bufs, + data, data_size, + NULL, 0, + NULL); +} /** * Wrapper around brw_cache_data_sz using the cache_id's canonical key size. @@ -292,11 +323,18 @@ brw_cache_data(struct brw_cache *cache, GLuint nr_reloc_bufs) { dri_bo *bo; - struct brw_cache_item *item; - GLuint hash = hash_key(data, data_size, reloc_bufs, nr_reloc_bufs); - - item = search_cache(cache, cache_id, hash, data, data_size, - reloc_bufs, nr_reloc_bufs); + struct brw_cache_item *item, lookup; + GLuint hash; + + lookup.cache_id = cache_id; + lookup.key = data; + lookup.key_size = data_size; + lookup.reloc_bufs = reloc_bufs; + lookup.nr_reloc_bufs = nr_reloc_bufs; + hash = hash_key(&lookup); + lookup.hash = hash; + + item = search_cache(cache, hash, &lookup); if (item) { update_cache_last(cache, cache_id, item->bo); dri_bo_reference(item->bo); @@ -306,8 +344,7 @@ brw_cache_data(struct brw_cache *cache, bo = brw_upload_cache(cache, cache_id, data, data_size, reloc_bufs, nr_reloc_bufs, - data, data_size, - NULL, NULL); + data, data_size); return bo; } @@ -321,11 +358,9 @@ enum pool_type { static void brw_init_cache_id(struct brw_cache *cache, const char *name, - enum brw_cache_id id, - GLuint aux_size) + enum brw_cache_id id) { cache->name[id] = strdup(name); - cache->aux_size[id] = aux_size; } @@ -341,80 +376,28 @@ brw_init_non_surface_cache(struct brw_context *brw) cache->items = (struct brw_cache_item **) _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); - brw_init_cache_id(cache, - "CC_VP", - BRW_CC_VP, - 0); - - brw_init_cache_id(cache, - "CC_UNIT", - BRW_CC_UNIT, - 0); - - brw_init_cache_id(cache, - "WM_PROG", - BRW_WM_PROG, - sizeof(struct brw_wm_prog_data)); - - brw_init_cache_id(cache, - "SAMPLER_DEFAULT_COLOR", - BRW_SAMPLER_DEFAULT_COLOR, - 0); - - brw_init_cache_id(cache, - "SAMPLER", - BRW_SAMPLER, - 0); - - brw_init_cache_id(cache, - "WM_UNIT", - BRW_WM_UNIT, - 0); - - brw_init_cache_id(cache, - "SF_PROG", - BRW_SF_PROG, - sizeof(struct brw_sf_prog_data)); - - brw_init_cache_id(cache, - "SF_VP", - BRW_SF_VP, - 0); - - brw_init_cache_id(cache, - "SF_UNIT", - BRW_SF_UNIT, - 0); - - brw_init_cache_id(cache, - "VS_UNIT", - BRW_VS_UNIT, - 0); - - brw_init_cache_id(cache, - "VS_PROG", - BRW_VS_PROG, - sizeof(struct brw_vs_prog_data)); - - brw_init_cache_id(cache, - "CLIP_UNIT", - BRW_CLIP_UNIT, - 0); - - brw_init_cache_id(cache, - "CLIP_PROG", - BRW_CLIP_PROG, - sizeof(struct brw_clip_prog_data)); - - brw_init_cache_id(cache, - "GS_UNIT", - BRW_GS_UNIT, - 0); - - brw_init_cache_id(cache, - "GS_PROG", - BRW_GS_PROG, - sizeof(struct brw_gs_prog_data)); + brw_init_cache_id(cache, "CC_VP", BRW_CC_VP); + brw_init_cache_id(cache, "CC_UNIT", BRW_CC_UNIT); + brw_init_cache_id(cache, "WM_PROG", BRW_WM_PROG); + brw_init_cache_id(cache, "SAMPLER_DEFAULT_COLOR", BRW_SAMPLER_DEFAULT_COLOR); + brw_init_cache_id(cache, "SAMPLER", BRW_SAMPLER); + brw_init_cache_id(cache, "WM_UNIT", BRW_WM_UNIT); + brw_init_cache_id(cache, "SF_PROG", BRW_SF_PROG); + brw_init_cache_id(cache, "SF_VP", BRW_SF_VP); + + brw_init_cache_id(cache, "SF_UNIT", BRW_SF_UNIT); + + brw_init_cache_id(cache, "VS_UNIT", BRW_VS_UNIT); + + brw_init_cache_id(cache, "VS_PROG", BRW_VS_PROG); + + brw_init_cache_id(cache, "CLIP_UNIT", BRW_CLIP_UNIT); + + brw_init_cache_id(cache, "CLIP_PROG", BRW_CLIP_PROG); + + brw_init_cache_id(cache, "GS_UNIT", BRW_GS_UNIT); + + brw_init_cache_id(cache, "GS_PROG", BRW_GS_PROG); } @@ -430,15 +413,8 @@ brw_init_surface_cache(struct brw_context *brw) cache->items = (struct brw_cache_item **) _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); - brw_init_cache_id(cache, - "SS_SURFACE", - BRW_SS_SURFACE, - 0); - - brw_init_cache_id(cache, - "SS_SURF_BIND", - BRW_SS_SURF_BIND, - 0); + brw_init_cache_id(cache, "SS_SURFACE", BRW_SS_SURFACE); + brw_init_cache_id(cache, "SS_SURF_BIND", BRW_SS_SURF_BIND); } diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c index e94fa7d2b4..020ac523b6 100644 --- a/src/mesa/drivers/dri/i965/brw_state_dump.c +++ b/src/mesa/drivers/dri/i965/brw_state_dump.c @@ -28,7 +28,6 @@ #include "main/mtypes.h" #include "brw_context.h" -#include "brw_state.h" #include "brw_defines.h" /** diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index af8dfb4c15..0ecbef1ef9 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -36,13 +36,7 @@ #include "intel_batchbuffer.h" #include "intel_buffers.h" -/* This is used to initialize brw->state.atoms[]. We could use this - * list directly except for a single atom, brw_constant_buffer, which - * has a .dirty value which changes according to the parameters of the - * current fragment and vertex programs, and so cannot be a static - * value. - */ -const struct brw_tracked_state *atoms[] = +static const struct brw_tracked_state *atoms[] = { &brw_check_fallback, @@ -208,7 +202,6 @@ static struct dirty_bit_map brw_bits[] = { DEFINE_BIT(BRW_NEW_CONTEXT), DEFINE_BIT(BRW_NEW_WM_INPUT_DIMENSIONS), DEFINE_BIT(BRW_NEW_PSP), - DEFINE_BIT(BRW_NEW_FENCE), DEFINE_BIT(BRW_NEW_INDICES), DEFINE_BIT(BRW_NEW_INDEX_BUFFER), DEFINE_BIT(BRW_NEW_VERTICES), diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 64a9535282..09edfd81fd 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -36,7 +36,6 @@ #include "intel_tex_layout.h" #include "intel_context.h" #include "main/macros.h" -#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_MIPTREE diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index fd055e225e..44b085e214 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -35,6 +35,7 @@ #include "brw_util.h" #include "brw_state.h" #include "shader/prog_print.h" +#include "shader/prog_parameter.h" @@ -42,9 +43,11 @@ static void do_vs_prog( struct brw_context *brw, struct brw_vertex_program *vp, struct brw_vs_prog_key *key ) { + GLcontext *ctx = &brw->intel.ctx; GLuint program_size; const GLuint *program; struct brw_vs_compile c; + int aux_size; memset(&c, 0, sizeof(c)); memcpy(&c.key, key, sizeof(*key)); @@ -73,13 +76,27 @@ static void do_vs_prog( struct brw_context *brw, */ program = brw_get_program(&c.func, &program_size); + /* We upload from &c.prog_data including the constant_map assuming + * they're packed together. It would be nice to have a + * compile-time assert macro here. + */ + assert(c.constant_map == (int8_t *)&c.prog_data + + sizeof(c.prog_data)); + assert(ctx->Const.VertexProgram.MaxNativeParameters == + ARRAY_SIZE(c.constant_map)); + + aux_size = sizeof(c.prog_data); + if (c.vp->use_const_buffer) + aux_size += c.vp->program.Base.Parameters->NumParameters; + dri_bo_unreference(brw->vs.prog_bo); - brw->vs.prog_bo = brw_upload_cache( &brw->cache, BRW_VS_PROG, - &c.key, sizeof(c.key), - NULL, 0, - program, program_size, - &c.prog_data, - &brw->vs.prog_data ); + brw->vs.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, BRW_VS_PROG, + &c.key, sizeof(c.key), + NULL, 0, + program, program_size, + &c.prog_data, + aux_size, + &brw->vs.prog_data); } @@ -109,6 +126,8 @@ static void brw_upload_vs_prog(struct brw_context *brw) &brw->vs.prog_data); if (brw->vs.prog_bo == NULL) do_vs_prog(brw, vp, &key); + brw->vs.constant_map = ((int8_t *)brw->vs.prog_data + + sizeof(*brw->vs.prog_data)); } diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 4a591365c9..95e0501b1e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -51,6 +51,7 @@ struct brw_vs_compile { struct brw_compile func; struct brw_vs_prog_key key; struct brw_vs_prog_data prog_data; + int8_t constant_map[1024]; struct brw_vertex_program *vp; @@ -81,6 +82,8 @@ struct brw_vs_compile { GLint index; struct brw_reg reg; } current_const[3]; + + GLboolean needs_stack; }; void brw_vs_emit( struct brw_vs_compile *c ); diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 1b84dd505f..52cc04fee8 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -104,9 +104,47 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) /* Vertex program parameters from curbe: */ if (c->vp->use_const_buffer) { - /* get constants from a real constant buffer */ - c->prog_data.curb_read_length = 0; - c->prog_data.nr_params = 4; /* XXX 0 causes a bug elsewhere... */ + int max_constant = BRW_MAX_GRF - 20 - c->vp->program.Base.NumTemporaries; + int constant = 0; + + /* We've got more constants than we can load with the push + * mechanism. This is often correlated with reladdr loads where + * we should probably be using a pull mechanism anyway to avoid + * excessive reading. However, the pull mechanism is slow in + * general. So, we try to allocate as many non-reladdr-loaded + * constants through the push buffer as we can before giving up. + */ + memset(c->constant_map, -1, c->vp->program.Base.Parameters->NumParameters); + for (i = 0; + i < c->vp->program.Base.NumInstructions && constant < max_constant; + i++) { + struct prog_instruction *inst = &c->vp->program.Base.Instructions[i]; + int arg; + + for (arg = 0; arg < 3 && constant < max_constant; arg++) { + if ((inst->SrcReg[arg].File != PROGRAM_STATE_VAR && + inst->SrcReg[arg].File != PROGRAM_CONSTANT && + inst->SrcReg[arg].File != PROGRAM_UNIFORM && + inst->SrcReg[arg].File != PROGRAM_ENV_PARAM && + inst->SrcReg[arg].File != PROGRAM_LOCAL_PARAM) || + inst->SrcReg[arg].RelAddr) + continue; + + if (c->constant_map[inst->SrcReg[arg].Index] == -1) { + c->constant_map[inst->SrcReg[arg].Index] = constant++; + } + } + } + + for (i = 0; i < constant; i++) { + c->regs[PROGRAM_STATE_VAR][i] = stride( brw_vec4_grf(reg+i/2, + (i%2) * 4), + 0, 4, 1); + } + reg += (constant + 1) / 2; + c->prog_data.curb_read_length = reg - 1; + /* XXX 0 causes a bug elsewhere... */ + c->prog_data.nr_params = MAX2(constant * 4, 4); } else { /* use a section of the GRF for constants */ @@ -214,8 +252,10 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) } } - c->stack = brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, reg, 0); - reg += 2; + if (c->needs_stack) { + c->stack = brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, reg, 0); + reg += 2; + } /* Some opcodes need an internal temporary: */ @@ -762,15 +802,14 @@ get_constant(struct brw_vs_compile *c, { const struct prog_src_register *src = &inst->SrcReg[argIndex]; struct brw_compile *p = &c->func; - struct brw_reg const_reg; - struct brw_reg const2_reg; - const GLboolean relAddr = src->RelAddr; + struct brw_reg const_reg = c->current_const[argIndex].reg; assert(argIndex < 3); - if (c->current_const[argIndex].index != src->Index || relAddr) { + if (c->current_const[argIndex].index != src->Index) { struct brw_reg addrReg = c->regs[PROGRAM_ADDRESS][0]; + /* Keep track of the last constant loaded in this slot, for reuse. */ c->current_const[argIndex].index = src->Index; #if 0 @@ -779,48 +818,74 @@ get_constant(struct brw_vs_compile *c, #endif /* need to fetch the constant now */ brw_dp_READ_4_vs(p, - c->current_const[argIndex].reg,/* writeback dest */ + const_reg, /* writeback dest */ 0, /* oword */ - relAddr, /* relative indexing? */ + 0, /* relative indexing? */ addrReg, /* address register */ 16 * src->Index, /* byte offset */ SURF_INDEX_VERT_CONST_BUFFER /* binding table index */ ); - - if (relAddr) { - /* second read */ - const2_reg = get_tmp(c); - - /* use upper half of address reg for second read */ - addrReg = stride(addrReg, 0, 4, 0); - addrReg.subnr = 16; - - brw_dp_READ_4_vs(p, - const2_reg, /* writeback dest */ - 1, /* oword */ - relAddr, /* relative indexing? */ - addrReg, /* address register */ - 16 * src->Index, /* byte offset */ - SURF_INDEX_VERT_CONST_BUFFER - ); - } } - const_reg = c->current_const[argIndex].reg; + /* replicate lower four floats into upper half (to get XYZWXYZW) */ + const_reg = stride(const_reg, 0, 4, 0); + const_reg.subnr = 0; - if (relAddr) { - /* merge the two Owords into the constant register */ - /* const_reg[7..4] = const2_reg[7..4] */ - brw_MOV(p, - suboffset(stride(const_reg, 0, 4, 1), 4), - suboffset(stride(const2_reg, 0, 4, 1), 4)); - release_tmp(c, const2_reg); - } - else { - /* replicate lower four floats into upper half (to get XYZWXYZW) */ - const_reg = stride(const_reg, 0, 4, 0); - const_reg.subnr = 0; - } + return const_reg; +} + +static struct brw_reg +get_reladdr_constant(struct brw_vs_compile *c, + const struct prog_instruction *inst, + GLuint argIndex) +{ + const struct prog_src_register *src = &inst->SrcReg[argIndex]; + struct brw_compile *p = &c->func; + struct brw_reg const_reg = c->current_const[argIndex].reg; + struct brw_reg const2_reg; + struct brw_reg addrReg = c->regs[PROGRAM_ADDRESS][0]; + + assert(argIndex < 3); + + /* Can't reuse a reladdr constant load. */ + c->current_const[argIndex].index = -1; + + #if 0 + printf(" fetch const[a0.x+%d] for arg %d into reg %d\n", + src->Index, argIndex, c->current_const[argIndex].reg.nr); +#endif + + /* fetch the first vec4 */ + brw_dp_READ_4_vs(p, + const_reg, /* writeback dest */ + 0, /* oword */ + 1, /* relative indexing? */ + addrReg, /* address register */ + 16 * src->Index, /* byte offset */ + SURF_INDEX_VERT_CONST_BUFFER /* binding table index */ + ); + /* second vec4 */ + const2_reg = get_tmp(c); + + /* use upper half of address reg for second read */ + addrReg = stride(addrReg, 0, 4, 0); + addrReg.subnr = 16; + + brw_dp_READ_4_vs(p, + const2_reg, /* writeback dest */ + 1, /* oword */ + 1, /* relative indexing? */ + addrReg, /* address register */ + 16 * src->Index, /* byte offset */ + SURF_INDEX_VERT_CONST_BUFFER + ); + + /* merge the two Owords into the constant register */ + /* const_reg[7..4] = const2_reg[7..4] */ + brw_MOV(p, + suboffset(stride(const_reg, 0, 4, 1), 4), + suboffset(stride(const2_reg, 0, 4, 1), 4)); + release_tmp(c, const2_reg); return const_reg; } @@ -928,7 +993,13 @@ get_src_reg( struct brw_vs_compile *c, case PROGRAM_ENV_PARAM: case PROGRAM_LOCAL_PARAM: if (c->vp->use_const_buffer) { - return get_constant(c, inst, argIndex); + if (!relAddr && c->constant_map[index] != -1) { + assert(c->regs[PROGRAM_STATE_VAR][c->constant_map[index]].nr != 0); + return c->regs[PROGRAM_STATE_VAR][c->constant_map[index]]; + } else if (relAddr) + return get_reladdr_constant(c, inst, argIndex); + else + return get_constant(c, inst, argIndex); } else if (relAddr) { return deref(c, c->regs[PROGRAM_STATE_VAR][0], index); @@ -1380,12 +1451,14 @@ void brw_vs_emit(struct brw_vs_compile *c ) brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_access_mode(p, BRW_ALIGN_16); - - /* Message registers can't be read, so copy the output into GRF register - if they are used in source registers */ + for (insn = 0; insn < nr_insns; insn++) { GLuint i; struct prog_instruction *inst = &c->vp->program.Base.Instructions[insn]; + + /* Message registers can't be read, so copy the output into GRF + * register if they are used in source registers + */ for (i = 0; i < 3; i++) { struct prog_src_register *src = &inst->SrcReg[i]; GLuint index = src->Index; @@ -1393,12 +1466,23 @@ void brw_vs_emit(struct brw_vs_compile *c ) if (file == PROGRAM_OUTPUT && index != VERT_RESULT_HPOS) c->output_regs[index].used_in_src = GL_TRUE; } + + switch (inst->Opcode) { + case OPCODE_CAL: + case OPCODE_RET: + c->needs_stack = GL_TRUE; + break; + default: + break; + } } /* Static register allocation */ brw_vs_alloc_regs(c); - brw_MOV(p, get_addr_reg(stack_index), brw_address(c->stack)); + + if (c->needs_stack) + brw_MOV(p, get_addr_reg(stack_index), brw_address(c->stack)); for (insn = 0; insn < nr_insns; insn++) { diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index 345ffa7ee1..fd9f2fee42 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -164,8 +164,7 @@ vs_unit_create_from_key(struct brw_context *brw, struct brw_vs_unit_key *key) bo = brw_upload_cache(&brw->cache, BRW_VS_UNIT, key, sizeof(*key), &brw->vs.prog_bo, 1, - &vs, sizeof(vs), - NULL, NULL); + &vs, sizeof(vs)); /* Emit VS program relocation */ dri_bo_emit_reloc(bo, diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 3bc9840a97..ead623fc0e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -35,7 +35,6 @@ #include "brw_context.h" #include "brw_state.h" -#include "brw_defines.h" /* Creates a new VS constant buffer reflecting the current VS program's * constants, if needed by the VS program. @@ -156,7 +155,7 @@ brw_vs_get_binding_table(struct brw_context *brw) if (bind_bo == NULL) { GLuint data_size = BRW_VS_MAX_SURF * sizeof(GLuint); - uint32_t *data = malloc(data_size); + uint32_t data[BRW_VS_MAX_SURF]; int i; for (i = 0; i < BRW_VS_MAX_SURF; i++) @@ -168,8 +167,7 @@ brw_vs_get_binding_table(struct brw_context *brw) bind_bo = brw_upload_cache( &brw->surface_cache, BRW_SS_SURF_BIND, NULL, 0, brw->vs.surf_bo, BRW_VS_MAX_SURF, - data, data_size, - NULL, NULL); + data, data_size); /* Emit binding table relocations to surface state */ for (i = 0; i < BRW_VS_MAX_SURF; i++) { @@ -182,8 +180,6 @@ brw_vs_get_binding_table(struct brw_context *brw) I915_GEM_DOMAIN_INSTRUCTION, 0); } } - - free(data); } return bind_bo; diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 72749b3859..e08f32c4e2 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -44,7 +44,6 @@ #include "brw_state.h" #include "brw_draw.h" #include "brw_state.h" -#include "brw_fallback.h" #include "brw_vs.h" #include "brw_wm.h" @@ -172,12 +171,6 @@ static void brw_new_batch( struct intel_context *intel ) } } - -static void brw_note_fence( struct intel_context *intel, GLuint fence ) -{ - brw_context(&intel->ctx)->state.dirty.brw |= BRW_NEW_FENCE; -} - static void brw_invalidate_state( struct intel_context *intel, GLuint new_state ) { /* nothing */ @@ -193,7 +186,6 @@ void brwInitVtbl( struct brw_context *brw ) brw->intel.vtbl.update_texture_state = 0; brw->intel.vtbl.invalidate_state = brw_invalidate_state; - brw->intel.vtbl.note_fence = brw_note_fence; brw->intel.vtbl.new_batch = brw_new_batch; brw->intel.vtbl.finish_batch = brw_finish_batch; brw->intel.vtbl.destroy = brw_destroy_context; diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 6895f64410..9191c81755 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -30,7 +30,6 @@ */ #include "brw_context.h" -#include "brw_util.h" #include "brw_wm.h" #include "brw_state.h" @@ -199,12 +198,13 @@ static void do_wm_prog( struct brw_context *brw, program = brw_get_program(&c->func, &program_size); dri_bo_unreference(brw->wm.prog_bo); - brw->wm.prog_bo = brw_upload_cache( &brw->cache, BRW_WM_PROG, - &c->key, sizeof(c->key), - NULL, 0, - program, program_size, - &c->prog_data, - &brw->wm.prog_data ); + brw->wm.prog_bo = brw_upload_cache_with_auxdata(&brw->cache, BRW_WM_PROG, + &c->key, sizeof(c->key), + NULL, 0, + program, program_size, + &c->prog_data, + sizeof(c->prog_data), + &brw->wm.prog_data); } @@ -336,11 +336,7 @@ static void brw_wm_populate_key( struct brw_context *brw, * drawable height in order to invert the Y axis. */ if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) { - if (brw->intel.driDrawable != NULL) { - key->origin_x = brw->intel.driDrawable->x; - key->origin_y = brw->intel.driDrawable->y; - key->drawable_height = brw->intel.driDrawable->h; - } + key->drawable_height = ctx->DrawBuffer->Height; } key->nr_color_regions = brw->state.nr_color_regions; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index b9b987ea70..88d84ee82f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -76,7 +76,6 @@ struct brw_wm_prog_key { GLushort tex_swizzles[BRW_MAX_TEX_UNIT]; - GLushort origin_x, origin_y; GLushort drawable_height; GLbitfield64 vp_outputs_written; GLuint program_string_id:32; diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index f316e0cda4..fa0898c586 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -138,19 +138,43 @@ void emit_wpos_xy(struct brw_wm_compile *c, * X and Y channels. */ if (mask & WRITEMASK_X) { - /* X' = X - origin */ - brw_ADD(p, - dst[0], - retype(arg0[0], BRW_REGISTER_TYPE_W), - brw_imm_d(0 - c->key.origin_x)); + if (c->fp->program.PixelCenterInteger) { + /* X' = X */ + brw_MOV(p, + dst[0], + retype(arg0[0], BRW_REGISTER_TYPE_W)); + } else { + /* X' = X + 0.5 */ + brw_ADD(p, + dst[0], + retype(arg0[0], BRW_REGISTER_TYPE_W), + brw_imm_f(0.5)); + } } if (mask & WRITEMASK_Y) { - /* Y' = height - (Y - origin_y) = height + origin_y - Y */ - brw_ADD(p, - dst[1], - negate(retype(arg0[1], BRW_REGISTER_TYPE_W)), - brw_imm_d(c->key.origin_y + c->key.drawable_height - 1)); + if (c->fp->program.OriginUpperLeft) { + if (c->fp->program.PixelCenterInteger) { + /* Y' = Y */ + brw_MOV(p, + dst[1], + retype(arg0[1], BRW_REGISTER_TYPE_W)); + } else { + /* Y' = Y + 0.5 */ + brw_ADD(p, + dst[1], + retype(arg0[1], BRW_REGISTER_TYPE_W), + brw_imm_f(0.5)); + } + } else { + float center_offset = c->fp->program.PixelCenterInteger ? 0.0 : 0.5; + + /* Y' = (height - 1) - Y + center */ + brw_ADD(p, + dst[1], + negate(retype(arg0[1], BRW_REGISTER_TYPE_W)), + brw_imm_f(c->key.drawable_height - 1 + center_offset)); + } } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index ad267a4e6a..87387b1e2d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -326,8 +326,7 @@ static void upload_wm_samplers( struct brw_context *brw ) brw->wm.sampler_bo = brw_upload_cache(&brw->cache, BRW_SAMPLER, &key, sizeof(key), brw->wm.sdc_bo, key.sampler_count, - &sampler, sizeof(sampler), - NULL, NULL); + &sampler, sizeof(sampler)); /* Emit SDC relocations */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index d3373ea79e..a7f80db554 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -210,8 +210,7 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, bo = brw_upload_cache(&brw->cache, BRW_WM_UNIT, key, sizeof(*key), reloc_bufs, 3, - &wm, sizeof(wm), - NULL, NULL); + &wm, sizeof(wm)); /* Emit WM program relocation */ dri_bo_emit_reloc(bo, diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index f26cfabb7d..1db438ae7b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -256,8 +256,7 @@ brw_create_texture_surface( struct brw_context *brw, bo = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, key, sizeof(*key), &key->bo, key->bo ? 1 : 0, - &surf, sizeof(surf), - NULL, NULL); + &surf, sizeof(surf)); if (key->bo) { /* Emit relocation to surface contents */ @@ -351,8 +350,7 @@ brw_create_constant_surface( struct brw_context *brw, bo = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, key, sizeof(*key), &key->bo, key->bo ? 1 : 0, - &surf, sizeof(surf), - NULL, NULL); + &surf, sizeof(surf)); if (key->bo) { /* Emit relocation to surface contents. Section 5.1.1 of the gen4 @@ -579,7 +577,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.draw_y = 0; } /* _NEW_COLOR */ - memcpy(key.color_mask, ctx->Color.ColorMask[0], + memcpy(key.color_mask, ctx->Color.ColorMask[unit], sizeof(key.color_mask)); /* As mentioned above, disable writes to the alpha component when the @@ -589,7 +587,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.color_mask[3] = GL_FALSE; key.color_blend = (!ctx->Color._LogicOpEnabled && - ctx->Color.BlendEnabled); + (ctx->Color.BlendEnabled & (1 << unit))); dri_bo_unreference(brw->wm.surf_bo[unit]); brw->wm.surf_bo[unit] = brw_search_cache(&brw->surface_cache, @@ -653,8 +651,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, BRW_SS_SURFACE, &key, sizeof(key), ®ion_bo, 1, - &surf, sizeof(surf), - NULL, NULL); + &surf, sizeof(surf)); if (region_bo != NULL) { /* We might sample from it, and we might render to it, so flag * them both. We might be able to figure out from other state @@ -701,8 +698,7 @@ brw_wm_get_binding_table(struct brw_context *brw) bind_bo = brw_upload_cache( &brw->surface_cache, BRW_SS_SURF_BIND, NULL, 0, brw->wm.surf_bo, brw->wm.nr_surfaces, - data, data_size, - NULL, NULL); + data, data_size); /* Emit binding table relocations to surface state */ for (i = 0; i < BRW_WM_MAX_SURF; i++) { diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 3a4b21a844..ae0f8a16f9 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -32,44 +32,6 @@ #include "intel_bufmgr.h" #include "intel_buffers.h" -/* Relocations in kernel space: - * - pass dma buffer seperately - * - memory manager knows how to patch - * - pass list of dependent buffers - * - pass relocation list - * - * Either: - * - get back an offset for buffer to fire - * - memory manager knows how to fire buffer - * - * Really want the buffer to be AGP and pinned. - * - */ - -/* Cliprect fence: The highest fence protecting a dma buffer - * containing explicit cliprect information. Like the old drawable - * lock but irq-driven. X server must wait for this fence to expire - * before changing cliprects [and then doing sw rendering?]. For - * other dma buffers, the scheduler will grab current cliprect info - * and mix into buffer. X server must hold the lock while changing - * cliprects??? Make per-drawable. Need cliprects in shared memory - * -- beats storing them with every cmd buffer in the queue. - * - * ==> X server must wait for this fence to expire before touching the - * framebuffer with new cliprects. - * - * ==> Cliprect-dependent buffers associated with a - * cliprect-timestamp. All of the buffers associated with a timestamp - * must go to hardware before any buffer with a newer timestamp. - * - * ==> Dma should be queued per-drawable for correct X/GL - * synchronization. Or can fences be used for this? - * - * Applies to: Blit operations, metaops, X server operations -- X - * server automatically waits on its own dma to complete before - * modifying cliprects ??? - */ - void intel_batchbuffer_reset(struct intel_batchbuffer *batch) { @@ -167,7 +129,8 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, struct intel_context *intel = batch->intel; GLuint used = batch->ptr - batch->map; - if (intel->first_post_swapbuffers_batch == NULL) { + if (!intel->using_dri2_swapbuffers && + intel->first_post_swapbuffers_batch == NULL) { intel->first_post_swapbuffers_batch = intel->batch->buf; drm_intel_bo_reference(intel->first_post_swapbuffers_batch); } diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 55bee0084c..31d4f3d421 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -38,7 +38,6 @@ #include "intel_reg.h" #include "intel_regions.h" #include "intel_batchbuffer.h" -#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_BLIT @@ -103,7 +102,7 @@ intelEmitCopyBlit(struct intel_context *intel, return GL_FALSE; } - /* do space/cliprects check before going any further */ + /* do space check before going any further */ do { aper_array[0] = intel->batch->buf; aper_array[1] = dst_buffer; @@ -213,10 +212,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) struct intel_context *intel = intel_context(ctx); struct gl_framebuffer *fb = ctx->DrawBuffer; GLuint clear_depth; - GLbitfield skipBuffers = 0; - unsigned int num_cliprects; - struct drm_clip_rect *cliprects; - int x_off, y_off; + GLboolean all; + GLint cx, cy, cw, ch; BATCH_LOCALS; /* @@ -230,183 +227,134 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; } - /* If clearing both depth and stencil, skip BUFFER_BIT_STENCIL in - * the loop below. - */ - if ((mask & BUFFER_BIT_DEPTH) && (mask & BUFFER_BIT_STENCIL)) { - skipBuffers = BUFFER_BIT_STENCIL; - } - - intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); - if (num_cliprects) { - GLint cx, cy, cw, ch; - drm_clip_rect_t clear; - int i; - - /* Get clear bounds after locking */ - cx = fb->_Xmin; + cx = fb->_Xmin; + if (fb->Name == 0) + cy = ctx->DrawBuffer->Height - fb->_Ymax; + else cy = fb->_Ymin; - cw = fb->_Xmax - cx; - ch = fb->_Ymax - cy; - - if (fb->Name == 0) { - /* clearing a window */ - - /* flip top to bottom */ - clear.x1 = cx + x_off; - clear.y1 = intel->driDrawable->y + intel->driDrawable->h - cy - ch; - clear.x2 = clear.x1 + cw; - clear.y2 = clear.y1 + ch; - } - else { - /* clearing FBO */ - assert(num_cliprects == 1); - assert(cliprects == &intel->fboRect); - clear.x1 = cx; - clear.y1 = cy; - clear.x2 = clear.x1 + cw; - clear.y2 = clear.y1 + ch; - /* no change to mask */ + cw = fb->_Xmax - fb->_Xmin; + ch = fb->_Ymax - fb->_Ymin; + + if (cw == 0 || ch == 0) + return; + + GLuint buf; + all = (cw == fb->Width && ch == fb->Height); + + /* Loop over all renderbuffers */ + for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { + const GLbitfield bufBit = 1 << buf; + struct intel_renderbuffer *irb; + drm_intel_bo *write_buffer; + int x1, y1, x2, y2; + uint32_t clear_val; + uint32_t BR13, CMD; + int pitch, cpp; + + if (!(mask & bufBit)) + continue; + + /* OK, clear this renderbuffer */ + irb = intel_get_renderbuffer(fb, buf); + write_buffer = intel_region_buffer(intel, irb->region, + all ? INTEL_WRITE_FULL : + INTEL_WRITE_PART); + x1 = cx + irb->region->draw_x; + y1 = cy + irb->region->draw_y; + x2 = cx + cw + irb->region->draw_x; + y2 = cy + ch + irb->region->draw_y; + + pitch = irb->region->pitch; + cpp = irb->region->cpp; + + DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n", + __FUNCTION__, + irb->region->buffer, (pitch * cpp), + x1, y1, x2 - x1, y2 - y1); + + BR13 = 0xf0 << 16; + CMD = XY_COLOR_BLT_CMD; + + /* Setup the blit command */ + if (cpp == 4) { + BR13 |= BR13_8888; + if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { + if (mask & BUFFER_BIT_DEPTH) + CMD |= XY_BLT_WRITE_RGB; + if (mask & BUFFER_BIT_STENCIL) + CMD |= XY_BLT_WRITE_ALPHA; + } else { + /* clearing RGBA */ + CMD |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; + } + } else { + ASSERT(cpp == 2); + BR13 |= BR13_565; } - for (i = 0; i < num_cliprects; i++) { - const drm_clip_rect_t *box = &cliprects[i]; - drm_clip_rect_t b; - GLuint buf; - GLuint clearMask = mask; /* use copy, since we modify it below */ - GLboolean all = (cw == fb->Width && ch == fb->Height); - - if (!all) { - intel_intersect_cliprects(&b, &clear, box); - } - else { - b = *box; - } - - if (b.x1 >= b.x2 || b.y1 >= b.y2) - continue; - - if (0) - _mesa_printf("clear %d,%d..%d,%d, mask %x\n", - b.x1, b.y1, b.x2, b.y2, mask); - - /* Loop over all renderbuffers */ - for (buf = 0; buf < BUFFER_COUNT && clearMask; buf++) { - const GLbitfield bufBit = 1 << buf; - if ((clearMask & bufBit) && !(bufBit & skipBuffers)) { - /* OK, clear this renderbuffer */ - struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, buf); - dri_bo *write_buffer = - intel_region_buffer(intel, irb->region, - all ? INTEL_WRITE_FULL : - INTEL_WRITE_PART); - int x1 = b.x1 + irb->region->draw_x; - int y1 = b.y1 + irb->region->draw_y; - int x2 = b.x2 + irb->region->draw_x; - int y2 = b.y2 + irb->region->draw_y; - - GLuint clearVal; - GLint pitch, cpp; - GLuint BR13, CMD; - - pitch = irb->region->pitch; - cpp = irb->region->cpp; - - DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n", - __FUNCTION__, - irb->region->buffer, (pitch * cpp), - x1, y1, x2 - x1, y2 - y1); - - BR13 = 0xf0 << 16; - CMD = XY_COLOR_BLT_CMD; - - /* Setup the blit command */ - if (cpp == 4) { - BR13 |= BR13_8888; - if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { - if (clearMask & BUFFER_BIT_DEPTH) - CMD |= XY_BLT_WRITE_RGB; - if (clearMask & BUFFER_BIT_STENCIL) - CMD |= XY_BLT_WRITE_ALPHA; - } - else { - /* clearing RGBA */ - CMD |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; - } - } - else { - ASSERT(cpp == 2); - BR13 |= BR13_565; - } - - assert(irb->region->tiling != I915_TILING_Y); + assert(irb->region->tiling != I915_TILING_Y); #ifndef I915 - if (irb->region->tiling != I915_TILING_NONE) { - CMD |= XY_DST_TILED; - pitch /= 4; - } + if (irb->region->tiling != I915_TILING_NONE) { + CMD |= XY_DST_TILED; + pitch /= 4; + } #endif - BR13 |= (pitch * cpp); - - if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { - clearVal = clear_depth; - } - else { - uint8_t clear[4]; - GLclampf *color = ctx->Color.ClearColor; - - CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); - - switch (irb->Base.Format) { - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_XRGB8888: - clearVal = PACK_COLOR_8888(clear[3], clear[0], - clear[1], clear[2]); - break; - case MESA_FORMAT_RGB565: - clearVal = PACK_COLOR_565(clear[0], clear[1], clear[2]); - break; - case MESA_FORMAT_ARGB4444: - clearVal = PACK_COLOR_4444(clear[3], clear[0], - clear[1], clear[2]); - break; - case MESA_FORMAT_ARGB1555: - clearVal = PACK_COLOR_1555(clear[3], clear[0], - clear[1], clear[2]); - break; - default: - _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", - irb->Base.Format); - clearVal = 0; - } - } - - /* - _mesa_debug(ctx, "hardware blit clear buf %d rb id %d\n", - buf, irb->Base.Name); - */ - - assert(x1 < x2); - assert(y1 < y2); - - BEGIN_BATCH(6); - OUT_BATCH(CMD); - OUT_BATCH(BR13); - OUT_BATCH((y1 << 16) | x1); - OUT_BATCH((y2 << 16) | x2); - OUT_RELOC(write_buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - 0); - OUT_BATCH(clearVal); - ADVANCE_BATCH(); - clearMask &= ~bufBit; /* turn off bit, for faster loop exit */ - } - } + BR13 |= (pitch * cpp); + + if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { + clear_val = clear_depth; + } else { + uint8_t clear[4]; + GLclampf *color = ctx->Color.ClearColor; + + CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); + + switch (irb->Base.Format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + clear_val = PACK_COLOR_8888(clear[3], clear[0], + clear[1], clear[2]); + break; + case MESA_FORMAT_RGB565: + clear_val = PACK_COLOR_565(clear[0], clear[1], clear[2]); + break; + case MESA_FORMAT_ARGB4444: + clear_val = PACK_COLOR_4444(clear[3], clear[0], + clear[1], clear[2]); + break; + case MESA_FORMAT_ARGB1555: + clear_val = PACK_COLOR_1555(clear[3], clear[0], + clear[1], clear[2]); + break; + default: + _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", + irb->Base.Format); + clear_val = 0; + } } + + assert(x1 < x2); + assert(y1 < y2); + + BEGIN_BATCH(6); + OUT_BATCH(CMD); + OUT_BATCH(BR13); + OUT_BATCH((y1 << 16) | x1); + OUT_BATCH((y2 << 16) | x2); + OUT_RELOC(write_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + 0); + OUT_BATCH(clear_val); + ADVANCE_BATCH(); + + if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) + mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL); + else + mask &= ~bufBit; /* turn off bit, for faster loop exit */ } } diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 7c4b79f743..2f03e45005 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -28,45 +28,7 @@ #include "intel_context.h" #include "intel_buffers.h" #include "intel_fbo.h" -#include "intel_regions.h" -#include "intel_batchbuffer.h" #include "main/framebuffer.h" -#include "drirenderbuffer.h" - - -/** - * XXX move this into a new dri/common/cliprects.c file. - */ -GLboolean -intel_intersect_cliprects(drm_clip_rect_t * dst, - const drm_clip_rect_t * a, - const drm_clip_rect_t * b) -{ - GLint bx = b->x1; - GLint by = b->y1; - GLint bw = b->x2 - bx; - GLint bh = b->y2 - by; - - if (bx < a->x1) - bw -= a->x1 - bx, bx = a->x1; - if (by < a->y1) - bh -= a->y1 - by, by = a->y1; - if (bx + bw > a->x2) - bw = a->x2 - bx; - if (by + bh > a->y2) - bh = a->y2 - by; - if (bw <= 0) - return GL_FALSE; - if (bh <= 0) - return GL_FALSE; - - dst->x1 = bx; - dst->y1 = by; - dst->x2 = bx + bw; - dst->y2 = by + bh; - - return GL_TRUE; -} /** * Return pointer to current color drawing region, or NULL. @@ -96,24 +58,6 @@ intel_readbuf_region(struct intel_context *intel) return NULL; } -void -intel_get_cliprects(struct intel_context *intel, - struct drm_clip_rect **cliprects, - unsigned int *num_cliprects, - int *x_off, int *y_off) -{ - intel->fboRect.x1 = 0; - intel->fboRect.y1 = 0; - intel->fboRect.x2 = intel->ctx.DrawBuffer->Width; - intel->fboRect.y2 = intel->ctx.DrawBuffer->Height; - - *cliprects = &intel->fboRect; - *num_cliprects = 1; - *x_off = 0; - *y_off = 0; -} - - /** * Check if we're about to draw into the front color buffer. * If so, set the intel->front_buffer_dirty field to true. diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index d7800f2ca2..abb86aade6 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -35,12 +35,6 @@ struct intel_context; struct intel_framebuffer; - -extern GLboolean -intel_intersect_cliprects(drm_clip_rect_t * dest, - const drm_clip_rect_t * a, - const drm_clip_rect_t * b); - extern struct intel_region *intel_readbuf_region(struct intel_context *intel); extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 956f2339ff..ca78681538 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -33,12 +33,9 @@ #include "intel_context.h" #include "intel_blit.h" -#include "intel_chipset.h" #include "intel_clear.h" #include "intel_fbo.h" -#include "intel_pixel.h" #include "intel_regions.h" -#include "intel_batchbuffer.h" #define FILE_DEBUG_FLAG DEBUG_BLIT diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 3f6634c65a..0adee6131e 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -28,7 +28,6 @@ #include "main/glheader.h" #include "main/context.h" -#include "main/arrayobj.h" #include "main/extensions.h" #include "main/framebuffer.h" #include "main/imports.h" @@ -52,13 +51,11 @@ #include "intel_regions.h" #include "intel_buffer_objects.h" #include "intel_fbo.h" -#include "intel_decode.h" #include "intel_bufmgr.h" #include "intel_screen.h" #include "drirenderbuffer.h" #include "utils.h" -#include "xmlpool.h" /* for symbolic values of enum-type options */ #ifndef INTEL_DEBUG @@ -522,7 +519,8 @@ intel_glFlush(GLcontext *ctx) * and getting our hands on that doesn't seem worth it, so we just us the * first batch we emitted after the last swap. */ - if (intel->first_post_swapbuffers_batch != NULL) { + if (!intel->using_dri2_swapbuffers && + intel->first_post_swapbuffers_batch != NULL) { drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch); drm_intel_bo_unreference(intel->first_post_swapbuffers_batch); intel->first_post_swapbuffers_batch = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 07207bfbec..36abef470a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -107,7 +107,6 @@ struct intel_context void (*finish_batch) (struct intel_context * intel); void (*new_batch) (struct intel_context * intel); void (*emit_invarient_state) (struct intel_context * intel); - void (*note_fence) (struct intel_context *intel, GLuint fence); void (*update_texture_state) (struct intel_context * intel); void (*render_start) (struct intel_context * intel); @@ -125,40 +124,6 @@ struct intel_context void (*invalidate_state) (struct intel_context *intel, GLuint new_state); - - /* Metaops: - */ - void (*install_meta_state) (struct intel_context * intel); - void (*leave_meta_state) (struct intel_context * intel); - - void (*meta_draw_region) (struct intel_context * intel, - struct intel_region * draw_region, - struct intel_region * depth_region); - - void (*meta_color_mask) (struct intel_context * intel, GLboolean); - - void (*meta_stencil_replace) (struct intel_context * intel, - GLuint mask, GLuint clear); - - void (*meta_depth_replace) (struct intel_context * intel); - - void (*meta_texture_blend_replace) (struct intel_context * intel); - - void (*meta_no_stencil_write) (struct intel_context * intel); - void (*meta_no_depth_write) (struct intel_context * intel); - void (*meta_no_texture) (struct intel_context * intel); - - void (*meta_import_pixel_state) (struct intel_context * intel); - void (*meta_frame_buffer_texture) (struct intel_context *intel, - GLint xoff, GLint yoff); - - GLboolean(*meta_tex_rect_source) (struct intel_context * intel, - dri_bo * buffer, - GLuint offset, - GLuint pitch, - GLuint height, - GLenum format, GLenum type); - void (*assert_not_dirty) (struct intel_context *intel); void (*debug_batch)(struct intel_context *intel); @@ -187,6 +152,7 @@ struct intel_context struct intel_batchbuffer *batch; drm_intel_bo *first_post_swapbuffers_batch; GLboolean no_batch_wrap; + GLboolean using_dri2_swapbuffers; struct { @@ -273,10 +239,6 @@ struct intel_context GLboolean use_texture_tiling; GLboolean use_early_z; - drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */ - - drm_clip_rect_t draw_rect; - drm_clip_rect_t scissor_rect; int driFd; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 5ac5ce10af..84c8d013e3 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -48,6 +48,7 @@ #define need_GL_EXT_blend_func_separate #define need_GL_EXT_blend_minmax #define need_GL_EXT_cull_vertex +#define need_GL_EXT_draw_buffers2 #define need_GL_EXT_fog_coord #define need_GL_EXT_framebuffer_object #define need_GL_EXT_framebuffer_blit @@ -154,12 +155,14 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_fragment_program_shadow", NULL }, { "GL_ARB_fragment_shader", NULL }, { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions}, + { "GL_ARB_half_float_vertex", NULL }, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_point_sprite", NULL }, { "GL_ARB_seamless_cube_map", NULL }, { "GL_ARB_shadow", NULL }, { "GL_MESA_texture_signed_rgba", NULL }, { "GL_ARB_texture_non_power_of_two", NULL }, + { "GL_EXT_draw_buffers2", GL_EXT_draw_buffers2_functions }, { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, { "GL_EXT_texture_sRGB", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 82e4150c6a..cb5a341050 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -29,7 +29,6 @@ #include "intel_mipmap_tree.h" #include "intel_regions.h" #include "intel_tex_layout.h" -#include "intel_chipset.h" #ifndef I915 #include "brw_state.h" #endif diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 5142f3dcd9..cb088e4032 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -29,14 +29,7 @@ #include "main/state.h" #include "main/bufferobj.h" #include "main/context.h" -#include "main/enable.h" -#include "main/matrix.h" -#include "main/texstate.h" -#include "main/varray.h" -#include "main/viewport.h" #include "swrast/swrast.h" -#include "shader/arbprogram.h" -#include "shader/program.h" #include "intel_context.h" #include "intel_pixel.h" diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 85e5ad2cdd..1e517650b7 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -37,7 +37,6 @@ #include "main/polygon.h" #include "main/state.h" #include "main/teximage.h" -#include "main/texenv.h" #include "main/texobj.h" #include "main/texstate.h" #include "main/texparam.h" @@ -46,7 +45,6 @@ #include "main/enable.h" #include "main/viewport.h" #include "shader/arbprogram.h" -#include "glapi/dispatch.h" #include "swrast/swrast.h" #include "intel_screen.h" @@ -54,7 +52,6 @@ #include "intel_batchbuffer.h" #include "intel_blit.h" #include "intel_regions.h" -#include "intel_buffer_objects.h" #include "intel_buffers.h" #include "intel_pixel.h" #include "intel_reg.h" @@ -106,7 +103,7 @@ static void set_bit( GLubyte *dest, GLuint bit ) } /* Extract a rectangle's worth of data from the bitmap. Called - * per-cliprect. + * per chunk of HW-sized bitmap. */ static GLuint get_bitmap_rect(GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, @@ -191,11 +188,12 @@ do_blit_bitmap( GLcontext *ctx, GLfloat tmpColor[4]; GLubyte ubcolor[4]; GLuint color; - unsigned int num_cliprects; - drm_clip_rect_t *cliprects; - int x_off, y_off; GLsizei bitmap_width = width; GLsizei bitmap_height = height; + GLint px, py; + GLuint stipple[32]; + GLint orig_dstx = dstx; + GLint orig_dsty = dsty; /* Update draw buffer bounds */ _mesa_update_state(ctx); @@ -236,90 +234,60 @@ do_blit_bitmap( GLcontext *ctx, if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F)) return GL_FALSE; - intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); - if (num_cliprects != 0) { - GLuint i; - GLint orig_dstx = dstx; - GLint orig_dsty = dsty; - - /* Clip to buffer bounds and scissor. */ - if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, - fb->_Xmax, fb->_Ymax, - &dstx, &dsty, &width, &height)) - goto out; - - dstx = x_off + dstx; - dsty = y_off + y_flip(fb, dsty, height); - - for (i = 0; i < num_cliprects; i++) { - int box_x, box_y, box_w, box_h; - GLint px, py; - GLuint stipple[32]; - - box_x = dstx; - box_y = dsty; - box_w = width; - box_h = height; - - /* Clip to drawable cliprect */ - if (!_mesa_clip_to_region(cliprects[i].x1, - cliprects[i].y1, - cliprects[i].x2, - cliprects[i].y2, - &box_x, &box_y, &box_w, &box_h)) - continue; + /* Clip to buffer bounds and scissor. */ + if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, + fb->_Xmax, fb->_Ymax, + &dstx, &dsty, &width, &height)) + goto out; + + dsty = y_flip(fb, dsty, height); #define DY 32 #define DX 32 - /* Then, finally, chop it all into chunks that can be - * digested by hardware: + /* Chop it all into chunks that can be digested by hardware: */ + for (py = 0; py < height; py += DY) { + for (px = 0; px < width; px += DX) { + int h = MIN2(DY, height - py); + int w = MIN2(DX, width - px); + GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8; + GLenum logic_op = ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY; + + assert(sz <= sizeof(stipple)); + memset(stipple, 0, sz); + + /* May need to adjust this when padding has been introduced in + * sz above: + * + * Have to translate destination coordinates back into source + * coordinates. */ - for (py = 0; py < box_h; py += DY) { - for (px = 0; px < box_w; px += DX) { - int h = MIN2(DY, box_h - py); - int w = MIN2(DX, box_w - px); - GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8; - GLenum logic_op = ctx->Color.ColorLogicOpEnabled ? - ctx->Color.LogicOp : GL_COPY; - - assert(sz <= sizeof(stipple)); - memset(stipple, 0, sz); - - /* May need to adjust this when padding has been introduced in - * sz above: - * - * Have to translate destination coordinates back into source - * coordinates. - */ - if (get_bitmap_rect(bitmap_width, bitmap_height, unpack, - bitmap, - -orig_dstx + (box_x + px - x_off), - -orig_dsty + y_flip(fb, - box_y + py - y_off, h), - w, h, - (GLubyte *)stipple, - 8, - fb->Name == 0 ? GL_TRUE : GL_FALSE) == 0) - continue; - - if (!intelEmitImmediateColorExpandBlit(intel, - dst->cpp, - (GLubyte *)stipple, - sz, - color, - dst->pitch, - dst->buffer, - 0, - dst->tiling, - box_x + px, - box_y + py, - w, h, - logic_op)) { - return GL_FALSE; - } - } - } + if (get_bitmap_rect(bitmap_width, bitmap_height, unpack, + bitmap, + -orig_dstx + (dstx + px), + -orig_dsty + y_flip(fb, dsty + py, h), + w, h, + (GLubyte *)stipple, + 8, + fb->Name == 0 ? GL_TRUE : GL_FALSE) == 0) + continue; + + if (!intelEmitImmediateColorExpandBlit(intel, + dst->cpp, + (GLubyte *)stipple, + sz, + color, + dst->pitch, + dst->buffer, + 0, + dst->tiling, + dstx + px, + dsty + py, + w, h, + logic_op)) { + return GL_FALSE; + } } } out: diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index e002516cdd..87c293d8b0 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -112,9 +112,10 @@ do_blit_copypixels(GLcontext * ctx, struct intel_region *src = copypix_src_region(intel, type); struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_framebuffer *read_fb = ctx->ReadBuffer; - unsigned int num_cliprects; - drm_clip_rect_t *cliprects; - int x_off, y_off; + GLint orig_dstx; + GLint orig_dsty; + GLint orig_srcx; + GLint orig_srcy; if (type == GL_DEPTH || type == GL_STENCIL) { if (INTEL_DEBUG & DEBUG_FALLBACKS) @@ -135,94 +136,56 @@ do_blit_copypixels(GLcontext * ctx, if (!src || !dst) return GL_FALSE; - - intelFlush(&intel->ctx); - intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); - if (num_cliprects != 0) { - GLint delta_x; - GLint delta_y; - GLint orig_dstx; - GLint orig_dsty; - GLint orig_srcx; - GLint orig_srcy; - GLuint i; - - /* XXX: We fail to handle different inversion between read and draw framebuffer. */ - - /* Clip to destination buffer. */ - orig_dstx = dstx; - orig_dsty = dsty; - if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, - fb->_Xmax, fb->_Ymax, - &dstx, &dsty, &width, &height)) - goto out; - /* Adjust src coords for our post-clipped destination origin */ - srcx += dstx - orig_dstx; - srcy += dsty - orig_dsty; - - /* Clip to source buffer. */ - orig_srcx = srcx; - orig_srcy = srcy; - if (!_mesa_clip_to_region(0, 0, - read_fb->Width, read_fb->Height, - &srcx, &srcy, &width, &height)) - goto out; - /* Adjust dst coords for our post-clipped source origin */ - dstx += srcx - orig_srcx; - dsty += srcy - orig_srcy; - - /* Convert from GL to hardware coordinates: - */ - if (fb->Name == 0) { - /* copypixels to a system framebuffer */ - dstx = x_off + dstx; - dsty = y_off + (fb->Height - dsty - height); - } else { - /* copypixels to a user framebuffer object */ - dstx = x_off + dstx; - dsty = y_off + dsty; - } - - /* Flip source Y if it's a system framebuffer. */ - if (read_fb->Name == 0) { - srcx = intel->driReadDrawable->x + srcx; - srcy = intel->driReadDrawable->y + (fb->Height - srcy - height); - } - - delta_x = srcx - dstx; - delta_y = srcy - dsty; - /* Could do slightly more clipping: Eg, take the intersection of - * the destination cliprects and the read drawable cliprects - * - * This code will not overwrite other windows, but will - * introduce garbage when copying from obscured window regions. - */ - for (i = 0; i < num_cliprects; i++) { - GLint clip_x = dstx; - GLint clip_y = dsty; - GLint clip_w = width; - GLint clip_h = height; - - if (!_mesa_clip_to_region(cliprects[i].x1, cliprects[i].y1, - cliprects[i].x2, cliprects[i].y2, - &clip_x, &clip_y, &clip_w, &clip_h)) - continue; - - if (!intel_region_copy(intel, - dst, 0, clip_x, clip_y, - src, 0, clip_x + delta_x, clip_y + delta_y, - clip_w, clip_h, - ctx->Color.ColorLogicOpEnabled ? - ctx->Color.LogicOp : GL_COPY)) { - DBG("%s: blit failure\n", __FUNCTION__); - return GL_FALSE; - } - } + /* XXX: We fail to handle different inversion between read and draw framebuffer. */ + + /* Clip to destination buffer. */ + orig_dstx = dstx; + orig_dsty = dsty; + if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin, + fb->_Xmax, fb->_Ymax, + &dstx, &dsty, &width, &height)) + goto out; + /* Adjust src coords for our post-clipped destination origin */ + srcx += dstx - orig_dstx; + srcy += dsty - orig_dsty; + + /* Clip to source buffer. */ + orig_srcx = srcx; + orig_srcy = srcy; + if (!_mesa_clip_to_region(0, 0, + read_fb->Width, read_fb->Height, + &srcx, &srcy, &width, &height)) + goto out; + /* Adjust dst coords for our post-clipped source origin */ + dstx += srcx - orig_srcx; + dsty += srcy - orig_srcy; + + /* Convert from GL to hardware coordinates: */ + if (fb->Name == 0) { + /* copypixels to a system framebuffer */ + dsty = fb->Height - dsty - height; + } else { + /* copypixels to a user framebuffer object */ + dsty = dsty; } -out: + /* Flip source Y if it's a system framebuffer. */ + if (read_fb->Name == 0) + srcy = fb->Height - srcy - height; + + if (!intel_region_copy(intel, + dst, 0, dstx, dsty, + src, 0, srcx, srcy, + width, height, + ctx->Color.ColorLogicOpEnabled ? + ctx->Color.LogicOp : GL_COPY)) { + DBG("%s: blit failure\n", __FUNCTION__); + return GL_FALSE; + } + +out: intel_check_front_buffer_rendering(intel); DBG("%s: success\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index b870e9315e..10177228bd 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -46,10 +46,6 @@ #include "drivers/common/meta.h" #include "intel_context.h" -#include "intel_batchbuffer.h" -#include "intel_blit.h" -#include "intel_buffers.h" -#include "intel_regions.h" #include "intel_pixel.h" #include "intel_fbo.h" diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 9c0fdc6067..a98e8e16c2 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -36,7 +36,6 @@ #include "intel_screen.h" #include "intel_context.h" -#include "intel_batchbuffer.h" #include "intel_blit.h" #include "intel_buffers.h" #include "intel_regions.h" @@ -65,99 +64,6 @@ * any case. */ - -static GLboolean -do_texture_readpixels(GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *pack, - struct intel_region *dest_region) -{ -#if 0 - struct intel_context *intel = intel_context(ctx); - intelScreenPrivate *screen = intel->intelScreen; - GLint pitch = pack->RowLength ? pack->RowLength : width; - __DRIdrawable *dPriv = intel->driDrawable; - int textureFormat; - GLenum glTextureFormat; - int destFormat, depthFormat, destPitch; - drm_clip_rect_t tmp; - - if (INTEL_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s\n", __FUNCTION__); - - - if (ctx->_ImageTransferState || - pack->SwapBytes || pack->LsbFirst || !pack->Invert) { - if (INTEL_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s: check_color failed\n", __FUNCTION__); - return GL_FALSE; - } - - intel->vtbl.meta_texrect_source(intel, intel_readbuf_region(intel)); - - if (!intel->vtbl.meta_render_dest(intel, dest_region, type, format)) { - if (INTEL_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s: couldn't set dest %s/%s\n", - __FUNCTION__, - _mesa_lookup_enum_by_nr(type), - _mesa_lookup_enum_by_nr(format)); - return GL_FALSE; - } - - if (intel->driDrawable->numClipRects) { - intel->vtbl.install_meta_state(intel); - intel->vtbl.meta_no_depth_write(intel); - intel->vtbl.meta_no_stencil_write(intel); - - if (!driClipRectToFramebuffer(ctx->ReadBuffer, &x, &y, &width, &height)) { - SET_STATE(i830, state); - if (INTEL_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s: cliprect failed\n", __FUNCTION__); - return GL_TRUE; - } - - y = dPriv->h - y - height; - x += dPriv->x; - y += dPriv->y; - - - /* Set the frontbuffer up as a large rectangular texture. - */ - intel->vtbl.meta_tex_rect_source(intel, src_region, textureFormat); - - - intel->vtbl.meta_texture_blend_replace(i830, glTextureFormat); - - - /* Set the 3d engine to draw into the destination region: - */ - - intel->vtbl.meta_draw_region(intel, dest_region); - intel->vtbl.meta_draw_format(intel, destFormat, depthFormat); /* ?? */ - - - /* Draw a single quad, no cliprects: - */ - intel->vtbl.meta_disable_cliprects(intel); - - intel->vtbl.draw_quad(intel, - 0, width, 0, height, - 0x00ff00ff, x, x + width, y, y + height); - - intel->vtbl.leave_meta_state(intel); - } - - intel_region_wait_fence(ctx, dest_region); /* required by GL */ - return GL_TRUE; -#endif - - return GL_FALSE; -} - - - - static GLboolean do_blit_readpixels(GLcontext * ctx, GLint x, GLint y, GLsizei width, GLsizei height, @@ -169,6 +75,9 @@ do_blit_readpixels(GLcontext * ctx, struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj); GLuint dst_offset; GLuint rowLength; + drm_intel_bo *dst_buffer; + GLboolean all; + GLint dst_x, dst_y; if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s\n", __FUNCTION__); @@ -209,56 +118,42 @@ do_blit_readpixels(GLcontext * ctx, return GL_FALSE; } else { - rowLength = -rowLength; + if (ctx->ReadBuffer->Name == 0) + rowLength = -rowLength; } dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height, format, type, 0, 0, 0); + if (!_mesa_clip_copytexsubimage(ctx, + &dst_x, &dst_y, + &x, &y, + &width, &height)) { + return GL_TRUE; + } - /* Although the blits go on the command buffer, need to do this and - * fire with lock held to guarentee cliprects are correct. - */ - intelFlush(&intel->ctx); - - if (intel->driReadDrawable->numClipRects) { - GLboolean all = (width * height * src->cpp == dst->Base.Size && - x == 0 && dst_offset == 0); - - dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst, - all ? INTEL_WRITE_FULL : - INTEL_WRITE_PART); - __DRIdrawable *dPriv = intel->driReadDrawable; - int nbox = dPriv->numClipRects; - drm_clip_rect_t *box = dPriv->pClipRects; - drm_clip_rect_t rect; - drm_clip_rect_t src_rect; - int i; - - src_rect.x1 = dPriv->x + x; - src_rect.y1 = dPriv->y + dPriv->h - (y + height); - src_rect.x2 = src_rect.x1 + width; - src_rect.y2 = src_rect.y1 + height; + all = (width * height * src->cpp == dst->Base.Size && + x == 0 && dst_offset == 0); + dst_x = 0; + dst_y = 0; + dst_buffer = intel_bufferobj_buffer(intel, dst, + all ? INTEL_WRITE_FULL : + INTEL_WRITE_PART); - for (i = 0; i < nbox; i++) { - if (!intel_intersect_cliprects(&rect, &src_rect, &box[i])) - continue; + if (ctx->ReadBuffer->Name == 0) + y = ctx->ReadBuffer->Height - (y + height); - if (!intelEmitCopyBlit(intel, - src->cpp, - src->pitch, src->buffer, 0, src->tiling, - rowLength, dst_buffer, dst_offset, GL_FALSE, - rect.x1, - rect.y1, - rect.x1 - src_rect.x1, - rect.y2 - src_rect.y2, - rect.x2 - rect.x1, rect.y2 - rect.y1, - GL_COPY)) { - return GL_FALSE; - } - } + if (!intelEmitCopyBlit(intel, + src->cpp, + src->pitch, src->buffer, 0, src->tiling, + rowLength, dst_buffer, dst_offset, GL_FALSE, + x, y, + dst_x, dst_y, + width, height, + GL_COPY)) { + return GL_FALSE; } if (INTEL_DEBUG & DEBUG_PIXEL) @@ -282,15 +177,6 @@ intelReadPixels(GLcontext * ctx, (ctx, x, y, width, height, format, type, pack, pixels)) return; -#ifdef I915 - if (do_texture_readpixels - (ctx, x, y, width, height, format, type, pack, pixels)) - return; -#else - (void)do_blit_readpixels; - (void)do_texture_readpixels; -#endif - if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index 61aefa01b8..301c3df17c 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -48,7 +48,6 @@ #include "intel_buffer_objects.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" -#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_REGION @@ -443,6 +442,7 @@ intel_region_attach_pbo(struct intel_context *intel, region->pbo->region = region; dri_bo_reference(buffer); region->buffer = buffer; + region->tiling = I915_TILING_NONE; } diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index e240957197..e8cc202f88 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -37,15 +37,11 @@ #include "intel_buffers.h" #include "intel_bufmgr.h" #include "intel_chipset.h" -#include "intel_extensions.h" #include "intel_fbo.h" -#include "intel_regions.h" #include "intel_screen.h" -#include "intel_span.h" #include "intel_tex.h" #include "i915_drm.h" -#include "i830_dri.h" #define DRI_CONF_TEXTURE_TILING(def) \ DRI_CONF_OPT_BEGIN(texture_tiling, bool, def) \ @@ -128,8 +124,14 @@ intelDRI2Flush(__DRIdrawable *drawable) static void intelDRI2FlushInvalidate(__DRIdrawable *drawable) { + struct intel_context *intel = drawable->driContextPriv->driverPrivate; + + intel->using_dri2_swapbuffers = GL_TRUE; + intelDRI2Flush(drawable); drawable->validBuffers = GL_FALSE; + + intel_update_renderbuffers(intel->driContext, drawable); } static const struct __DRI2flushExtensionRec intelFlushExtension = { diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 605734d8e5..d925cb9997 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -259,36 +259,20 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define DBG 0 #define LOCAL_VARS \ - struct intel_context *intel = intel_context(ctx); \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \ const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\ - unsigned int num_cliprects; \ - struct drm_clip_rect *cliprects; \ - int x_off, y_off; \ + int minx = 0, miny = 0; \ + int maxx = ctx->DrawBuffer->Width; \ + int maxy = ctx->DrawBuffer->Height; \ int pitch = irb->region->pitch * irb->region->cpp; \ void *buf = irb->region->buffer->virtual; \ GLuint p; \ (void) p; \ (void)buf; (void)pitch; /* unused for non-gttmap. */ \ - intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); -/* XXX FBO: this is identical to the macro in spantmp2.h except we get - * the cliprect info from the context, not the driDrawable. - * Move this into spantmp2.h someday. - */ -#define HW_CLIPLOOP() \ - do { \ - int _nc = num_cliprects; \ - while ( _nc-- ) { \ - int minx = cliprects[_nc].x1 - x_off; \ - int miny = cliprects[_nc].y1 - y_off; \ - int maxx = cliprects[_nc].x2 - x_off; \ - int maxy = cliprects[_nc].y2 - y_off; - -#if 0 - }} -#endif +#define HW_CLIPLOOP() +#define HW_ENDCLIPLOOP() #define Y_FLIP(_y) ((_y) * yScale + yBias) @@ -297,9 +281,9 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define HW_UNLOCK() /* Convenience macros to avoid typing the swizzle argument over and over */ -#define NO_TILE(_X, _Y) no_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off) -#define X_TILE(_X, _Y) x_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off) -#define Y_TILE(_X, _Y) y_tile_swizzle(irb, (_X) + x_off, (_Y) + y_off) +#define NO_TILE(_X, _Y) no_tile_swizzle(irb, (_X), (_Y)) +#define X_TILE(_X, _Y) x_tile_swizzle(irb, (_X), (_Y)) +#define Y_TILE(_X, _Y) y_tile_swizzle(irb, (_X), (_Y)) /* r5g6b5 color span and pixel functions */ #define INTEL_PIXEL_FMT GL_RGB @@ -342,18 +326,15 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #include "intel_spantmp.h" #define LOCAL_DEPTH_VARS \ - struct intel_context *intel = intel_context(ctx); \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \ const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\ - unsigned int num_cliprects; \ - struct drm_clip_rect *cliprects; \ - int x_off, y_off; \ + int minx = 0, miny = 0; \ + int maxx = ctx->DrawBuffer->Width; \ + int maxy = ctx->DrawBuffer->Height; \ int pitch = irb->region->pitch * irb->region->cpp; \ void *buf = irb->region->buffer->virtual; \ (void)buf; (void)pitch; /* unused for non-gttmap. */ \ - intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); - #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS diff --git a/src/mesa/drivers/dri/intel/intel_state.c b/src/mesa/drivers/dri/intel/intel_state.c index aefae53eb2..c5ef909dbf 100644 --- a/src/mesa/drivers/dri/intel/intel_state.c +++ b/src/mesa/drivers/dri/intel/intel_state.c @@ -35,8 +35,6 @@ #include "intel_screen.h" #include "intel_context.h" -#include "intel_regions.h" -#include "swrast/swrast.h" int intel_translate_shadow_compare_func(GLenum func) diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index d8e71093c4..d67451cf8e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -36,7 +36,6 @@ #include "intel_screen.h" #include "intel_context.h" -#include "intel_batchbuffer.h" #include "intel_buffers.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" @@ -114,8 +113,6 @@ do_copy_texsubimage(struct intel_context *intel, drm_intel_bo *dst_bo = intel_region_buffer(intel, intelImage->mt->region, INTEL_WRITE_PART); - const GLint orig_x = x; - const GLint orig_y = y; GLuint image_x, image_y; GLshort src_pitch; @@ -125,9 +122,6 @@ do_copy_texsubimage(struct intel_context *intel, intelImage->face, 0, &image_x, &image_y); - /* Update dst for clipped src. Need to also clip the source rect. */ - dstx += x - orig_x; - dsty += y - orig_y; /* Can't blit to tiled buffers with non-tile-aligned offset. */ if (intelImage->mt->region->tiling == I915_TILING_Y) { diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index a7c6c45ffe..7be5231eae 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -1,6 +1,5 @@ #include "intel_context.h" #include "intel_tex.h" -#include "intel_chipset.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 6f41eafd0e..a56e085b90 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -7,7 +7,6 @@ #include "main/convolve.h" #include "main/context.h" #include "main/formats.h" -#include "main/image.h" #include "main/texcompress.h" #include "main/texstore.h" #include "main/texgetimage.h" @@ -241,7 +240,8 @@ try_pbo_upload(struct intel_context *intel, if (!intelEmitCopyBlit(intel, intelImage->mt->cpp, src_stride, src_buffer, src_offset, GL_FALSE, - dst_stride, dst_buffer, 0, GL_FALSE, + dst_stride, dst_buffer, 0, + intelImage->mt->region->tiling, 0, 0, dst_x, dst_y, width, height, GL_COPY)) { return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index c9a24ac398..ed5c5d896b 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -2,10 +2,8 @@ #include "main/macros.h" #include "intel_context.h" -#include "intel_batchbuffer.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" -#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_TEXTURE diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 3b4ef7ffd8..11bce31b12 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -33,8 +33,6 @@ #include "main/context.h" #include "main/simple_list.h" #include "main/imports.h" -#include "main/matrix.h" -#include "main/extensions.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c index e400e9a918..ca713e2de5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.c +++ b/src/mesa/drivers/dri/mach64/mach64_dd.c @@ -31,12 +31,9 @@ #include "mach64_context.h" #include "mach64_ioctl.h" -#include "mach64_state.h" -#include "mach64_vb.h" #include "mach64_dd.h" #include "main/context.h" -#include "main/framebuffer.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c index 8653c77da5..1a95a8f619 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.c +++ b/src/mesa/drivers/dri/mach64/mach64_lock.c @@ -32,7 +32,6 @@ #include "mach64_context.h" #include "mach64_state.h" #include "mach64_lock.h" -#include "mach64_tex.h" #include "drirenderbuffer.h" #if DEBUG_LOCKING diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 1ed3b0b70e..5cbfb85627 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -31,8 +31,6 @@ #include "mach64_context.h" #include "mach64_ioctl.h" -#include "mach64_tris.h" -#include "mach64_vb.h" #include "mach64_span.h" #include "main/context.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_span.c b/src/mesa/drivers/dri/mach64/mach64_span.c index b4ba2a41c9..0c52c0c88c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.c +++ b/src/mesa/drivers/dri/mach64/mach64_span.c @@ -31,7 +31,6 @@ #include "mach64_context.h" #include "mach64_ioctl.h" -#include "mach64_state.h" #include "mach64_span.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index df7cbc8670..b9093b5a13 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -36,7 +36,6 @@ #include "mach64_vb.h" #include "mach64_tex.h" -#include "main/context.h" #include "main/enums.h" #include "main/colormac.h" #include "swrast/swrast.h" @@ -44,8 +43,6 @@ #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_pipeline.h" - /* ============================================================= * Alpha blending diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 6627d3c38a..1bce967d58 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -31,13 +31,8 @@ #include "mach64_context.h" #include "mach64_ioctl.h" -#include "mach64_state.h" -#include "mach64_vb.h" -#include "mach64_tris.h" #include "mach64_tex.h" -#include "main/context.h" -#include "main/macros.h" #include "main/simple_list.h" #include "main/enums.h" #include "main/texstore.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index b97e9eec25..46cee4320d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -37,10 +37,7 @@ #include "main/imports.h" #include "mach64_context.h" -#include "mach64_state.h" #include "mach64_ioctl.h" -#include "mach64_vb.h" -#include "mach64_tris.h" #include "mach64_tex.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index df0a09a5c1..adf774ec19 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -36,8 +36,6 @@ #include "mach64_context.h" #include "mach64_ioctl.h" -#include "mach64_state.h" -#include "mach64_vb.h" #include "mach64_tris.h" #include "mach64_tex.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c index e58812e902..00da835376 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_vb.c @@ -42,7 +42,6 @@ #include "mach64_vb.h" #include "mach64_ioctl.h" #include "mach64_tris.h" -#include "mach64_state.h" #define MACH64_TEX1_BIT 0x1 diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index f835cb8bd6..e7813b6372 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -35,7 +35,6 @@ #include "mga_drm.h" #include "mga_xmesa.h" #include "main/context.h" -#include "main/matrix.h" #include "main/simple_list.h" #include "main/imports.h" #include "main/framebuffer.h" @@ -64,7 +63,6 @@ #include "utils.h" #include "vblank.h" -#include "main/extensions.h" #include "drirenderbuffer.h" #include "GL/internal/dri_interface.h" diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c index 3b1ea22b60..2f23c0e514 100644 --- a/src/mesa/drivers/dri/mga/mgadd.c +++ b/src/mesa/drivers/dri/mga/mgadd.c @@ -32,11 +32,6 @@ #include "mgacontext.h" #include "mgadd.h" -#include "mgastate.h" -#include "mgaspan.h" -#include "mgatex.h" -#include "mgatris.h" -#include "mgavb.h" #include "mga_xmesa.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index 8ce5d802ab..259358eaa3 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -42,10 +42,7 @@ #include "mgacontext.h" #include "mgadd.h" #include "mgastate.h" -#include "mgatex.h" -#include "mgavb.h" #include "mgaioctl.h" -#include "mgatris.h" #include "vblank.h" diff --git a/src/mesa/drivers/dri/mga/mgarender.c b/src/mesa/drivers/dri/mga/mgarender.c index 517c3b8f82..8b8fc485d3 100644 --- a/src/mesa/drivers/dri/mga/mgarender.c +++ b/src/mesa/drivers/dri/mga/mgarender.c @@ -48,7 +48,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mgacontext.h" #include "mgatris.h" -#include "mgastate.h" #include "mgaioctl.h" #include "mgavb.h" diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 62a9317cd4..ca3dd4b013 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -40,11 +40,8 @@ #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" -#include "mgatris.h" #include "mgaioctl.h" -#include "swrast/swrast.h" - #include "xmlpool.h" /** diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c index c1bcd4b853..4c58c3bdb0 100644 --- a/src/mesa/drivers/dri/mga/mgatris.c +++ b/src/mesa/drivers/dri/mga/mgatris.c @@ -38,7 +38,6 @@ #include "mgaioctl.h" #include "mgatris.h" #include "mgavb.h" -#include "mgastate.h" static void mgaRenderPrimitive( GLcontext *ctx, GLenum prim ); diff --git a/src/mesa/drivers/dri/mga/mgavb.c b/src/mesa/drivers/dri/mga/mgavb.c index 1c635b23a6..def5109863 100644 --- a/src/mesa/drivers/dri/mga/mgavb.c +++ b/src/mesa/drivers/dri/mga/mgavb.c @@ -39,7 +39,6 @@ #include "main/colormac.h" #include "tnl/t_context.h" -#include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index e389e1c87b..67e9240505 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -36,7 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/simple_list.h" #include "main/imports.h" -#include "main/matrix.h" #include "main/extensions.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c index dfe47f2dd6..64dec70cdd 100644 --- a/src/mesa/drivers/dri/r128/r128_dd.c +++ b/src/mesa/drivers/dri/r128/r128_dd.c @@ -34,12 +34,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_ioctl.h" -#include "r128_state.h" #include "r128_dd.h" -#include "swrast/swrast.h" #include "main/context.h" -#include "main/framebuffer.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/r128/r128_lock.c b/src/mesa/drivers/dri/r128/r128_lock.c index 9bc3515b5a..c1fa068d1f 100644 --- a/src/mesa/drivers/dri/r128/r128_lock.c +++ b/src/mesa/drivers/dri/r128/r128_lock.c @@ -33,8 +33,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_lock.h" -#include "r128_tex.h" -#include "r128_state.h" #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 80b265811e..ef6b5a35c4 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -37,7 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_ioctl.h" #include "r128_span.h" -#include "r128_tris.h" #include "main/context.h" #include "main/imports.h" diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index 0413e5b4f1..2fbe93c590 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -35,9 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_ioctl.h" -#include "r128_state.h" #include "r128_span.h" -#include "r128_tex.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 2254a7a4ff..42f6dd7388 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -47,8 +47,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_pipeline.h" - #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index f1be7cc1c4..24fbf8f519 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -33,21 +33,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "r128_context.h" -#include "r128_state.h" #include "r128_ioctl.h" -#include "r128_tris.h" #include "r128_tex.h" #include "r128_texobj.h" -#include "main/context.h" -#include "main/macros.h" #include "main/simple_list.h" #include "main/enums.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/imports.h" -#include "main/colormac.h" #include "main/texobj.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index 4ddcb86bcd..5eec8c08cd 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -33,12 +33,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "r128_context.h" -#include "r128_state.h" #include "r128_ioctl.h" -#include "r128_tris.h" #include "r128_tex.h" -#include "main/context.h" #include "main/macros.h" #include "main/simple_list.h" #include "main/imports.h" diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index cb2b5f9536..2505b5cd65 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -38,7 +38,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/macros.h" #include "r128_context.h" -#include "r128_state.h" #include "r128_ioctl.h" #include "r128_tris.h" #include "r128_tex.h" diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 8212dc1203..14eb96c1ba 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -9,10 +9,6 @@ LIBNAME = r200_dri.so MINIGLX_SOURCES = server/radeon_dri.c -ifeq ($(USING_EGL), 1) -EGL_SOURCES = server/radeon_egl.c -endif - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif @@ -29,8 +25,8 @@ RADEON_COMMON_SOURCES = \ radeon_mipmap_tree.c \ radeon_queryobj.c \ radeon_span.c \ - radeon_texture.c - + radeon_texture.c \ + radeon_tex_copy.c DRIVER_SOURCES = r200_context.c \ r200_ioctl.c \ @@ -46,6 +42,7 @@ DRIVER_SOURCES = r200_context.c \ r200_sanity.c \ r200_fragshader.c \ r200_vertprog.c \ + r200_blit.c \ radeon_screen.c \ $(EGL_SOURCES) \ $(RADEON_COMMON_SOURCES) \ @@ -55,7 +52,7 @@ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) X86_SOURCES = -DRIVER_DEFINES = -DRADEON_R200 -Wall +DRIVER_DEFINES = -DRADEON_R200 DRI_LIB_DEPS += $(RADEON_LDFLAGS) diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c new file mode 100644 index 0000000000..e446d532cf --- /dev/null +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -0,0 +1,407 @@ +/* + * Copyright (C) 2009 Maciej Cencora <m.cencora@gmail.com> + * + * 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 (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. + * + */ + +#include "radeon_common.h" +#include "r200_context.h" +#include "r200_blit.h" + +static inline uint32_t cmdpacket0(struct radeon_screen *rscrn, + int reg, int count) +{ + if (count) + return CP_PACKET0(reg, count - 1); + return CP_PACKET2; +} + +/* common formats supported as both textures and render targets */ +static unsigned is_blit_supported(gl_format mesa_format) +{ + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_A8: + break; + default: + return 0; + } + + /* ??? */ + if (_mesa_get_format_bits(mesa_format, GL_DEPTH_BITS) > 0) + return 0; + + return 1; +} + +static inline void emit_vtx_state(struct r200_context *r200) +{ + BATCH_LOCALS(&r200->radeon); + + BEGIN_BATCH(14); + if (r200->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) { + OUT_BATCH_REGVAL(R200_SE_VAP_CNTL_STATUS, 0); + } else { + OUT_BATCH_REGVAL(R200_SE_VAP_CNTL_STATUS, RADEON_TCL_BYPASS); + } + OUT_BATCH_REGVAL(R200_SE_VAP_CNTL, (R200_VAP_FORCE_W_TO_ONE | + (9 << R200_VAP_VF_MAX_VTX_NUM__SHIFT))); + OUT_BATCH_REGVAL(R200_SE_VTX_STATE_CNTL, 0); + OUT_BATCH_REGVAL(R200_SE_VTE_CNTL, 0); + OUT_BATCH_REGVAL(R200_SE_VTX_FMT_0, R200_VTX_XY); + OUT_BATCH_REGVAL(R200_SE_VTX_FMT_1, (2 << R200_VTX_TEX0_COMP_CNT_SHIFT)); + OUT_BATCH_REGVAL(RADEON_SE_CNTL, (RADEON_DIFFUSE_SHADE_GOURAUD | + RADEON_BFACE_SOLID | + RADEON_FFACE_SOLID | + RADEON_VTX_PIX_CENTER_OGL | + RADEON_ROUND_MODE_ROUND | + RADEON_ROUND_PREC_4TH_PIX)); + END_BATCH(); +} + +static void inline emit_tx_setup(struct r200_context *r200, + gl_format mesa_format, + struct radeon_bo *bo, + intptr_t offset, + unsigned width, + unsigned height, + unsigned pitch) +{ + uint32_t txformat = R200_TXFORMAT_NON_POWER2; + BATCH_LOCALS(&r200->radeon); + + assert(width <= 2047); + assert(height <= 2047); + assert(offset % 32 == 0); + + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_XRGB8888: + txformat |= R200_TXFORMAT_ARGB8888; + break; + case MESA_FORMAT_RGB565: + txformat |= R200_TXFORMAT_RGB565; + break; + case MESA_FORMAT_ARGB4444: + txformat |= R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_ARGB1555: + txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_A8: + txformat |= R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP; + break; + default: + break; + } + + BEGIN_BATCH(28); + OUT_BATCH_REGVAL(RADEON_PP_CNTL, RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE); + OUT_BATCH_REGVAL(R200_PP_CNTL_X, 0); + OUT_BATCH_REGVAL(R200_PP_TXMULTI_CTL_0, 0); + OUT_BATCH_REGVAL(R200_PP_TXCBLEND_0, (R200_TXC_ARG_A_ZERO | + R200_TXC_ARG_B_ZERO | + R200_TXC_ARG_C_R0_COLOR | + R200_TXC_OP_MADD)); + OUT_BATCH_REGVAL(R200_PP_TXCBLEND2_0, R200_TXC_CLAMP_0_1 | R200_TXC_OUTPUT_REG_R0); + OUT_BATCH_REGVAL(R200_PP_TXABLEND_0, (R200_TXA_ARG_A_ZERO | + R200_TXA_ARG_B_ZERO | + R200_TXA_ARG_C_R0_ALPHA | + R200_TXA_OP_MADD)); + OUT_BATCH_REGVAL(R200_PP_TXABLEND2_0, R200_TXA_CLAMP_0_1 | R200_TXA_OUTPUT_REG_R0); + OUT_BATCH_REGVAL(R200_PP_TXFILTER_0, (R200_CLAMP_S_CLAMP_LAST | + R200_CLAMP_T_CLAMP_LAST | + R200_MAG_FILTER_NEAREST | + R200_MIN_FILTER_NEAREST)); + OUT_BATCH_REGVAL(R200_PP_TXFORMAT_0, txformat); + OUT_BATCH_REGVAL(R200_PP_TXFORMAT_X_0, 0); + OUT_BATCH_REGVAL(R200_PP_TXSIZE_0, ((width - 1) | + ((height - 1) << RADEON_TEX_VSIZE_SHIFT))); + OUT_BATCH_REGVAL(R200_PP_TXPITCH_0, pitch * _mesa_get_format_bytes(mesa_format) - 32); + + OUT_BATCH_REGSEQ(R200_PP_TXOFFSET_0, 1); + OUT_BATCH_RELOC(0, bo, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + + END_BATCH(); +} + +static inline void emit_cb_setup(struct r200_context *r200, + struct radeon_bo *bo, + intptr_t offset, + gl_format mesa_format, + unsigned pitch, + unsigned width, + unsigned height) +{ + uint32_t dst_pitch = pitch; + uint32_t dst_format = 0; + BATCH_LOCALS(&r200->radeon); + + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + dst_format = RADEON_COLOR_FORMAT_ARGB8888; + break; + case MESA_FORMAT_RGB565: + dst_format = RADEON_COLOR_FORMAT_RGB565; + break; + case MESA_FORMAT_ARGB4444: + dst_format = RADEON_COLOR_FORMAT_ARGB4444; + break; + case MESA_FORMAT_ARGB1555: + dst_format = RADEON_COLOR_FORMAT_ARGB1555; + break; + case MESA_FORMAT_A8: + dst_format = RADEON_COLOR_FORMAT_RGB8; + break; + default: + break; + } + + BEGIN_BATCH_NO_AUTOSTATE(22); + OUT_BATCH_REGVAL(R200_RE_AUX_SCISSOR_CNTL, 0); + OUT_BATCH_REGVAL(R200_RE_CNTL, 0); + OUT_BATCH_REGVAL(RADEON_RE_TOP_LEFT, 0); + OUT_BATCH_REGVAL(RADEON_RE_WIDTH_HEIGHT, ((width << RADEON_RE_WIDTH_SHIFT) | + (height << RADEON_RE_HEIGHT_SHIFT))); + OUT_BATCH_REGVAL(RADEON_RB3D_PLANEMASK, 0xffffffff); + OUT_BATCH_REGVAL(RADEON_RB3D_BLENDCNTL, RADEON_SRC_BLEND_GL_ONE | RADEON_DST_BLEND_GL_ZERO); + OUT_BATCH_REGVAL(RADEON_RB3D_CNTL, dst_format); + + OUT_BATCH_REGSEQ(RADEON_RB3D_COLOROFFSET, 1); + OUT_BATCH_RELOC(0, bo, 0, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0); + OUT_BATCH_REGSEQ(RADEON_RB3D_COLORPITCH, 1); + OUT_BATCH_RELOC(dst_pitch, bo, dst_pitch, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0); + + END_BATCH(); +} + +static GLboolean validate_buffers(struct r200_context *r200, + struct radeon_bo *src_bo, + struct radeon_bo *dst_bo) +{ + int ret; + radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + + radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + + ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, + first_elem(&r200->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); + if (ret) + return GL_FALSE; + + return GL_TRUE; +} + +/** + * Calculate texcoords for given image region. + * Output values are [minx, maxx, miny, maxy] + */ +static inline void calc_tex_coords(float img_width, float img_height, + float x, float y, + float reg_width, float reg_height, + unsigned flip_y, float *buf) +{ + buf[0] = x / img_width; + buf[1] = buf[0] + reg_width / img_width; + buf[2] = y / img_height; + buf[3] = buf[2] + reg_height / img_height; + if (flip_y) + { + buf[2] = 1.0 - buf[2]; + buf[3] = 1.0 - buf[3]; + } +} + +static inline void emit_draw_packet(struct r200_context *r200, + unsigned src_width, unsigned src_height, + unsigned src_x_offset, unsigned src_y_offset, + unsigned dst_x_offset, unsigned dst_y_offset, + unsigned reg_width, unsigned reg_height, + unsigned flip_y) +{ + float texcoords[4]; + float verts[12]; + BATCH_LOCALS(&r200->radeon); + + calc_tex_coords(src_width, src_height, + src_x_offset, src_y_offset, + reg_width, reg_height, + flip_y, texcoords); + + verts[0] = dst_x_offset; + verts[1] = dst_y_offset + reg_height; + verts[2] = texcoords[0]; + verts[3] = texcoords[3]; + + verts[4] = dst_x_offset + reg_width; + verts[5] = dst_y_offset + reg_height; + verts[6] = texcoords[1]; + verts[7] = texcoords[3]; + + verts[8] = dst_x_offset + reg_width; + verts[9] = dst_y_offset; + verts[10] = texcoords[1]; + verts[11] = texcoords[2]; + + BEGIN_BATCH(14); + OUT_BATCH(R200_CP_CMD_3D_DRAW_IMMD_2 | (12 << 16)); + OUT_BATCH(RADEON_CP_VC_CNTL_PRIM_WALK_RING | + RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST | + (3 << 16)); + OUT_BATCH_TABLE(verts, 12); + END_BATCH(); +} + +/** + * Copy a region of [@a width x @a height] pixels from source buffer + * to destination buffer. + * @param[in] r200 r200 context + * @param[in] src_bo source radeon buffer object + * @param[in] src_offset offset of the source image in the @a src_bo + * @param[in] src_mesaformat source image format + * @param[in] src_pitch aligned source image width + * @param[in] src_width source image width + * @param[in] src_height source image height + * @param[in] src_x_offset x offset in the source image + * @param[in] src_y_offset y offset in the source image + * @param[in] dst_bo destination radeon buffer object + * @param[in] dst_offset offset of the destination image in the @a dst_bo + * @param[in] dst_mesaformat destination image format + * @param[in] dst_pitch aligned destination image width + * @param[in] dst_width destination image width + * @param[in] dst_height destination image height + * @param[in] dst_x_offset x offset in the destination image + * @param[in] dst_y_offset y offset in the destination image + * @param[in] width region width + * @param[in] height region height + * @param[in] flip_y set if y coords of the source image need to be flipped + */ +unsigned r200_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned reg_width, + unsigned reg_height, + unsigned flip_y) +{ + struct r200_context *r200 = R200_CONTEXT(ctx); + + if (!is_blit_supported(dst_mesaformat)) + return GL_FALSE; + + /* Make sure that colorbuffer has even width - hw limitation */ + if (dst_pitch % 2 > 0) + ++dst_pitch; + + /* Rendering to small buffer doesn't work. + * Looks like a hw limitation. + */ + if (dst_pitch < 32) + return GL_FALSE; + + /* Need to clamp the region size to make sure + * we don't read outside of the source buffer + * or write outside of the destination buffer. + */ + if (reg_width + src_x_offset > src_width) + reg_width = src_width - src_x_offset; + if (reg_height + src_y_offset > src_height) + reg_height = src_height - src_y_offset; + if (reg_width + dst_x_offset > dst_width) + reg_width = dst_width - dst_x_offset; + if (reg_height + dst_y_offset > dst_height) + reg_height = dst_height - dst_y_offset; + + if (src_bo == dst_bo) { + return GL_FALSE; + } + + if (src_offset % 32 || dst_offset % 32) { + return GL_FALSE; + } + + if (0) { + fprintf(stderr, "src: size [%d x %d], pitch %d, " + "offset [%d x %d], format %s, bo %p\n", + src_width, src_height, src_pitch, + src_x_offset, src_y_offset, + _mesa_get_format_name(src_mesaformat), + src_bo); + fprintf(stderr, "dst: pitch %d, offset[%d x %d], format %s, bo %p\n", + dst_pitch, dst_x_offset, dst_y_offset, + _mesa_get_format_name(dst_mesaformat), dst_bo); + fprintf(stderr, "region: %d x %d\n", reg_width, reg_height); + } + + /* Flush is needed to make sure that source buffer has correct data */ + radeonFlush(r200->radeon.glCtx); + + rcommonEnsureCmdBufSpace(&r200->radeon, 78, __FUNCTION__); + + if (!validate_buffers(r200, src_bo, dst_bo)) + return GL_FALSE; + + /* 14 */ + emit_vtx_state(r200); + /* 28 */ + emit_tx_setup(r200, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); + /* 22 */ + emit_cb_setup(r200, dst_bo, dst_offset, dst_mesaformat, dst_pitch, dst_width, dst_height); + /* 14 */ + emit_draw_packet(r200, src_width, src_height, + src_x_offset, src_y_offset, + dst_x_offset, dst_y_offset, + reg_width, reg_height, + flip_y); + + radeonFlush(ctx); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/r200/r200_blit.h b/src/mesa/drivers/dri/r200/r200_blit.h new file mode 100644 index 0000000000..38487266ae --- /dev/null +++ b/src/mesa/drivers/dri/r200/r200_blit.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2009 Maciej Cencora <m.cencora@gmail.com> + * + * 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 (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. + * + */ + +#ifndef R200_BLIT_H +#define R200_BLIT_H + +void r200_blit_init(struct r200_context *r200); + +unsigned r200_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned width, + unsigned height, + unsigned flip_y); + +#endif // R200_BLIT_H diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index f34e319222..453c8de220 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -61,6 +61,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_maos.h" #include "r200_vertprog.h" #include "radeon_queryobj.h" +#include "r200_blit.h" #include "radeon_span.h" @@ -268,6 +269,7 @@ static void r200_init_vtbl(radeonContextPtr radeon) radeon->vtbl.fallback = r200Fallback; radeon->vtbl.update_scissor = r200_vtbl_update_scissor; radeon->vtbl.emit_query_finish = r200_emit_query_finish; + radeon->vtbl.blit = r200_blit; } @@ -294,6 +296,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, if ( !rmesa ) return GL_FALSE; + rmesa->radeon.radeonScreen = screen; r200_init_vtbl(&rmesa->radeon); /* init exp fog table data */ r200InitStaticFogData(); @@ -326,7 +329,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, r200InitDriverFuncs(&functions); r200InitIoctlFuncs(&functions); r200InitStateFuncs(&functions); - r200InitTextureFuncs(&functions); + r200InitTextureFuncs(&rmesa->radeon, &functions); r200InitShaderFuncs(&functions); radeonInitQueryObjFunctions(&functions); diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 17e4d8962e..a9dce310ae 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -645,6 +645,8 @@ extern GLboolean r200MakeCurrent( __DRIcontext *driContextPriv, __DRIdrawable *driReadPriv ); extern GLboolean r200UnbindContext( __DRIcontext *driContextPriv ); +extern void r200_init_texcopy_functions(struct dd_function_table *table); + /* ================================================================ * Debugging: */ diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 6c5a0b79ee..80b08dcc99 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -698,7 +698,8 @@ static void tex_emit_mm(GLcontext *ctx, struct radeon_state_atom *atom) uint32_t dwords = atom->check(ctx, atom); int i = atom->idx; radeonTexObj *t = r200->state.texture.unit[i].texobj; - if (!r200->state.texture.unit[i].unitneeded) + + if (!r200->state.texture.unit[i].unitneeded && !(dwords <= atom->cmd_size)) dwords -= 4; BEGIN_BATCH_NO_AUTOSTATE(dwords); diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 5b87ba6ccd..0916df6476 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -477,7 +477,7 @@ static struct gl_texture_object *r200NewTextureObject(GLcontext * ctx, -void r200InitTextureFuncs( struct dd_function_table *functions ) +void r200InitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions ) { /* Note: we only plug in the functions we implement in the driver * since _mesa_init_driver_functions() was already called. @@ -511,6 +511,11 @@ void r200InitTextureFuncs( struct dd_function_table *functions ) functions->CompressedTexImage2D = radeonCompressedTexImage2D; functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D; + if (radeon->radeonScreen->kernel_mm) { + functions->CopyTexImage2D = radeonCopyTexImage2D; + functions->CopyTexSubImage2D = radeonCopyTexSubImage2D; + } + functions->GenerateMipmap = radeonGenerateMipmap; functions->NewTextureImage = radeonNewTextureImage; diff --git a/src/mesa/drivers/dri/r200/r200_tex.h b/src/mesa/drivers/dri/r200/r200_tex.h index e122de6e5e..1a1e7038df 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.h +++ b/src/mesa/drivers/dri/r200/r200_tex.h @@ -48,7 +48,7 @@ extern int r200UploadTexImages( r200ContextPtr rmesa, radeonTexObjPtr t, GLuint extern void r200DestroyTexObj( r200ContextPtr rmesa, radeonTexObjPtr t ); -extern void r200InitTextureFuncs( struct dd_function_table *functions ); +extern void r200InitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions ); extern void r200UpdateFragmentShader( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 11405d7cae..4f225a233d 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -437,7 +437,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte (1 << VERT_RESULT_TEX2) | (1 << VERT_RESULT_TEX3) | (1 << VERT_RESULT_TEX4) | (1 << VERT_RESULT_TEX5) | (1 << VERT_RESULT_PSIZ))) != 0) { if (R200_DEBUG & RADEON_FALLBACKS) { - fprintf(stderr, "can't handle vert prog outputs 0x%x\n", + fprintf(stderr, "can't handle vert prog outputs 0x%llx\n", mesa_vp->Base.OutputsWritten); } return GL_FALSE; diff --git a/src/mesa/drivers/dri/r200/radeon_tex_copy.c b/src/mesa/drivers/dri/r200/radeon_tex_copy.c new file mode 120000 index 0000000000..dfa5ba34e6 --- /dev/null +++ b/src/mesa/drivers/dri/r200/radeon_tex_copy.c @@ -0,0 +1 @@ +../radeon/radeon_tex_copy.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r200/server/radeon_egl.c b/src/mesa/drivers/dri/r200/server/radeon_egl.c deleted file mode 120000 index d7735a7643..0000000000 --- a/src/mesa/drivers/dri/r200/server/radeon_egl.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_egl.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index be005bd164..04459c2ddf 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -9,10 +9,6 @@ LIBNAME = r300_dri.so MINIGLX_SOURCES = server/radeon_dri.c -ifeq ($(USING_EGL), 1) -EGL_SOURCES = server/radeon_egl.c -endif - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif @@ -39,7 +35,8 @@ RADEON_COMMON_SOURCES = \ radeon_mipmap_tree.c \ radeon_span.c \ radeon_queryobj.c \ - radeon_texture.c + radeon_texture.c \ + radeon_tex_copy.c DRIVER_SOURCES = \ radeon_screen.c \ @@ -50,7 +47,6 @@ DRIVER_SOURCES = \ r300_state.c \ r300_render.c \ r300_tex.c \ - r300_texcopy.c \ r300_texstate.c \ r300_vertprog.c \ r300_fragprog_common.c \ @@ -66,7 +62,6 @@ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) DRIVER_DEFINES = -DRADEON_R300 # -DRADEON_BO_TRACK \ - -Wall DRI_LIB_DEPS += $(RADEON_LDFLAGS) diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index 731adc1af2..f27f858652 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -23,6 +23,8 @@ #ifndef RADEON_COMPILER_H #define RADEON_COMPILER_H +#include "../../../../main/compiler.h" + #include "memory_pool.h" #include "radeon_code.h" #include "radeon_program.h" diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 2eec27e900..e24c7955d4 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -150,8 +150,8 @@ static void r300_emit_tx_setup(struct r300_context *r300, (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT) | (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_R_SHIFT) | R300_TX_MIN_FILTER_MIP_NONE | - R300_TX_MIN_FILTER_LINEAR | - R300_TX_MAG_FILTER_LINEAR | + R300_TX_MIN_FILTER_NEAREST | + R300_TX_MAG_FILTER_NEAREST | (0 << 28)); OUT_BATCH_REGVAL(R300_TX_FILTER1_0, 0); OUT_BATCH_REGVAL(R300_TX_SIZE_0, @@ -403,9 +403,8 @@ static void calc_tex_coords(float img_width, float img_height, buf[3] = buf[2] + reg_height / img_height; if (flip_y) { - float tmp = buf[2]; - buf[2] = 1.0 - buf[3]; - buf[3] = 1.0 - tmp; + buf[2] = 1.0 - buf[2]; + buf[3] = 1.0 - buf[3]; } } @@ -424,13 +423,13 @@ static void emit_draw_packet(struct r300_context *r300, flip_y, texcoords); float verts[] = { dst_x_offset, dst_y_offset, - texcoords[0], texcoords[3], - dst_x_offset, dst_y_offset + reg_height, texcoords[0], texcoords[2], + dst_x_offset, dst_y_offset + reg_height, + texcoords[0], texcoords[3], dst_x_offset + reg_width, dst_y_offset + reg_height, - texcoords[1], texcoords[2], + texcoords[1], texcoords[3], dst_x_offset + reg_width, dst_y_offset, - texcoords[1], texcoords[3] }; + texcoords[1], texcoords[2] }; BATCH_LOCALS(&r300->radeon); @@ -495,6 +494,27 @@ static void emit_cb_setup(struct r300_context *r300, END_BATCH(); } +static unsigned is_blit_supported(gl_format dst_format) +{ + switch (dst_format) { + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_XRGB8888: + break; + default: + return 0; + } + + if (_mesa_get_format_bits(dst_format, GL_DEPTH_BITS) > 0) + return 0; + + return 1; +} + /** * Copy a region of [@a width x @a height] pixels from source buffer * to destination buffer. @@ -519,29 +539,31 @@ static void emit_cb_setup(struct r300_context *r300, * @param[in] height region height * @param[in] flip_y set if y coords of the source image need to be flipped */ -GLboolean r300_blit(struct r300_context *r300, - struct radeon_bo *src_bo, - intptr_t src_offset, - gl_format src_mesaformat, - unsigned src_pitch, - unsigned src_width, - unsigned src_height, - unsigned src_x_offset, - unsigned src_y_offset, - struct radeon_bo *dst_bo, - intptr_t dst_offset, - gl_format dst_mesaformat, - unsigned dst_pitch, - unsigned dst_width, - unsigned dst_height, - unsigned dst_x_offset, - unsigned dst_y_offset, - unsigned reg_width, - unsigned reg_height, - unsigned flip_y) +unsigned r300_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned reg_width, + unsigned reg_height, + unsigned flip_y) { - if (_mesa_get_format_bits(src_mesaformat, GL_DEPTH_BITS) > 0) - return GL_FALSE; + r300ContextPtr r300 = R300_CONTEXT(ctx); + + if (!is_blit_supported(dst_mesaformat)) + return 0; /* Make sure that colorbuffer has even width - hw limitation */ if (dst_pitch % 2 > 0) @@ -551,7 +573,7 @@ GLboolean r300_blit(struct r300_context *r300, * Looks like a hw limitation. */ if (dst_pitch < 32) - return GL_FALSE; + return 0; /* Need to clamp the region size to make sure * we don't read outside of the source buffer @@ -567,6 +589,10 @@ GLboolean r300_blit(struct r300_context *r300, reg_height = dst_height - dst_y_offset; if (src_bo == dst_bo) { + return 0; + } + + if (src_offset % 32 || dst_offset % 32) { return GL_FALSE; } @@ -587,7 +613,7 @@ GLboolean r300_blit(struct r300_context *r300, radeonFlush(r300->radeon.glCtx); if (!validate_buffers(r300, src_bo, dst_bo)) - return GL_FALSE; + return 0; rcommonEnsureCmdBufSpace(&r300->radeon, 200, __FUNCTION__); @@ -618,5 +644,5 @@ GLboolean r300_blit(struct r300_context *r300, radeonFlush(r300->radeon.glCtx); - return GL_TRUE; -}
\ No newline at end of file + return 1; +} diff --git a/src/mesa/drivers/dri/r300/r300_blit.h b/src/mesa/drivers/dri/r300/r300_blit.h index dc21e88098..735acaddd7 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.h +++ b/src/mesa/drivers/dri/r300/r300_blit.h @@ -30,25 +30,25 @@ void r300_blit_init(struct r300_context *r300); -GLboolean r300_blit(struct r300_context *r300, - struct radeon_bo *src_bo, - intptr_t src_offset, - gl_format src_mesaformat, - unsigned src_pitch, - unsigned src_width, - unsigned src_height, - unsigned src_x_offset, - unsigned src_y_offset, - struct radeon_bo *dst_bo, - intptr_t dst_offset, - gl_format dst_mesaformat, - unsigned dst_pitch, - unsigned dst_width, - unsigned dst_height, - unsigned dst_x_offset, - unsigned dst_y_offset, - unsigned width, - unsigned height, - unsigned flip_y); +unsigned r300_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned reg_width, + unsigned reg_height, + unsigned flip_y); #endif // R300_BLIT_H
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index e1c33bbb2c..4787bafc66 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -39,7 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/macros.h" #include "main/context.h" #include "main/simple_list.h" -#include "swrast/swrast.h" #include "drm.h" #include "radeon_drm.h" @@ -50,7 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" #include "radeon_bocs_wrapper.h" #include "radeon_mipmap_tree.h" -#include "r300_state.h" #include "radeon_queryobj.h" /** # of dwords reserved for additional instructions that may need to be written diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 1f6ccf6ddc..eedb7b6ed8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -40,9 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/simple_list.h" #include "main/imports.h" -#include "main/matrix.h" #include "main/extensions.h" -#include "main/state.h" #include "main/bufferobj.h" #include "main/texobj.h" @@ -52,13 +50,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#include "tnl/t_vp_build.h" #include "drivers/common/driverfuncs.h" #include "drivers/common/meta.h" #include "r300_context.h" -#include "radeon_context.h" #include "radeon_span.h" #include "r300_blit.h" #include "r300_cmdbuf.h" @@ -70,7 +66,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_buffer_objects.h" #include "radeon_queryobj.h" -#include "vblank.h" #include "utils.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ @@ -93,8 +88,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/remap_helper.h" -void r300_init_texcopy_functions(struct dd_function_table *table); - static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, @@ -326,6 +319,8 @@ static void r300_init_vtbl(radeonContextPtr radeon) radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z; } else radeon->vtbl.emit_query_finish = r300_emit_query_finish; + + radeon->vtbl.blit = r300_blit; } static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen) @@ -451,6 +446,8 @@ static void r300InitGLExtensions(GLcontext *ctx) if (!r300->radeon.radeonScreen->drmSupportsOcclusionQueries) { _mesa_disable_extension(ctx, "GL_ARB_occlusion_query"); } + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV350) + _mesa_enable_extension(ctx, "GL_ARB_half_float_vertex"); } static void r300InitIoctlFuncs(struct dd_function_table *functions) @@ -488,15 +485,11 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, _mesa_init_driver_functions(&functions); r300InitIoctlFuncs(&functions); r300InitStateFuncs(&functions); - r300InitTextureFuncs(&functions); + r300InitTextureFuncs(&r300->radeon, &functions); r300InitShaderFuncs(&functions); radeonInitQueryObjFunctions(&functions); radeonInitBufferObjectFuncs(&functions); - if (r300->radeon.radeonScreen->kernel_mm) { - r300_init_texcopy_functions(&functions); - } - if (!radeonInitContext(&r300->radeon, &functions, glVisual, driContextPriv, sharedContextPrivate)) { diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 546cd8ddde..78ab43a99f 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -554,8 +554,6 @@ extern void r300InitShaderFunctions(r300ContextPtr r300); extern void r300InitDraw(GLcontext *ctx); -extern void r300_init_texcopy_functions(struct dd_function_table *table); - #define r300PackFloat32 radeonPackFloat32 #define r300PackFloat24 radeonPackFloat24 diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 3dcd986e22..813495a046 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -29,7 +29,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/state.h" -#include "main/api_validate.h" #include "main/enums.h" #include "main/simple_list.h" @@ -47,8 +46,6 @@ #include "tnl/tnl.h" #include "tnl/t_vp_build.h" #include "vbo/vbo_context.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" static int getTypeSize(GLenum type) @@ -56,6 +53,8 @@ static int getTypeSize(GLenum type) switch (type) { case GL_DOUBLE: return sizeof(GLdouble); + case GL_HALF_FLOAT: + return sizeof(GLhalfARB); case GL_FLOAT: return sizeof(GLfloat); case GL_INT: @@ -385,6 +384,18 @@ static void r300TranslateAttrib(GLcontext *ctx, GLuint attr, int count, const st r300_attr._signed = 0; r300_attr.normalize = 0; break; + case GL_HALF_FLOAT: + switch (input->Size) { + case 1: + case 2: + r300_attr.data_type = R300_DATA_TYPE_FLT16_2; + break; + case 3: + case 4: + r300_attr.data_type = R300_DATA_TYPE_FLT16_4; + break; + } + break; case GL_SHORT: r300_attr._signed = 1; r300_attr.normalize = input->Normalized; diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 15aeaf0514..740c902221 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -39,19 +39,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/colormac.h" #include "main/imports.h" #include "main/macros.h" -#include "main/image.h" #include "swrast_setup/swrast_setup.h" -#include "math/m_translate.h" #include "tnl/tnl.h" #include "tnl/t_context.h" #include "r300_context.h" -#include "r300_state.h" #include "r300_emit.h" #include "r300_render.h" #include "r300_swtcl.h" + GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead) { /* No idea what this value means. I have seen other values written to diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 2933d31136..e41aeff91a 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -38,14 +38,12 @@ #include "r300_fragprog_common.h" -#include "shader/program.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "compiler/radeon_compiler.h" #include "radeon_mesa_to_rc.h" -#include "r300_state.h" static GLuint build_dtm(GLuint depthmode) diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index ea684e7df1..d18ebab8ff 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -230,6 +230,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_DATA_TYPE_SHORT_4 7 # define R300_DATA_TYPE_VECTOR_3_TTT 8 # define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_DATA_TYPE_FLT16_2 11 +# define R300_DATA_TYPE_FLT16_4 12 + # define R300_SKIP_DWORDS_SHIFT 4 # define R300_DST_VEC_LOC_SHIFT 8 # define R300_LAST_VEC (1 << 13) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 02c94250a8..e3e6285784 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -53,7 +53,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_render.h" #include "main/glheader.h" -#include "main/state.h" #include "main/imports.h" #include "main/enums.h" #include "main/macros.h" @@ -65,14 +64,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" #include "vbo/vbo_split.h" -#include "tnl/tnl.h" -#include "tnl/t_vp_build.h" #include "r300_context.h" #include "r300_state.h" #include "r300_reg.h" -#include "r300_tex.h" #include "r300_emit.h" -#include "r300_fragprog_common.h" #include "r300_swtcl.h" /** diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index c51285aad9..017d45a503 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -58,13 +58,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" #include "r300_reg.h" #include "r300_emit.h" -#include "r300_tex.h" #include "r300_fragprog_common.h" #include "r300_render.h" #include "r300_vertprog.h" -#include "drirenderbuffer.h" - static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) { r300ContextPtr rmesa = R300_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 963f648cb1..8dd8507395 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -41,18 +41,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/mipmap.h" #include "main/simple_list.h" #include "main/texstore.h" -#include "main/teximage.h" #include "main/texobj.h" #include "texmem.h" #include "r300_context.h" -#include "r300_state.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" -#include "xmlpool.h" - static unsigned int translate_wrap_mode(GLenum wrapmode) { @@ -312,7 +308,7 @@ static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx, return &t->base; } -void r300InitTextureFuncs(struct dd_function_table *functions) +void r300InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions) { /* Note: we only plug in the functions we implement in the driver * since _mesa_init_driver_functions() was already called. @@ -340,6 +336,11 @@ void r300InitTextureFuncs(struct dd_function_table *functions) functions->CompressedTexImage2D = radeonCompressedTexImage2D; functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D; + if (radeon->radeonScreen->kernel_mm) { + functions->CopyTexImage2D = radeonCopyTexImage2D; + functions->CopyTexSubImage2D = radeonCopyTexSubImage2D; + } + functions->GenerateMipmap = radeonGenerateMipmap; driInitTextureFormats(); diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 6ede0fe25c..9694e703b8 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -49,7 +49,7 @@ extern void r300SetTexOffset(__DRIcontext *pDRICtx, GLint texname, extern GLboolean r300ValidateBuffers(GLcontext * ctx); -extern void r300InitTextureFuncs(struct dd_function_table *functions); +extern void r300InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions); int32_t r300TranslateTexFormat(gl_format mesaFormat); diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 78ff54574f..09e046859a 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/simple_list.h" #include "r300_context.h" -#include "r300_state.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" #include "r300_reg.h" diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index aa98a049aa..e6fa57d439 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -34,7 +34,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "shader/program.h" #include "shader/programopt.h" #include "shader/prog_instruction.h" -#include "shader/prog_optimize.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "shader/prog_statevars.h" diff --git a/src/mesa/drivers/dri/r300/radeon_tex_copy.c b/src/mesa/drivers/dri/r300/radeon_tex_copy.c new file mode 120000 index 0000000000..dfa5ba34e6 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_tex_copy.c @@ -0,0 +1 @@ +../radeon/radeon_tex_copy.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/server/radeon_egl.c b/src/mesa/drivers/dri/r300/server/radeon_egl.c deleted file mode 120000 index d7735a7643..0000000000 --- a/src/mesa/drivers/dri/r300/server/radeon_egl.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_egl.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index b90efce17a..5d50941539 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -9,10 +9,6 @@ LIBNAME = r600_dri.so MINIGLX_SOURCES = server/radeon_dri.c -ifeq ($(USING_EGL), 1) -EGL_SOURCES = server/radeon_egl.c -endif - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif @@ -39,7 +35,8 @@ RADEON_COMMON_SOURCES = \ radeon_mipmap_tree.c \ radeon_span.c \ radeon_texture.c \ - radeon_queryobj.c + radeon_queryobj.c \ + radeon_tex_copy.c DRIVER_SOURCES = \ radeon_screen.c \ @@ -60,7 +57,6 @@ DRIVER_SOURCES = \ r600_tex.c \ r600_texstate.c \ r600_blit.c \ - r600_texcopy.c \ r700_debug.c \ $(RADEON_COMMON_SOURCES) \ $(EGL_SOURCES) \ @@ -68,9 +64,8 @@ DRIVER_SOURCES = \ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -DRIVER_DEFINES = -DRADEON_R600 \ +DRIVER_DEFINES = -DRADEON_R600 # -DRADEON_BO_TRACK \ - -Wall DRI_LIB_DEPS += $(RADEON_LDFLAGS) diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index de3a58706e..d7cd59ade6 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -32,18 +32,73 @@ #include "r600_blit_shaders.h" #include "r600_cmdbuf.h" +/* common formats supported as both textures and render targets */ +static unsigned is_blit_supported(gl_format mesa_format) +{ + switch (mesa_format) { + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_SIGNED_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_SIGNED_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_XRGB8888_REV: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_RGB332: + case MESA_FORMAT_A8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + case MESA_FORMAT_L8: + case MESA_FORMAT_RGBA_FLOAT32: + case MESA_FORMAT_RGBA_FLOAT16: + case MESA_FORMAT_ALPHA_FLOAT32: + case MESA_FORMAT_ALPHA_FLOAT16: + case MESA_FORMAT_LUMINANCE_FLOAT32: + case MESA_FORMAT_LUMINANCE_FLOAT16: + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + case MESA_FORMAT_INTENSITY_FLOAT32: /* X, X, X, X */ + case MESA_FORMAT_INTENSITY_FLOAT16: /* X, X, X, X */ + case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z16: + case MESA_FORMAT_Z32: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SLA8: + case MESA_FORMAT_SL8: + break; + default: + return 0; + } + + /* ??? */ + /* not sure blit to depth works or not yet */ + if (_mesa_get_format_bits(mesa_format, GL_DEPTH_BITS) > 0) + return 0; + + return 1; +} + static inline void set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_format, - int pitch, int w, int h, intptr_t dst_offset) + int nPitchInPixel, int w, int h, intptr_t dst_offset) { uint32_t cb_color0_base, cb_color0_size = 0, cb_color0_info = 0, cb_color0_view = 0; - int nPitchInPixel, id = 0; - uint32_t comp_swap, format, bpp = _mesa_get_format_bytes(mesa_format); + int id = 0; + uint32_t comp_swap, format; BATCH_LOCALS(&context->radeon); cb_color0_base = dst_offset / 256; - nPitchInPixel = pitch/bpp; SETfield(cb_color0_size, (nPitchInPixel / 8) - 1, PITCH_TILE_MAX_shift, PITCH_TILE_MAX_mask); SETfield(cb_color0_size, ((nPitchInPixel * h) / 64) - 1, @@ -310,12 +365,31 @@ set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_forma END_BATCH(); } - BEGIN_BATCH_NO_AUTOSTATE(18); + /* Set CMASK & TILE buffer to the offset of color buffer as + * we don't use those this shouldn't cause any issue and we + * then have a valid cmd stream + */ + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(CB_COLOR0_TILE + (4 * id), 1); + R600_OUT_BATCH(cb_color0_base); + R600_OUT_BATCH_RELOC(0, + bo, + 0, + 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(CB_COLOR0_FRAG + (4 * id), 1); + R600_OUT_BATCH(cb_color0_base); + R600_OUT_BATCH_RELOC(0, + bo, + 0, + 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); + END_BATCH(); + + BEGIN_BATCH_NO_AUTOSTATE(12); R600_OUT_BATCH_REGVAL(CB_COLOR0_SIZE + (4 * id), cb_color0_size); R600_OUT_BATCH_REGVAL(CB_COLOR0_VIEW + (4 * id), cb_color0_view); R600_OUT_BATCH_REGVAL(CB_COLOR0_INFO + (4 * id), cb_color0_info); - R600_OUT_BATCH_REGVAL(CB_COLOR0_TILE + (4 * id), 0); - R600_OUT_BATCH_REGVAL(CB_COLOR0_FRAG + (4 * id), 0); R600_OUT_BATCH_REGVAL(CB_COLOR0_MASK + (4 * id), 0); END_BATCH(); @@ -481,11 +555,9 @@ set_vtx_resource(context_t *context) static inline void set_tex_resource(context_t * context, gl_format mesa_format, struct radeon_bo *bo, int w, int h, - int pitch, intptr_t src_offset) + int TexelPitch, intptr_t src_offset) { uint32_t sq_tex_resource0, sq_tex_resource1, sq_tex_resource2, sq_tex_resource4, sq_tex_resource6; - int bpp = _mesa_get_format_bytes(mesa_format); - int TexelPitch = pitch/bpp; sq_tex_resource0 = sq_tex_resource1 = sq_tex_resource2 = sq_tex_resource4 = sq_tex_resource6 = 0; BATCH_LOCALS(&context->radeon); @@ -1484,37 +1556,41 @@ static GLboolean validate_buffers(context_t *rmesa, return GL_TRUE; } -GLboolean r600_blit(context_t *context, - struct radeon_bo *src_bo, - intptr_t src_offset, - gl_format src_mesaformat, - unsigned src_pitch, - unsigned src_width, - unsigned src_height, - unsigned src_x, - unsigned src_y, - struct radeon_bo *dst_bo, - intptr_t dst_offset, - gl_format dst_mesaformat, - unsigned dst_pitch, - unsigned dst_width, - unsigned dst_height, - unsigned dst_x, - unsigned dst_y, - unsigned w, - unsigned h, - unsigned flip_y) +unsigned r600_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x, + unsigned src_y, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x, + unsigned dst_y, + unsigned w, + unsigned h, + unsigned flip_y) { + context_t *context = R700_CONTEXT(ctx); int id = 0; - /* not sure blit to depth works or not yet */ - if (_mesa_get_format_bits(src_mesaformat, GL_DEPTH_BITS) > 0) - return GL_FALSE; + if (!is_blit_supported(dst_mesaformat)) + return GL_FALSE; if (src_bo == dst_bo) { return GL_FALSE; } + if (src_offset % 256 || dst_offset % 256) { + return GL_FALSE; + } + if (0) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, @@ -1527,9 +1603,9 @@ GLboolean r600_blit(context_t *context, } /* Flush is needed to make sure that source buffer has correct data */ - radeonFlush(context->radeon.glCtx); + radeonFlush(ctx); - rcommonEnsureCmdBufSpace(&context->radeon, 302, __FUNCTION__); + rcommonEnsureCmdBufSpace(&context->radeon, 304, __FUNCTION__); /* load shaders */ load_shaders(context->radeon.glCtx); @@ -1554,7 +1630,7 @@ GLboolean r600_blit(context_t *context, set_tex_sampler(context); /* dst */ - /* 25 */ + /* 27 */ set_render_target(context, dst_bo, dst_mesaformat, dst_pitch, dst_width, dst_height, dst_offset); /* scissors */ @@ -1578,7 +1654,7 @@ GLboolean r600_blit(context_t *context, /* 5 */ r700WaitForIdleClean(context); - radeonFlush(context->radeon.glCtx); + radeonFlush(ctx); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r600_blit.h b/src/mesa/drivers/dri/r600/r600_blit.h index f30c13c288..f280e23489 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.h +++ b/src/mesa/drivers/dri/r600/r600_blit.h @@ -1,21 +1,21 @@ -GLboolean r600_blit(context_t *context, - struct radeon_bo *src_bo, - intptr_t src_offset, - gl_format src_mesaformat, - unsigned src_pitch, - unsigned src_width, - unsigned src_height, - unsigned src_x_offset, - unsigned src_y_offset, - struct radeon_bo *dst_bo, - intptr_t dst_offset, - gl_format dst_mesaformat, - unsigned dst_pitch, - unsigned dst_width, - unsigned dst_height, - unsigned dst_x_offset, - unsigned dst_y_offset, - unsigned w, - unsigned h, - unsigned flip_y); +unsigned r600_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned w, + unsigned h, + unsigned flip_y); diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 55680fad32..ab3c7723c9 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -65,6 +65,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r600_emit.h" #include "radeon_bocs_wrapper.h" #include "radeon_queryobj.h" +#include "r600_blit.h" #include "r700_state.h" #include "r700_ioctl.h" @@ -240,16 +241,16 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.pre_emit_atoms = r600_vtbl_pre_emit_atoms; radeon->vtbl.fallback = r600_fallback; radeon->vtbl.emit_query_finish = r600_emit_query_finish; + radeon->vtbl.blit = r600_blit; } static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) { - context_t *r600 = R700_CONTEXT(ctx); - - ctx->Const.MaxTextureImageUnits = - driQueryOptioni(&r600->radeon.optionCache, "texture_image_units"); - ctx->Const.MaxTextureCoordUnits = - driQueryOptioni(&r600->radeon.optionCache, "texture_coord_units"); + ctx->Const.MaxTextureImageUnits = 16; + /* 8 per clause on r6xx, 16 on r7xx + * but I think mesa only supports 8 at the moment + */ + ctx->Const.MaxTextureCoordUnits = 8; ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits); @@ -284,9 +285,8 @@ static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) ctx->Const.FragmentProgram.MaxNativeAttribs = 32; ctx->Const.FragmentProgram.MaxNativeParameters = 256; ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; - /* 8 per clause on r6xx, 16 on rv670/r7xx */ - if ((screen->chip_family == CHIP_FAMILY_RV670) || - (screen->chip_family >= CHIP_FAMILY_RV770)) + /* 8 per clause on r6xx, 16 on r7xx */ + if (screen->chip_family >= CHIP_FAMILY_RV770) ctx->Const.FragmentProgram.MaxNativeTexInstructions = 16; else ctx->Const.FragmentProgram.MaxNativeTexInstructions = 8; @@ -378,16 +378,12 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _mesa_init_driver_functions(&functions); r700InitStateFuncs(&functions); - r600InitTextureFuncs(&functions); + r600InitTextureFuncs(&r600->radeon, &functions); r700InitShaderFuncs(&functions); radeonInitQueryObjFunctions(&functions); r700InitIoctlFuncs(&functions); radeonInitBufferObjectFuncs(&functions); - if (r600->radeon.radeonScreen->kernel_mm) { - r600_init_texcopy_functions(&functions); - } - if (!radeonInitContext(&r600->radeon, &functions, glVisual, driContextPriv, sharedContextPrivate)) { diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 1f7cd4096b..72c8c869b7 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -185,7 +185,6 @@ extern void r700WaitForIdleClean(context_t *context); extern void r700Start3D(context_t *context); extern void r600InitAtoms(context_t *context); extern void r700InitDraw(GLcontext *ctx); -extern void r600_init_texcopy_functions(struct dd_function_table *table); #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index f745fe3e8a..71dfd7e059 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -396,7 +396,7 @@ static struct gl_texture_object *r600NewTextureObject(GLcontext * ctx, return &t->base; } -void r600InitTextureFuncs(struct dd_function_table *functions) +void r600InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions) { /* Note: we only plug in the functions we implement in the driver * since _mesa_init_driver_functions() was already called. @@ -424,6 +424,11 @@ void r600InitTextureFuncs(struct dd_function_table *functions) functions->CompressedTexImage2D = radeonCompressedTexImage2D; functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D; + if (radeon->radeonScreen->kernel_mm) { + functions->CopyTexImage2D = radeonCopyTexImage2D; + functions->CopyTexSubImage2D = radeonCopyTexSubImage2D; + } + functions->GenerateMipmap = radeonGenerateMipmap; driInitTextureFormats(); diff --git a/src/mesa/drivers/dri/r600/r600_tex.h b/src/mesa/drivers/dri/r600/r600_tex.h index fb0e1a023e..1d75a2ecd6 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.h +++ b/src/mesa/drivers/dri/r600/r600_tex.h @@ -42,7 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Texel pitch is 8 alignment. */ #define R700_TEXEL_PITCH_ALIGNMENT_MASK 0x7 -#define R700_MAX_TEXTURE_UNITS 8 /* TODO : should be 16, lets make it work, review later */ +#define R700_MAX_TEXTURE_UNITS 16 extern void r600SetDepthTexMode(struct gl_texture_object *tObj); @@ -58,6 +58,6 @@ extern void r600SetTexOffset(__DRIcontext *pDRICtx, GLint texname, extern GLboolean r600ValidateBuffers(GLcontext * ctx); -extern void r600InitTextureFuncs(struct dd_function_table *functions); +extern void r600InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions); #endif /* __r600_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r600/r600_texcopy.c b/src/mesa/drivers/dri/r600/r600_texcopy.c deleted file mode 100644 index 287a82ea8f..0000000000 --- a/src/mesa/drivers/dri/r600/r600_texcopy.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2009 Maciej Cencora <m.cencora@gmail.com> - * - * 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 (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. - * - */ - -#include "radeon_common.h" -#include "r600_context.h" - -#include "main/image.h" -#include "main/teximage.h" -#include "main/texstate.h" -#include "drivers/common/meta.h" - -#include "radeon_mipmap_tree.h" -#include "r600_blit.h" -#include <main/debug.h> - -// TODO: -// need to pass correct pitch for small dst textures! -static GLboolean -do_copy_texsubimage(GLcontext *ctx, - GLenum target, GLint level, - struct radeon_tex_obj *tobj, - radeon_texture_image *timg, - GLint dstx, GLint dsty, - GLint x, GLint y, - GLsizei width, GLsizei height) -{ - context_t *context = R700_CONTEXT(ctx); - struct radeon_renderbuffer *rrb; - - if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { - rrb = radeon_get_depthbuffer(&context->radeon); - } else { - rrb = radeon_get_colorbuffer(&context->radeon); - } - - if (!timg->mt) { - radeon_validate_texture_miptree(ctx, &tobj->base); - } - - assert(rrb && rrb->bo); - assert(timg->mt->bo); - assert(timg->base.Width >= dstx + width); - assert(timg->base.Height >= dsty + height); - - intptr_t src_offset = rrb->draw_offset; - intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); - - if (src_offset % 256 || dst_offset % 256) { - return GL_FALSE; - } - - if (0) { - fprintf(stderr, "%s: copying to face %d, level %d\n", - __FUNCTION__, _mesa_tex_target_to_face(target), level); - fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); - fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d\n", - x, y, rrb->base.Width, rrb->base.Height, (uint32_t) src_offset, rrb->pitch/rrb->cpp); - fprintf(stderr, "src size %d, dst size %d\n", rrb->bo->size, timg->mt->bo->size); - - } - - - /* blit from src buffer to texture */ - return r600_blit(context, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, - rrb->base.Width, rrb->base.Height, x, y, - timg->mt->bo, dst_offset, timg->base.TexFormat, - timg->mt->levels[level].rowstride, timg->base.Width, timg->base.Height, - dstx, dsty, width, height, 1); -} - -static void -r600CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border) -{ - struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); - struct gl_texture_object *texObj = - _mesa_select_tex_object(ctx, texUnit, target); - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); - int srcx, srcy, dstx, dsty; - - if (border) - goto fail; - - /* Setup or redefine the texture object, mipmap tree and texture - * image. Don't populate yet. - */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_RGBA, GL_UNSIGNED_BYTE, NULL, - &ctx->DefaultPacking, texObj, texImage); - - srcx = x; - srcy = y; - dstx = 0; - dsty = 0; - if (!_mesa_clip_copytexsubimage(ctx, - &dstx, &dsty, - &srcx, &srcy, - &width, &height)) { - return; - } - - if (!do_copy_texsubimage(ctx, target, level, - radeon_tex_obj(texObj), (radeon_texture_image *)texImage, - 0, 0, x, y, width, height)) { - goto fail; - } - - return; - -fail: - _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, - width, height, border); -} - -static void -r600CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height) -{ - struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); - struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); - struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); - - if (!do_copy_texsubimage(ctx, target, level, - radeon_tex_obj(texObj), (radeon_texture_image *)texImage, - xoffset, yoffset, x, y, width, height)) { - - //DEBUG_FALLBACKS - - _mesa_meta_CopyTexSubImage2D(ctx, target, level, - xoffset, yoffset, x, y, width, height); - } -} - - -void r600_init_texcopy_functions(struct dd_function_table *table) -{ - table->CopyTexImage2D = r600CopyTexImage2D; - table->CopyTexSubImage2D = r600CopyTexSubImage2D; -} diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index b8466bdd75..3289d89c92 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -85,6 +85,7 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + CLEARbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); @@ -95,6 +96,11 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, FORMAT_COMP_W_shift, FORMAT_COMP_W_mask); + CLEARbit(t->SQ_TEX_RESOURCE0, TILE_TYPE_bit); + SETfield(t->SQ_TEX_RESOURCE0, ARRAY_LINEAR_GENERAL, + SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_shift, + SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_mask); + switch (mesa_format) /* This is mesa format. */ { case MESA_FORMAT_RGBA8888: @@ -158,6 +164,32 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); break; + case MESA_FORMAT_XRGB8888: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + break; + case MESA_FORMAT_XRGB8888_REV: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + break; case MESA_FORMAT_ARGB8888_REV: SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); @@ -515,6 +547,10 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa case MESA_FORMAT_Z24_S8: case MESA_FORMAT_Z32: case MESA_FORMAT_S8: + SETbit(t->SQ_TEX_RESOURCE0, TILE_TYPE_bit); + SETfield(t->SQ_TEX_RESOURCE0, ARRAY_1D_TILED_THIN1, + SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_shift, + SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_mask); switch (mesa_format) { case MESA_FORMAT_Z16: SETfield(t->SQ_TEX_RESOURCE1, FMT_16, @@ -651,6 +687,12 @@ static GLuint r600_translate_shadow_func(GLenum func) } } +static INLINE uint32_t +S_FIXED(float value, uint32_t frac_bits) +{ + return value * (1 << frac_bits); +} + void r600SetDepthTexMode(struct gl_texture_object *tObj) { radeonTexObjPtr t; @@ -670,8 +712,9 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj) * \param rmesa Context pointer * \param t the r300 texture object */ -static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *texObj) +static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit) { + context_t *rmesa = R700_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); const struct gl_texture_image *firstImage; GLuint uTexelPitch, row_align; @@ -733,11 +776,21 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex t->SQ_TEX_RESOURCE2 = get_base_teximage_offset(t) / 256; - if ((t->maxLod - t->minLod) > 0) { - t->SQ_TEX_RESOURCE3 = radeon_miptree_image_offset(t->mt, 0, t->minLod + 1) / 256; - SETfield(t->SQ_TEX_RESOURCE4, 0, BASE_LEVEL_shift, BASE_LEVEL_mask); - SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask); - } + t->SQ_TEX_RESOURCE3 = radeon_miptree_image_offset(t->mt, 0, t->minLod + 1) / 256; + + SETfield(t->SQ_TEX_RESOURCE4, 0, BASE_LEVEL_shift, BASE_LEVEL_mask); + SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask); + + SETfield(t->SQ_TEX_SAMPLER1, + S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 6), + MIN_LOD_shift, MIN_LOD_mask); + SETfield(t->SQ_TEX_SAMPLER1, + S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 6), + MAX_LOD_shift, MAX_LOD_mask); + SETfield(t->SQ_TEX_SAMPLER1, + S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 6), + SQ_TEX_SAMPLER_WORD1_0__LOD_BIAS_shift, SQ_TEX_SAMPLER_WORD1_0__LOD_BIAS_mask); + if(texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { SETfield(t->SQ_TEX_SAMPLER0, r600_translate_shadow_func(texObj->CompareFunc), DEPTH_COMPARE_FUNCTION_shift, DEPTH_COMPARE_FUNCTION_mask); @@ -754,9 +807,8 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex * * Mostly this means populating the texture object's mipmap tree. */ -static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object *texObj) +static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object *texObj, int unit) { - context_t *rmesa = R700_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); if (!radeon_validate_texture_miptree(ctx, texObj)) @@ -764,7 +816,7 @@ static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object /* Configure the hardware registers (more precisely, the cached version * of the hardware registers). */ - setup_hardware_state(rmesa, texObj); + setup_hardware_state(ctx, texObj, unit); t->validated = GL_TRUE; return GL_TRUE; @@ -805,7 +857,7 @@ GLboolean r600ValidateBuffers(GLcontext * ctx) if (!ctx->Texture.Unit[i]._ReallyEnabled) continue; - if (!r600_validate_texture(ctx, ctx->Texture.Unit[i]._Current)) { + if (!r600_validate_texture(ctx, ctx->Texture.Unit[i]._Current, i)) { radeon_warning("failed to validate texture for unit %d.\n", i); } t = radeon_tex_obj(ctx->Texture.Unit[i]._Current); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 0ff16b4ddd..89adb77bf5 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4469,7 +4469,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } pAsm->D2.dst2.SaturateMode = 1; - pAsm->S[0].src.rtype = pAsm->D.dst.rtype; + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; pAsm->S[0].src.reg = pAsm->D.dst.reg; noswizzle_PVSSRC(&(pAsm->S[0].src)); noneg_PVSSRC(&(pAsm->S[0].src)); @@ -4491,20 +4491,21 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) GLboolean assemble_XPD(r700_AssemblerBase *pAsm) { - BITS tmp; + BITS tmp1; + BITS tmp2 = 0; if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - tmp = gethelpr(pAsm); + tmp1 = gethelpr(pAsm); pAsm->D.dst.opcode = SQ_OP2_INST_MUL; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; + pAsm->D.dst.reg = tmp1; nomask_PVSDST(&(pAsm->D.dst)); if( GL_FALSE == assemble_src(pAsm, 0, -1) ) @@ -4530,11 +4531,11 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) { - tmp = gethelpr(pAsm); + tmp2 = gethelpr(pAsm); setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; + pAsm->D.dst.reg = tmp2; nomask_PVSDST(&(pAsm->D.dst)); } @@ -4562,7 +4563,7 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) // result1 + (neg) result0 setaddrmode_PVSSRC(&(pAsm->S[2].src),ADDR_ABSOLUTE); pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[2].src.reg = tmp; + pAsm->S[2].src.reg = tmp1; neg_PVSSRC(&(pAsm->S[2].src)); noswizzle_PVSSRC(&(pAsm->S[2].src)); @@ -4585,7 +4586,7 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) // Use tmp as source setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp; + pAsm->S[0].src.reg = tmp2; noneg_PVSSRC(&(pAsm->S[0].src)); noswizzle_PVSSRC(&(pAsm->S[0].src)); @@ -5090,15 +5091,15 @@ void add_return_inst(r700_AssemblerBase *pAsm) { if(GL_FALSE == add_cf_instruction(pAsm) ) { - return GL_FALSE; + return; } //pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_RETURN; pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; @@ -5302,7 +5303,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) { - GLfloat fLiteral[2] = {0.1, 0.0}; + /*GLfloat fLiteral[2] = {0.1, 0.0};*/ pAsm->D.dst.opcode = SQ_OP2_INST_MOV; pAsm->D.dst.op3 = 0; @@ -5353,7 +5354,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) GLboolean testFlag(r700_AssemblerBase *pAsm) { - GLfloat fLiteral[2] = {0.1, 0.0}; + /*GLfloat fLiteral[2] = {0.1, 0.0};*/ //Test flag GLuint tmp = gethelpr(pAsm); @@ -6123,7 +6124,7 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, R700ControlFlowGenericClause* prelude_cf_ptr = NULL; - /* copy srcs to presub inputs */ + /* copy srcs to presub inputs */ pAsm->alu_x_opcode = SQ_CF_INST_ALU; for(i=0; i<uNumValidSrc; i++) { diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 56baf5b0d9..0064d0814f 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -619,6 +619,7 @@ GLboolean assemble_RCP(r700_AssemblerBase *pAsm); GLboolean assemble_RSQ(r700_AssemblerBase *pAsm); GLboolean assemble_SCS(r700_AssemblerBase *pAsm); GLboolean assemble_SGE(r700_AssemblerBase *pAsm); +GLboolean assemble_CONT(r700_AssemblerBase *pAsm); GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 3bc2d2ba02..ef25cd93fe 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -303,14 +303,13 @@ static void r700SetRenderTarget(context_t *context, int id) R600_STATECHANGE(context, cb_target); /* color buffer */ - r700->render_target[id].CB_COLOR0_BASE.u32All = context->radeon.state.color.draw_offset; + r700->render_target[id].CB_COLOR0_BASE.u32All = context->radeon.state.color.draw_offset / 256; nPitchInPixel = rrb->pitch/rrb->cpp; SETfield(r700->render_target[id].CB_COLOR0_SIZE.u32All, (nPitchInPixel/8)-1, PITCH_TILE_MAX_shift, PITCH_TILE_MAX_mask); SETfield(r700->render_target[id].CB_COLOR0_SIZE.u32All, ( (nPitchInPixel * context->radeon.radeonScreen->driScreen->fbHeight)/64 )-1, SLICE_TILE_MAX_shift, SLICE_TILE_MAX_mask); - r700->render_target[id].CB_COLOR0_BASE.u32All = 0; SETfield(r700->render_target[id].CB_COLOR0_INFO.u32All, ENDIAN_NONE, ENDIAN_shift, ENDIAN_mask); SETfield(r700->render_target[id].CB_COLOR0_INFO.u32All, ARRAY_LINEAR_GENERAL, CB_COLOR0_INFO__ARRAY_MODE_shift, CB_COLOR0_INFO__ARRAY_MODE_mask); @@ -453,13 +452,31 @@ static void r700SendRenderTargetState(GLcontext *ctx, struct radeon_state_atom * R600_OUT_BATCH((2 << id)); END_BATCH(); } + /* Set CMASK & TILE buffer to the offset of color buffer as + * we don't use those this shouldn't cause any issue and we + * then have a valid cmd stream + */ + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(CB_COLOR0_TILE + (4 * id), 1); + R600_OUT_BATCH(r700->render_target[id].CB_COLOR0_TILE.u32All); + R600_OUT_BATCH_RELOC(r700->render_target[id].CB_COLOR0_BASE.u32All, + rrb->bo, + r700->render_target[id].CB_COLOR0_BASE.u32All, + 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(CB_COLOR0_FRAG + (4 * id), 1); + R600_OUT_BATCH(r700->render_target[id].CB_COLOR0_FRAG.u32All); + R600_OUT_BATCH_RELOC(r700->render_target[id].CB_COLOR0_BASE.u32All, + rrb->bo, + r700->render_target[id].CB_COLOR0_BASE.u32All, + 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(18); + BEGIN_BATCH_NO_AUTOSTATE(12); R600_OUT_BATCH_REGVAL(CB_COLOR0_SIZE + (4 * id), r700->render_target[id].CB_COLOR0_SIZE.u32All); R600_OUT_BATCH_REGVAL(CB_COLOR0_VIEW + (4 * id), r700->render_target[id].CB_COLOR0_VIEW.u32All); R600_OUT_BATCH_REGVAL(CB_COLOR0_INFO + (4 * id), r700->render_target[id].CB_COLOR0_INFO.u32All); - R600_OUT_BATCH_REGVAL(CB_COLOR0_TILE + (4 * id), r700->render_target[id].CB_COLOR0_TILE.u32All); - R600_OUT_BATCH_REGVAL(CB_COLOR0_FRAG + (4 * id), r700->render_target[id].CB_COLOR0_FRAG.u32All); R600_OUT_BATCH_REGVAL(CB_COLOR0_MASK + (4 * id), r700->render_target[id].CB_COLOR0_MASK.u32All); END_BATCH(); diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index eab27cbd84..3a6210c53a 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -422,7 +422,7 @@ static void r700RunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, } /* start 3d, idle, cb/db flush */ -#define PRE_EMIT_STATE_BUFSZ 10 + 5 + 14 +#define PRE_EMIT_STATE_BUFSZ 10 + 5 + 18 static GLuint r700PredictRenderSize(GLcontext* ctx, const struct _mesa_prim *prim, diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 3c8cb579f9..20e8afefba 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -59,6 +59,7 @@ static void r700SetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean state); static void r700UpdatePolygonMode(GLcontext * ctx); static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state); static void r700SetStencilState(GLcontext * ctx, GLboolean state); +static void r700UpdateWindow(GLcontext * ctx, int id); void r700UpdateShaders(GLcontext * ctx) { @@ -780,6 +781,9 @@ static void r700Enable(GLcontext * ctx, GLenum cap, GLboolean state) //--------- case GL_LINE_STIPPLE: r700UpdateLineStipple(ctx); break; + case GL_DEPTH_CLAMP: + r700UpdateWindow(ctx, 0); + break; default: break; } @@ -1576,9 +1580,9 @@ static void r700InitSQConfig(GLcontext * ctx) SETbit(r700->sq_config.SQ_CONFIG.u32All, DX9_CONSTS_bit); SETbit(r700->sq_config.SQ_CONFIG.u32All, ALU_INST_PREFER_VECTOR_bit); SETfield(r700->sq_config.SQ_CONFIG.u32All, ps_prio, PS_PRIO_shift, PS_PRIO_mask); - SETfield(r700->sq_config.SQ_CONFIG.u32All, ps_prio, VS_PRIO_shift, VS_PRIO_mask); - SETfield(r700->sq_config.SQ_CONFIG.u32All, ps_prio, GS_PRIO_shift, GS_PRIO_mask); - SETfield(r700->sq_config.SQ_CONFIG.u32All, ps_prio, ES_PRIO_shift, ES_PRIO_mask); + SETfield(r700->sq_config.SQ_CONFIG.u32All, vs_prio, VS_PRIO_shift, VS_PRIO_mask); + SETfield(r700->sq_config.SQ_CONFIG.u32All, gs_prio, GS_PRIO_shift, GS_PRIO_mask); + SETfield(r700->sq_config.SQ_CONFIG.u32All, es_prio, ES_PRIO_shift, ES_PRIO_mask); r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All = 0; SETfield(r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All, num_ps_gprs, NUM_PS_GPRS_shift, NUM_PS_GPRS_mask); diff --git a/src/mesa/drivers/dri/r600/radeon_tex_copy.c b/src/mesa/drivers/dri/r600/radeon_tex_copy.c new file mode 120000 index 0000000000..dfa5ba34e6 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_tex_copy.c @@ -0,0 +1 @@ +../radeon/radeon_tex_copy.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/server/radeon_egl.c b/src/mesa/drivers/dri/r600/server/radeon_egl.c deleted file mode 120000 index d7735a7643..0000000000 --- a/src/mesa/drivers/dri/r600/server/radeon_egl.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_egl.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index 2b2f2c4aa7..a54ea16ec6 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -26,7 +26,8 @@ RADEON_COMMON_SOURCES = \ radeon_mipmap_tree.c \ radeon_queryobj.c \ radeon_span.c \ - radeon_texture.c + radeon_texture.c \ + radeon_tex_copy.c DRIVER_SOURCES = \ radeon_context.c \ @@ -40,6 +41,7 @@ DRIVER_SOURCES = \ radeon_swtcl.c \ radeon_maos.c \ radeon_sanity.c \ + radeon_blit.c \ $(RADEON_COMMON_SOURCES) C_SOURCES = \ @@ -47,7 +49,7 @@ C_SOURCES = \ $(DRIVER_SOURCES) \ $(CS_SOURCES) -DRIVER_DEFINES = -DRADEON_R100 -Wall +DRIVER_DEFINES = -DRADEON_R100 DRI_LIB_DEPS += $(RADEON_LDFLAGS) diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c new file mode 100644 index 0000000000..0df4fbb33c --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -0,0 +1,403 @@ +/* + * Copyright (C) 2010 Advanced Micro Devices, Inc. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. + * + */ + +#include "radeon_common.h" +#include "radeon_context.h" +#include "radeon_blit.h" + +static inline uint32_t cmdpacket0(struct radeon_screen *rscrn, + int reg, int count) +{ + if (count) + return CP_PACKET0(reg, count - 1); + return CP_PACKET2; +} + +/* common formats supported as both textures and render targets */ +static unsigned is_blit_supported(gl_format mesa_format) +{ + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_A8: + break; + default: + return 0; + } + + /* ??? */ + if (_mesa_get_format_bits(mesa_format, GL_DEPTH_BITS) > 0) + return 0; + + return 1; +} + +static inline void emit_vtx_state(struct r100_context *r100) +{ + BATCH_LOCALS(&r100->radeon); + + BEGIN_BATCH(8); + if (r100->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) { + OUT_BATCH_REGVAL(RADEON_SE_CNTL_STATUS, 0); + } else { + OUT_BATCH_REGVAL(RADEON_SE_CNTL_STATUS, RADEON_TCL_BYPASS); + + } + OUT_BATCH_REGVAL(RADEON_SE_COORD_FMT, (RADEON_VTX_XY_PRE_MULT_1_OVER_W0 | + RADEON_TEX1_W_ROUTING_USE_W0)); + OUT_BATCH_REGVAL(RADEON_SE_VTX_FMT, RADEON_SE_VTX_FMT_XY | RADEON_SE_VTX_FMT_ST0); + OUT_BATCH_REGVAL(RADEON_SE_CNTL, (RADEON_DIFFUSE_SHADE_GOURAUD | + RADEON_BFACE_SOLID | + RADEON_FFACE_SOLID | + RADEON_VTX_PIX_CENTER_OGL | + RADEON_ROUND_MODE_ROUND | + RADEON_ROUND_PREC_4TH_PIX)); + END_BATCH(); +} + +static void inline emit_tx_setup(struct r100_context *r100, + gl_format mesa_format, + struct radeon_bo *bo, + intptr_t offset, + unsigned width, + unsigned height, + unsigned pitch) +{ + uint32_t txformat = RADEON_TXFORMAT_NON_POWER2; + BATCH_LOCALS(&r100->radeon); + + assert(width <= 2047); + assert(height <= 2047); + assert(offset % 32 == 0); + + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + txformat |= RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_XRGB8888: + txformat |= RADEON_TXFORMAT_ARGB8888; + break; + case MESA_FORMAT_RGB565: + txformat |= RADEON_TXFORMAT_RGB565; + break; + case MESA_FORMAT_ARGB4444: + txformat |= RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_ARGB1555: + txformat |= RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP; + break; + case MESA_FORMAT_A8: + txformat |= RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP; + break; + default: + break; + } + + BEGIN_BATCH(18); + OUT_BATCH_REGVAL(RADEON_PP_CNTL, RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE); + OUT_BATCH_REGVAL(RADEON_PP_TXCBLEND_0, (RADEON_COLOR_ARG_A_ZERO | + RADEON_COLOR_ARG_B_ZERO | + RADEON_COLOR_ARG_C_T0_COLOR | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX)); + OUT_BATCH_REGVAL(RADEON_PP_TXABLEND_0, (RADEON_ALPHA_ARG_A_ZERO | + RADEON_ALPHA_ARG_B_ZERO | + RADEON_ALPHA_ARG_C_T0_ALPHA | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX)); + OUT_BATCH_REGVAL(RADEON_PP_TXFILTER_0, (RADEON_CLAMP_S_CLAMP_LAST | + RADEON_CLAMP_T_CLAMP_LAST | + RADEON_MAG_FILTER_NEAREST | + RADEON_MIN_FILTER_NEAREST)); + OUT_BATCH_REGVAL(RADEON_PP_TXFORMAT_0, txformat); + OUT_BATCH_REGVAL(RADEON_PP_TEX_SIZE_0, ((width - 1) | + ((height - 1) << RADEON_TEX_VSIZE_SHIFT))); + OUT_BATCH_REGVAL(RADEON_PP_TEX_PITCH_0, pitch * _mesa_get_format_bytes(mesa_format) - 32); + + OUT_BATCH_REGSEQ(RADEON_PP_TXOFFSET_0, 1); + OUT_BATCH_RELOC(0, bo, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + + END_BATCH(); +} + +static inline void emit_cb_setup(struct r100_context *r100, + struct radeon_bo *bo, + intptr_t offset, + gl_format mesa_format, + unsigned pitch, + unsigned width, + unsigned height) +{ + uint32_t dst_pitch = pitch; + uint32_t dst_format = 0; + BATCH_LOCALS(&r100->radeon); + + /* XXX others? BE/LE? */ + switch (mesa_format) { + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: + dst_format = RADEON_COLOR_FORMAT_ARGB8888; + break; + case MESA_FORMAT_RGB565: + dst_format = RADEON_COLOR_FORMAT_RGB565; + break; + case MESA_FORMAT_ARGB4444: + dst_format = RADEON_COLOR_FORMAT_ARGB4444; + break; + case MESA_FORMAT_ARGB1555: + dst_format = RADEON_COLOR_FORMAT_ARGB1555; + break; + case MESA_FORMAT_A8: + dst_format = RADEON_COLOR_FORMAT_RGB8; + break; + default: + break; + } + + BEGIN_BATCH_NO_AUTOSTATE(18); + OUT_BATCH_REGVAL(RADEON_RE_TOP_LEFT, 0); + OUT_BATCH_REGVAL(RADEON_RE_WIDTH_HEIGHT, ((width << RADEON_RE_WIDTH_SHIFT) | + (height << RADEON_RE_HEIGHT_SHIFT))); + OUT_BATCH_REGVAL(RADEON_RB3D_PLANEMASK, 0xffffffff); + OUT_BATCH_REGVAL(RADEON_RB3D_BLENDCNTL, RADEON_SRC_BLEND_GL_ONE | RADEON_DST_BLEND_GL_ZERO); + OUT_BATCH_REGVAL(RADEON_RB3D_CNTL, dst_format); + + OUT_BATCH_REGSEQ(RADEON_RB3D_COLOROFFSET, 1); + OUT_BATCH_RELOC(0, bo, 0, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0); + OUT_BATCH_REGSEQ(RADEON_RB3D_COLORPITCH, 1); + OUT_BATCH_RELOC(dst_pitch, bo, dst_pitch, 0, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0); + + END_BATCH(); +} + +static GLboolean validate_buffers(struct r100_context *r100, + struct radeon_bo *src_bo, + struct radeon_bo *dst_bo) +{ + int ret; + radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + + radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + + ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, + first_elem(&r100->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); + if (ret) + return GL_FALSE; + + return GL_TRUE; +} + +/** + * Calculate texcoords for given image region. + * Output values are [minx, maxx, miny, maxy] + */ +static inline void calc_tex_coords(float img_width, float img_height, + float x, float y, + float reg_width, float reg_height, + unsigned flip_y, float *buf) +{ + buf[0] = x / img_width; + buf[1] = buf[0] + reg_width / img_width; + buf[2] = y / img_height; + buf[3] = buf[2] + reg_height / img_height; + if (flip_y) + { + buf[2] = 1.0 - buf[2]; + buf[3] = 1.0 - buf[3]; + } +} + +static inline void emit_draw_packet(struct r100_context *r100, + unsigned src_width, unsigned src_height, + unsigned src_x_offset, unsigned src_y_offset, + unsigned dst_x_offset, unsigned dst_y_offset, + unsigned reg_width, unsigned reg_height, + unsigned flip_y) +{ + float texcoords[4]; + float verts[12]; + BATCH_LOCALS(&r100->radeon); + + calc_tex_coords(src_width, src_height, + src_x_offset, src_y_offset, + reg_width, reg_height, + flip_y, texcoords); + + verts[0] = dst_x_offset; + verts[1] = dst_y_offset + reg_height; + verts[2] = texcoords[0]; + verts[3] = texcoords[3]; + + verts[4] = dst_x_offset + reg_width; + verts[5] = dst_y_offset + reg_height; + verts[6] = texcoords[1]; + verts[7] = texcoords[3]; + + verts[8] = dst_x_offset + reg_width; + verts[9] = dst_y_offset; + verts[10] = texcoords[1]; + verts[11] = texcoords[2]; + + BEGIN_BATCH(15); + OUT_BATCH(RADEON_CP_PACKET3_3D_DRAW_IMMD | (13 << 16)); + OUT_BATCH(RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_ST0); + OUT_BATCH(RADEON_CP_VC_CNTL_PRIM_WALK_RING | + RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST | + RADEON_CP_VC_CNTL_MAOS_ENABLE | + RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE | + (3 << 16)); + OUT_BATCH_TABLE(verts, 12); + END_BATCH(); +} + +/** + * Copy a region of [@a width x @a height] pixels from source buffer + * to destination buffer. + * @param[in] r100 r100 context + * @param[in] src_bo source radeon buffer object + * @param[in] src_offset offset of the source image in the @a src_bo + * @param[in] src_mesaformat source image format + * @param[in] src_pitch aligned source image width + * @param[in] src_width source image width + * @param[in] src_height source image height + * @param[in] src_x_offset x offset in the source image + * @param[in] src_y_offset y offset in the source image + * @param[in] dst_bo destination radeon buffer object + * @param[in] dst_offset offset of the destination image in the @a dst_bo + * @param[in] dst_mesaformat destination image format + * @param[in] dst_pitch aligned destination image width + * @param[in] dst_width destination image width + * @param[in] dst_height destination image height + * @param[in] dst_x_offset x offset in the destination image + * @param[in] dst_y_offset y offset in the destination image + * @param[in] width region width + * @param[in] height region height + * @param[in] flip_y set if y coords of the source image need to be flipped + */ +unsigned r100_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned reg_width, + unsigned reg_height, + unsigned flip_y) +{ + struct r100_context *r100 = R100_CONTEXT(ctx); + + if (!is_blit_supported(dst_mesaformat)) + return GL_FALSE; + + /* Make sure that colorbuffer has even width - hw limitation */ + if (dst_pitch % 2 > 0) + ++dst_pitch; + + /* Rendering to small buffer doesn't work. + * Looks like a hw limitation. + */ + if (dst_pitch < 32) + return GL_FALSE; + + /* Need to clamp the region size to make sure + * we don't read outside of the source buffer + * or write outside of the destination buffer. + */ + if (reg_width + src_x_offset > src_width) + reg_width = src_width - src_x_offset; + if (reg_height + src_y_offset > src_height) + reg_height = src_height - src_y_offset; + if (reg_width + dst_x_offset > dst_width) + reg_width = dst_width - dst_x_offset; + if (reg_height + dst_y_offset > dst_height) + reg_height = dst_height - dst_y_offset; + + if (src_bo == dst_bo) { + return GL_FALSE; + } + + if (src_offset % 32 || dst_offset % 32) { + return GL_FALSE; + } + + if (0) { + fprintf(stderr, "src: size [%d x %d], pitch %d, " + "offset [%d x %d], format %s, bo %p\n", + src_width, src_height, src_pitch, + src_x_offset, src_y_offset, + _mesa_get_format_name(src_mesaformat), + src_bo); + fprintf(stderr, "dst: pitch %d, offset[%d x %d], format %s, bo %p\n", + dst_pitch, dst_x_offset, dst_y_offset, + _mesa_get_format_name(dst_mesaformat), dst_bo); + fprintf(stderr, "region: %d x %d\n", reg_width, reg_height); + } + + /* Flush is needed to make sure that source buffer has correct data */ + radeonFlush(ctx); + + rcommonEnsureCmdBufSpace(&r100->radeon, 59, __FUNCTION__); + + if (!validate_buffers(r100, src_bo, dst_bo)) + return GL_FALSE; + + /* 8 */ + emit_vtx_state(r100); + /* 18 */ + emit_tx_setup(r100, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); + /* 18 */ + emit_cb_setup(r100, dst_bo, dst_offset, dst_mesaformat, dst_pitch, dst_width, dst_height); + /* 15 */ + emit_draw_packet(r100, src_width, src_height, + src_x_offset, src_y_offset, + dst_x_offset, dst_y_offset, + reg_width, reg_height, + flip_y); + + radeonFlush(ctx); + + return GL_TRUE; +} diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.h b/src/mesa/drivers/dri/radeon/radeon_blit.h new file mode 100644 index 0000000000..d36366ff79 --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_blit.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2010 Advanced Micro Devices, Inc. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. + * + */ + +#ifndef RADEON_BLIT_H +#define RADEON_BLIT_H + +void r100_blit_init(struct r100_context *r100); + +unsigned r100_blit(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned width, + unsigned height, + unsigned flip_y); + +#endif // RADEON_BLIT_H diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index e0b853bc97..79f3ff7da6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1036,10 +1036,11 @@ static INLINE void radeon_emit_atom(radeonContextPtr radeon, struct radeon_state OUT_BATCH_TABLE(atom->cmd, dwords); END_BATCH(); } + atom->dirty = GL_FALSE; + } else { radeon_print(RADEON_STATE, RADEON_VERBOSE, " skip state %s\n", atom->name); } - atom->dirty = GL_FALSE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index ab79d2dc0f..e397ee8c22 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -518,6 +518,26 @@ struct radeon_context { void (*free_context)(GLcontext *ctx); void (*emit_query_finish)(radeonContextPtr radeon); void (*update_scissor)(GLcontext *ctx); + unsigned (*blit)(GLcontext *ctx, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + unsigned src_x_offset, + unsigned src_y_offset, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_pitch, + unsigned dst_width, + unsigned dst_height, + unsigned dst_x_offset, + unsigned dst_y_offset, + unsigned reg_width, + unsigned reg_height, + unsigned flip_y); } vtbl; }; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 3cd305b0a2..6c08a90bbd 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -63,6 +63,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_tcl.h" #include "radeon_maos.h" #include "radeon_queryobj.h" +#include "radeon_blit.h" #define need_GL_ARB_occlusion_query #define need_GL_EXT_blend_minmax @@ -202,6 +203,7 @@ static void r100_init_vtbl(radeonContextPtr radeon) radeon->vtbl.fallback = radeonFallback; radeon->vtbl.free_context = r100_vtbl_free_context; radeon->vtbl.emit_query_finish = r100_emit_query_finish; + radeon->vtbl.blit = r100_blit; } /* Create the device specific context. @@ -228,6 +230,7 @@ r100CreateContext( const __GLcontextModes *glVisual, if ( !rmesa ) return GL_FALSE; + rmesa->radeon.radeonScreen = screen; r100_init_vtbl(&rmesa->radeon); /* init exp fog table data */ @@ -257,7 +260,7 @@ r100CreateContext( const __GLcontextModes *glVisual, * (the texture functions are especially important) */ _mesa_init_driver_functions( &functions ); - radeonInitTextureFuncs( &functions ); + radeonInitTextureFuncs( &rmesa->radeon, &functions ); radeonInitQueryObjFunctions(&functions); if (!radeonInitContext(&rmesa->radeon, &functions, diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index dfedc38bfd..d84760bf74 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -453,7 +453,6 @@ struct r100_context { extern GLboolean r100CreateContext( const __GLcontextModes *glVisual, __DRIcontext *driContextPriv, void *sharedContextPrivate); - #endif /* __RADEON_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index bf46eb8aab..cc951a12cb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -180,7 +180,6 @@ static int cs_begin(struct radeon_cs_int *cs, if (cs->cdw + ndw > cs->ndw) { uint32_t tmp, *ptr; - int num = (ndw > 0x3FF) ? ndw : 0x3FF; tmp = (cs->cdw + ndw + 0x3ff) & (~0x3ff); ptr = (uint32_t*)realloc(cs->packets, 4 * tmp); diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 7b1f84a715..e780b9eef1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -531,10 +531,9 @@ radeon_render_texture(GLcontext * ctx, att->TextureLevel); if (att->Texture->Target == GL_TEXTURE_3D) { - GLuint offsets[6]; - radeon_miptree_depth_offsets(radeon_image->mt, att->TextureLevel, - offsets); - imageOffset += offsets[att->Zoffset]; + imageOffset += radeon_image->mt->levels[att->TextureLevel].rowstride * + radeon_image->mt->levels[att->TextureLevel].height * + att->Zoffset; } /* store that offset in the region, along with the correct pitch for diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index a9d50c5d07..afe3d9f12e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -46,7 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/shaders.h" #include "main/texstate.h" #include "main/varray.h" -#include "glapi/dispatch.h" #include "swrast/swrast.h" #include "main/stencil.h" #include "main/matrix.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_lighting.c b/src/mesa/drivers/dri/radeon/radeon_lighting.c deleted file mode 100644 index ba444f2b10..0000000000 --- a/src/mesa/drivers/dri/radeon/radeon_lighting.c +++ /dev/null @@ -1,681 +0,0 @@ -/* - * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. - * - * 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 - * VA LINUX SYSTEMS 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: - * Gareth Hughes <gareth@valinux.com> - * Keith Whitwell <keith@tungstengraphics.com> - */ - -#include "main/glheader.h" -#include "main/imports.h" -#include "api_arrayelt.h" -/* #include "mmath.h" */ -#include "main/enums.h" -#include "colormac.h" - - -#include "radeon_context.h" -#include "radeon_ioctl.h" -#include "radeon_state.h" -#include "radeon_tcl.h" -#include "radeon_tex.h" -#include "radeon_vtxfmt.h" - - - -/* ============================================================= - * Materials - */ - - -/* Update on colormaterial, material emmissive/ambient, - * lightmodel.globalambient - */ -void update_global_ambient( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - float *fcmd = (float *)RADEON_DB_STATE( glt ); - - /* Need to do more if both emmissive & ambient are PREMULT: - */ - if ((rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] & - ((3 << RADEON_EMISSIVE_SOURCE_SHIFT) | - (3 << RADEON_AMBIENT_SOURCE_SHIFT))) == 0) - { - COPY_3V( &fcmd[GLT_RED], - ctx->Light.Material[0].Emission); - ACC_SCALE_3V( &fcmd[GLT_RED], - ctx->Light.Model.Ambient, - ctx->Light.Material[0].Ambient); - } - else - { - COPY_3V( &fcmd[GLT_RED], ctx->Light.Model.Ambient ); - } - - RADEON_DB_STATECHANGE(rmesa, &rmesa->hw.glt); -} - -/* Update on change to - * - light[p].colors - * - light[p].enabled - * - material, - * - colormaterial enabled - * - colormaterial bitmask - */ -void update_light_colors( GLcontext *ctx, GLuint p ) -{ - struct gl_light *l = &ctx->Light.Light[p]; - -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (l->Enabled) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - float *fcmd = (float *)RADEON_DB_STATE( lit[p] ); - GLuint bitmask = ctx->Light.ColorMaterialBitmask; - struct gl_material *mat = &ctx->Light.Material[0]; - - COPY_4V( &fcmd[LIT_AMBIENT_RED], l->Ambient ); - COPY_4V( &fcmd[LIT_DIFFUSE_RED], l->Diffuse ); - COPY_4V( &fcmd[LIT_SPECULAR_RED], l->Specular ); - - if (!ctx->Light.ColorMaterialEnabled) - bitmask = 0; - - if ((bitmask & FRONT_AMBIENT_BIT) == 0) - SELF_SCALE_3V( &fcmd[LIT_AMBIENT_RED], mat->Ambient ); - - if ((bitmask & FRONT_DIFFUSE_BIT) == 0) - SELF_SCALE_3V( &fcmd[LIT_DIFFUSE_RED], mat->Diffuse ); - - if ((bitmask & FRONT_SPECULAR_BIT) == 0) - SELF_SCALE_3V( &fcmd[LIT_SPECULAR_RED], mat->Specular ); - - RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] ); - } -} - -/* Also fallback for asym colormaterial mode in twoside lighting... - */ -void check_twoside_fallback( GLcontext *ctx ) -{ - GLboolean fallback = GL_FALSE; - - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) { - if (memcmp( &ctx->Light.Material[0], - &ctx->Light.Material[1], - sizeof(struct gl_material)) != 0) - fallback = GL_TRUE; - else if (ctx->Light.ColorMaterialEnabled && - (ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) != - ((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1)) - fallback = GL_TRUE; - } - - TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_LIGHT_TWOSIDE, fallback ); -} - -void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) -{ - if (ctx->Light.ColorMaterialEnabled) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLuint light_model_ctl = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]; - GLuint mask = ctx->Light.ColorMaterialBitmask; - - /* Default to PREMULT: - */ - light_model_ctl &= ~((3 << RADEON_EMISSIVE_SOURCE_SHIFT) | - (3 << RADEON_AMBIENT_SOURCE_SHIFT) | - (3 << RADEON_DIFFUSE_SOURCE_SHIFT) | - (3 << RADEON_SPECULAR_SOURCE_SHIFT)); - - if (mask & FRONT_EMISSION_BIT) { - light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE << - RADEON_EMISSIVE_SOURCE_SHIFT); - } - - if (mask & FRONT_AMBIENT_BIT) { - light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE << - RADEON_AMBIENT_SOURCE_SHIFT); - } - - if (mask & FRONT_DIFFUSE_BIT) { - light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE << - RADEON_DIFFUSE_SOURCE_SHIFT); - } - - if (mask & FRONT_SPECULAR_BIT) { - light_model_ctl |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE << - RADEON_SPECULAR_SOURCE_SHIFT); - } - - if (light_model_ctl != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]) { - GLuint p; - - RADEON_STATECHANGE( rmesa, tcl ); - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = light_model_ctl; - - for (p = 0 ; p < MAX_LIGHTS; p++) - update_light_colors( ctx, p ); - update_global_ambient( ctx ); - } - } - - check_twoside_fallback( ctx ); -} - -void radeonUpdateMaterial( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( mtl ); - GLuint p; - GLuint mask = ~0; - - if (ctx->Light.ColorMaterialEnabled) - mask &= ~ctx->Light.ColorMaterialBitmask; - - if (RADEON_DEBUG & RADEON_STATE) - fprintf(stderr, "%s\n", __FUNCTION__); - - - if (mask & FRONT_EMISSION_BIT) { - fcmd[MTL_EMMISSIVE_RED] = ctx->Light.Material[0].Emission[0]; - fcmd[MTL_EMMISSIVE_GREEN] = ctx->Light.Material[0].Emission[1]; - fcmd[MTL_EMMISSIVE_BLUE] = ctx->Light.Material[0].Emission[2]; - fcmd[MTL_EMMISSIVE_ALPHA] = ctx->Light.Material[0].Emission[3]; - } - if (mask & FRONT_AMBIENT_BIT) { - fcmd[MTL_AMBIENT_RED] = ctx->Light.Material[0].Ambient[0]; - fcmd[MTL_AMBIENT_GREEN] = ctx->Light.Material[0].Ambient[1]; - fcmd[MTL_AMBIENT_BLUE] = ctx->Light.Material[0].Ambient[2]; - fcmd[MTL_AMBIENT_ALPHA] = ctx->Light.Material[0].Ambient[3]; - } - if (mask & FRONT_DIFFUSE_BIT) { - fcmd[MTL_DIFFUSE_RED] = ctx->Light.Material[0].Diffuse[0]; - fcmd[MTL_DIFFUSE_GREEN] = ctx->Light.Material[0].Diffuse[1]; - fcmd[MTL_DIFFUSE_BLUE] = ctx->Light.Material[0].Diffuse[2]; - fcmd[MTL_DIFFUSE_ALPHA] = ctx->Light.Material[0].Diffuse[3]; - } - if (mask & FRONT_SPECULAR_BIT) { - fcmd[MTL_SPECULAR_RED] = ctx->Light.Material[0].Specular[0]; - fcmd[MTL_SPECULAR_GREEN] = ctx->Light.Material[0].Specular[1]; - fcmd[MTL_SPECULAR_BLUE] = ctx->Light.Material[0].Specular[2]; - fcmd[MTL_SPECULAR_ALPHA] = ctx->Light.Material[0].Specular[3]; - } - if (mask & FRONT_SHININESS_BIT) { - fcmd[MTL_SHININESS] = ctx->Light.Material[0].Shininess; - } - - if (RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl )) { - for (p = 0 ; p < MAX_LIGHTS; p++) - update_light_colors( ctx, p ); - - check_twoside_fallback( ctx ); - update_global_ambient( ctx ); - } - else if (RADEON_DEBUG & (RADEON_PRIMS|DEBUG_STATE)) - fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__); -} - -/* _NEW_LIGHT - * _NEW_MODELVIEW - * _MESA_NEW_NEED_EYE_COORDS - * - * Uses derived state from mesa: - * _VP_inf_norm - * _h_inf_norm - * _Position - * _NormSpotDirection - * _ModelViewInvScale - * _NeedEyeCoords - * _EyeZDir - * - * which are calculated in light.c and are correct for the current - * lighting space (model or eye), hence dependencies on _NEW_MODELVIEW - * and _MESA_NEW_NEED_EYE_COORDS. - */ -void radeonUpdateLighting( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - - /* Have to check these, or have an automatic shortcircuit mechanism - * to remove noop statechanges. (Or just do a better job on the - * front end). - */ - { - GLuint tmp = rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]; - - if (ctx->_NeedEyeCoords) - tmp &= ~RADEON_LIGHT_IN_MODELSPACE; - else - tmp |= RADEON_LIGHT_IN_MODELSPACE; - - - /* Leave this test disabled: (unexplained q3 lockup) (even with - new packets) - */ - if (tmp != rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]) - { - RADEON_STATECHANGE( rmesa, tcl ); - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] = tmp; - } - } - - { - GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( eye ); - fcmd[EYE_X] = ctx->_EyeZDir[0]; - fcmd[EYE_Y] = ctx->_EyeZDir[1]; - fcmd[EYE_Z] = - ctx->_EyeZDir[2]; - fcmd[EYE_RESCALE_FACTOR] = ctx->_ModelViewInvScale; - RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.eye ); - } - - -/* RADEON_STATECHANGE( rmesa, glt ); */ - - if (ctx->Light.Enabled) { - GLint p; - for (p = 0 ; p < MAX_LIGHTS; p++) { - if (ctx->Light.Light[p].Enabled) { - struct gl_light *l = &ctx->Light.Light[p]; - GLfloat *fcmd = (GLfloat *)RADEON_DB_STATE( lit[p] ); - - if (l->EyePosition[3] == 0.0) { - COPY_3FV( &fcmd[LIT_POSITION_X], l->_VP_inf_norm ); - COPY_3FV( &fcmd[LIT_DIRECTION_X], l->_h_inf_norm ); - fcmd[LIT_POSITION_W] = 0; - fcmd[LIT_DIRECTION_W] = 0; - } else { - COPY_4V( &fcmd[LIT_POSITION_X], l->_Position ); - fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0]; - fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1]; - fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2]; - fcmd[LIT_DIRECTION_W] = 0; - } - - RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.lit[p] ); - } - } - } -} - - -void radeonLightfv( GLcontext *ctx, GLenum light, - GLenum pname, const GLfloat *params ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLint p = light - GL_LIGHT0; - struct gl_light *l = &ctx->Light.Light[p]; - GLfloat *fcmd = (GLfloat *)rmesa->hw.lit[p].cmd; - - - switch (pname) { - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - update_light_colors( ctx, p ); - break; - - case GL_SPOT_DIRECTION: - /* picked up in update_light */ - break; - - case GL_POSITION: { - /* positions picked up in update_light, but can do flag here */ - GLuint flag = (p&1)? RADEON_LIGHT_1_IS_LOCAL : RADEON_LIGHT_0_IS_LOCAL; - GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; - - RADEON_STATECHANGE(rmesa, tcl); - if (l->EyePosition[3] != 0.0F) - rmesa->hw.tcl.cmd[idx] |= flag; - else - rmesa->hw.tcl.cmd[idx] &= ~flag; - break; - } - - case GL_SPOT_EXPONENT: - RADEON_STATECHANGE(rmesa, lit[p]); - fcmd[LIT_SPOT_EXPONENT] = params[0]; - break; - - case GL_SPOT_CUTOFF: { - GLuint flag = (p&1) ? RADEON_LIGHT_1_IS_SPOT : RADEON_LIGHT_0_IS_SPOT; - GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; - - RADEON_STATECHANGE(rmesa, lit[p]); - fcmd[LIT_SPOT_CUTOFF] = l->_CosCutoff; - - RADEON_STATECHANGE(rmesa, tcl); - if (l->SpotCutoff != 180.0F) - rmesa->hw.tcl.cmd[idx] |= flag; - else - rmesa->hw.tcl.cmd[idx] &= ~flag; - break; - } - - case GL_CONSTANT_ATTENUATION: - RADEON_STATECHANGE(rmesa, lit[p]); - fcmd[LIT_ATTEN_CONST] = params[0]; - break; - case GL_LINEAR_ATTENUATION: - RADEON_STATECHANGE(rmesa, lit[p]); - fcmd[LIT_ATTEN_LINEAR] = params[0]; - break; - case GL_QUADRATIC_ATTENUATION: - RADEON_STATECHANGE(rmesa, lit[p]); - fcmd[LIT_ATTEN_QUADRATIC] = params[0]; - break; - default: - return; - } - -} - - - - -void radeonLightModelfv( GLcontext *ctx, GLenum pname, - const GLfloat *param ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - - switch (pname) { - case GL_LIGHT_MODEL_AMBIENT: - update_global_ambient( ctx ); - break; - - case GL_LIGHT_MODEL_LOCAL_VIEWER: - RADEON_STATECHANGE( rmesa, tcl ); - if (ctx->Light.Model.LocalViewer) - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LOCAL_VIEWER; - else - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LOCAL_VIEWER; - break; - - case GL_LIGHT_MODEL_TWO_SIDE: - RADEON_STATECHANGE( rmesa, tcl ); - if (ctx->Light.Model.TwoSide) - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_LIGHT_TWOSIDE; - else - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_LIGHT_TWOSIDE; - - check_twoside_fallback( ctx ); - -#if _HAVE_SWTNL - if (rmesa->TclFallback) { - radeonChooseRenderState( ctx ); - radeonChooseVertexState( ctx ); - } -#endif - break; - - case GL_LIGHT_MODEL_COLOR_CONTROL: - radeonUpdateSpecular(ctx); - - RADEON_STATECHANGE( rmesa, tcl ); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= - ~RADEON_DIFFUSE_SPECULAR_COMBINE; - else - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= - RADEON_DIFFUSE_SPECULAR_COMBINE; - break; - - default: - break; - } -} - - -/* ============================================================= - * Fog - */ - - -static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - union { int i; float f; } c, d; - GLchan col[4]; - - c.i = rmesa->hw.fog.cmd[FOG_C]; - d.i = rmesa->hw.fog.cmd[FOG_D]; - - switch (pname) { - case GL_FOG_MODE: - if (!ctx->Fog.Enabled) - return; - RADEON_STATECHANGE(rmesa, tcl); - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_TCL_FOG_MASK; - switch (ctx->Fog.Mode) { - case GL_LINEAR: - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_LINEAR; - if (ctx->Fog.Start == ctx->Fog.End) { - c.f = 1.0F; - d.f = 1.0F; - } - else { - c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start); - d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start); - } - break; - case GL_EXP: - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP; - c.f = 0.0; - d.f = ctx->Fog.Density; - break; - case GL_EXP2: - rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_TCL_FOG_EXP2; - c.f = 0.0; - d.f = -(ctx->Fog.Density * ctx->Fog.Density); - break; - default: - return; - } - break; - case GL_FOG_DENSITY: - switch (ctx->Fog.Mode) { - case GL_EXP: - c.f = 0.0; - d.f = ctx->Fog.Density; - break; - case GL_EXP2: - c.f = 0.0; - d.f = -(ctx->Fog.Density * ctx->Fog.Density); - break; - default: - break; - } - break; - case GL_FOG_START: - case GL_FOG_END: - if (ctx->Fog.Mode == GL_LINEAR) { - if (ctx->Fog.Start == ctx->Fog.End) { - c.f = 1.0F; - d.f = 1.0F; - } else { - c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start); - d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start); - } - } - break; - case GL_FOG_COLOR: - RADEON_STATECHANGE( rmesa, ctx ); - UNCLAMPED_FLOAT_TO_RGB_CHAN( col, ctx->Fog.Color ); - rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = - radeonPackColor( 4, col[0], col[1], col[2], 0 ); - break; - case GL_FOG_COORDINATE_SOURCE_EXT: - /* What to do? - */ - break; - default: - return; - } - - if (c.i != rmesa->hw.fog.cmd[FOG_C] || d.i != rmesa->hw.fog.cmd[FOG_D]) { - RADEON_STATECHANGE( rmesa, fog ); - rmesa->hw.fog.cmd[FOG_C] = c.i; - rmesa->hw.fog.cmd[FOG_D] = d.i; - } -} - -/* Examine lighting and texture state to determine if separate specular - * should be enabled. - */ -void radeonUpdateSpecular( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLuint p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; - - if (NEED_SECONDARY_COLOR(ctx)) { - p |= RADEON_SPECULAR_ENABLE; - } else { - p &= ~RADEON_SPECULAR_ENABLE; - } - - if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) { - RADEON_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p; - } - - /* Bizzare: have to leave lighting enabled to get fog. - */ - RADEON_STATECHANGE( rmesa, tcl ); - if ((ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } - else if (ctx->Fog.Enabled) { - if (ctx->Light.Enabled) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } else { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } - } - else if (ctx->Light.Enabled) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } else if (ctx->Fog.ColorSumEnabled ) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; - } else { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; - } - -#if _HAVE_SWTNL - /* Update vertex/render formats - */ - if (rmesa->TclFallback) { - radeonChooseRenderState( ctx ); - radeonChooseVertexState( ctx ); - } -#endif -} - - - -static void radeonLightingSpaceChange( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLboolean tmp; - RADEON_STATECHANGE( rmesa, tcl ); - - if (RADEON_DEBUG & RADEON_STATE) - fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords); - - if (ctx->_NeedEyeCoords) - tmp = ctx->Transform.RescaleNormals; - else - tmp = !ctx->Transform.RescaleNormals; - - if ( tmp ) { - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_RESCALE_NORMALS; - } else { - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS; - } -} - -void radeonInitLightStateFuncs( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - int i; - - ctx->Driver.LightModelfv = radeonLightModelfv; - ctx->Driver.Lightfv = radeonLightfv; - ctx->Driver.Fogfv = radeonFogfv; - ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange; - - for (i = 0 ; i < 8; i++) { - struct gl_light *l = &ctx->Light.Light[i]; - GLenum p = GL_LIGHT0 + i; - *(float *)&(rmesa->hw.lit[i].cmd[LIT_RANGE_CUTOFF]) = FLT_MAX; - - ctx->Driver.Lightfv( ctx, p, GL_AMBIENT, l->Ambient ); - ctx->Driver.Lightfv( ctx, p, GL_DIFFUSE, l->Diffuse ); - ctx->Driver.Lightfv( ctx, p, GL_SPECULAR, l->Specular ); - ctx->Driver.Lightfv( ctx, p, GL_POSITION, 0 ); - ctx->Driver.Lightfv( ctx, p, GL_SPOT_DIRECTION, 0 ); - ctx->Driver.Lightfv( ctx, p, GL_SPOT_EXPONENT, &l->SpotExponent ); - ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff ); - ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION, - &l->ConstantAttenuation ); - ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION, - &l->LinearAttenuation ); - ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION, - &l->QuadraticAttenuation ); - } - - ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT, - ctx->Light.Model.Ambient ); - - ctx->Driver.Fogfv( ctx, GL_FOG_MODE, 0 ); - ctx->Driver.Fogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density ); - ctx->Driver.Fogfv( ctx, GL_FOG_START, &ctx->Fog.Start ); - ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End ); - ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color ); - ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, 0 ); -} diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 033f26db2a..a1a523931f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -177,6 +177,12 @@ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_ for(face = 0; face < mt->faces; face++) compute_tex_image_offset(rmesa, mt, face, level, &curOffset); + /* r600 cube levels seems to be aligned to 8 faces but + * we have separate register for 1'st level offset so add + * 2 image alignment after 1'st mip level */ + if(rmesa->radeonScreen->chip_family >= CHIP_FAMILY_R600 && + mt->target == GL_TEXTURE_CUBE_MAP && level >= 1) + curOffset += 2 * mt->levels[level].size; } /* Note the required size in memory */ @@ -380,25 +386,6 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t) texImg->Depth, t->tile_bits); } -/* Although we use the image_offset[] array to store relative offsets - * to cube faces, Mesa doesn't know anything about this and expects - * each cube face to be treated as a separate image. - * - * These functions present that view to mesa: - */ -void -radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets) -{ - if (mt->target != GL_TEXTURE_3D || mt->faces == 1) { - offsets[0] = 0; - } else { - int i; - for (i = 0; i < 6; i++) { - offsets[i] = mt->levels[level].faces[i].offset; - } - } -} - GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level) @@ -619,4 +606,4 @@ uint32_t get_base_teximage_offset(radeonTexObj *texObj) } else { return radeon_miptree_image_offset(texObj->mt, 0, texObj->minLod); } -}
\ No newline at end of file +} diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index a10649b5ae..c911688c1a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -88,7 +88,5 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t); GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level); -void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets); - uint32_t get_base_teximage_offset(radeonTexObj *texObj); #endif /* __RADEON_MIPMAP_TREE_H_ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index 98117cdfc1..d0dcf0e431 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -65,7 +65,7 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) } radeon_print(RADEON_STATE, RADEON_TRACE, - "%d start: %lx, end: %lx %ld\n", i, start, end, end - start); + "%d start: %llx, end: %llx %lld\n", i, start, end, end - start); } } else { for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) { diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 14163f13af..882ee5c194 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -434,7 +434,7 @@ radeonNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) -void radeonInitTextureFuncs( struct dd_function_table *functions ) +void radeonInitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions ) { functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa; functions->TexImage1D = radeonTexImage1D; @@ -455,6 +455,11 @@ void radeonInitTextureFuncs( struct dd_function_table *functions ) functions->CompressedTexImage2D = radeonCompressedTexImage2D; functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D; + if (radeon->radeonScreen->kernel_mm) { + functions->CopyTexImage2D = radeonCopyTexImage2D; + functions->CopyTexSubImage2D = radeonCopyTexSubImage2D; + } + functions->GenerateMipmap = radeonGenerateMipmap; functions->NewTextureImage = radeonNewTextureImage; diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.h b/src/mesa/drivers/dri/radeon/radeon_tex.h index a4aaddc74f..0113ffd3da 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.h +++ b/src/mesa/drivers/dri/radeon/radeon_tex.h @@ -52,6 +52,6 @@ extern int radeonUploadTexImages( r100ContextPtr rmesa, radeonTexObjPtr t, extern void radeonDestroyTexObj( r100ContextPtr rmesa, radeonTexObjPtr t ); -extern void radeonInitTextureFuncs( struct dd_function_table *functions ); +extern void radeonInitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions ); #endif /* __RADEON_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index ebc9c05b8a..44e144c80f 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -26,7 +26,7 @@ */ #include "radeon_common.h" -#include "r300_context.h" +#include "radeon_texture.h" #include "main/image.h" #include "main/teximage.h" @@ -34,11 +34,8 @@ #include "drivers/common/meta.h" #include "radeon_mipmap_tree.h" -#include "r300_blit.h" #include <main/debug.h> -// TODO: -// need to pass correct pitch for small dst textures! static GLboolean do_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, @@ -48,13 +45,13 @@ do_copy_texsubimage(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height) { - struct r300_context *r300 = R300_CONTEXT(ctx); + radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_renderbuffer *rrb; if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { - rrb = radeon_get_depthbuffer(&r300->radeon); + rrb = radeon_get_depthbuffer(radeon); } else { - rrb = radeon_get_colorbuffer(&r300->radeon); + rrb = radeon_get_colorbuffer(radeon); } if (!timg->mt) { @@ -69,10 +66,6 @@ do_copy_texsubimage(GLcontext *ctx, intptr_t src_offset = rrb->draw_offset; intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); - if (src_offset % 32 || dst_offset % 32) { - return GL_FALSE; - } - if (0) { fprintf(stderr, "%s: copying to face %d, level %d\n", __FUNCTION__, _mesa_tex_target_to_face(target), level); @@ -84,18 +77,19 @@ do_copy_texsubimage(GLcontext *ctx, } /* blit from src buffer to texture */ - return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp, - rrb->base.Width, rrb->base.Height, x, y, - timg->mt->bo, dst_offset, timg->base.TexFormat, - timg->base.Width, timg->base.Width, timg->base.Height, - dstx, dsty, width, height, 1); + return radeon->vtbl.blit(ctx, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp, + rrb->base.Width, rrb->base.Height, x, y, + timg->mt->bo, dst_offset, timg->base.TexFormat, + timg->mt->levels[level].rowstride / _mesa_get_format_bytes(timg->base.TexFormat), + timg->base.Width, timg->base.Height, + dstx, dsty, width, height, 1); } -static void -r300CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border) +void +radeonCopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) { struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = @@ -139,11 +133,11 @@ fail: width, height, border); } -static void -r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height) +void +radeonCopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) { struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); @@ -159,10 +153,3 @@ r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, xoffset, yoffset, x, y, width, height); } } - - -void r300_init_texcopy_functions(struct dd_function_table *table) -{ - table->CopyTexImage2D = r300CopyTexImage2D; - table->CopyTexSubImage2D = r300CopyTexSubImage2D; -}
\ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 03178116c1..4538e74eea 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -197,21 +197,6 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj) radeon_bo_unmap(t->mt->bo); } -GLuint radeon_face_for_target(GLenum target) -{ - switch (target) { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - return (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; - default: - return 0; - } -} - /** * Wraps Mesa's implementation to ensure that the base level image is mapped. * @@ -248,8 +233,15 @@ static void radeon_generate_mipmap(GLcontext *ctx, GLenum target, void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj) { - GLuint face = radeon_face_for_target(target); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + struct radeon_bo *bo; + GLuint face = _mesa_tex_target_to_face(target); radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]); + bo = !baseimage->mt ? baseimage->bo : baseimage->mt->bo; + + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) { + radeon_firevertices(rmesa); + } radeon_teximage_map(baseimage, GL_FALSE); radeon_generate_mipmap(ctx, target, texObj); @@ -710,7 +702,7 @@ static void radeon_teximage( radeon_texture_image* image = get_radeon_texture_image(texImage); GLint postConvWidth = width; GLint postConvHeight = height; - GLuint face = radeon_face_for_target(target); + GLuint face = _mesa_tex_target_to_face(target); { struct radeon_bo *bo; @@ -863,7 +855,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve if (RADEON_DEBUG & RADEON_TEXTURE) { fprintf(stderr, "radeon_texsubimage%dd: texObj %p, texImage %p, face %d, level %d\n", - dims, texObj, texImage, radeon_face_for_target(target), level); + dims, texObj, texImage, _mesa_tex_target_to_face(target), level); } t->validated = GL_FALSE; diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index 906daf12d0..f09dd65214 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -44,7 +44,6 @@ void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj); void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj); void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj); int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj); -GLuint radeon_face_for_target(GLenum target); gl_format radeonChooseTextureFormat_mesa(GLcontext * ctx, GLint internalFormat, @@ -126,4 +125,14 @@ void radeonGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage); +void radeonCopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border); + +void radeonCopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); + #endif diff --git a/src/mesa/drivers/dri/radeon/server/radeon_egl.c b/src/mesa/drivers/dri/radeon/server/radeon_egl.c deleted file mode 100644 index c16d66e4ec..0000000000 --- a/src/mesa/drivers/dri/radeon/server/radeon_egl.c +++ /dev/null @@ -1,1088 +0,0 @@ -/* - * EGL driver for radeon_dri.so - */ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <dirent.h> -#include <errno.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/mman.h> - -#include "eglconfig.h" -#include "eglcontext.h" -#include "egldisplay.h" -#include "egldriver.h" -#include "eglglobals.h" -#include "egllog.h" -#include "eglmode.h" -#include "eglscreen.h" -#include "eglsurface.h" -#include "egldri.h" - -#include "mtypes.h" -#include "memops.h" -#include "drm.h" -#include "drm_sarea.h" -#include "radeon_drm.h" -#include "radeon_dri.h" -#include "radeon.h" - -static size_t radeon_drm_page_size; - -/** - * radeon driver-specific driver class derived from _EGLDriver - */ -typedef struct radeon_driver -{ - _EGLDriver Base; /* base class/object */ - GLuint radeonStuff; -} radeonDriver; - -static int -RADEONSetParam(driDisplay *disp, int param, int value) -{ - drm_radeon_setparam_t sp; - int ret; - - memset(&sp, 0, sizeof(sp)); - sp.param = param; - sp.value = value; - - if ((ret=drmCommandWrite(disp->drmFD, DRM_RADEON_SETPARAM, &sp, sizeof(sp)))) { - fprintf(stderr,"Set param failed\n", ret); - return -1; - } - - return 0; -} - -static int -RADEONCheckDRMVersion(driDisplay *disp, RADEONInfoPtr info) -{ - drmVersionPtr version; - - version = drmGetVersion(disp->drmFD); - if (version) { - int req_minor, req_patch; - - /* Need 1.21.x for card type detection getparam - */ - req_minor = 21; - req_patch = 0; - - if (version->version_major != 1 || - version->version_minor < req_minor || - (version->version_minor == req_minor && - version->version_patchlevel < req_patch)) { - /* Incompatible drm version */ - fprintf(stderr, - "[dri] RADEONDRIScreenInit failed because of a version " - "mismatch.\n" - "[dri] radeon.o kernel module version is %d.%d.%d " - "but version 1.%d.%d or newer is needed.\n" - "[dri] Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel, - req_minor, - req_patch); - drmFreeVersion(version); - return 0; - } - - info->drmMinor = version->version_minor; - drmFreeVersion(version); - } - - return 1; -} - - -/** - * \brief Compute base 2 logarithm. - * - * \param val value. - * - * \return base 2 logarithm of \p val. - */ -static int RADEONMinBits(int val) -{ - int bits; - - if (!val) return 1; - for (bits = 0; val; val >>= 1, ++bits); - return bits; -} - - -/* Initialize the PCI GART state. Request memory for use in PCI space, - * and initialize the Radeon registers to point to that memory. - */ -static int RADEONDRIPciInit(driDisplay *disp, RADEONInfoPtr info) -{ - int ret; - int flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL; - int s, l; - - ret = drmScatterGatherAlloc(disp->drmFD, info->gartSize*1024*1024, - &info->gartMemHandle); - if (ret < 0) { - fprintf(stderr, "[pci] Out of memory (%d)\n", ret); - return 0; - } - fprintf(stderr, - "[pci] %d kB allocated with handle 0x%04lx\n", - info->gartSize*1024, (long) info->gartMemHandle); - - info->gartOffset = 0; - - /* Initialize the CP ring buffer data */ - info->ringStart = info->gartOffset; - info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = radeon_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - /* Reserve the rest for AGP textures */ - info->gartTexStart = info->bufStart + info->bufMapSize; - s = (info->gartSize*1024*1024 - info->gartTexStart); - l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - info->gartTexMapSize = (s >> l) << l; - info->log2GARTTexGran = l; - - if (drmAddMap(disp->drmFD, info->ringStart, info->ringMapSize, - DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] ring handle = 0x%08lx\n", info->ringHandle); - - if (drmAddMap(disp->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring read ptr mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] ring read ptr handle = 0x%08lx\n", - info->ringReadPtrHandle); - - if (drmAddMap(disp->drmFD, info->bufStart, info->bufMapSize, - DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[pci] Could not add vertex/indirect buffers mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] vertex/indirect buffers handle = 0x%08lx\n", - info->bufHandle); - - if (drmAddMap(disp->drmFD, info->gartTexStart, info->gartTexMapSize, - DRM_SCATTER_GATHER, 0, &info->gartTexHandle) < 0) { - fprintf(stderr, - "[pci] Could not add GART texture map mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] GART texture map handle = 0x%08lx\n", - info->gartTexHandle); - - return 1; -} - - -/** - * \brief Initialize the AGP state - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Acquires and enables the AGP device. Reserves memory in the AGP space for - * the ring buffer, vertex buffers and textures. Initialize the Radeon - * registers to point to that memory and add client mappings. - */ -static int RADEONDRIAgpInit( driDisplay *disp, RADEONInfoPtr info) -{ - int mode, ret; - int s, l; - int agpmode = 1; - - if (drmAgpAcquire(disp->drmFD) < 0) { - fprintf(stderr, "[gart] AGP not available\n"); - return 0; - } - - mode = drmAgpGetMode(disp->drmFD); /* Default mode */ - /* Disable fast write entirely - too many lockups. - */ - mode &= ~RADEON_AGP_MODE_MASK; - switch (agpmode) { - case 4: mode |= RADEON_AGP_4X_MODE; - case 2: mode |= RADEON_AGP_2X_MODE; - case 1: default: mode |= RADEON_AGP_1X_MODE; - } - - if (drmAgpEnable(disp->drmFD, mode) < 0) { - fprintf(stderr, "[gart] AGP not enabled\n"); - drmAgpRelease(disp->drmFD); - return 0; - } - -#if 0 - /* Workaround for some hardware bugs */ - if (info->ChipFamily < CHIP_FAMILY_R200) - OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0000); -#endif - info->gartOffset = 0; - - if ((ret = drmAgpAlloc(disp->drmFD, info->gartSize*1024*1024, 0, NULL, - &info->gartMemHandle)) < 0) { - fprintf(stderr, "[gart] Out of memory (%d)\n", ret); - drmAgpRelease(disp->drmFD); - return 0; - } - fprintf(stderr, - "[gart] %d kB allocated with handle 0x%08x\n", - info->gartSize*1024, (unsigned)info->gartMemHandle); - - if (drmAgpBind(disp->drmFD, - info->gartMemHandle, info->gartOffset) < 0) { - fprintf(stderr, "[gart] Could not bind\n"); - drmAgpFree(disp->drmFD, info->gartMemHandle); - drmAgpRelease(disp->drmFD); - return 0; - } - - /* Initialize the CP ring buffer data */ - info->ringStart = info->gartOffset; - info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = radeon_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - /* Reserve the rest for AGP textures */ - info->gartTexStart = info->bufStart + info->bufMapSize; - s = (info->gartSize*1024*1024 - info->gartTexStart); - l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - info->gartTexMapSize = (s >> l) << l; - info->log2GARTTexGran = l; - - if (drmAddMap(disp->drmFD, info->ringStart, info->ringMapSize, - DRM_AGP, DRM_READ_ONLY, &info->ringHandle) < 0) { - fprintf(stderr, "[gart] Could not add ring mapping\n"); - return 0; - } - fprintf(stderr, "[gart] ring handle = 0x%08lx\n", info->ringHandle); - - - if (drmAddMap(disp->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_AGP, DRM_READ_ONLY, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[gart] Could not add ring read ptr mapping\n"); - return 0; - } - - fprintf(stderr, - "[gart] ring read ptr handle = 0x%08lx\n", - info->ringReadPtrHandle); - - if (drmAddMap(disp->drmFD, info->bufStart, info->bufMapSize, - DRM_AGP, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[gart] Could not add vertex/indirect buffers mapping\n"); - return 0; - } - fprintf(stderr, - "[gart] vertex/indirect buffers handle = 0x%08lx\n", - info->bufHandle); - - if (drmAddMap(disp->drmFD, info->gartTexStart, info->gartTexMapSize, - DRM_AGP, 0, &info->gartTexHandle) < 0) { - fprintf(stderr, - "[gart] Could not add AGP texture map mapping\n"); - return 0; - } - fprintf(stderr, - "[gart] AGP texture map handle = 0x%08lx\n", - info->gartTexHandle); - - return 1; -} - - -/** - * Initialize all the memory-related fields of the RADEONInfo object. - * This includes the various 'offset' and 'size' fields. - */ -static int -RADEONMemoryInit(driDisplay *disp, RADEONInfoPtr info) -{ - int width_bytes = disp->virtualWidth * disp->cpp; - int cpp = disp->cpp; - int bufferSize = ((disp->virtualHeight * width_bytes - + RADEON_BUFFER_ALIGN) - & ~RADEON_BUFFER_ALIGN); - int depthSize = ((((disp->virtualHeight+15) & ~15) * width_bytes - + RADEON_BUFFER_ALIGN) - & ~RADEON_BUFFER_ALIGN); - int l; - int pcie_gart_table_size = 0; - - info->frontOffset = 0; - info->frontPitch = disp->virtualWidth; - - if (disp->card_type==RADEON_CARD_PCIE) - pcie_gart_table_size = RADEON_PCIGART_TABLE_SIZE; - - /* Front, back and depth buffers - everything else texture?? - */ - info->textureSize = disp->fbSize - pcie_gart_table_size - 2 * bufferSize - depthSize; - - if (info->textureSize < 0) - return 0; - - l = RADEONMinBits((info->textureSize-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't - * round down. - */ - info->log2TexGran = l; - info->textureSize = (info->textureSize >> l) << l; - - /* Set a minimum usable local texture heap size. This will fit - * two 256x256x32bpp textures. - */ - if (info->textureSize < 512 * 1024) { - info->textureOffset = 0; - info->textureSize = 0; - } - - /* Reserve space for textures */ - info->textureOffset = ((disp->fbSize - pcie_gart_table_size - info->textureSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - - /* Reserve space for the shared depth - * buffer. - */ - info->depthOffset = ((info->textureOffset - depthSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - info->depthPitch = disp->virtualWidth; - - info->backOffset = ((info->depthOffset - bufferSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - info->backPitch = disp->virtualWidth; - - if (pcie_gart_table_size) - info->pcieGartTableOffset = disp->fbSize - pcie_gart_table_size; - - fprintf(stderr, - "Will use back buffer at offset 0x%x, pitch %d\n", - info->backOffset, info->backPitch); - fprintf(stderr, - "Will use depth buffer at offset 0x%x, pitch %d\n", - info->depthOffset, info->depthPitch); - fprintf(stderr, - "Will use %d kb for textures at offset 0x%x\n", - info->textureSize/1024, info->textureOffset); - if (pcie_gart_table_size) - { - fprintf(stderr, - "Will use %d kb for PCIE GART Table at offset 0x%x\n", - pcie_gart_table_size/1024, info->pcieGartTableOffset); - } - - /* XXX I don't think these are needed. */ -#if 0 - info->frontPitchOffset = (((info->frontPitch * cpp / 64) << 22) | - (info->frontOffset >> 10)); - - info->backPitchOffset = (((info->backPitch * cpp / 64) << 22) | - (info->backOffset >> 10)); - - info->depthPitchOffset = (((info->depthPitch * cpp / 64) << 22) | - (info->depthOffset >> 10)); -#endif - - if (pcie_gart_table_size) - RADEONSetParam(disp, RADEON_SETPARAM_PCIGART_LOCATION, info->pcieGartTableOffset); - - return 1; -} - - -/** - * \brief Initialize the kernel data structures and enable the CP engine. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * This function is a wrapper around the DRM_RADEON_CP_INIT command, passing - * all the parameters in a drm_radeon_init_t structure. - */ -static int RADEONDRIKernelInit( driDisplay *disp, - RADEONInfoPtr info) -{ - int cpp = disp->bpp / 8; - drm_radeon_init_t drmInfo; - int ret; - - memset(&drmInfo, 0, sizeof(drmInfo)); - - if ( (info->ChipFamily >= CHIP_FAMILY_R300) ) - drmInfo.func = RADEON_INIT_R300_CP; - else if ( (info->ChipFamily == CHIP_FAMILY_R200) || - (info->ChipFamily == CHIP_FAMILY_RV250) || - (info->ChipFamily == CHIP_FAMILY_M9) || - (info->ChipFamily == CHIP_FAMILY_RV280) ) - drmInfo.func = RADEON_INIT_R200_CP; - else - drmInfo.func = RADEON_INIT_CP; - - /* This is the struct passed to the kernel module for its initialization */ - /* XXX problem here: - * The front/back/depth_offset/pitch fields may change depending upon - * which drawing surface we're using!!! They can't be set just once - * during initialization. - * Looks like we'll need a new ioctl to update these fields for drawing - * to other surfaces... - */ - drmInfo.sarea_priv_offset = sizeof(drm_sarea_t); - drmInfo.cp_mode = RADEON_DEFAULT_CP_BM_MODE; - drmInfo.gart_size = info->gartSize*1024*1024; - drmInfo.ring_size = info->ringSize*1024*1024; - drmInfo.usec_timeout = 1000; - drmInfo.fb_bpp = disp->bpp; - drmInfo.depth_bpp = disp->bpp; - drmInfo.front_offset = info->frontOffset; - drmInfo.front_pitch = info->frontPitch * cpp; - drmInfo.back_offset = info->backOffset; - drmInfo.back_pitch = info->backPitch * cpp; - drmInfo.depth_offset = info->depthOffset; - drmInfo.depth_pitch = info->depthPitch * cpp; - drmInfo.ring_offset = info->ringHandle; - drmInfo.ring_rptr_offset = info->ringReadPtrHandle; - drmInfo.buffers_offset = info->bufHandle; - drmInfo.gart_textures_offset = info->gartTexHandle; - - ret = drmCommandWrite(disp->drmFD, DRM_RADEON_CP_INIT, &drmInfo, - sizeof(drm_radeon_init_t)); - - return ret >= 0; -} - - -/** - * \brief Add a map for the vertex buffers that will be accessed by any - * DRI-based clients. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Calls drmAddBufs() with the previously allocated vertex buffers. - */ -static int RADEONDRIBufInit( driDisplay *disp, RADEONInfoPtr info ) -{ - /* Initialize vertex buffers */ - info->bufNumBufs = drmAddBufs(disp->drmFD, - info->bufMapSize / RADEON_BUFFER_SIZE, - RADEON_BUFFER_SIZE, - (disp->card_type!=RADEON_CARD_AGP) ? DRM_SG_BUFFER : DRM_AGP_BUFFER, - info->bufStart); - - if (info->bufNumBufs <= 0) { - fprintf(stderr, - "[drm] Could not create vertex/indirect buffers list\n"); - return 0; - } - fprintf(stderr, - "[drm] Added %d %d byte vertex/indirect buffers\n", - info->bufNumBufs, RADEON_BUFFER_SIZE); - - return 1; -} - - -/** - * \brief Install an IRQ handler. - * - * \param disp display handle. - * \param info driver private data. - * - * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to - * IRQ-free operation on failure. - */ -static void RADEONDRIIrqInit(driDisplay *disp, RADEONInfoPtr info) -{ - if ((drmCtlInstHandler(disp->drmFD, 0)) != 0) - fprintf(stderr, "[drm] failure adding irq handler, " - "there is a device already using that irq\n" - "[drm] falling back to irq-free operation\n"); -} - - -/** - * \brief Initialize the AGP heap. - * - * \param disp display handle. - * \param info driver private data. - * - * This function is a wrapper around the DRM_RADEON_INIT_HEAP command, passing - * all the parameters in a drm_radeon_mem_init_heap structure. - */ -static void RADEONDRIAgpHeapInit(driDisplay *disp, - RADEONInfoPtr info) -{ - drm_radeon_mem_init_heap_t drmHeap; - - /* Start up the simple memory manager for gart space */ - drmHeap.region = RADEON_MEM_REGION_GART; - drmHeap.start = 0; - drmHeap.size = info->gartTexMapSize; - - if (drmCommandWrite(disp->drmFD, DRM_RADEON_INIT_HEAP, - &drmHeap, sizeof(drmHeap))) { - fprintf(stderr, - "[drm] Failed to initialized gart heap manager\n"); - } else { - fprintf(stderr, - "[drm] Initialized kernel gart heap manager, %d\n", - info->gartTexMapSize); - } -} - -static int RADEONGetCardType(driDisplay *disp, RADEONInfoPtr info) -{ - drm_radeon_getparam_t gp; - int ret; - - gp.param = RADEON_PARAM_CARD_TYPE; - gp.value = &disp->card_type; - - ret=drmCommandWriteRead(disp->drmFD, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); - if (ret) { - fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_CARD_TYPE) : %d\n", ret); - return -1; - } - - return disp->card_type; -} - -/** - * Called at the start of each server generation. - * - * \param disp display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * Performs static frame buffer allocation. Opens the DRM device and add maps - * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more - * information. Creates a \e server context to grab the lock for the - * initialization ioctls and calls the other initilization functions in this - * file. Starts the CP engine via the DRM_RADEON_CP_START command. - * - * Setups a RADEONDRIRec structure to be passed to radeon_dri.so for its - * initialization. - */ -static int -RADEONScreenInit( driDisplay *disp, RADEONInfoPtr info, - RADEONDRIPtr pRADEONDRI) -{ - int i, err; - - /* XXX this probably isn't needed here */ - { - int width_bytes = (disp->virtualWidth * disp->cpp); - int maxy = disp->fbSize / width_bytes; - - if (maxy <= disp->virtualHeight * 3) { - _eglLog(_EGL_WARNING, - "Static buffer allocation failed -- " - "need at least %d kB video memory (have %d kB)\n", - (disp->virtualWidth * disp->virtualHeight * - disp->cpp * 3 + 1023) / 1024, - disp->fbSize / 1024); - return 0; - } - } - - /* Memory manager setup */ - if (!RADEONMemoryInit(disp, info)) { - return 0; - } - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(disp->drmFD, &disp->serverContext)) != 0) { - _eglLog(_EGL_WARNING, "%s: drmCreateContext failed %d\n", - __FUNCTION__, err); - return 0; - } - - DRM_LOCK(disp->drmFD, disp->pSAREA, disp->serverContext, 0); - - /* Initialize the kernel data structures */ - if (!RADEONDRIKernelInit(disp, info)) { - _eglLog(_EGL_WARNING, "RADEONDRIKernelInit failed\n"); - DRM_UNLOCK(disp->drmFD, disp->pSAREA, disp->serverContext); - return 0; - } - - /* Initialize the vertex buffers list */ - if (!RADEONDRIBufInit(disp, info)) { - fprintf(stderr, "RADEONDRIBufInit failed\n"); - DRM_UNLOCK(disp->drmFD, disp->pSAREA, disp->serverContext); - return 0; - } - - /* Initialize IRQ */ - RADEONDRIIrqInit(disp, info); - - /* Initialize kernel gart memory manager */ - RADEONDRIAgpHeapInit(disp, info); - - /* Initialize the SAREA private data structure */ - { - drm_radeon_sarea_t *pSAREAPriv; - pSAREAPriv = (drm_radeon_sarea_t *)(((char*)disp->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - pSAREAPriv->pfState = info->page_flip_enable; - } - - for ( i = 0;; i++ ) { - drmMapType type; - drmMapFlags flags; - drm_handle_t handle, offset; - drmSize size; - int rc, mtrr; - - if ( ( rc = drmGetMap( disp->drmFD, i, &offset, &size, &type, &flags, &handle, &mtrr ) ) != 0 ) - break; - if ( type == DRM_REGISTERS ) { - pRADEONDRI->registerHandle = offset; - pRADEONDRI->registerSize = size; - break; - } - } - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - drimemsetio((char *)disp->pFB + info->frontOffset, - 0xEE, - info->frontPitch * disp->cpp * disp->virtualHeight ); - - drimemsetio((char *)disp->pFB + info->backOffset, - 0x30, - info->backPitch * disp->cpp * disp->virtualHeight ); - - - /* This is the struct passed to radeon_dri.so for its initialization */ - pRADEONDRI->deviceID = info->Chipset; - pRADEONDRI->width = disp->virtualWidth; - pRADEONDRI->height = disp->virtualHeight; - pRADEONDRI->depth = disp->bpp; /* XXX: depth */ - pRADEONDRI->bpp = disp->bpp; - pRADEONDRI->IsPCI = (disp->card_type != RADEON_CARD_AGP);; - pRADEONDRI->frontOffset = info->frontOffset; - pRADEONDRI->frontPitch = info->frontPitch; - pRADEONDRI->backOffset = info->backOffset; - pRADEONDRI->backPitch = info->backPitch; - pRADEONDRI->depthOffset = info->depthOffset; - pRADEONDRI->depthPitch = info->depthPitch; - pRADEONDRI->textureOffset = info->textureOffset; - pRADEONDRI->textureSize = info->textureSize; - pRADEONDRI->log2TexGran = info->log2TexGran; - pRADEONDRI->statusHandle = info->ringReadPtrHandle; - pRADEONDRI->statusSize = info->ringReadMapSize; - pRADEONDRI->gartTexHandle = info->gartTexHandle; - pRADEONDRI->gartTexMapSize = info->gartTexMapSize; - pRADEONDRI->log2GARTTexGran = info->log2GARTTexGran; - pRADEONDRI->gartTexOffset = info->gartTexStart; - pRADEONDRI->sarea_priv_offset = sizeof(drm_sarea_t); - - /* Don't release the lock now - let the VT switch handler do it. */ - - return 1; -} - - -/** - * \brief Get Radeon chip family from chipset number. - * - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * Called by radeonInitFBDev() to set RADEONInfoRec::ChipFamily - * according to the value of RADEONInfoRec::Chipset. Fails if the - * chipset is unrecognized or not appropriate for this driver (i.e., not - * an r100 style radeon) - */ -static int get_chipfamily_from_chipset( RADEONInfoPtr info ) -{ - switch (info->Chipset) { - case PCI_CHIP_RADEON_LY: - case PCI_CHIP_RADEON_LZ: - info->ChipFamily = CHIP_FAMILY_M6; - break; - - case PCI_CHIP_RADEON_QY: - case PCI_CHIP_RADEON_QZ: - info->ChipFamily = CHIP_FAMILY_VE; - break; - - case PCI_CHIP_R200_QL: - case PCI_CHIP_R200_QN: - case PCI_CHIP_R200_QO: - case PCI_CHIP_R200_Ql: - case PCI_CHIP_R200_BB: - info->ChipFamily = CHIP_FAMILY_R200; - break; - - case PCI_CHIP_RV200_QW: /* RV200 desktop */ - case PCI_CHIP_RV200_QX: - info->ChipFamily = CHIP_FAMILY_RV200; - break; - - case PCI_CHIP_RADEON_LW: - case PCI_CHIP_RADEON_LX: - info->ChipFamily = CHIP_FAMILY_M7; - break; - - case PCI_CHIP_RV250_Id: - case PCI_CHIP_RV250_Ie: - case PCI_CHIP_RV250_If: - case PCI_CHIP_RV250_Ig: - info->ChipFamily = CHIP_FAMILY_RV250; - break; - - case PCI_CHIP_RV250_Ld: - case PCI_CHIP_RV250_Le: - case PCI_CHIP_RV250_Lf: - case PCI_CHIP_RV250_Lg: - info->ChipFamily = CHIP_FAMILY_M9; - break; - - case PCI_CHIP_RV280_Y_: - case PCI_CHIP_RV280_Ya: - case PCI_CHIP_RV280_Yb: - case PCI_CHIP_RV280_Yc: - info->ChipFamily = CHIP_FAMILY_RV280; - break; - - case PCI_CHIP_R300_ND: - case PCI_CHIP_R300_NE: - case PCI_CHIP_R300_NF: - case PCI_CHIP_R300_NG: - info->ChipFamily = CHIP_FAMILY_R300; - break; - - case PCI_CHIP_RV370_5460: - info->ChipFamily = CHIP_FAMILY_RV380; - break; - - default: - /* Original Radeon/7200 */ - info->ChipFamily = CHIP_FAMILY_RADEON; - } - - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param disp display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p disp - * and then calls RADEONScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int radeonInitFBDev( driDisplay *disp, RADEONDRIPtr pRADEONDRI ) -{ - int err; - RADEONInfoPtr info = calloc(1, sizeof(*info)); - - disp->driverPrivate = (void *)info; - - info->gartFastWrite = RADEON_DEFAULT_AGP_FAST_WRITE; - info->gartSize = RADEON_DEFAULT_AGP_SIZE; - info->gartTexSize = RADEON_DEFAULT_AGP_TEX_SIZE; - info->bufSize = RADEON_DEFAULT_BUFFER_SIZE; - info->ringSize = RADEON_DEFAULT_RING_SIZE; - info->page_flip_enable = RADEON_DEFAULT_PAGE_FLIP; - - fprintf(stderr, - "Using %d MB AGP aperture\n", info->gartSize); - fprintf(stderr, - "Using %d MB for the ring buffer\n", info->ringSize); - fprintf(stderr, - "Using %d MB for vertex/indirect buffers\n", info->bufSize); - fprintf(stderr, - "Using %d MB for AGP textures\n", info->gartTexSize); - fprintf(stderr, - "page flipping %sabled\n", info->page_flip_enable?"en":"dis"); - - info->Chipset = disp->chipset; - - if (!get_chipfamily_from_chipset( info )) { - fprintf(stderr, "Unknown or non-radeon chipset -- cannot continue\n"); - fprintf(stderr, "==> Verify PCI BusID is correct in miniglx.conf\n"); - return 0; - } -#if 0 - if (info->ChipFamily >= CHIP_FAMILY_R300) { - fprintf(stderr, - "Direct rendering not yet supported on " - "Radeon 9700 and newer cards\n"); - return 0; - } -#endif - -#if 00 - /* don't seem to need this here */ - info->frontPitch = disp->virtualWidth; -#endif - - /* Check the radeon DRM version */ - if (!RADEONCheckDRMVersion(disp, info)) { - return 0; - } - - if (RADEONGetCardType(disp, info)<0) - return 0; - - if (disp->card_type!=RADEON_CARD_AGP) { - /* Initialize PCI */ - if (!RADEONDRIPciInit(disp, info)) - return 0; - } - else { - /* Initialize AGP */ - if (!RADEONDRIAgpInit(disp, info)) - return 0; - } - - if (!RADEONScreenInit( disp, info, pRADEONDRI)) - return 0; - - /* Initialize and start the CP if required */ - if ((err = drmCommandNone(disp->drmFD, DRM_RADEON_CP_START)) != 0) { - fprintf(stderr, "%s: CP start %d\n", __FUNCTION__, err); - return 0; - } - - return 1; -} - - -/** - * Create list of all supported surface configs, attach list to the display. - */ -static EGLBoolean -radeonFillInConfigs(_EGLDisplay *disp, unsigned pixel_bits, - unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer) -{ - _EGLConfig *configs; - _EGLConfig *c; - unsigned int i, num_configs; - unsigned int depth_buffer_factor; - unsigned int back_buffer_factor; - GLenum fb_format; - GLenum fb_type; - - /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy - * enough to add support. Basically, if a context is created with an - * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping - * will never be used. - */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ - }; - - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; - - depth_bits_array[0] = depth_bits; - depth_bits_array[1] = depth_bits; - - /* Just like with the accumulation buffer, always provide some modes - * with a stencil buffer. It will be a sw fallback, but some apps won't - * care about that. - */ - stencil_bits_array[0] = 0; - stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; - - depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; - back_buffer_factor = (have_back_buffer) ? 2 : 1; - - num_configs = depth_buffer_factor * back_buffer_factor * 2; - - if (pixel_bits == 16) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } else { - fb_format = GL_RGBA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - configs = calloc(sizeof(*configs), num_configs); - c = configs; - if (!_eglFillInConfigs(c, fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_TRUE_COLOR)) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", - __func__, __LINE__); - return EGL_FALSE; - } - - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for (i = 0, c = configs; i < num_configs; i++, c++) { - int stencil = GET_CONFIG_ATTRIB(c, EGL_STENCIL_SIZE); - if ((stencil != 0) && (stencil != stencil_bits)) { - SET_CONFIG_ATTRIB(c, EGL_CONFIG_CAVEAT, EGL_SLOW_CONFIG); - } - } - - for (i = 0, c = configs; i < num_configs; i++, c++) - _eglAddConfig(disp, c); - - free(configs); - - return EGL_TRUE; -} - - -/** - * Show the given surface on the named screen. - * If surface is EGL_NO_SURFACE, disable the screen's output. - */ -static EGLBoolean -radeonShowScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, - EGLSurface surface, EGLModeMESA m) -{ - EGLBoolean b = _eglDRIShowScreenSurfaceMESA(drv, dpy, screen, surface, m); - return b; -} - - -/** - * Called via eglInitialize() by user. - */ -static EGLBoolean -radeonInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor) -{ - __DRIframebuffer framebuffer; - driDisplay *display; - - /* one-time init */ - radeon_drm_page_size = getpagesize(); - - if (!_eglDRIInitialize(drv, dpy, major, minor)) - return EGL_FALSE; - - display = Lookup_driDisplay(dpy); - - framebuffer.dev_priv_size = sizeof(RADEONDRIRec); - framebuffer.dev_priv = malloc(sizeof(RADEONDRIRec)); - - /* XXX we shouldn't hard-code values here! */ - /* we won't know the screen surface size until the user calls - * eglCreateScreenSurfaceMESA(). - */ -#if 0 - display->virtualWidth = 1024; - display->virtualHeight = 768; -#else - display->virtualWidth = 1280; - display->virtualHeight = 1024; -#endif - display->bpp = 32; - display->cpp = 4; - - if (!_eglDRIGetDisplayInfo(display)) - return EGL_FALSE; - - framebuffer.base = display->pFB; - framebuffer.width = display->virtualWidth; - framebuffer.height = display->virtualHeight; - framebuffer.stride = display->virtualWidth; - framebuffer.size = display->fbSize; - radeonInitFBDev( display, framebuffer.dev_priv ); - - if (!_eglDRICreateDisplay(display, &framebuffer)) - return EGL_FALSE; - - if (!_eglDRICreateScreens(display)) - return EGL_FALSE; - - /* create a variety of both 32 and 16-bit configurations */ - radeonFillInConfigs(&display->Base, 32, 24, 8, GL_TRUE); - radeonFillInConfigs(&display->Base, 16, 16, 0, GL_TRUE); - - drv->Initialized = EGL_TRUE; - return EGL_TRUE; -} - - -/** - * The bootstrap function. Return a new radeonDriver object and - * plug in API functions. - */ -_EGLDriver * -_eglMain(_EGLDisplay *dpy) -{ - radeonDriver *radeon; - - radeon = (radeonDriver *) calloc(1, sizeof(*radeon)); - if (!radeon) { - return NULL; - } - - /* First fill in the dispatch table with defaults */ - _eglDRIInitDriverFallbacks(&radeon->Base); - - /* then plug in our radeon-specific functions */ - radeon->Base.API.Initialize = radeonInitialize; - radeon->Base.API.ShowScreenSurfaceMESA = radeonShowScreenSurfaceMESA; - - return &radeon->Base; -} diff --git a/src/mesa/drivers/dri/radeon/server/radeon_reg.h b/src/mesa/drivers/dri/radeon/server/radeon_reg.h index e81d7fdcd0..1b33de1edf 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_reg.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_reg.h @@ -1959,7 +1959,30 @@ #define RADEON_SE_ZBIAS_FACTOR 0x1db0 #define RADEON_SE_ZBIAS_CONSTANT 0x1db4 - +#define RADEON_SE_VTX_FMT 0x2080 +# define RADEON_SE_VTX_FMT_XY 0x00000000 +# define RADEON_SE_VTX_FMT_W0 0x00000001 +# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002 +# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004 +# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008 +# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010 +# define RADEON_SE_VTX_FMT_FPFOG 0x00000020 +# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040 +# define RADEON_SE_VTX_FMT_ST0 0x00000080 +# define RADEON_SE_VTX_FMT_ST1 0x00000100 +# define RADEON_SE_VTX_FMT_Q1 0x00000200 +# define RADEON_SE_VTX_FMT_ST2 0x00000400 +# define RADEON_SE_VTX_FMT_Q2 0x00000800 +# define RADEON_SE_VTX_FMT_ST3 0x00001000 +# define RADEON_SE_VTX_FMT_Q3 0x00002000 +# define RADEON_SE_VTX_FMT_Q0 0x00004000 +# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 +# define RADEON_SE_VTX_FMT_N0 0x00040000 +# define RADEON_SE_VTX_FMT_XY1 0x08000000 +# define RADEON_SE_VTX_FMT_Z1 0x10000000 +# define RADEON_SE_VTX_FMT_W1 0x20000000 +# define RADEON_SE_VTX_FMT_N1 0x40000000 +# define RADEON_SE_VTX_FMT_Z 0x80000000 /* Registers for CP and Microcode Engine */ #define RADEON_CP_ME_RAM_ADDR 0x07d4 diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c index 32ca86de8a..bbf49aec27 100644 --- a/src/mesa/drivers/dri/savage/savagedd.c +++ b/src/mesa/drivers/dri/savage/savagedd.c @@ -29,15 +29,11 @@ #include <stdio.h> #include "main/mm.h" -#include "swrast/swrast.h" #include "savagedd.h" #include "savagestate.h" -#include "savagespan.h" #include "savagetex.h" -#include "savagetris.h" #include "savagecontext.h" -#include "main/extensions.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index d0b64e801a..9e181ce3be 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -37,12 +37,10 @@ #include "savagecontext.h" #include "savageioctl.h" -#include "savage_bci.h" #include "savagestate.h" #include "savagespan.h" #include "drm.h" -#include <sys/ioctl.h> #include <sys/timeb.h> #define DEPTH_SCALE_16 ((1<<16)-1) diff --git a/src/mesa/drivers/dri/savage/savagerender.c b/src/mesa/drivers/dri/savage/savagerender.c index 8221edf387..c369bb124c 100644 --- a/src/mesa/drivers/dri/savage/savagerender.c +++ b/src/mesa/drivers/dri/savage/savagerender.c @@ -36,7 +36,6 @@ #include "tnl/t_context.h" #include "savagecontext.h" -#include "savagetris.h" #include "savagestate.h" #include "savageioctl.h" diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 792e166d9c..0913dd1278 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -26,7 +26,6 @@ #include "savagedd.h" #include "savagespan.h" #include "savageioctl.h" -#include "savage_bci.h" #include "savage_3d_reg.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 97598f599e..394be44eac 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -33,8 +33,6 @@ #include "main/simple_list.h" #include "main/enums.h" -#include "swrast/swrast.h" - #include "savagecontext.h" #include "savagetex.h" #include "savagetris.h" diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index 9a92541ef7..a177a7d2b6 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -52,7 +52,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "savagestate.h" #include "savagetex.h" #include "savageioctl.h" -#include "savage_bci.h" static void savageRasterPrimitive( GLcontext *ctx, GLuint prim ); static void savageRenderPrimitive( GLcontext *ctx, GLenum prim ); diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c index 65d4c06466..52008c7ea3 100644 --- a/src/mesa/drivers/dri/sis/sis6326_state.c +++ b/src/mesa/drivers/dri/sis/sis6326_state.c @@ -34,14 +34,12 @@ #include "sis_reg.h" #include "main/context.h" -#include "main/enums.h" #include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_pipeline.h" /* ============================================================= * Alpha blending diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 0944f4d8b4..400681a04a 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -43,8 +43,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_alloc.h" #include "main/imports.h" -#include "main/matrix.h" -#include "main/extensions.h" #include "utils.h" #include "main/framebuffer.h" @@ -55,7 +53,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbo/vbo.h" #include "tnl/tnl.h" -#include "tnl/t_pipeline.h" #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 217d77557f..fe4ade8592 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -40,9 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_state.h" #include "sis_tris.h" -#include "swrast/swrast.h" #include "main/formats.h" -#include "main/framebuffer.h" #include "main/renderbuffer.h" #include "utils.h" diff --git a/src/mesa/drivers/dri/sis/sis_fog.c b/src/mesa/drivers/dri/sis/sis_fog.c index 517d5722e6..6c774e010e 100644 --- a/src/mesa/drivers/dri/sis/sis_fog.c +++ b/src/mesa/drivers/dri/sis/sis_fog.c @@ -33,7 +33,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_context.h" #include "sis_state.h" -#include "swrast/swrast.h" #include "main/macros.h" diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index d38b93ec9b..cb7ed8a08b 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -39,7 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_context.h" #include "sis_dri.h" #include "sis_lock.h" -#include "sis_span.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index 98e8d02fab..a22195ccce 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -35,17 +35,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_state.h" #include "sis_tris.h" #include "sis_lock.h" -#include "sis_tex.h" #include "main/context.h" -#include "main/enums.h" -#include "main/colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_pipeline.h" /* ============================================================= * Alpha blending diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 951c470dad..31709c3af6 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -31,7 +31,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast/swrast.h" #include "main/imports.h" #include "main/texstore.h" -#include "main/teximage.h" #include "main/texobj.h" #include "sis_context.h" diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 4c22a10cf7..7b0eebd066 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -38,7 +38,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/macros.h" #include "sis_context.h" -#include "sis_state.h" #include "sis_tex.h" #include "sis_tris.h" #include "sis_alloc.h" diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 4690274c3c..4b41d78d82 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -47,7 +47,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_state.h" #include "sis_lock.h" #include "sis_span.h" -#include "sis_alloc.h" #include "sis_tex.h" /* 6326 and 300-series shared */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index ed8a331549..2cbbeb8114 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -35,17 +35,10 @@ #include "tdfx_context.h" #include "tdfx_dd.h" #include "tdfx_lock.h" -#include "tdfx_vb.h" #include "tdfx_pixels.h" #include "utils.h" #include "main/context.h" -#include "main/enums.h" -#include "main/framebuffer.h" -#include "swrast/swrast.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif #define DRIVER_DATE "20061113" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/src/mesa/drivers/dri/tdfx/tdfx_lock.c index 4f84240104..f218e4ee57 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_lock.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.c @@ -38,7 +38,6 @@ #include "tdfx_state.h" #include "tdfx_render.h" #include "tdfx_texman.h" -#include "tdfx_tris.h" #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 65f0464f8a..4449627418 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -38,7 +38,6 @@ #include "tdfx_context.h" #include "tdfx_dd.h" #include "tdfx_lock.h" -#include "tdfx_vb.h" #include "tdfx_pixels.h" #include "tdfx_render.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 4422b5dec4..9f6b35faa2 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -36,9 +36,7 @@ #include "tdfx_dri.h" #include "tdfx_context.h" #include "tdfx_lock.h" -#include "tdfx_vb.h" #include "tdfx_span.h" -#include "tdfx_tris.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index cdb61a0ce0..dcbc7647f2 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -40,8 +40,6 @@ #include "main/mtypes.h" #include "main/colormac.h" -#include "main/texstore.h" -#include "main/teximage.h" #include "swrast/swrast.h" #include "vbo/vbo.h" @@ -51,11 +49,9 @@ #include "tdfx_context.h" #include "tdfx_state.h" -#include "tdfx_vb.h" #include "tdfx_tex.h" #include "tdfx_texman.h" #include "tdfx_texstate.h" -#include "tdfx_tris.h" #include "tdfx_render.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texman.c b/src/mesa/drivers/dri/tdfx/tdfx_texman.c index 35636ee5ef..726cc58a10 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texman.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texman.c @@ -35,7 +35,6 @@ */ #include "tdfx_context.h" -#include "tdfx_tex.h" #include "tdfx_texman.h" #include "main/texobj.h" #include "main/hash.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index 3f737878ed..6658b4d0c3 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -38,7 +38,6 @@ */ #include "tdfx_state.h" -#include "tdfx_tex.h" #include "tdfx_texman.h" #include "tdfx_texstate.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/src/mesa/drivers/dri/tdfx/tdfx_vb.c index c200ba3255..0f3c877a3e 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.c @@ -29,13 +29,8 @@ #include "main/macros.h" #include "main/colormac.h" -#include "math/m_translate.h" -#include "swrast_setup/swrast_setup.h" - #include "tdfx_context.h" #include "tdfx_vb.h" -#include "tdfx_tris.h" -#include "tdfx_state.h" #include "tdfx_render.h" static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index d17a160271..9da96bdd45 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -33,10 +33,7 @@ #include "main/glheader.h" #include "main/context.h" #include "main/formats.h" -#include "main/matrix.h" -#include "main/state.h" #include "main/simple_list.h" -#include "main/extensions.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 8d4edfa305..c9a31f3383 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -34,7 +34,6 @@ #include "via_context.h" #include "via_tris.h" #include "via_ioctl.h" -#include "via_state.h" #include "via_fb.h" #include "via_3d_reg.h" diff --git a/src/mesa/drivers/dri/unichrome/via_render.c b/src/mesa/drivers/dri/unichrome/via_render.c index f676cc13c8..896c43db1b 100644 --- a/src/mesa/drivers/dri/unichrome/via_render.c +++ b/src/mesa/drivers/dri/unichrome/via_render.c @@ -37,7 +37,6 @@ #include "via_context.h" #include "via_tris.h" -#include "via_state.h" #include "via_ioctl.h" /* diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 2cfb98317d..8c91c937c6 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -30,17 +30,13 @@ #include "main/context.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" -#include "main/matrix.h" #include "main/simple_list.h" #include "vblank.h" #include "via_state.h" #include "via_tex.h" #include "via_span.h" -#include "via_tris.h" -#include "via_ioctl.h" #include "via_screen.h" -#include "via_fb.h" #include "via_dri.h" #include "GL/internal/dri_interface.h" diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index e6e5526d34..f7029b9492 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -35,7 +35,6 @@ #include "via_context.h" #include "via_state.h" #include "via_tex.h" -#include "via_tris.h" #include "via_ioctl.h" #include "via_3d_reg.h" @@ -44,8 +43,6 @@ #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/t_pipeline.h" - static GLuint ROP[16] = { HC_HROP_BLACK, /* GL_CLEAR 0 */ diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 24924d2613..917f975466 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -37,14 +37,12 @@ #include "main/mipmap.h" #include "main/mm.h" #include "main/simple_list.h" -#include "main/texcompress.h" #include "main/texobj.h" #include "main/texstore.h" #include "via_context.h" #include "via_fb.h" #include "via_tex.h" -#include "via_state.h" #include "via_ioctl.h" #include "via_3d_reg.h" diff --git a/src/mesa/drivers/dri/unichrome/via_texcombine.c b/src/mesa/drivers/dri/unichrome/via_texcombine.c index b646897848..f87ba071f3 100644 --- a/src/mesa/drivers/dri/unichrome/via_texcombine.c +++ b/src/mesa/drivers/dri/unichrome/via_texcombine.c @@ -38,7 +38,6 @@ #include "main/enums.h" #include "via_context.h" -#include "via_state.h" #include "via_tex.h" #include "via_3d_reg.h" diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index 62f75d9541..700e333429 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -870,7 +870,6 @@ EXPORTS _mesa_bzero _mesa_calloc _mesa_choose_tex_format - _mesa_compressed_texture_size _mesa_create_framebuffer _mesa_create_visual _mesa_delete_array_object @@ -932,6 +931,8 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport + _mesa_meta_init + _mesa_meta_free _mesa_meta_CopyColorSubTable _mesa_meta_CopyColorTable _mesa_meta_CopyConvolutionFilter1D @@ -941,7 +942,6 @@ EXPORTS _mesa_meta_CopyTexSubImage1D _mesa_meta_CopyTexSubImage2D _mesa_meta_CopyTexSubImage3D - _mesa_wait_query _swrast_Accum _swrast_Bitmap _swrast_BlitFramebuffer diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 76c825a090..ceeafd5f90 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1286,9 +1286,6 @@ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, rb->PutMonoValues = write_mono_rgba_pixels_16; rb->GetRow = read_rgba_span_16; rb->GetValues = read_rgba_pixels_16; - rb->RedBits = 5; - rb->GreenBits = 6; - rb->BlueBits = 5; break; case PF_8R8G8B: if (cColorBits == 24) @@ -1300,9 +1297,6 @@ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, rb->PutMonoValues = write_mono_rgba_pixels_24; rb->GetRow = read_rgba_span_24; rb->GetValues = read_rgba_pixels_24; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; } else { @@ -1313,9 +1307,6 @@ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, rb->PutMonoValues = write_mono_rgba_pixels_32; rb->GetRow = read_rgba_span_32; rb->GetValues = read_rgba_pixels_32; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; } break; default: @@ -1331,9 +1322,6 @@ void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, rb->PutMonoValues = write_mono_rgba_pixels_front; rb->GetRow = read_rgba_span_front; rb->GetValues = read_rgba_pixels_front; - rb->RedBits = 8; /* XXX fix these (565?) */ - rb->GreenBits = 8; - rb->BlueBits = 8; } } diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index a17c2c3ffc..e11aff1a84 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -50,6 +50,37 @@ struct display_dispatch { struct display_dispatch *Next; }; + +/** + * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in + * libglapi.a. We need to define them here. + */ +#ifdef GLX_INDIRECT_RENDERING + +#include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" + +#define KEYWORD1 PUBLIC + +#if defined(USE_MGL_NAMESPACE) +#define NAME(func) mgl##func +#else +#define NAME(func) gl##func +#endif + +#define DISPATCH(FUNC, ARGS, MESSAGE) \ + CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ + return CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +/* skip normal ones */ +#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#include "glapi/glapitemp.h" + +#endif /* GLX_INDIRECT_RENDERING */ + + static struct display_dispatch *DispatchList = NULL; diff --git a/src/mesa/es/.gitignore b/src/mesa/es/.gitignore new file mode 100644 index 0000000000..7643e9f0db --- /dev/null +++ b/src/mesa/es/.gitignore @@ -0,0 +1,5 @@ +glapi/glapi-es* +glapi/glapi-stamp +main/get_es*.c +main/api_exec_es*.c +objs-es* diff --git a/src/mesa/es/Makefile b/src/mesa/es/Makefile new file mode 100644 index 0000000000..fbe67445c9 --- /dev/null +++ b/src/mesa/es/Makefile @@ -0,0 +1,141 @@ +# src/mesa/es/Makefile +# +TOP := ../../.. +MESA := .. + +include $(TOP)/configs/current +include sources.mak + +ES1_LIBS := libes1gallium.a libes1api.a +ES2_LIBS := libes2gallium.a libes2api.a + +# Default rule: create ES1 and ES2 libs +.PHONY: default es1 es2 +default: depend es1 es2 + +es1: $(ES1_LIBS) + @rm -f subdirs-stamp-tmp + +es2: $(ES2_LIBS) + @rm -f subdirs-stamp-tmp + +# force the inclusion of es's mfeatures.h +ES1_CPPFLAGS := -include main/mfeatures_es1.h -D__GL_EXPORTS +ES2_CPPFLAGS := -include main/mfeatures_es2.h -D__GL_EXPORTS + +ES1_OBJ_DIR := objs-es1 +ES2_OBJ_DIR := objs-es2 + +# adjust output dirs +ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_OBJECTS)) +ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_GALLIUM_OBJECTS)) +ES1_API_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_API_OBJECTS)) + +ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_OBJECTS)) +ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_GALLIUM_OBJECTS)) +ES2_API_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_API_OBJECTS)) + +# compile either ES1 or ES2 sources +define es-compile + @mkdir -p $(dir $@) + $(CC) -c $(CFLAGS) $(ES$(1)_CPPFLAGS) $(ES$(1)_INCLUDES) -o $@ $< +endef + +$(ES1_OBJ_DIR)/%.o: %.c + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: %.S + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: $(MESA)/%.c + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: $(MESA)/%.S + $(call es-compile,1) + +$(ES2_OBJ_DIR)/%.o: %.c + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: %.S + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: $(MESA)/%.c + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: $(MESA)/%.S + $(call es-compile,2) + +libes1.a: $(ES1_OBJECTS) $(GLSL_LIBS) + @$(MKLIB) -o es1 -static $(ES1_OBJECTS) $(GLSL_LIBS) + +libes2.a: $(ES2_OBJECTS) $(GLSL_LIBS) + @$(MKLIB) -o es2 -static $(ES1_OBJECTS) $(GLSL_LIBS) + +libes1gallium.a: $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS) + @$(MKLIB) -o es1gallium -static $(ES1_GALLIUM_OBJECTS) $(GLSL_LIBS) + +libes2gallium.a: $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS) + @$(MKLIB) -o es2gallium -static $(ES2_GALLIUM_OBJECTS) $(GLSL_LIBS) + +libes1api.a: $(ES1_API_OBJECTS) + @$(MKLIB) -o es1api -static $(ES1_API_OBJECTS) + +libes2api.a: $(ES2_API_OBJECTS) + @$(MKLIB) -o es2api -static $(ES2_API_OBJECTS) + +GENERATED_SOURCES := \ + main/api_exec_es1.c \ + main/api_exec_es2.c \ + main/get_es1.c \ + main/get_es2.c + +main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@ + +main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@ + +main/get_es1.c: main/get_gen.py + $(PYTHON2) $(PYTHON_FLAGS) $< 1 > $@ + +main/get_es2.c: main/get_gen.py + $(PYTHON2) $(PYTHON_FLAGS) $< 2 > $@ + +.PHONY: clean +clean: + -rm -f $(ES1_LIBS) $(ES2_LIBS) + -rm -rf $(ES1_OBJ_DIR) $(ES2_OBJ_DIR) + -rm -f $(GENERATED_SOURCES) + -rm -f depend depend.bak + -rm -f subdirs-stamp-tmp + @$(MAKE) -C glapi clean + +# nothing to install +install: + +subdirs-stamp-tmp: + @$(MAKE) -C $(MESA) asm_subdirs + @$(MAKE) -C $(MESA) glsl_builtin + @$(MAKE) -C glapi + @touch subdirs-stamp-tmp + +# sort to avoid duplicates +ALL_SOURCES := $(sort $(ES1_ALL_SOURCES) $(ES2_ALL_SOURCES)) + +# need to make sure the subdirs are processed first +$(ALL_SOURCES): | subdirs-stamp-tmp + +depend: $(ALL_SOURCES) + @echo "running $(MKDEP)" + @touch depend + @# MESA is "..", but luckily, directories are longer than 2 characters + @$(MKDEP) -f- -p$(ES1_OBJ_DIR)/ $(DEFINES) $(ES1_CFLAGS) \ + $(ES1_INCLUDES) $(ES1_ALL_SOURCES) 2>/dev/null | \ + sed -e 's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend + @$(MKDEP) -f- -p$(ES2_OBJ_DIR)/ $(DEFINES) $(ES2_CFLAGS) \ + $(ES2_INCLUDES) $(ES2_ALL_SOURCES) 2>/dev/null | \ + sed -e 's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend + +ifneq ($(MAKECMDGOALS),clean) +-include depend +endif diff --git a/src/mesa/es/glapi/Makefile b/src/mesa/es/glapi/Makefile new file mode 100644 index 0000000000..1e32af867d --- /dev/null +++ b/src/mesa/es/glapi/Makefile @@ -0,0 +1,90 @@ +TOP = ../../../.. +GLAPI = ../../glapi +include $(TOP)/configs/current + +OUTPUTS := \ + glapi/glapidispatch.h \ + glapi/glapioffsets.h \ + glapi/glapitable.h \ + glapi/glapitemp.h \ + glapi/glprocs.h \ + sparc/glapi_sparc.S \ + x86-64/glapi_x86-64.S \ + x86/glapi_x86.S \ + main/enums.c \ + main/remap_helper.h + +COMMON = gl_XML.py glX_XML.py license.py typeexpr.py +COMMON := $(addprefix $(GLAPI)/, $(COMMON)) + +ES1_APIXML := es1_API.xml +ES2_APIXML := es2_API.xml +ES1_OUTPUT_DIR := glapi-es1 +ES2_OUTPUT_DIR := glapi-es2 + +ES1_DEPS = $(ES1_APIXML) base1_API.xml es1_EXT.xml es_EXT.xml \ + es1_COMPAT.xml es_COMPAT.xml +ES2_DEPS = $(ES2_APIXML) base2_API.xml es2_EXT.xml es_EXT.xml \ + es2_COMPAT.xml es_COMPAT.xml + +ES1_OUTPUTS := $(addprefix $(ES1_OUTPUT_DIR)/, $(OUTPUTS)) +ES2_OUTPUTS := $(addprefix $(ES2_OUTPUT_DIR)/, $(OUTPUTS)) + +all: $(ES1_OUTPUTS) $(ES2_OUTPUTS) + +$(ES1_OUTPUTS): APIXML := $(ES1_APIXML) +$(ES2_OUTPUTS): APIXML := $(ES2_APIXML) +$(ES1_OUTPUTS): $(ES1_DEPS) +$(ES2_OUTPUTS): $(ES2_DEPS) + +define gen-glapi + @mkdir -p $(dir $@) + $(PYTHON2) $(PYTHON_FLAGS) $< -f $(APIXML) $(1) > $@ +endef + +%/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON) + $(call gen-glapi,-c -m remap_table) + +%/glapioffsets.h: $(GLAPI)/gl_offsets.py $(COMMON) + $(call gen-glapi,-c) + +%/glapitable.h: $(GLAPI)/gl_table.py $(COMMON) + $(call gen-glapi,-c) + +%/glapitemp.h: $(GLAPI)/gl_apitemp.py $(COMMON) + $(call gen-glapi,-c) + +%/glprocs.h: $(GLAPI)/gl_procs.py $(COMMON) + $(call gen-glapi,-c) + +%/sparc/glapi_sparc.S: $(GLAPI)/gl_SPARC_asm.py $(COMMON) + $(call gen-glapi) + +%/x86-64/glapi_x86-64.S: $(GLAPI)/gl_x86-64_asm.py $(COMMON) + $(call gen-glapi) + +%/x86/glapi_x86.S: $(GLAPI)/gl_x86_asm.py $(COMMON) + $(call gen-glapi) + +%/main/enums.c: $(GLAPI)/gl_enums.py $(COMMON) + $(call gen-glapi) + +%/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON) + $(call gen-glapi) + +verify_xml: + @if [ ! -f gl.h ]; then \ + echo "Please copy gl.h and gl2.h to this directory"; \ + exit 1; \ + fi + @echo "Verifying that es1_API.xml covers OpenGL ES 1.1..." + @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl.h > tmp.xml + @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es1_API.xml + @echo "Verifying that es2_API.xml covers OpenGL ES 2.0..." + @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl2.h > tmp.xml + @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es2_API.xml + @rm -f tmp.xml + +clean: + -rm -rf $(ES1_OUTPUT_DIR) $(ES2_OUTPUT_DIR) + -rm -f *~ *.pyc *.pyo diff --git a/src/mesa/es/glapi/base1_API.xml b/src/mesa/es/glapi/base1_API.xml new file mode 100644 index 0000000000..f5d136ccef --- /dev/null +++ b/src/mesa/es/glapi/base1_API.xml @@ -0,0 +1,744 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL and OpenGL ES 1.x APIs + This file defines the base categories that can be shared by all APIs. + They are defined in an incremental fashion. +--> + +<OpenGLAPI> + +<!-- base subset of OpenGL 1.0 --> +<category name="base1.0"> + <enum name="FALSE" value="0x0"/> + <enum name="TRUE" value="0x1"/> + <enum name="ZERO" value="0x0"/> + <enum name="ONE" value="0x1"/> + <enum name="NO_ERROR" value="0x0"/> + + <enum name="POINTS" value="0x0000"/> + <enum name="LINES" value="0x0001"/> + <enum name="LINE_LOOP" value="0x0002"/> + <enum name="LINE_STRIP" value="0x0003"/> + <enum name="TRIANGLES" value="0x0004"/> + <enum name="TRIANGLE_STRIP" value="0x0005"/> + <enum name="TRIANGLE_FAN" value="0x0006"/> + <enum name="NEVER" value="0x0200"/> + <enum name="LESS" value="0x0201"/> + <enum name="EQUAL" value="0x0202"/> + <enum name="LEQUAL" value="0x0203"/> + <enum name="GREATER" value="0x0204"/> + <enum name="NOTEQUAL" value="0x0205"/> + <enum name="GEQUAL" value="0x0206"/> + <enum name="ALWAYS" value="0x0207"/> + <enum name="SRC_COLOR" value="0x0300"/> + <enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/> + <enum name="SRC_ALPHA" value="0x0302"/> + <enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/> + <enum name="DST_ALPHA" value="0x0304"/> + <enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/> + <enum name="DST_COLOR" value="0x0306"/> + <enum name="ONE_MINUS_DST_COLOR" value="0x0307"/> + <enum name="SRC_ALPHA_SATURATE" value="0x0308"/> + <enum name="FRONT" value="0x0404"/> + <enum name="BACK" value="0x0405"/> + <enum name="FRONT_AND_BACK" value="0x0408"/> + <enum name="INVALID_ENUM" value="0x0500"/> + <enum name="INVALID_VALUE" value="0x0501"/> + <enum name="INVALID_OPERATION" value="0x0502"/> + <enum name="OUT_OF_MEMORY" value="0x0505"/> + <enum name="CW" value="0x0900"/> + <enum name="CCW" value="0x0901"/> + <enum name="CULL_FACE" count="1" value="0x0B44"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_TEST" count="1" value="0x0B71"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_TEST" count="1" value="0x0B90"> + <size name="Get" mode="get"/> + </enum> + <enum name="DITHER" count="1" value="0x0BD0"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND" count="1" value="0x0BE2"> + <size name="Get" mode="get"/> + </enum> + <enum name="SCISSOR_TEST" count="1" value="0x0C11"> + <size name="Get" mode="get"/> + </enum> + <enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5"> + <size name="Get" mode="get"/> + </enum> + <enum name="PACK_ALIGNMENT" count="1" value="0x0D05"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A"> + <size name="Get" mode="get"/> + </enum> + <enum name="SUBPIXEL_BITS" count="1" value="0x0D50"> + <size name="Get" mode="get"/> + </enum> + <enum name="RED_BITS" count="1" value="0x0D52"> + <size name="Get" mode="get"/> + </enum> + <enum name="GREEN_BITS" count="1" value="0x0D53"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLUE_BITS" count="1" value="0x0D54"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALPHA_BITS" count="1" value="0x0D55"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_BITS" count="1" value="0x0D56"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_BITS" count="1" value="0x0D57"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_2D" count="1" value="0x0DE1"> + <size name="Get" mode="get"/> + </enum> + <enum name="DONT_CARE" value="0x1100"/> + <enum name="FASTEST" value="0x1101"/> + <enum name="NICEST" value="0x1102"/> + <enum name="BYTE" count="1" value="0x1400"> + <size name="CallLists"/> + </enum> + <enum name="UNSIGNED_BYTE" count="1" value="0x1401"> + <size name="CallLists"/> + </enum> + <enum name="SHORT" count="2" value="0x1402"> + <size name="CallLists"/> + </enum> + <enum name="UNSIGNED_SHORT" count="2" value="0x1403"> + <size name="CallLists"/> + </enum> + <enum name="FLOAT" count="4" value="0x1406"> + <size name="CallLists"/> + </enum> + <enum name="INVERT" value="0x150A"/> + <enum name="TEXTURE" value="0x1702"/> + <enum name="ALPHA" value="0x1906"/> + <enum name="RGB" value="0x1907"/> + <enum name="RGBA" value="0x1908"/> + <enum name="LUMINANCE" value="0x1909"/> + <enum name="LUMINANCE_ALPHA" value="0x190A"/> + <enum name="KEEP" value="0x1E00"/> + <enum name="REPLACE" value="0x1E01"/> + <enum name="INCR" value="0x1E02"/> + <enum name="DECR" value="0x1E03"/> + <enum name="VENDOR" value="0x1F00"/> + <enum name="RENDERER" value="0x1F01"/> + <enum name="VERSION" value="0x1F02"/> + <enum name="EXTENSIONS" value="0x1F03"/> + <enum name="NEAREST" value="0x2600"/> + <enum name="LINEAR" value="0x2601"/> + <enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/> + <enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/> + <enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/> + <enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/> + <enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800"> + <size name="TexParameterfv"/> + <size name="TexParameteriv"/> + <size name="GetTexParameterfv" mode="get"/> + <size name="GetTexParameteriv" mode="get"/> + </enum> + <enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801"> + <size name="TexParameterfv"/> + <size name="TexParameteriv"/> + <size name="GetTexParameterfv" mode="get"/> + <size name="GetTexParameteriv" mode="get"/> + </enum> + <enum name="TEXTURE_WRAP_S" count="1" value="0x2802"> + <size name="TexParameterfv"/> + <size name="TexParameteriv"/> + <size name="GetTexParameterfv" mode="get"/> + <size name="GetTexParameteriv" mode="get"/> + </enum> + <enum name="TEXTURE_WRAP_T" count="1" value="0x2803"> + <size name="TexParameterfv"/> + <size name="TexParameteriv"/> + <size name="GetTexParameterfv" mode="get"/> + <size name="GetTexParameteriv" mode="get"/> + </enum> + <enum name="REPEAT" value="0x2901"/> + + <enum name="DEPTH_BUFFER_BIT" value="0x00000100"/> + <enum name="STENCIL_BUFFER_BIT" value="0x00000400"/> + <enum name="COLOR_BUFFER_BIT" value="0x00004000"/> + + <type name="float" size="4" float="true" glx_name="FLOAT32"/> + <type name="clampf" size="4" float="true" glx_name="FLOAT32"/> + + <type name="int" size="4" glx_name="CARD32"/> + <type name="uint" size="4" unsigned="true" glx_name="CARD32"/> + <type name="sizei" size="4" glx_name="CARD32"/> + <type name="enum" size="4" unsigned="true" glx_name="ENUM"/> + <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/> + + <type name="short" size="2" glx_name="CARD16"/> + <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/> + + <type name="byte" size="1" glx_name="CARD8"/> + <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/> + <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/> + + <type name="void" size="1"/> + + <function name="BlendFunc" offset="241"> + <param name="sfactor" type="GLenum"/> + <param name="dfactor" type="GLenum"/> + <glx rop="160"/> + </function> + + <function name="Clear" offset="203"> + <param name="mask" type="GLbitfield"/> + <glx rop="127"/> + </function> + + <function name="ClearColor" offset="206"> + <param name="red" type="GLclampf"/> + <param name="green" type="GLclampf"/> + <param name="blue" type="GLclampf"/> + <param name="alpha" type="GLclampf"/> + <glx rop="130"/> + </function> + + <function name="ClearStencil" offset="207"> + <param name="s" type="GLint"/> + <glx rop="131"/> + </function> + + <function name="ColorMask" offset="210"> + <param name="red" type="GLboolean"/> + <param name="green" type="GLboolean"/> + <param name="blue" type="GLboolean"/> + <param name="alpha" type="GLboolean"/> + <glx rop="134"/> + </function> + + <function name="CullFace" offset="152"> + <param name="mode" type="GLenum"/> + <glx rop="79"/> + </function> + + <function name="DepthFunc" offset="245"> + <param name="func" type="GLenum"/> + <glx rop="164"/> + </function> + + <function name="DepthMask" offset="211"> + <param name="flag" type="GLboolean"/> + <glx rop="135"/> + </function> + + <function name="Disable" offset="214"> + <param name="cap" type="GLenum"/> + <glx rop="138" handcode="client"/> + </function> + + <function name="Enable" offset="215"> + <param name="cap" type="GLenum"/> + <glx rop="139" handcode="client"/> + </function> + + <function name="Finish" offset="216"> + <glx sop="108" handcode="true"/> + </function> + + <function name="Flush" offset="217"> + <glx sop="142" handcode="true"/> + </function> + + <function name="FrontFace" offset="157"> + <param name="mode" type="GLenum"/> + <glx rop="84"/> + </function> + + <function name="GetError" offset="261"> + <return type="GLenum"/> + <glx sop="115" handcode="client"/> + </function> + + <function name="GetIntegerv" offset="263"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="117" handcode="client"/> + </function> + + <function name="GetString" offset="275"> + <param name="name" type="GLenum"/> + <return type="const GLubyte *"/> + <glx sop="129" handcode="true"/> + </function> + + <function name="Hint" offset="158"> + <param name="target" type="GLenum"/> + <param name="mode" type="GLenum"/> + <glx rop="85"/> + </function> + + <function name="LineWidth" offset="168"> + <param name="width" type="GLfloat"/> + <glx rop="95"/> + </function> + + <function name="PixelStorei" offset="250"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx sop="110" handcode="client"/> + </function> + + <function name="ReadPixels" offset="256"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/> + <glx sop="111"/> + </function> + + <function name="Scissor" offset="176"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="103"/> + </function> + + <function name="StencilFunc" offset="243"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLint"/> + <param name="mask" type="GLuint"/> + <glx rop="162"/> + </function> + + <function name="StencilMask" offset="209"> + <param name="mask" type="GLuint"/> + <glx rop="133"/> + </function> + + <function name="StencilOp" offset="244"> + <param name="fail" type="GLenum"/> + <param name="zfail" type="GLenum"/> + <param name="zpass" type="GLenum"/> + <glx rop="163"/> + </function> + + <function name="TexParameterf" offset="178"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="105"/> + </function> + + <function name="Viewport" offset="305"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="191"/> + </function> + + <!-- these are not in OpenGL ES 1.0 --> + <enum name="LINE_WIDTH" count="1" value="0x0B21"> + <size name="Get" mode="get"/> + </enum> + <enum name="CULL_FACE_MODE" count="1" value="0x0B45"> + <size name="Get" mode="get"/> + </enum> + <enum name="FRONT_FACE" count="1" value="0x0B46"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_RANGE" count="2" value="0x0B70"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_WRITEMASK" count="1" value="0x0B72"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_FUNC" count="1" value="0x0B74"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_FUNC" count="1" value="0x0B92"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_FAIL" count="1" value="0x0B94"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_REF" count="1" value="0x0B97"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_WRITEMASK" count="1" value="0x0B98"> + <size name="Get" mode="get"/> + </enum> + <enum name="VIEWPORT" count="4" value="0x0BA2"> + <size name="Get" mode="get"/> + </enum> + <enum name="SCISSOR_BOX" count="4" value="0x0C10"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_WRITEMASK" count="4" value="0x0C23"> + <size name="Get" mode="get"/> + </enum> + + <function name="TexParameterfv" offset="179"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="106"/> + </function> + + <function name="TexParameteri" offset="180"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="107"/> + </function> + + <function name="TexParameteriv" offset="181"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="108"/> + </function> + + <function name="GetBooleanv" offset="258"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLboolean *" output="true" variable_param="pname"/> + <glx sop="112" handcode="client"/> + </function> + + <function name="GetFloatv" offset="262"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="116" handcode="client"/> + </function> + + <function name="GetTexParameterfv" offset="282"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="136"/> + </function> + + <function name="GetTexParameteriv" offset="283"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="137"/> + </function> + + <function name="IsEnabled" offset="286"> + <param name="cap" type="GLenum"/> + <return type="GLboolean"/> + <glx sop="140" handcode="client"/> + </function> +</category> + +<!-- base subset of OpenGL 1.1 --> +<category name="base1.1"> + <enum name="POLYGON_OFFSET_FILL" value="0x8037"/> + + <function name="BindTexture" offset="307"> + <param name="target" type="GLenum"/> + <param name="texture" type="GLuint"/> + <glx rop="4117"/> + </function> + + <function name="CopyTexImage2D" offset="324"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <glx rop="4120"/> + </function> + + <function name="CopyTexSubImage2D" offset="326"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4122"/> + </function> + + <function name="DeleteTextures" offset="327"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="const GLuint *" count="n"/> + <glx sop="144"/> + </function> + + <function name="DrawArrays" offset="310"> + <param name="mode" type="GLenum"/> + <param name="first" type="GLint"/> + <param name="count" type="GLsizei"/> + <glx rop="193" handcode="true"/> + </function> + + <function name="DrawElements" offset="311"> + <param name="mode" type="GLenum"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="GenTextures" offset="328"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="GLuint *" output="true" count="n"/> + <glx sop="145" always_array="true"/> + </function> + + <function name="PolygonOffset" offset="319"> + <param name="factor" type="GLfloat"/> + <param name="units" type="GLfloat"/> + <glx rop="192"/> + </function> + + <function name="TexSubImage2D" offset="333"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4100" large="true"/> + </function> + + <!-- these are not in OpenGL ES 1.0 --> + <enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00"> + <size name="Get" mode="get"/> + </enum> + <enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_BINDING_2D" count="1" value="0x8069"> + <size name="Get" mode="get"/> + </enum> + + <function name="IsTexture" offset="330"> + <param name="texture" type="GLuint"/> + <return type="GLboolean"/> + <glx sop="146"/> + </function> +</category> + +<!-- base subset of OpenGL 1.2 --> +<category name="base1.2"> + <enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/> + <enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/> + <enum name="CLAMP_TO_EDGE" value="0x812F"/> + <enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/> + <enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E"> + <size name="Get" mode="get"/> + </enum> +</category> + +<!-- base subset of OpenGL 1.3 --> +<category name="base1.3"> + <enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E"> + <size name="Get" mode="get"/> + </enum> + <enum name="SAMPLE_COVERAGE" count="1" value="0x80A0"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE0" value="0x84C0"/> + <enum name="TEXTURE1" value="0x84C1"/> + <enum name="TEXTURE2" value="0x84C2"/> + <enum name="TEXTURE3" value="0x84C3"/> + <enum name="TEXTURE4" value="0x84C4"/> + <enum name="TEXTURE5" value="0x84C5"/> + <enum name="TEXTURE6" value="0x84C6"/> + <enum name="TEXTURE7" value="0x84C7"/> + <enum name="TEXTURE8" value="0x84C8"/> + <enum name="TEXTURE9" value="0x84C9"/> + <enum name="TEXTURE10" value="0x84CA"/> + <enum name="TEXTURE11" value="0x84CB"/> + <enum name="TEXTURE12" value="0x84CC"/> + <enum name="TEXTURE13" value="0x84CD"/> + <enum name="TEXTURE14" value="0x84CE"/> + <enum name="TEXTURE15" value="0x84CF"/> + <enum name="TEXTURE16" value="0x84D0"/> + <enum name="TEXTURE17" value="0x84D1"/> + <enum name="TEXTURE18" value="0x84D2"/> + <enum name="TEXTURE19" value="0x84D3"/> + <enum name="TEXTURE20" value="0x84D4"/> + <enum name="TEXTURE21" value="0x84D5"/> + <enum name="TEXTURE22" value="0x84D6"/> + <enum name="TEXTURE23" value="0x84D7"/> + <enum name="TEXTURE24" value="0x84D8"/> + <enum name="TEXTURE25" value="0x84D9"/> + <enum name="TEXTURE26" value="0x84DA"/> + <enum name="TEXTURE27" value="0x84DB"/> + <enum name="TEXTURE28" value="0x84DC"/> + <enum name="TEXTURE29" value="0x84DD"/> + <enum name="TEXTURE30" value="0x84DE"/> + <enum name="TEXTURE31" value="0x84DF"/> + <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2"> + <size name="Get" mode="get"/> + </enum> + <enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3"> + <size name="Get" mode="get"/> + </enum> + + <function name="ActiveTexture" offset="374"> + <param name="texture" type="GLenum"/> + <glx rop="197"/> + </function> + + <function name="CompressedTexImage2D" offset="assign"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="imageSize" type="GLsizei" counter="true"/> + <param name="data" type="const GLvoid *" count="imageSize"/> + <glx rop="215" handcode="client"/> + </function> + + <function name="CompressedTexSubImage2D" offset="assign"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="imageSize" type="GLsizei" counter="true"/> + <param name="data" type="const GLvoid *" count="imageSize"/> + <glx rop="218" handcode="client"/> + </function> + + <function name="SampleCoverage" offset="assign"> + <param name="value" type="GLclampf"/> + <param name="invert" type="GLboolean"/> + <glx rop="229"/> + </function> + + <!-- these are not in OpenGL ES 1.0 --> + <enum name="SAMPLE_BUFFERS" count="1" value="0x80A8"> + <size name="Get" mode="get"/> + </enum> + <enum name="SAMPLES" count="1" value="0x80A9"> + <size name="Get" mode="get"/> + </enum> + <enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA"> + <size name="Get" mode="get"/> + </enum> + <enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB"> + <size name="Get" mode="get"/> + </enum> + <enum name="ACTIVE_TEXTURE" count="1" value="0x84E0"> + <size name="Get" mode="get"/> + </enum> +</category> + +<!-- base subset of OpenGL 1.4 --> +<category name="base1.4"> + <enum name="GENERATE_MIPMAP_HINT" value="0x8192"/> +</category> + +<!-- base subset of OpenGL 1.5 --> +<category name="base1.5"> + <enum name="BUFFER_SIZE" value="0x8764"/> + <enum name="BUFFER_USAGE" value="0x8765"/> + <enum name="ARRAY_BUFFER" value="0x8892"/> + <enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/> + <enum name="ARRAY_BUFFER_BINDING" value="0x8894"/> + <enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/> + <enum name="STATIC_DRAW" value="0x88E4"/> + <enum name="DYNAMIC_DRAW" value="0x88E8"/> + + <type name="intptr" size="4" glx_name="CARD32"/> + <type name="sizeiptr" size="4" glx_name="CARD32"/> + + <function name="BindBuffer" offset="assign"> + <param name="target" type="GLenum"/> + <param name="buffer" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="BufferData" offset="assign"> + <param name="target" type="GLenum"/> + <param name="size" type="GLsizeiptr" counter="true"/> + <param name="data" type="const GLvoid *" count="size" img_null_flag="true"/> + <param name="usage" type="GLenum"/> + <glx ignore="true"/> + </function> + + <function name="BufferSubData" offset="assign"> + <param name="target" type="GLenum"/> + <param name="offset" type="GLintptr"/> + <param name="size" type="GLsizeiptr" counter="true"/> + <param name="data" type="const GLvoid *" count="size"/> + <glx ignore="true"/> + </function> + + <function name="DeleteBuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="buffer" type="const GLuint *" count="n"/> + <glx ignore="true"/> + </function> + + <function name="GenBuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="buffer" type="GLuint *" output="true" count="n"/> + <glx ignore="true"/> + </function> + + <function name="GetBufferParameteriv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx ignore="true"/> + </function> + + <function name="IsBuffer" offset="assign"> + <param name="buffer" type="GLuint"/> + <return type="GLboolean"/> + <glx ignore="true"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/base2_API.xml b/src/mesa/es/glapi/base2_API.xml new file mode 100644 index 0000000000..6aa43b728a --- /dev/null +++ b/src/mesa/es/glapi/base2_API.xml @@ -0,0 +1,533 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL and OpenGL ES 2.x APIs --> + +<OpenGLAPI> + +<xi:include href="base1_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- base subset of OpenGL 2.0 --> +<category name="base2.0"> + <enum name="BLEND_EQUATION_RGB" count="1" value="0x8009"> <!-- same as BLEND_EQUATION --> + <size name="Get" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" count="1" value="0x8622"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_SIZE" count="1" value="0x8623"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" count="1" value="0x8624"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_TYPE" count="1" value="0x8625"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="CURRENT_VERTEX_ATTRIB" count="1" value="0x8626"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/> + <enum name="STENCIL_BACK_FUNC" count="1" value="0x8800"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_BACK_FAIL" count="1" value="0x8801"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" count="1" value="0x8802"> + <size name="Get" mode="get"/> + </enum> + <enum name="STENCIL_BACK_PASS_DEPTH_PASS" count="1" value="0x8803"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_EQUATION_ALPHA" count="1" value="0x883D"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_VERTEX_ATTRIBS" count="1" value="0x8869"> + <size name="Get" mode="get"/> + </enum> + <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/> + <enum name="MAX_TEXTURE_IMAGE_UNITS" count="1" value="0x8872"> + <size name="Get" mode="get"/> + </enum> + <enum name="FRAGMENT_SHADER" value="0x8B30"/> + <enum name="VERTEX_SHADER" value="0x8B31"/> + <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/> + <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/> + <enum name="SHADER_TYPE" value="0x8B4F"/> + <enum name="FLOAT_VEC2" value="0x8B50"/> + <enum name="FLOAT_VEC3" value="0x8B51"/> + <enum name="FLOAT_VEC4" value="0x8B52"/> + <enum name="INT_VEC2" value="0x8B53"/> + <enum name="INT_VEC3" value="0x8B54"/> + <enum name="INT_VEC4" value="0x8B55"/> + <enum name="BOOL" value="0x8B56"/> + <enum name="BOOL_VEC2" value="0x8B57"/> + <enum name="BOOL_VEC3" value="0x8B58"/> + <enum name="BOOL_VEC4" value="0x8B59"/> + <enum name="FLOAT_MAT2" value="0x8B5A"/> + <enum name="FLOAT_MAT3" value="0x8B5B"/> + <enum name="FLOAT_MAT4" value="0x8B5C"/> + <enum name="SAMPLER_2D" value="0x8B5E"/> + <enum name="SAMPLER_CUBE" value="0x8B60"/> + <enum name="DELETE_STATUS" value="0x8B80"/> + <enum name="COMPILE_STATUS" value="0x8B81"/> + <enum name="LINK_STATUS" value="0x8B82"/> + <enum name="VALIDATE_STATUS" value="0x8B83"/> + <enum name="INFO_LOG_LENGTH" value="0x8B84"/> + <enum name="ATTACHED_SHADERS" value="0x8B85"/> + <enum name="ACTIVE_UNIFORMS" value="0x8B86"/> + <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/> + <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/> + <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/> + <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/> + <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/> + <enum name="CURRENT_PROGRAM" value="0x8B8D"/> + <enum name="STENCIL_BACK_REF" value="0x8CA3"/> + <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/> + <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/> + + <type name="char" size="1" glx_name="CARD8"/> + + <function name="AttachShader" offset="assign"> + <param name="program" type="GLuint"/> + <param name="shader" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="BindAttribLocation" offset="assign"> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="name" type="const GLchar *"/> + <glx ignore="true"/> + </function> + + <function name="BlendEquationSeparate" offset="assign"> + <param name="modeRGB" type="GLenum"/> + <param name="modeA" type="GLenum"/> + <glx rop="4228"/> + </function> + + <function name="CompileShader" offset="assign"> + <param name="shader" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="CreateProgram" offset="assign"> + <return type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="CreateShader" offset="assign"> + <param name="type" type="GLenum"/> + <return type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="DeleteProgram" offset="assign"> + <param name="program" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="DeleteShader" offset="assign"> + <param name="program" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="DetachShader" offset="assign"> + <param name="program" type="GLuint"/> + <param name="shader" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="DisableVertexAttribArray" offset="assign"> + <param name="index" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="EnableVertexAttribArray" offset="assign"> + <param name="index" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="GetActiveAttrib" offset="assign"> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="bufSize" type="GLsizei "/> + <param name="length" type="GLsizei *" output="true"/> + <param name="size" type="GLint *" output="true"/> + <param name="type" type="GLenum *" output="true"/> + <param name="name" type="GLchar *" output="true"/> + <glx ignore="true"/> + </function> + + <function name="GetActiveUniform" offset="assign"> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *" output="true"/> + <param name="size" type="GLint *" output="true"/> + <param name="type" type="GLenum *" output="true"/> + <param name="name" type="GLchar *" output="true"/> + <glx ignore="true"/> + </function> + + <function name="GetAttachedShaders" offset="assign"> + <param name="program" type="GLuint"/> + <param name="maxCount" type="GLsizei"/> + <param name="count" type="GLsizei *" output="true"/> + <param name="obj" type="GLuint *" output="true"/> + <glx ignore="true"/> + </function> + + <function name="GetAttribLocation" offset="assign"> + <param name="program" type="GLuint"/> + <param name="name" type="const GLchar *"/> + <return type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="GetProgramiv" offset="assign"> + <param name="program" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *"/> + <glx ignore="true"/> + </function> + + <function name="GetProgramInfoLog" offset="assign"> + <param name="program" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="infoLog" type="GLchar *"/> + <glx ignore="true"/> + </function> + + <function name="GetShaderiv" offset="assign"> + <param name="shader" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *"/> + <glx ignore="true"/> + </function> + + <function name="GetShaderInfoLog" offset="assign"> + <param name="shader" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="infoLog" type="GLchar *"/> + <glx ignore="true"/> + </function> + + <function name="GetShaderSource" offset="assign"> + <param name="shader" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *" output="true"/> + <param name="source" type="GLchar *" output="true"/> + <glx ignore="true"/> + </function> + + <function name="GetUniformfv" offset="assign"> + <param name="program" type="GLuint"/> + <param name="location" type="GLint"/> + <param name="params" type="GLfloat *" output="true"/> + <glx ignore="true"/> + </function> + + <function name="GetUniformiv" offset="assign"> + <param name="program" type="GLuint"/> + <param name="location" type="GLint"/> + <param name="params" type="GLint *"/> + <glx ignore="true"/> + </function> + + <function name="GetUniformLocation" offset="assign"> + <param name="program" type="GLuint"/> + <param name="name" type="const GLchar *"/> + <return type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="GetVertexAttribfv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx ignore="true"/> + </function> + + <function name="GetVertexAttribiv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx ignore="true"/> + </function> + + <function name="GetVertexAttribPointerv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="pointer" type="GLvoid **" output="true"/> + <glx ignore="true"/> + </function> + + <function name="IsProgram" offset="assign"> + <param name="program" type="GLuint"/> + <return type="GLboolean"/> + <glx ignore="true"/> + </function> + + <function name="IsShader" offset="assign"> + <param name="shader" type="GLuint"/> + <return type="GLboolean"/> + <glx ignore="true"/> + </function> + + <function name="LinkProgram" offset="assign"> + <param name="program" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="ShaderSource" offset="assign"> + <param name="shader" type="GLuint"/> + <param name="count" type="GLsizei"/> + <param name="string" type="const GLchar **"/> + <param name="length" type="const GLint *"/> + <glx ignore="true"/> + </function> + + <function name="StencilFuncSeparate" offset="assign"> + <param name="face" type="GLenum"/> + <param name="func" type="GLenum"/> + <param name="ref" type="GLint"/> + <param name="mask" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="StencilOpSeparate" offset="assign"> + <param name="face" type="GLenum"/> + <param name="sfail" type="GLenum"/> + <param name="zfail" type="GLenum"/> + <param name="zpass" type="GLenum"/> + <glx ignore="true"/> + </function> + + <function name="StencilMaskSeparate" offset="assign"> + <param name="face" type="GLenum"/> + <param name="mask" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="Uniform1f" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLfloat"/> + <glx ignore="true"/> + </function> + + <function name="Uniform1fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform1i" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="Uniform1iv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLint *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform2f" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLfloat"/> + <param name="v1" type="GLfloat"/> + <glx ignore="true"/> + </function> + + <function name="Uniform2fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform2i" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLint"/> + <param name="v1" type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="Uniform2iv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLint *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform3f" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLfloat"/> + <param name="v1" type="GLfloat"/> + <param name="v2" type="GLfloat"/> + <glx ignore="true"/> + </function> + + <function name="Uniform3fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform3i" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLint"/> + <param name="v1" type="GLint"/> + <param name="v2" type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="Uniform3iv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLint *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform4f" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLfloat"/> + <param name="v1" type="GLfloat"/> + <param name="v2" type="GLfloat"/> + <param name="v3" type="GLfloat"/> + <glx ignore="true"/> + </function> + + <function name="Uniform4fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="Uniform4i" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLint"/> + <param name="v1" type="GLint"/> + <param name="v2" type="GLint"/> + <param name="v3" type="GLint"/> + <glx ignore="true"/> + </function> + + <function name="Uniform4iv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLint *"/> + <glx ignore="true"/> + </function> + + <function name="UniformMatrix2fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="transpose" type="GLboolean"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="UniformMatrix3fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="transpose" type="GLboolean"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="UniformMatrix4fv" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="transpose" type="GLboolean"/> + <param name="value" type="const GLfloat *"/> + <glx ignore="true"/> + </function> + + <function name="UseProgram" offset="assign"> + <param name="program" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="ValidateProgram" offset="assign"> + <param name="program" type="GLuint"/> + <glx ignore="true"/> + </function> + + <function name="VertexAttrib1f" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLfloat"/> + </function> + + <function name="VertexAttrib1fv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLfloat *"/> + </function> + + <function name="VertexAttrib2f" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + </function> + + <function name="VertexAttrib2fv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLfloat *"/> + </function> + + <function name="VertexAttrib3f" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + </function> + + <function name="VertexAttrib3fv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLfloat *"/> + </function> + + <function name="VertexAttrib4f" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <param name="w" type="GLfloat"/> + </function> + + <function name="VertexAttrib4fv" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLfloat *"/> + </function> + + <function name="VertexAttribPointer" offset="assign"> + <param name="index" type="GLuint"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="normalized" type="GLboolean"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es1_API.xml b/src/mesa/es/glapi/es1_API.xml new file mode 100644 index 0000000000..7ee5515f19 --- /dev/null +++ b/src/mesa/es/glapi/es1_API.xml @@ -0,0 +1,1100 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL ES 1.x API --> + +<OpenGLAPI> + +<xi:include href="base1_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- core subset of OpenGL 1.3 defined in OpenGL ES 1.0 --> +<category name="core1.0"> + <!-- addition to base1.0 --> + <enum name="ADD" value="0x0104"/> + <enum name="STACK_OVERFLOW" value="0x0503"/> + <enum name="STACK_UNDERFLOW" value="0x0504"/> + <enum name="EXP" value="0x0800"/> + <enum name="EXP2" value="0x0801"/> + <enum name="POINT_SMOOTH" count="1" value="0x0B10"> + <size name="Get" mode="get"/> + </enum> + <enum name="LINE_SMOOTH" count="1" value="0x0B20"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHTING" count="1" value="0x0B50"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT_MODEL_TWO_SIDE" count="1" value="0x0B52"> + <size name="LightModelfv"/> + <size name="LightModeliv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT_MODEL_AMBIENT" count="4" value="0x0B53"> + <size name="LightModelfv"/> + <size name="LightModeliv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_MATERIAL" count="1" value="0x0B57"> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG" count="1" value="0x0B60"> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_DENSITY" count="1" value="0x0B62"> + <size name="Fogfv"/> + <size name="Fogiv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_START" count="1" value="0x0B63"> + <size name="Fogfv"/> + <size name="Fogiv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_END" count="1" value="0x0B64"> + <size name="Fogfv"/> + <size name="Fogiv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_MODE" count="1" value="0x0B65"> + <size name="Fogfv"/> + <size name="Fogiv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_COLOR" count="4" value="0x0B66"> + <size name="Fogfv"/> + <size name="Fogiv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="NORMALIZE" count="1" value="0x0BA1"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALPHA_TEST" count="1" value="0x0BC0"> + <size name="Get" mode="get"/> + </enum> + <enum name="PERSPECTIVE_CORRECTION_HINT" count="1" value="0x0C50"> + <size name="Get" mode="get"/> + </enum> + <enum name="POINT_SMOOTH_HINT" count="1" value="0x0C51"> + <size name="Get" mode="get"/> + </enum> + <enum name="LINE_SMOOTH_HINT" count="1" value="0x0C52"> + <size name="Get" mode="get"/> + </enum> + <enum name="POLYGON_SMOOTH_HINT" count="1" value="0x0C53"> + <size name="Get" mode="get"/> + </enum> + <enum name="FOG_HINT" count="1" value="0x0C54"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_LIGHTS" count="1" value="0x0D31"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_MODELVIEW_STACK_DEPTH" count="1" value="0x0D36"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_PROJECTION_STACK_DEPTH" count="1" value="0x0D38"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_TEXTURE_STACK_DEPTH" count="1" value="0x0D39"> + <size name="Get" mode="get"/> + </enum> + <enum name="AMBIENT" count="4" value="0x1200"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="DIFFUSE" count="4" value="0x1201"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="SPECULAR" count="4" value="0x1202"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="POSITION" count="4" value="0x1203"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="SPOT_DIRECTION" count="3" value="0x1204"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="SPOT_EXPONENT" count="1" value="0x1205"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="SPOT_CUTOFF" count="1" value="0x1206"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="CONSTANT_ATTENUATION" count="1" value="0x1207"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="LINEAR_ATTENUATION" count="1" value="0x1208"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="QUADRATIC_ATTENUATION" count="1" value="0x1209"> + <size name="Lightfv"/> + <size name="Lightiv"/> + <size name="GetLightfv" mode="get"/> + <size name="GetLightiv" mode="get"/> + </enum> + <enum name="CLEAR" value="0x1500"/> + <enum name="AND" value="0x1501"/> + <enum name="AND_REVERSE" value="0x1502"/> + <enum name="COPY" value="0x1503"/> + <enum name="AND_INVERTED" value="0x1504"/> + <enum name="NOOP" value="0x1505"/> + <enum name="XOR" value="0x1506"/> + <enum name="OR" value="0x1507"/> + <enum name="NOR" value="0x1508"/> + <enum name="EQUIV" value="0x1509"/> + <enum name="OR_REVERSE" value="0x150B"/> + <enum name="COPY_INVERTED" value="0x150C"/> + <enum name="OR_INVERTED" value="0x150D"/> + <enum name="NAND" value="0x150E"/> + <enum name="SET" value="0x150F"/> + <enum name="EMISSION" count="4" value="0x1600"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + </enum> + <enum name="SHININESS" count="1" value="0x1601"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + </enum> + <enum name="AMBIENT_AND_DIFFUSE" count="4" value="0x1602"> + <size name="Materialfv"/> + <size name="Materialiv"/> + <size name="GetMaterialfv" mode="get"/> + <size name="GetMaterialiv" mode="get"/> + </enum> + <enum name="MODELVIEW" value="0x1700"/> + <enum name="PROJECTION" value="0x1701"/> + <enum name="FLAT" value="0x1D00"/> + <enum name="SMOOTH" value="0x1D01"/> + <enum name="MODULATE" value="0x2100"/> + <enum name="DECAL" value="0x2101"/> + <enum name="TEXTURE_ENV_MODE" count="1" value="0x2200"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="TEXTURE_ENV_COLOR" count="4" value="0x2201"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="TEXTURE_ENV" value="0x2300"/> + <enum name="LIGHT0" count="1" value="0x4000"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT1" count="1" value="0x4001"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT2" count="1" value="0x4002"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT3" count="1" value="0x4003"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT4" count="1" value="0x4004"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT5" count="1" value="0x4005"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT6" count="1" value="0x4006"> + <size name="Get" mode="get"/> + </enum> + <enum name="LIGHT7" count="1" value="0x4007"> + <size name="Get" mode="get"/> + </enum> + + <function name="AlphaFunc" offset="240"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLclampf"/> + <glx rop="159"/> + </function> + + <function name="Color4f" offset="29" vectorequiv="Color4fv"> + <param name="red" type="GLfloat"/> + <param name="green" type="GLfloat"/> + <param name="blue" type="GLfloat"/> + <param name="alpha" type="GLfloat"/> + </function> + + <function name="Fogf" offset="153"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="80"/> + </function> + + <function name="Fogfv" offset="154"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="81"/> + </function> + + <function name="Lightf" offset="159"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="86"/> + </function> + + <function name="Lightfv" offset="160"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="87"/> + </function> + + <function name="LightModelf" offset="163"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="90"/> + </function> + + <function name="LightModelfv" offset="164"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="91"/> + </function> + + <function name="LoadIdentity" offset="290"> + <glx rop="176"/> + </function> + + <function name="LoadMatrixf" offset="291"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="177"/> + </function> + + <function name="LogicOp" offset="242"> + <param name="opcode" type="GLenum"/> + <glx rop="161"/> + </function> + + <function name="Materialf" offset="169"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="96"/> + </function> + + <function name="Materialfv" offset="170"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="97"/> + </function> + + <function name="MatrixMode" offset="293"> + <param name="mode" type="GLenum"/> + <glx rop="179"/> + </function> + + <function name="MultMatrixf" offset="294"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="180"/> + </function> + + <function name="Normal3f" offset="56" vectorequiv="Normal3fv"> + <param name="nx" type="GLfloat"/> + <param name="ny" type="GLfloat"/> + <param name="nz" type="GLfloat"/> + </function> + + <function name="PointSize" offset="173"> + <param name="size" type="GLfloat"/> + <glx rop="100"/> + </function> + + <function name="PopMatrix" offset="297"> + <glx rop="183"/> + </function> + + <function name="PushMatrix" offset="298"> + <glx rop="184"/> + </function> + + <function name="Rotatef" offset="300"> + <param name="angle" type="GLfloat"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="186"/> + </function> + + <function name="Scalef" offset="302"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="188"/> + </function> + + <function name="ShadeModel" offset="177"> + <param name="mode" type="GLenum"/> + <glx rop="104"/> + </function> + + <function name="TexEnvf" offset="184"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="111"/> + </function> + + <function name="TexEnvfv" offset="185"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="112"/> + </function> + + <function name="TexImage2D" offset="183"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/> + <glx rop="110" large="true"/> + </function> + + <function name="Translatef" offset="304"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="190"/> + </function> + + <!-- addition to base1.1 --> + <enum name="COLOR_LOGIC_OP" value="0x0BF2"/> + <enum name="VERTEX_ARRAY" count="1" value="0x8074"> + <size name="Get" mode="get"/> + </enum> + <enum name="NORMAL_ARRAY" count="1" value="0x8075"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_ARRAY" count="1" value="0x8076"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_COORD_ARRAY" count="1" value="0x8078"> + <size name="Get" mode="get"/> + </enum> + + <function name="ColorPointer" offset="308"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="DisableClientState" offset="309"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="EnableClientState" offset="313"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="NormalPointer" offset="318"> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="TexCoordPointer" offset="320"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="VertexPointer" offset="321"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <!-- addition to base1.2 --> + <enum name="SMOOTH_POINT_SIZE_RANGE" count="2" value="0x0B12"> + <size name="Get" mode="get"/> + </enum> + <enum name="SMOOTH_LINE_WIDTH_RANGE" count="2" value="0x0B22"> + <size name="Get" mode="get"/> + </enum> + <enum name="RESCALE_NORMAL" count="1" value="0x803A"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_ELEMENTS_VERTICES" count="1" value="0x80E8"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_ELEMENTS_INDICES" count="1" value="0x80E9"> + <size name="Get" mode="get"/> + </enum> + + <!-- addition to base1.3 --> + <enum name="MULTISAMPLE" count="1" value="0x809D"> + <size name="Get" mode="get"/> + </enum> + <enum name="SAMPLE_ALPHA_TO_ONE" count="1" value="0x809F"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_TEXTURE_UNITS" count="1" value="0x84E2"> + <size name="Get" mode="get"/> + </enum> + + <function name="ClientActiveTexture" offset="375"> + <param name="texture" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="MultiTexCoord4f" offset="402" vectorequiv="MultiTexCoord4fv"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + <param name="q" type="GLfloat"/> + </function> +</category> + +<!-- core subset of OpenGL 1.5 defined in OpenGL ES 1.1 --> +<category name="core1.1"> + <!-- addition to base1.0 --> + <enum name="CURRENT_COLOR" count="4" value="0x0B00"> + <size name="Get" mode="get"/> + </enum> + <enum name="CURRENT_NORMAL" count="3" value="0x0B02"> + <size name="Get" mode="get"/> + </enum> + <enum name="CURRENT_TEXTURE_COORDS" count="4" value="0x0B03"> + <size name="Get" mode="get"/> + </enum> + <enum name="POINT_SIZE" count="1" value="0x0B11"> + <size name="Get" mode="get"/> + </enum> + <enum name="SHADE_MODEL" count="1" value="0x0B54"> + <size name="Get" mode="get"/> + </enum> + <enum name="MATRIX_MODE" count="1" value="0x0BA0"> + <size name="Get" mode="get"/> + </enum> + <enum name="MODELVIEW_STACK_DEPTH" count="1" value="0x0BA3"> + <size name="Get" mode="get"/> + </enum> + <enum name="PROJECTION_STACK_DEPTH" count="1" value="0x0BA4"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_STACK_DEPTH" count="1" value="0x0BA5"> + <size name="Get" mode="get"/> + </enum> + <enum name="MODELVIEW_MATRIX" count="16" value="0x0BA6"> + <size name="Get" mode="get"/> + </enum> + <enum name="PROJECTION_MATRIX" count="16" value="0x0BA7"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_MATRIX" count="16" value="0x0BA8"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALPHA_TEST_FUNC" count="1" value="0x0BC1"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALPHA_TEST_REF" count="1" value="0x0BC2"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_DST" count="1" value="0x0BE0"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_SRC" count="1" value="0x0BE1"> + <size name="Get" mode="get"/> + </enum> + <enum name="LOGIC_OP_MODE" count="1" value="0x0BF0"> + <size name="Get" mode="get"/> + </enum> + <enum name="ALPHA_SCALE" count="1" value="0x0D1C"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_CLIP_PLANES" count="1" value="0x0D32"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE0" count="1" value="0x3000"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE1" count="1" value="0x3001"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE2" count="1" value="0x3002"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE3" count="1" value="0x3003"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE4" count="1" value="0x3004"> + <size name="Get" mode="get"/> + </enum> + <enum name="CLIP_PLANE5" count="1" value="0x3005"> + <size name="Get" mode="get"/> + </enum> + + <function name="Color4ub" offset="35" vectorequiv="Color4ubv"> + <param name="red" type="GLubyte"/> + <param name="green" type="GLubyte"/> + <param name="blue" type="GLubyte"/> + <param name="alpha" type="GLubyte"/> + </function> + + <function name="GetLightfv" offset="264"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="118"/> + </function> + + <function name="GetMaterialfv" offset="269"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="123"/> + </function> + + <function name="GetTexEnvfv" offset="276"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="130"/> + </function> + + <function name="GetTexEnviv" offset="277"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="131"/> + </function> + + <function name="TexEnvi" offset="186"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="113"/> + </function> + + <function name="TexEnviv" offset="187"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="114"/> + </function> + + <!-- addition to base1.1 --> + <enum name="VERTEX_ARRAY_SIZE" count="1" value="0x807A"> + <size name="Get" mode="get"/> + </enum> + <enum name="VERTEX_ARRAY_TYPE" count="1" value="0x807B"> + <size name="Get" mode="get"/> + </enum> + <enum name="VERTEX_ARRAY_STRIDE" count="1" value="0x807C"> + <size name="Get" mode="get"/> + </enum> + <enum name="NORMAL_ARRAY_TYPE" count="1" value="0x807E"> + <size name="Get" mode="get"/> + </enum> + <enum name="NORMAL_ARRAY_STRIDE" count="1" value="0x807F"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_ARRAY_SIZE" count="1" value="0x8081"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_ARRAY_TYPE" count="1" value="0x8082"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_ARRAY_STRIDE" count="1" value="0x8083"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_COORD_ARRAY_SIZE" count="1" value="0x8088"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_COORD_ARRAY_TYPE" count="1" value="0x8089"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_COORD_ARRAY_STRIDE" count="1" value="0x808A"> + <size name="Get" mode="get"/> + </enum> + <enum name="VERTEX_ARRAY_POINTER" value="0x808E"/> + <enum name="NORMAL_ARRAY_POINTER" value="0x808F"/> + <enum name="COLOR_ARRAY_POINTER" value="0x8090"/> + <enum name="TEXTURE_COORD_ARRAY_POINTER" value="0x8092"/> + + <function name="GetPointerv" offset="329"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLvoid **" output="true"/> + <glx handcode="true"/> + </function> + + <!-- addition to base1.2 --> + + <!-- addition to base1.3 --> + <enum name="CLIENT_ACTIVE_TEXTURE" count="1" value="0x84E1"> + <size name="Get" mode="get"/> + </enum> + <enum name="SUBTRACT" value="0x84E7"/> + <enum name="COMBINE" value="0x8570"/> + <enum name="COMBINE_RGB" count="1" value="0x8571"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="COMBINE_ALPHA" count="1" value="0x8572"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="RGB_SCALE" count="1" value="0x8573"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="ADD_SIGNED" value="0x8574"/> + <enum name="INTERPOLATE" value="0x8575"/> + <enum name="CONSTANT" value="0x8576"/> + <enum name="PRIMARY_COLOR" value="0x8577"/> + <enum name="PREVIOUS" value="0x8578"/> + <enum name="OPERAND0_RGB" count="1" value="0x8590"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="OPERAND1_RGB" count="1" value="0x8591"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="OPERAND2_RGB" count="1" value="0x8592"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="OPERAND0_ALPHA" count="1" value="0x8598"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="OPERAND1_ALPHA" count="1" value="0x8599"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="OPERAND2_ALPHA" count="1" value="0x859A"> + <size name="TexEnvfv"/> + <size name="TexEnviv"/> + <size name="GetTexEnvfv" mode="get"/> + <size name="GetTexEnviv" mode="get"/> + </enum> + <enum name="DOT3_RGB" value="0x86AE"/> + <enum name="DOT3_RGBA" value="0x86AF"/> + + <!-- addition to base1.4 --> + <enum name="POINT_SIZE_MIN" count="1" value="0x8126"> + <size name="PointParameterfv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="POINT_SIZE_MAX" count="1" value="0x8127"> + <size name="PointParameterfv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128"> + <size name="PointParameterfv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129"> + <size name="PointParameterfv"/> + <size name="Get" mode="get"/> + </enum> + <enum name="GENERATE_MIPMAP" count="1" value="0x8191"> + <size name="TexParameterfv"/> + <size name="TexParameteriv"/> + <size name="GetTexParameterfv" mode="get"/> + <size name="GetTexParameteriv" mode="get"/> + </enum> + + <function name="PointParameterf" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="2065"/> + </function> + + <function name="PointParameterfv" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="2066"/> + </function> + + <!-- addition to base1.5 --> + <enum name="SRC0_RGB" value="0x8580"/> + <enum name="SRC1_RGB" value="0x8581"/> + <enum name="SRC2_RGB" value="0x8582"/> + <enum name="SRC0_ALPHA" value="0x8588"/> + <enum name="SRC1_ALPHA" value="0x8589"/> + <enum name="SRC2_ALPHA" value="0x858A"/> + <enum name="VERTEX_ARRAY_BUFFER_BINDING" count="1" value="0x8896"> + <size name="Get" mode="get"/> + </enum> + <enum name="NORMAL_ARRAY_BUFFER_BINDING" count="1" value="0x8897"> + <size name="Get" mode="get"/> + </enum> + <enum name="COLOR_ARRAY_BUFFER_BINDING" count="1" value="0x8898"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING" count="1" value="0x889A"> + <size name="Get" mode="get"/> + </enum> +</category> + +<!-- OpenGL ES 1.0 --> +<category name="es1.0"> + <!-- addition to core1.0 --> + + <!-- from GL_OES_fixed_point --> + <enum name="FIXED" value="0x140C"/> + + <type name="fixed" size="4" /> + <type name="clampx" size="4" /> + + <function name="AlphaFuncx" offset="assign"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLclampx"/> + </function> + + <function name="ClearColorx" offset="assign"> + <param name="red" type="GLclampx"/> + <param name="green" type="GLclampx"/> + <param name="blue" type="GLclampx"/> + <param name="alpha" type="GLclampx"/> + </function> + + <function name="ClearDepthx" offset="assign"> + <param name="depth" type="GLclampx"/> + </function> + + <function name="Color4x" offset="assign"> + <param name="red" type="GLfixed"/> + <param name="green" type="GLfixed"/> + <param name="blue" type="GLfixed"/> + <param name="alpha" type="GLfixed"/> + </function> + + <function name="DepthRangex" offset="assign"> + <param name="zNear" type="GLclampx"/> + <param name="zFar" type="GLclampx"/> + </function> + + <function name="Fogx" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="Fogxv" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="Frustumx" offset="assign"> + <param name="left" type="GLfixed"/> + <param name="right" type="GLfixed"/> + <param name="bottom" type="GLfixed"/> + <param name="top" type="GLfixed"/> + <param name="zNear" type="GLfixed"/> + <param name="zFar" type="GLfixed"/> + </function> + + <function name="LightModelx" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="LightModelxv" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="Lightx" offset="assign"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="Lightxv" offset="assign"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="LineWidthx" offset="assign"> + <param name="width" type="GLfixed"/> + </function> + + <function name="LoadMatrixx" offset="assign"> + <param name="m" type="const GLfixed *" count="16"/> + </function> + + <function name="Materialx" offset="assign"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="Materialxv" offset="assign"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="MultMatrixx" offset="assign"> + <param name="m" type="const GLfixed *" count="16"/> + </function> + + <function name="MultiTexCoord4x" offset="assign"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfixed"/> + <param name="t" type="GLfixed"/> + <param name="r" type="GLfixed"/> + <param name="q" type="GLfixed"/> + </function> + + <function name="Normal3x" offset="assign"> + <param name="nx" type="GLfixed"/> + <param name="ny" type="GLfixed"/> + <param name="nz" type="GLfixed"/> + </function> + + <function name="Orthox" offset="assign"> + <param name="left" type="GLfixed"/> + <param name="right" type="GLfixed"/> + <param name="bottom" type="GLfixed"/> + <param name="top" type="GLfixed"/> + <param name="zNear" type="GLfixed"/> + <param name="zFar" type="GLfixed"/> + </function> + + <function name="PointSizex" offset="assign"> + <param name="size" type="GLfixed"/> + </function> + + <function name="PolygonOffsetx" offset="assign"> + <param name="factor" type="GLfixed"/> + <param name="units" type="GLfixed"/> + </function> + + <function name="Rotatex" offset="assign"> + <param name="angle" type="GLfixed"/> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <function name="SampleCoveragex" offset="assign"> + <param name="value" type="GLclampx"/> + <param name="invert" type="GLboolean"/> + </function> + + <function name="Scalex" offset="assign"> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <function name="TexEnvx" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="TexEnvxv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="TexParameterx" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="Translatex" offset="assign"> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <!-- from GL_OES_single_precision --> + <function name="ClearDepthf" offset="assign"> + <param name="depth" type="GLclampf"/> + </function> + + <function name="DepthRangef" offset="assign"> + <param name="zNear" type="GLclampf"/> + <param name="zFar" type="GLclampf"/> + </function> + + <function name="Frustumf" offset="assign"> + <param name="left" type="GLfloat"/> + <param name="right" type="GLfloat"/> + <param name="bottom" type="GLfloat"/> + <param name="top" type="GLfloat"/> + <param name="zNear" type="GLfloat"/> + <param name="zFar" type="GLfloat"/> + </function> + + <function name="Orthof" offset="assign"> + <param name="left" type="GLfloat"/> + <param name="right" type="GLfloat"/> + <param name="bottom" type="GLfloat"/> + <param name="top" type="GLfloat"/> + <param name="zNear" type="GLfloat"/> + <param name="zFar" type="GLfloat"/> + </function> +</category> + +<!-- OpenGL ES 1.1 --> +<category name="es1.1"> + <!-- addition to core1.1 --> + + <!-- from GL_OES_fixed_point --> + <function name="ClipPlanex" offset="assign"> + <param name="plane" type="GLenum"/> + <param name="equation" type="const GLfixed *" count="4"/> + </function> + + <function name="GetClipPlanex" offset="assign"> + <param name="plane" type="GLenum"/> + <param name="equation" type="GLfixed *" output="true" count="4"/> + </function> + + <function name="GetFixedv" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetLightxv" offset="assign"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetMaterialxv" offset="assign"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetTexEnvxv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetTexParameterxv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="PointParameterx" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="PointParameterxv" offset="assign"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *"/> + </function> + + <function name="TexParameterxv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <!-- from GL_OES_matrix_get --> + <enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/> + <enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/> + <enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/> + + <!-- from GL_OES_single_precision --> + <function name="ClipPlanef" offset="assign"> + <param name="plane" type="GLenum"/> + <param name="equation" type="const GLfloat *" count="4"/> + </function> + + <function name="GetClipPlanef" offset="assign"> + <param name="plane" type="GLenum"/> + <param name="equation" type="GLfloat *" output="true" count="4"/> + </function> +</category> + +<xi:include href="es1_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="es1_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es1_COMPAT.xml b/src/mesa/es/glapi/es1_COMPAT.xml new file mode 100644 index 0000000000..4fc9223cc0 --- /dev/null +++ b/src/mesa/es/glapi/es1_COMPAT.xml @@ -0,0 +1,135 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<OpenGLAPI> + +<!-- This file defines the functions that are needed by Mesa. It + makes sure the generated glapi headers are compatible with Mesa. + It mainly consists of missing functions and aliases in OpenGL ES. +--> + +<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- except for those defined by es_COMPAT.xml, these are also needed --> +<category name="compat"> + <!-- OpenGL 1.0 --> + <function name="TexGenf" alias="TexGenfOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="117"/> + </function> + + <function name="TexGenfv" alias="TexGenfvOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="118"/> + </function> + + <function name="TexGeni" alias="TexGeniOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="119"/> + </function> + + <function name="TexGeniv" alias="TexGenivOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="120"/> + </function> + + <function name="GetTexGenfv" alias="GetTexGenfvOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="133"/> + </function> + + <function name="GetTexGeniv" alias="GetTexGenivOES" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="134"/> + </function> + + <!-- OpenGL 1.2 --> + <function name="BlendColor" offset="336" static_dispatch="false"> + <param name="red" type="GLclampf"/> + <param name="green" type="GLclampf"/> + <param name="blue" type="GLclampf"/> + <param name="alpha" type="GLclampf"/> + <glx rop="4096"/> + </function> + + <function name="BlendEquation" alias="BlendEquationOES" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="4097"/> + </function> + + <function name="TexImage3D" offset="371" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/> + <glx rop="4114" large="true"/> + </function> + + <function name="TexSubImage3D" offset="372" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4115" large="true"/> + </function> + + <function name="CopyTexSubImage3D" offset="373" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4123"/> + </function> + + <!-- GL_ARB_multitexture --> + <function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx rop="197"/> + </function> + + <function name="ClientActiveTextureARB" alias="ClientActiveTexture" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="MultiTexCoord4fARB" alias="MultiTexCoord4f" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + <param name="q" type="GLfloat"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es1_EXT.xml b/src/mesa/es/glapi/es1_EXT.xml new file mode 100644 index 0000000000..de4868cfd4 --- /dev/null +++ b/src/mesa/es/glapi/es1_EXT.xml @@ -0,0 +1,699 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL ES 1.x extensions --> + +<OpenGLAPI> + +<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- part of es1.1 extension pack --> +<category name="GL_OES_blend_equation_separate" number="1"> + <enum name="BLEND_EQUATION_RGB_OES" count="1" value="0x8009"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_EQUATION_ALPHA_OES" count="1" value="0x883D"> + <size name="Get" mode="get"/> + </enum> + + <function name="BlendEquationSeparateOES" offset="assign"> + <param name="modeRGB" type="GLenum"/> + <param name="modeA" type="GLenum"/> + <glx rop="4228"/> + </function> +</category> + +<!-- part of es1.1 extension pack --> +<category name="GL_OES_blend_func_separate" number="2"> + <enum name="BLEND_DST_RGB_OES" count="1" value="0x80C8"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_SRC_RGB_OES" count="1" value="0x80C9"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_DST_ALPHA_OES" count="1" value="0x80CA"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_SRC_ALPHA_OES" count="1" value="0x80CB"> + <size name="Get" mode="get"/> + </enum> + + <function name="BlendFuncSeparateOES" offset="assign"> + <param name="sfactorRGB" type="GLenum"/> + <param name="dfactorRGB" type="GLenum"/> + <param name="sfactorAlpha" type="GLenum"/> + <param name="dfactorAlpha" type="GLenum"/> + <glx rop="4134"/> + </function> +</category> + +<!-- part of es1.1 extension pack --> +<category name="GL_OES_blend_subtract" number="3"> + <enum name="FUNC_ADD_OES" value="0x8006"/> + <enum name="BLEND_EQUATION_OES" count="1" value="0x8009"> + <size name="Get" mode="get"/> + </enum> + <enum name="FUNC_SUBTRACT_OES" value="0x800A"/> + <enum name="FUNC_REVERSE_SUBTRACT_OES" value="0x800B"/> + + <function name="BlendEquationOES" offset="337"> + <param name="mode" type="GLenum"/> + <glx rop="4097"/> + </function> +</category> + +<!-- core addition to es1.0 and later --> +<category name="GL_OES_byte_coordinates" number="4"> + <enum name="BYTE" value="0x1400"/> +</category> + +<!-- optional for es1.1 --> +<category name="GL_OES_draw_texture" number="7"> + <enum name="TEXTURE_CROP_RECT_OES" value="0x8B9D"/> + + <function name="DrawTexiOES" offset="assign"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + <param name="width" type="GLint"/> + <param name="height" type="GLint"/> + </function> + + <function name="DrawTexivOES" offset="assign"> + <param name="coords" type="const GLint *" count="5"/> + </function> + + <function name="DrawTexfOES" offset="assign"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <param name="width" type="GLfloat"/> + <param name="height" type="GLfloat"/> + </function> + + <function name="DrawTexfvOES" offset="assign"> + <param name="coords" type="const GLfloat *" count="5"/> + </function> + + <function name="DrawTexsOES" offset="assign"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + <param name="z" type="GLshort"/> + <param name="width" type="GLshort"/> + <param name="height" type="GLshort"/> + </function> + + <function name="DrawTexsvOES" offset="assign"> + <param name="coords" type="const GLshort *" count="5"/> + </function> + + <function name="DrawTexxOES" offset="assign"> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + <param name="width" type="GLfixed"/> + <param name="height" type="GLfixed"/> + </function> + + <function name="DrawTexxvOES" offset="assign"> + <param name="coords" type="const GLfixed *" count="5"/> + </function> + + <!-- TexParameter{ifx}v is skipped here --> +</category> + +<!-- core addition to es1.0 and later --> +<category name="GL_OES_fixed_point" number="9"> + <enum name="FIXED_OES" value="0x140C"/> + + <!-- additon to es1.0 --> + <function name="AlphaFuncxOES" alias="AlphaFuncx"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLclampx"/> + </function> + + <function name="ClearColorxOES" alias="ClearColorx"> + <param name="red" type="GLclampx"/> + <param name="green" type="GLclampx"/> + <param name="blue" type="GLclampx"/> + <param name="alpha" type="GLclampx"/> + </function> + + <function name="ClearDepthxOES" alias="ClearDepthx"> + <param name="depth" type="GLclampx"/> + </function> + + <function name="Color4xOES" alias="Color4x"> + <param name="red" type="GLfixed"/> + <param name="green" type="GLfixed"/> + <param name="blue" type="GLfixed"/> + <param name="alpha" type="GLfixed"/> + </function> + + <function name="DepthRangexOES" alias="DepthRangex"> + <param name="zNear" type="GLclampx"/> + <param name="zFar" type="GLclampx"/> + </function> + + <function name="FogxOES" alias="Fogx"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="FogxvOES" alias="Fogxv"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="FrustumxOES" alias="Frustumx"> + <param name="left" type="GLfixed"/> + <param name="right" type="GLfixed"/> + <param name="bottom" type="GLfixed"/> + <param name="top" type="GLfixed"/> + <param name="zNear" type="GLfixed"/> + <param name="zFar" type="GLfixed"/> + </function> + + <function name="LightModelxOES" alias="LightModelx"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="LightModelxvOES" alias="LightModelxv"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="LightxOES" alias="Lightx"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="LightxvOES" alias="Lightxv"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="LineWidthxOES" alias="LineWidthx"> + <param name="width" type="GLfixed"/> + </function> + + <function name="LoadMatrixxOES" alias="LoadMatrixx"> + <param name="m" type="const GLfixed *" count="16"/> + </function> + + <function name="MaterialxOES" alias="Materialx"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="MaterialxvOES" alias="Materialxv"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="MultiTexCoord4xOES" alias="MultiTexCoord4x"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfixed"/> + <param name="t" type="GLfixed"/> + <param name="r" type="GLfixed"/> + <param name="q" type="GLfixed"/> + </function> + + <function name="MultMatrixxOES" alias="MultMatrixx"> + <param name="m" type="const GLfixed *" count="16"/> + </function> + + <function name="Normal3xOES" alias="Normal3x"> + <param name="nx" type="GLfixed"/> + <param name="ny" type="GLfixed"/> + <param name="nz" type="GLfixed"/> + </function> + + <function name="OrthoxOES" alias="Orthox"> + <param name="left" type="GLfixed"/> + <param name="right" type="GLfixed"/> + <param name="bottom" type="GLfixed"/> + <param name="top" type="GLfixed"/> + <param name="zNear" type="GLfixed"/> + <param name="zFar" type="GLfixed"/> + </function> + + <function name="PointSizexOES" alias="PointSizex"> + <param name="size" type="GLfixed"/> + </function> + + <function name="PolygonOffsetxOES" alias="PolygonOffsetx"> + <param name="factor" type="GLfixed"/> + <param name="units" type="GLfixed"/> + </function> + + <function name="RotatexOES" alias="Rotatex"> + <param name="angle" type="GLfixed"/> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <function name="SampleCoveragexOES" alias="SampleCoveragex"> + <param name="value" type="GLclampx"/> + <param name="invert" type="GLboolean"/> + </function> + + <function name="ScalexOES" alias="Scalex"> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <function name="TexEnvxOES" alias="TexEnvx"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="TexEnvxvOES" alias="TexEnvxv"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> + + <function name="TexParameterxOES" alias="TexParameterx"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="TranslatexOES" alias="Translatex"> + <param name="x" type="GLfixed"/> + <param name="y" type="GLfixed"/> + <param name="z" type="GLfixed"/> + </function> + + <!-- additon to es1.1 --> + <function name="ClipPlanexOES" alias="ClipPlanex"> + <param name="plane" type="GLenum"/> + <param name="equation" type="const GLfixed *" count="4"/> + </function> + + <function name="GetClipPlanexOES" alias="GetClipPlanex"> + <param name="plane" type="GLenum"/> + <param name="equation" type="GLfixed *" output="true" count="4"/> + </function> + + <function name="GetFixedvOES" alias="GetFixedv"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetLightxvOES" alias="GetLightxv"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetMaterialxvOES" alias="GetMaterialxv"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetTexEnvxvOES" alias="GetTexEnvxv"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="GetTexParameterxvOES" alias="GetTexParameterxv"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="PointParameterxOES" alias="PointParameterx"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfixed"/> + </function> + + <function name="PointParameterxvOES" alias="PointParameterxv"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *"/> + </function> + + <function name="TexParameterxvOES" alias="TexParameterxv"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> +</category> + +<!-- part of es1.1 extension pack --> +<category name="GL_OES_framebuffer_object" number="10"> + <enum name="NONE_OES" value="0"/> + <enum name="INVALID_FRAMEBUFFER_OPERATION_OES" value="0x0506"/> + <enum name="RGBA4_OES" value="0x8056"/> + <enum name="RGB5_A1_OES" value="0x8057"/> + <enum name="DEPTH_COMPONENT16_OES" value="0x81A5"/> + + <enum name="MAX_RENDERBUFFER_SIZE_OES" value="0x84E8"/> + <enum name="FRAMEBUFFER_BINDING_OES" value="0x8CA6"/> + <enum name="RENDERBUFFER_BINDING_OES" value="0x8CA7"/> + <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" value="0x8CD0"/> + <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" value="0x8CD1"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" value="0x8CD2"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" value="0x8CD3"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/> + <enum name="FRAMEBUFFER_COMPLETE_OES" value="0x8CD5"/> + <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES" value="0x8CD6"/> + <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES" value="0x8CD7"/> + <enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES" value="0x8CD9"/> + <enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_OES" value="0x8CDA"/> + <enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES" value="0x8CDB"/> + <enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES" value="0x8CDC"/> + <enum name="FRAMEBUFFER_UNSUPPORTED_OES" value="0x8CDD"/> + <enum name="COLOR_ATTACHMENT0_OES" value="0x8CE0"/> + <enum name="DEPTH_ATTACHMENT_OES" value="0x8D00"/> + <enum name="STENCIL_ATTACHMENT_OES" value="0x8D20"/> + <enum name="FRAMEBUFFER_OES" value="0x8D40"/> + <enum name="RENDERBUFFER_OES" value="0x8D41"/> + <enum name="RENDERBUFFER_WIDTH_OES" value="0x8D42"/> + <enum name="RENDERBUFFER_HEIGHT_OES" value="0x8D43"/> + <enum name="RENDERBUFFER_INTERNAL_FORMAT_OES" value="0x8D44"/> + <enum name="STENCIL_INDEX1_OES" value="0x8D46"/> + <enum name="STENCIL_INDEX4_OES" value="0x8D47"/> + <enum name="STENCIL_INDEX8_OES" value="0x8D48"/> + <enum name="RENDERBUFFER_RED_SIZE_OES" value="0x8D50"/> + <enum name="RENDERBUFFER_GREEN_SIZE_OES" value="0x8D51"/> + <enum name="RENDERBUFFER_BLUE_SIZE_OES" value="0x8D52"/> + <enum name="RENDERBUFFER_ALPHA_SIZE_OES" value="0x8D53"/> + <enum name="RENDERBUFFER_DEPTH_SIZE_OES" value="0x8D54"/> + <enum name="RENDERBUFFER_STENCIL_SIZE_OES" value="0x8D55"/> + <enum name="RGB565_OES" value="0x8D62"/> + + <function name="BindFramebufferOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="framebuffer" type="GLuint"/> + </function> + + <function name="BindRenderbufferOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </function> + + <function name="CheckFramebufferStatusOES" offset="assign"> + <param name="target" type="GLenum"/> + <return type="GLenum"/> + </function> + + <function name="DeleteFramebuffersOES" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="framebuffers" type="const GLuint *" count="n"/> + </function> + + <function name="DeleteRenderbuffersOES" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="renderbuffers" type="const GLuint *" count="n"/> + </function> + + <function name="FramebufferRenderbufferOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="renderbuffertarget" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </function> + + <function name="FramebufferTexture2DOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="textarget" type="GLenum"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + </function> + + <function name="GenerateMipmapOES" offset="assign"> + <param name="target" type="GLenum"/> + </function> + + <function name="GenFramebuffersOES" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="framebuffers" type="GLuint *" count="n" output="true"/> + </function> + + <function name="GenRenderbuffersOES" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="renderbuffers" type="GLuint *" count="n" output="true"/> + </function> + + <function name="GetFramebufferAttachmentParameterivOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true"/> + </function> + + <function name="GetRenderbufferParameterivOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true"/> + </function> + + <function name="IsFramebufferOES" offset="assign"> + <param name="framebuffer" type="GLuint"/> + <return type="GLboolean"/> + </function> + + <function name="IsRenderbufferOES" offset="assign"> + <param name="renderbuffer" type="GLuint"/> + <return type="GLboolean"/> + </function> + + <function name="RenderbufferStorageOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </function> +</category> + +<!-- core addition to es1.1 --> +<category name="GL_OES_matrix_get" number="11"> + <enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/> + <enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/> + <enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/> +</category> + +<!-- optional for es1.1 --> +<category name="GL_OES_matrix_palette" number="12"> + <enum name="MAX_VERTEX_UNITS_OES" value="0x86A4"/> + <enum name="WEIGHT_ARRAY_TYPE_OES" value="0x86A9"/> + <enum name="WEIGHT_ARRAY_STRIDE_OES" value="0x86AA"/> + <enum name="WEIGHT_ARRAY_SIZE_OES" value="0x86AB"/> + <enum name="WEIGHT_ARRAY_POINTER_OES" value="0x86AC"/> + <enum name="WEIGHT_ARRAY_OES" value="0x86AD"/> + <enum name="MATRIX_PALETTE_OES" value="0x8840"/> + <enum name="MAX_PALETTE_MATRICES_OES" value="0x8842"/> + <enum name="CURRENT_PALETTE_MATRIX_OES" value="0x8843"/> + <enum name="MATRIX_INDEX_ARRAY_OES" value="0x8844"/> + <enum name="MATRIX_INDEX_ARRAY_SIZE_OES" value="0x8846"/> + <enum name="MATRIX_INDEX_ARRAY_TYPE_OES" value="0x8847"/> + <enum name="MATRIX_INDEX_ARRAY_STRIDE_OES" value="0x8848"/> + <enum name="MATRIX_INDEX_ARRAY_POINTER_OES" value="0x8849"/> + <enum name="WEIGHT_ARRAY_BUFFER_BINDING_OES" value="0x889E"/> + <enum name="MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES" value="0x8B9E"/> + + <function name="CurrentPaletteMatrixOES"> + <param name="matrixpaletteindex" type="GLuint"/> + </function> + + <function name="LoadPaletteFromModelViewMatrixOES"> + </function> + + <function name="MatrixIndexPointerOES"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </function> + + <function name="WeightPointerOES"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </function> +</category> + +<!-- required for es1.1 --> +<category name="GL_OES_point_size_array" number="14"> + <enum name="POINT_SIZE_ARRAY_TYPE_OES" value="0x898A"/> + <enum name="POINT_SIZE_ARRAY_STRIDE_OES" value="0x898B"/> + <enum name="POINT_SIZE_ARRAY_POINTER_OES" value="0x898C"/> + <enum name="POINT_SIZE_ARRAY_OES" value="0x8B9C"/> + <enum name="POINT_SIZE_ARRAY_BUFFER_BINDING_OES" value="0x8B9F"/> + + <function name="PointSizePointerOES" offset="assign"> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </function> +</category> + +<!-- required for es1.1 --> +<category name="GL_OES_point_sprite" number="15"> + <enum name="POINT_SPRITE_OES" value="0x8861"/> + <enum name="COORD_REPLACE_OES" value="0x8862"/> +</category> + +<!-- optional for es1.0 --> +<category name="GL_OES_query_matrix" number="16"> + <function name="QueryMatrixxOES" offset="assign"> + <param name="mantissa" type="GLfixed *" count="16" /> + <param name="exponent" type="GLint *" count="16" /> + <return type="GLbitfield"/> + </function> +</category> + +<!-- required for es1.0 and later --> +<category name="GL_OES_read_format" number="17"> + <enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/> + <enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/> +</category> + +<!-- core addition to es1.0 and later --> +<category name="GL_OES_single_precision" number="18"> + <!-- additon to es1.0 --> + <function name="ClearDepthfOES" alias="ClearDepthf"> + <param name="depth" type="GLclampf"/> + </function> + + <function name="DepthRangefOES" alias="DepthRangef"> + <param name="zNear" type="GLclampf"/> + <param name="zFar" type="GLclampf"/> + </function> + + <function name="FrustumfOES" alias="Frustumf"> + <param name="left" type="GLfloat"/> + <param name="right" type="GLfloat"/> + <param name="bottom" type="GLfloat"/> + <param name="top" type="GLfloat"/> + <param name="zNear" type="GLfloat"/> + <param name="zFar" type="GLfloat"/> + </function> + + <function name="OrthofOES" alias="Orthof"> + <param name="left" type="GLfloat"/> + <param name="right" type="GLfloat"/> + <param name="bottom" type="GLfloat"/> + <param name="top" type="GLfloat"/> + <param name="zNear" type="GLfloat"/> + <param name="zFar" type="GLfloat"/> + </function> + + <!-- additon to es1.1 --> + <function name="ClipPlanefOES" alias="ClipPlanef"> + <param name="plane" type="GLenum"/> + <param name="equation" type="const GLfloat *" count="4"/> + </function> + + <function name="GetClipPlanefOES" alias="GetClipPlanef"> + <param name="plane" type="GLenum"/> + <param name="equation" type="GLfloat *" output="true" count="4"/> + </function> +</category> + +<!-- part of es1.1 extension pack --> +<category name="GL_OES_texture_cube_map" number="20"> + <enum name="TEXTURE_GEN_MODE_OES" value="0x2500"/> + <enum name="NORMAL_MAP_OES" value="0x8511"/> + <enum name="REFLECTION_MAP_OES" value="0x8512"/> + <enum name="TEXTURE_CUBE_MAP_OES" value="0x8513"/> + <enum name="TEXTURE_BINDING_CUBE_MAP_OES" value="0x8514"/> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_X_OES" value="0x8515"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_OES" value="0x8516"/> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_OES" value="0x8517"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" value="0x8518"/> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_OES" value="0x8519"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" value="0x851A"/> + <enum name="MAX_CUBE_MAP_TEXTURE_SIZE_OES" value="0x851C"/> + <enum name="TEXTURE_GEN_STR_OES" value="0x8D60"/> + + <function name="GetTexGenfvOES" offset="279"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="133"/> + </function> + + <function name="GetTexGenivOES" offset="280"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="134"/> + </function> + + <function name="GetTexGenxvOES" offset="assign"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfixed *" output="true" variable_param="pname"/> + </function> + + <function name="TexGenfOES" offset="190"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="117"/> + </function> + + <function name="TexGenfvOES" offset="191"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="118"/> + </function> + + <function name="TexGeniOES" offset="192"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="119"/> + </function> + + <function name="TexGenivOES" offset="193"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="120"/> + </function> + + <function name="TexGenxOES" offset="assign"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + </function> + + <function name="TexGenxvOES" offset="assign"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfixed *" variable_param="pname"/> + </function> +</category> + +<category name="GL_OES_texture_env_crossbar" number="21"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_OES_texture_mirrored_repeat" number="22"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_EXT_texture_lod_bias" number="60"> + <enum name="TEXTURE_FILTER_CONTROL_EXT" value="0x8500"/> + <enum name="TEXTURE_LOD_BIAS_EXT" value="0x8501"/> + <enum name="MAX_TEXTURE_LOD_BIAS_EXT" value="0x84FD"/> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es2_API.xml b/src/mesa/es/glapi/es2_API.xml new file mode 100644 index 0000000000..266c07613c --- /dev/null +++ b/src/mesa/es/glapi/es2_API.xml @@ -0,0 +1,294 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL ES 2.x API --> + +<OpenGLAPI> + +<xi:include href="base2_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- core subset of OpenGL 2.0 defined in OpenGL ES 2.0 --> +<category name="core2.0"> + <!-- addition to base1.0 --> + <enum name="NONE" value="0x0"/> + <enum name="INT" count="4" value="0x1404"> + <size name="CallLists"/> + </enum> + <enum name="UNSIGNED_INT" count="4" value="0x1405"> + <size name="CallLists"/> + </enum> + <enum name="STENCIL_INDEX" value="0x1901"/> + <enum name="DEPTH_COMPONENT" value="0x1902"/> + + <function name="TexImage2D" offset="183"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> <!-- XXX the actual type is GLenum... --> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/> + <glx rop="110" large="true"/> + </function> + + <!-- addition to base1.1 --> + <enum name="RGBA4" value="0x8056"/> + <enum name="RGB5_A1" value="0x8057"/> + + <!-- addition to base1.2 --> + <enum name="CONSTANT_COLOR" value="0x8001"/> + <enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/> + <enum name="CONSTANT_ALPHA" value="0x8003"/> + <enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/> + <enum name="BLEND_COLOR" count="4" value="0x8005"> + <size name="Get" mode="get"/> + </enum> + <enum name="FUNC_ADD" value="0x8006"/> + <enum name="BLEND_EQUATION" count="1" value="0x8009"> + <size name="Get" mode="get"/> + </enum> + <enum name="FUNC_SUBTRACT" value="0x800A"/> + <enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/> + + <function name="BlendColor" offset="336"> + <param name="red" type="GLclampf"/> + <param name="green" type="GLclampf"/> + <param name="blue" type="GLclampf"/> + <param name="alpha" type="GLclampf"/> + <glx rop="4096"/> + </function> + + <function name="BlendEquation" offset="337"> + <param name="mode" type="GLenum"/> + <glx rop="4097"/> + </function> + + <!-- addition to base1.3 --> + <enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514"> + <size name="Get" mode="get"/> + </enum> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/> + <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/> + <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/> + <enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C"> + <size name="Get" mode="get"/> + </enum> + + <!-- addition to base1.4 --> + <enum name="BLEND_DST_RGB" count="1" value="0x80C8"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_SRC_RGB" count="1" value="0x80C9"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_DST_ALPHA" count="1" value="0x80CA"> + <size name="Get" mode="get"/> + </enum> + <enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB"> + <size name="Get" mode="get"/> + </enum> + <enum name="DEPTH_COMPONENT16" value="0x81A5"/> + <enum name="MIRRORED_REPEAT" value="0x8370"/> + <enum name="INCR_WRAP" value="0x8507"/> + <enum name="DECR_WRAP" value="0x8508"/> + + <function name="BlendFuncSeparate" offset="assign"> + <param name="sfactorRGB" type="GLenum"/> + <param name="dfactorRGB" type="GLenum"/> + <param name="sfactorAlpha" type="GLenum"/> + <param name="dfactorAlpha" type="GLenum"/> + <glx rop="4134"/> + </function> + + <!-- addition to base1.5 --> + <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" count="1" value="0x889F"> + <size name="GetVertexAttribdv" mode="get"/> + <size name="GetVertexAttribfv" mode="get"/> + <size name="GetVertexAttribiv" mode="get"/> + </enum> + <enum name="STREAM_DRAW" value="0x88E0"/> + + <!-- addition to base2.0 --> + <!-- base2.0 should have everything defined --> +</category> + +<!-- OpenGL ES 2.0 --> +<category name="es2.0"> + <!-- addition to core2.0 --> + <enum name="LOW_FLOAT" value="0x8DF0"/> + <enum name="MEDIUM_FLOAT" value="0x8DF1"/> + <enum name="HIGH_FLOAT" value="0x8DF2"/> + <enum name="LOW_INT" value="0x8DF3"/> + <enum name="MEDIUM_INT" value="0x8DF4"/> + <enum name="HIGH_INT" value="0x8DF5"/> + <enum name="SHADER_BINARY_FORMATS" value="0x8DF8"/> + <enum name="NUM_SHADER_BINARY_FORMATS" value="0x8DF9"/> + <enum name="SHADER_COMPILER" value="0x8DFA"/> + <enum name="MAX_VERTEX_UNIFORM_VECTORS" value="0x8DFB"/> + <enum name="MAX_VARYING_VECTORS" value="0x8DFC"/> + <enum name="MAX_FRAGMENT_UNIFORM_VECTORS" value="0x8DFD"/> + + <function name="GetShaderPrecisionFormat" offset="assign"> + <param name="shadertype" type="GLenum"/> + <param name="precisiontype" type="GLenum"/> + <param name="range" type="GLint *"/> + <param name="precision" type="GLint *"/> + </function> + + <function name="ReleaseShaderCompiler" offset="assign"> + </function> + + <function name="ShaderBinary" offset="assign"> + <param name="n" type="GLsizei"/> + <param name="shaders" type="const GLuint *"/> + <param name="binaryformat" type="GLenum"/> + <param name="binary" type="const GLvoid *"/> + <param name="length" type="GLsizei"/> + </function> + + <!-- from GL_OES_fixed_point --> + <enum name="FIXED" value="0x140C"/> + <type name="fixed" size="4" /> + + <!-- from GL_OES_framebuffer_object --> + <enum name="INVALID_FRAMEBUFFER_OPERATION" value="0x0506"/> + <enum name="MAX_RENDERBUFFER_SIZE" value="0x84E8"/> + <enum name="FRAMEBUFFER_BINDING" value="0x8CA6"/> + <enum name="RENDERBUFFER_BINDING" value="0x8CA7"/> + <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" value="0x8CD0"/> + <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" value="0x8CD1"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" value="0x8CD2"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" value="0x8CD3"/> + <enum name="FRAMEBUFFER_COMPLETE" value="0x8CD5"/> + <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT" value="0x8CD6"/> + <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" value="0x8CD7"/> + <enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS" value="0x8CD9"/> + <enum name="FRAMEBUFFER_UNSUPPORTED" value="0x8CDD"/> + <enum name="COLOR_ATTACHMENT0" value="0x8CE0"/> + <enum name="DEPTH_ATTACHMENT" value="0x8D00"/> + <enum name="STENCIL_ATTACHMENT" value="0x8D20"/> + <enum name="FRAMEBUFFER" value="0x8D40"/> + <enum name="RENDERBUFFER" value="0x8D41"/> + <enum name="RENDERBUFFER_WIDTH" value="0x8D42"/> + <enum name="RENDERBUFFER_HEIGHT" value="0x8D43"/> + <enum name="RENDERBUFFER_INTERNAL_FORMAT" value="0x8D44"/> + <enum name="STENCIL_INDEX8" value="0x8D48"/> + <enum name="RENDERBUFFER_RED_SIZE" value="0x8D50"/> + <enum name="RENDERBUFFER_GREEN_SIZE" value="0x8D51"/> + <enum name="RENDERBUFFER_BLUE_SIZE" value="0x8D52"/> + <enum name="RENDERBUFFER_ALPHA_SIZE" value="0x8D53"/> + <enum name="RENDERBUFFER_DEPTH_SIZE" value="0x8D54"/> + <enum name="RENDERBUFFER_STENCIL_SIZE" value="0x8D55"/> + <enum name="RGB565" value="0x8D62"/> + + <function name="BindFramebuffer" offset="assign"> + <param name="target" type="GLenum"/> + <param name="framebuffer" type="GLuint"/> + </function> + + <function name="BindRenderbuffer" offset="assign"> + <param name="target" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </function> + + <function name="CheckFramebufferStatus" offset="assign"> + <param name="target" type="GLenum"/> + <return type="GLenum"/> + </function> + + <function name="DeleteFramebuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="framebuffers" type="const GLuint *" count="n"/> + </function> + + <function name="DeleteRenderbuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="renderbuffers" type="const GLuint *" count="n"/> + </function> + + <function name="FramebufferRenderbuffer" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="renderbuffertarget" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </function> + + <function name="FramebufferTexture2D" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="textarget" type="GLenum"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + </function> + + <function name="GenerateMipmap" offset="assign"> + <param name="target" type="GLenum"/> + </function> + + <function name="GenFramebuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="framebuffers" type="GLuint *" count="n" output="true"/> + </function> + + <function name="GenRenderbuffers" offset="assign"> + <param name="n" type="GLsizei" counter="true"/> + <param name="renderbuffers" type="GLuint *" count="n" output="true"/> + </function> + + <function name="GetFramebufferAttachmentParameteriv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true"/> + </function> + + <function name="GetRenderbufferParameteriv" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true"/> + </function> + + <function name="IsFramebuffer" offset="assign"> + <param name="framebuffer" type="GLuint"/> + <return type="GLboolean"/> + </function> + + <function name="IsRenderbuffer" offset="assign"> + <param name="renderbuffer" type="GLuint"/> + <return type="GLboolean"/> + </function> + + <function name="RenderbufferStorage" offset="assign"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </function> + + <!-- from GL_OES_read_format --> + <enum name="IMPLEMENTATION_COLOR_READ_TYPE" value="0x8B9A"/> + <enum name="IMPLEMENTATION_COLOR_READ_FORMAT" value="0x8B9B"/> + + <!-- from GL_OES_single_precision --> + <function name="ClearDepthf" offset="assign"> + <param name="depth" type="GLclampf"/> + </function> + + <function name="DepthRangef" offset="assign"> + <param name="zNear" type="GLclampf"/> + <param name="zFar" type="GLclampf"/> + </function> +</category> + +<xi:include href="es2_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="es2_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es2_COMPAT.xml b/src/mesa/es/glapi/es2_COMPAT.xml new file mode 100644 index 0000000000..61f11a604e --- /dev/null +++ b/src/mesa/es/glapi/es2_COMPAT.xml @@ -0,0 +1,368 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<OpenGLAPI> + +<!-- This file defines the functions that are needed by Mesa. It + makes sure the generated glapi headers are compatible with Mesa. + It mainly consists of missing functions and aliases in OpenGL ES. +--> + +<xi:include href="es_COMPAT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- except for those defined by es_COMPAT.xml, these are also needed --> +<category name="compat"> + <!-- OpenGL 1.0 --> + <function name="Color4f" offset="29" vectorequiv="Color4fv" static_dispatch="false"> + <param name="red" type="GLfloat"/> + <param name="green" type="GLfloat"/> + <param name="blue" type="GLfloat"/> + <param name="alpha" type="GLfloat"/> + </function> + + <function name="Color4ub" offset="35" vectorequiv="Color4ubv" static_dispatch="false"> + <param name="red" type="GLubyte"/> + <param name="green" type="GLubyte"/> + <param name="blue" type="GLubyte"/> + <param name="alpha" type="GLubyte"/> + </function> + + <function name="Normal3f" offset="56" vectorequiv="Normal3fv" static_dispatch="false"> + <param name="nx" type="GLfloat"/> + <param name="ny" type="GLfloat"/> + <param name="nz" type="GLfloat"/> + </function> + + <function name="Fogf" offset="153" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="80"/> + </function> + + <function name="Fogfv" offset="154" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="81"/> + </function> + + <function name="Lightf" offset="159" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="86"/> + </function> + + <function name="Lightfv" offset="160" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="87"/> + </function> + + <function name="LightModelf" offset="163" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="90"/> + </function> + + <function name="LightModelfv" offset="164" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="91"/> + </function> + + <function name="Materialf" offset="169" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="96"/> + </function> + + <function name="Materialfv" offset="170" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="97"/> + </function> + + <function name="PointSize" offset="173" static_dispatch="false"> + <param name="size" type="GLfloat"/> + <glx rop="100"/> + </function> + + <function name="ShadeModel" offset="177" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="104"/> + </function> + + <function name="TexEnvf" offset="184" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="111"/> + </function> + + <function name="TexEnvfv" offset="185" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="112"/> + </function> + + <function name="TexEnvi" offset="186" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="113"/> + </function> + + <function name="TexEnviv" offset="187" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="114"/> + </function> + + <function name="TexGenf" offset="190" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="117"/> + </function> + + <function name="TexGenfv" offset="191" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="118"/> + </function> + + <function name="TexGeni" offset="192" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="119"/> + </function> + + <function name="TexGeniv" offset="193" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="120"/> + </function> + + <function name="AlphaFunc" offset="240" static_dispatch="false"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLclampf"/> + <glx rop="159"/> + </function> + + <function name="LogicOp" offset="242" static_dispatch="false"> + <param name="opcode" type="GLenum"/> + <glx rop="161"/> + </function> + + <function name="GetLightfv" offset="264" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="118"/> + </function> + + <function name="GetMaterialfv" offset="269" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="123"/> + </function> + + <function name="GetTexEnvfv" offset="276" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="130"/> + </function> + + <function name="GetTexEnviv" offset="277" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="131"/> + </function> + + <function name="GetTexGenfv" offset="279" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="133"/> + </function> + + <function name="GetTexGeniv" offset="280" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="134"/> + </function> + + <function name="LoadIdentity" offset="290" static_dispatch="false"> + <glx rop="176"/> + </function> + + <function name="LoadMatrixf" offset="291" static_dispatch="false"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="177"/> + </function> + + <function name="MatrixMode" offset="293" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="179"/> + </function> + + <function name="MultMatrixf" offset="294" static_dispatch="false"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="180"/> + </function> + + <function name="PopMatrix" offset="297" static_dispatch="false"> + <glx rop="183"/> + </function> + + <function name="PushMatrix" offset="298" static_dispatch="false"> + <glx rop="184"/> + </function> + + <function name="Rotatef" offset="300" static_dispatch="false"> + <param name="angle" type="GLfloat"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="186"/> + </function> + + <function name="Scalef" offset="302" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="188"/> + </function> + + <function name="Translatef" offset="304" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="190"/> + </function> + + <!-- OpenGL 1.1 --> + <function name="ColorPointer" offset="308" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="DisableClientState" offset="309" static_dispatch="false"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="EnableClientState" offset="313" static_dispatch="false"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="NormalPointer" offset="318" static_dispatch="false"> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="TexCoordPointer" offset="320" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="VertexPointer" offset="321" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="GetPointerv" offset="329" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLvoid **" output="true"/> + <glx handcode="true"/> + </function> + + <!-- OpenGL 1.2 --> + <function name="TexImage3D" alias="TexImage3DOES" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/> + <glx rop="4114" large="true"/> + </function> + + <function name="TexSubImage3D" alias="TexSubImage3DOES" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4115" large="true"/> + </function> + + <function name="CopyTexSubImage3D" alias="CopyTexSubImage3DOES" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4123"/> + </function> + + <!-- GL_ARB_multitexture --> + <function name="ActiveTextureARB" alias="ActiveTexture" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx rop="197"/> + </function> + + <function name="ClientActiveTextureARB" offset="375" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + <param name="q" type="GLfloat"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es2_EXT.xml b/src/mesa/es/glapi/es2_EXT.xml new file mode 100644 index 0000000000..3615772b56 --- /dev/null +++ b/src/mesa/es/glapi/es2_EXT.xml @@ -0,0 +1,162 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL ES 2.x extensions --> + +<OpenGLAPI> + +<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<category name="GL_OES_texture_3D" number="34"> + <enum name="TEXTURE_BINDING_3D_OES" value="0x806A"/> + <enum name="TEXTURE_3D_OES" value="0x806F"/> + <enum name="TEXTURE_WRAP_R_OES" value="0x8072"/> + <enum name="MAX_3D_TEXTURE_SIZE_OES" value="0x8073"/> + <enum name="SAMPLER_3D_OES" value="0x8B5F"/> + <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/> + + <function name="CompressedTexImage3DOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="imageSize" type="GLsizei" counter="true"/> + <param name="data" type="const GLvoid *" count="imageSize"/> + <glx rop="216" handcode="client"/> + </function> + + <function name="CompressedTexSubImage3DOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="imageSize" type="GLsizei" counter="true"/> + <param name="data" type="const GLvoid *" count="imageSize"/> + <glx rop="219" handcode="client"/> + </function> + + <function name="CopyTexSubImage3DOES" offset="373"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4123"/> + </function> + + <function name="FramebufferTexture3DOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="textarget" type="GLenum"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + <param name="zoffset" type="GLint"/> + <glx rop="4323"/> + </function> + + <function name="TexImage3DOES" offset="371"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/> + <glx rop="4114" large="true"/> + </function> + + <function name="TexSubImage3DOES" offset="372"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4115" large="true"/> + </function> +</category> + +<!-- the other name is OES_texture_float_linear --> +<category name="OES_texture_half_float_linear" number="35"> + <!-- No new functions, types, enums. --> +</category> + +<!-- the other name is OES_texture_float --> +<category name="OES_texture_half_float" number="36"> + <enum name="HALF_FLOAT_OES" value="0x8D61"/> +</category> + +<category name="GL_OES_texture_npot" number="37"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_OES_vertex_half_float" number="38"> + <enum name="HALF_FLOAT_OES" value="0x8D61"/> +</category> + +<category name="GL_EXT_texture_type_2_10_10_10_REV" number="42"> + <enum name="UNSIGNED_INT_2_10_10_10_REV_EXT" value="0x8368"/> +</category> + +<category name="GL_OES_packed_depth_stencil" number="43"> + <enum name="DEPTH_STENCIL_OES" value="0x84F9"/> + <enum name="UNSIGNED_INT_24_8_OES" value="0x84FA"/> + <enum name="DEPTH24_STENCIL8_OES" value="0x88F0"/> +</category> + +<category name="GL_OES_depth_texture" number="44"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_OES_standard_derivatives" number="45"> + <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT_OES" value="0x8B8B"/> +</category> + +<category name="GL_OES_vertex_type_10_10_10_2" number="46"> + <enum name="UNSIGNED_INT_10_10_10_2_OES" value="0x8DF6"/> + <enum name="INT_10_10_10_2_OES" value="0x8DF7"/> +</category> + +<category name="GL_OES_get_program_binary" number="47"> + <enum name="PROGRAM_BINARY_LENGTH_OES" value="0x8741"/> + <enum name="NUM_PROGRAM_BINARY_FORMATS_OES" value="0x87FE"/> + <enum name="PROGRAM_BINARY_FORMATS_OES" value="0x87FF"/> + + <function name="GetProgramBinaryOES" offset="assign"> + <param name="program" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="binaryFormat" type="GLenum *"/> + <param name="binary" type="GLvoid *"/> + </function> + + <function name="ProgramBinaryOES" offset="assign"> + <param name="program" type="GLuint"/> + <param name="binaryFormat" type="GLenum"/> + <param name="binary" type="const GLvoid *"/> + <param name="length" type="GLint"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es_COMPAT.xml b/src/mesa/es/glapi/es_COMPAT.xml new file mode 100644 index 0000000000..bb6d28db83 --- /dev/null +++ b/src/mesa/es/glapi/es_COMPAT.xml @@ -0,0 +1,2646 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<OpenGLAPI> + +<!-- This file defines the following categories + + a subset of 1.0 + a subset of 1.1 + a subset of 1.2 + a subset of GL_ARB_multitexture + GL_APPLE_vertex_array_object + + to make sure the generated glapi headers are compatible with Mesa. + It is included by es1_COMPAT.xml and es2_COMPAT.xml. +--> + +<category name="1.0"> + <type name="double" size="8" float="true" glx_name="FLOAT64"/> + <type name="clampd" size="8" float="true" glx_name="FLOAT64"/> + + <type name="float" size="4" float="true" glx_name="FLOAT32"/> + <type name="clampf" size="4" float="true" glx_name="FLOAT32"/> + + <type name="int" size="4" glx_name="CARD32"/> + <type name="uint" size="4" unsigned="true" glx_name="CARD32"/> + <type name="sizei" size="4" unsigned="true" glx_name="CARD32"/> + <type name="enum" size="4" unsigned="true" glx_name="ENUM"/> + <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/> + + <type name="short" size="2" glx_name="CARD16"/> + <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/> + + <type name="byte" size="1" glx_name="CARD8"/> + <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/> + <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/> + + <type name="void" size="1"/> + + <function name="NewList" offset="0" static_dispatch="false"> + <param name="list" type="GLuint"/> + <param name="mode" type="GLenum"/> + <glx sop="101"/> + </function> + + <function name="EndList" offset="1" static_dispatch="false"> + <glx sop="102"/> + </function> + + <function name="CallList" offset="2" static_dispatch="false"> + <param name="list" type="GLuint"/> + <glx rop="1"/> + </function> + + <function name="CallLists" offset="3" static_dispatch="false"> + <param name="n" type="GLsizei" counter="true"/> + <param name="type" type="GLenum"/> + <param name="lists" type="const GLvoid *" variable_param="type" count="n"/> + <glx rop="2" large="true"/> + </function> + + <function name="DeleteLists" offset="4" static_dispatch="false"> + <param name="list" type="GLuint"/> + <param name="range" type="GLsizei"/> + <glx sop="103"/> + </function> + + <function name="GenLists" offset="5" static_dispatch="false"> + <param name="range" type="GLsizei"/> + <return type="GLuint"/> + <glx sop="104"/> + </function> + + <function name="ListBase" offset="6" static_dispatch="false"> + <param name="base" type="GLuint"/> + <glx rop="3"/> + </function> + + <function name="Begin" offset="7" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="4"/> + </function> + + <function name="Bitmap" offset="8" static_dispatch="false"> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="xorig" type="GLfloat"/> + <param name="yorig" type="GLfloat"/> + <param name="xmove" type="GLfloat"/> + <param name="ymove" type="GLfloat"/> + <param name="bitmap" type="const GLubyte *" img_width="width" img_height="height" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/> + <glx rop="5" large="true"/> + </function> + + <function name="Color3b" offset="9" vectorequiv="Color3bv" static_dispatch="false"> + <param name="red" type="GLbyte"/> + <param name="green" type="GLbyte"/> + <param name="blue" type="GLbyte"/> + </function> + + <function name="Color3bv" offset="10" static_dispatch="false"> + <param name="v" type="const GLbyte *" count="3"/> + <glx rop="6"/> + </function> + + <function name="Color3d" offset="11" vectorequiv="Color3dv" static_dispatch="false"> + <param name="red" type="GLdouble"/> + <param name="green" type="GLdouble"/> + <param name="blue" type="GLdouble"/> + </function> + + <function name="Color3dv" offset="12" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="7"/> + </function> + + <function name="Color3f" offset="13" vectorequiv="Color3fv" static_dispatch="false"> + <param name="red" type="GLfloat"/> + <param name="green" type="GLfloat"/> + <param name="blue" type="GLfloat"/> + </function> + + <function name="Color3fv" offset="14" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="8"/> + </function> + + <function name="Color3i" offset="15" vectorequiv="Color3iv" static_dispatch="false"> + <param name="red" type="GLint"/> + <param name="green" type="GLint"/> + <param name="blue" type="GLint"/> + </function> + + <function name="Color3iv" offset="16" static_dispatch="false"> + <param name="v" type="const GLint *" count="3"/> + <glx rop="9"/> + </function> + + <function name="Color3s" offset="17" vectorequiv="Color3sv" static_dispatch="false"> + <param name="red" type="GLshort"/> + <param name="green" type="GLshort"/> + <param name="blue" type="GLshort"/> + </function> + + <function name="Color3sv" offset="18" static_dispatch="false"> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="10"/> + </function> + + <function name="Color3ub" offset="19" vectorequiv="Color3ubv" static_dispatch="false"> + <param name="red" type="GLubyte"/> + <param name="green" type="GLubyte"/> + <param name="blue" type="GLubyte"/> + </function> + + <function name="Color3ubv" offset="20" static_dispatch="false"> + <param name="v" type="const GLubyte *" count="3"/> + <glx rop="11"/> + </function> + + <function name="Color3ui" offset="21" vectorequiv="Color3uiv" static_dispatch="false"> + <param name="red" type="GLuint"/> + <param name="green" type="GLuint"/> + <param name="blue" type="GLuint"/> + </function> + + <function name="Color3uiv" offset="22" static_dispatch="false"> + <param name="v" type="const GLuint *" count="3"/> + <glx rop="12"/> + </function> + + <function name="Color3us" offset="23" vectorequiv="Color3usv" static_dispatch="false"> + <param name="red" type="GLushort"/> + <param name="green" type="GLushort"/> + <param name="blue" type="GLushort"/> + </function> + + <function name="Color3usv" offset="24" static_dispatch="false"> + <param name="v" type="const GLushort *" count="3"/> + <glx rop="13"/> + </function> + + <function name="Color4b" offset="25" vectorequiv="Color4bv" static_dispatch="false"> + <param name="red" type="GLbyte"/> + <param name="green" type="GLbyte"/> + <param name="blue" type="GLbyte"/> + <param name="alpha" type="GLbyte"/> + </function> + + <function name="Color4bv" offset="26" static_dispatch="false"> + <param name="v" type="const GLbyte *" count="4"/> + <glx rop="14"/> + </function> + + <function name="Color4d" offset="27" vectorequiv="Color4dv" static_dispatch="false"> + <param name="red" type="GLdouble"/> + <param name="green" type="GLdouble"/> + <param name="blue" type="GLdouble"/> + <param name="alpha" type="GLdouble"/> + </function> + + <function name="Color4dv" offset="28" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="4"/> + <glx rop="15"/> + </function> + + <!--function name="Color4f" offset="29" vectorequiv="Color4fv" static_dispatch="false"> + <param name="red" type="GLfloat"/> + <param name="green" type="GLfloat"/> + <param name="blue" type="GLfloat"/> + <param name="alpha" type="GLfloat"/> + </function--> + + <function name="Color4fv" offset="30" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="4"/> + <glx rop="16"/> + </function> + + <function name="Color4i" offset="31" vectorequiv="Color4iv" static_dispatch="false"> + <param name="red" type="GLint"/> + <param name="green" type="GLint"/> + <param name="blue" type="GLint"/> + <param name="alpha" type="GLint"/> + </function> + + <function name="Color4iv" offset="32" static_dispatch="false"> + <param name="v" type="const GLint *" count="4"/> + <glx rop="17"/> + </function> + + <function name="Color4s" offset="33" vectorequiv="Color4sv" static_dispatch="false"> + <param name="red" type="GLshort"/> + <param name="green" type="GLshort"/> + <param name="blue" type="GLshort"/> + <param name="alpha" type="GLshort"/> + </function> + + <function name="Color4sv" offset="34" static_dispatch="false"> + <param name="v" type="const GLshort *" count="4"/> + <glx rop="18"/> + </function> + + <!--function name="Color4ub" offset="35" vectorequiv="Color4ubv" static_dispatch="false"> + <param name="red" type="GLubyte"/> + <param name="green" type="GLubyte"/> + <param name="blue" type="GLubyte"/> + <param name="alpha" type="GLubyte"/> + </function--> + + <function name="Color4ubv" offset="36" static_dispatch="false"> + <param name="v" type="const GLubyte *" count="4"/> + <glx rop="19"/> + </function> + + <function name="Color4ui" offset="37" vectorequiv="Color4uiv" static_dispatch="false"> + <param name="red" type="GLuint"/> + <param name="green" type="GLuint"/> + <param name="blue" type="GLuint"/> + <param name="alpha" type="GLuint"/> + </function> + + <function name="Color4uiv" offset="38" static_dispatch="false"> + <param name="v" type="const GLuint *" count="4"/> + <glx rop="20"/> + </function> + + <function name="Color4us" offset="39" vectorequiv="Color4usv" static_dispatch="false"> + <param name="red" type="GLushort"/> + <param name="green" type="GLushort"/> + <param name="blue" type="GLushort"/> + <param name="alpha" type="GLushort"/> + </function> + + <function name="Color4usv" offset="40" static_dispatch="false"> + <param name="v" type="const GLushort *" count="4"/> + <glx rop="21"/> + </function> + + <function name="EdgeFlag" offset="41" vectorequiv="EdgeFlagv" static_dispatch="false"> + <param name="flag" type="GLboolean"/> + </function> + + <function name="EdgeFlagv" offset="42" static_dispatch="false"> + <param name="flag" type="const GLboolean *" count="1"/> + <glx rop="22"/> + </function> + + <function name="End" offset="43" static_dispatch="false"> + <glx rop="23"/> + </function> + + <function name="Indexd" offset="44" vectorequiv="Indexdv" static_dispatch="false"> + <param name="c" type="GLdouble"/> + </function> + + <function name="Indexdv" offset="45" static_dispatch="false"> + <param name="c" type="const GLdouble *" count="1"/> + <glx rop="24"/> + </function> + + <function name="Indexf" offset="46" vectorequiv="Indexfv" static_dispatch="false"> + <param name="c" type="GLfloat"/> + </function> + + <function name="Indexfv" offset="47" static_dispatch="false"> + <param name="c" type="const GLfloat *" count="1"/> + <glx rop="25"/> + </function> + + <function name="Indexi" offset="48" vectorequiv="Indexiv" static_dispatch="false"> + <param name="c" type="GLint"/> + </function> + + <function name="Indexiv" offset="49" static_dispatch="false"> + <param name="c" type="const GLint *" count="1"/> + <glx rop="26"/> + </function> + + <function name="Indexs" offset="50" vectorequiv="Indexsv" static_dispatch="false"> + <param name="c" type="GLshort"/> + </function> + + <function name="Indexsv" offset="51" static_dispatch="false"> + <param name="c" type="const GLshort *" count="1"/> + <glx rop="27"/> + </function> + + <function name="Normal3b" offset="52" vectorequiv="Normal3bv" static_dispatch="false"> + <param name="nx" type="GLbyte"/> + <param name="ny" type="GLbyte"/> + <param name="nz" type="GLbyte"/> + </function> + + <function name="Normal3bv" offset="53" static_dispatch="false"> + <param name="v" type="const GLbyte *" count="3"/> + <glx rop="28"/> + </function> + + <function name="Normal3d" offset="54" vectorequiv="Normal3dv" static_dispatch="false"> + <param name="nx" type="GLdouble"/> + <param name="ny" type="GLdouble"/> + <param name="nz" type="GLdouble"/> + </function> + + <function name="Normal3dv" offset="55" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="29"/> + </function> + + <!--function name="Normal3f" offset="56" vectorequiv="Normal3fv" static_dispatch="false"> + <param name="nx" type="GLfloat"/> + <param name="ny" type="GLfloat"/> + <param name="nz" type="GLfloat"/> + </function--> + + <function name="Normal3fv" offset="57" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="30"/> + </function> + + <function name="Normal3i" offset="58" vectorequiv="Normal3iv" static_dispatch="false"> + <param name="nx" type="GLint"/> + <param name="ny" type="GLint"/> + <param name="nz" type="GLint"/> + </function> + + <function name="Normal3iv" offset="59" static_dispatch="false"> + <param name="v" type="const GLint *" count="3"/> + <glx rop="31"/> + </function> + + <function name="Normal3s" offset="60" vectorequiv="Normal3sv" static_dispatch="false"> + <param name="nx" type="GLshort"/> + <param name="ny" type="GLshort"/> + <param name="nz" type="GLshort"/> + </function> + + <function name="Normal3sv" offset="61" static_dispatch="false"> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="32"/> + </function> + + <function name="RasterPos2d" offset="62" vectorequiv="RasterPos2dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + </function> + + <function name="RasterPos2dv" offset="63" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="2"/> + <glx rop="33"/> + </function> + + <function name="RasterPos2f" offset="64" vectorequiv="RasterPos2fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + </function> + + <function name="RasterPos2fv" offset="65" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="2"/> + <glx rop="34"/> + </function> + + <function name="RasterPos2i" offset="66" vectorequiv="RasterPos2iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + </function> + + <function name="RasterPos2iv" offset="67" static_dispatch="false"> + <param name="v" type="const GLint *" count="2"/> + <glx rop="35"/> + </function> + + <function name="RasterPos2s" offset="68" vectorequiv="RasterPos2sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + </function> + + <function name="RasterPos2sv" offset="69" static_dispatch="false"> + <param name="v" type="const GLshort *" count="2"/> + <glx rop="36"/> + </function> + + <function name="RasterPos3d" offset="70" vectorequiv="RasterPos3dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + </function> + + <function name="RasterPos3dv" offset="71" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="37"/> + </function> + + <function name="RasterPos3f" offset="72" vectorequiv="RasterPos3fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + </function> + + <function name="RasterPos3fv" offset="73" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="38"/> + </function> + + <function name="RasterPos3i" offset="74" vectorequiv="RasterPos3iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + </function> + + <function name="RasterPos3iv" offset="75" static_dispatch="false"> + <param name="v" type="const GLint *" count="3"/> + <glx rop="39"/> + </function> + + <function name="RasterPos3s" offset="76" vectorequiv="RasterPos3sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + <param name="z" type="GLshort"/> + </function> + + <function name="RasterPos3sv" offset="77" static_dispatch="false"> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="40"/> + </function> + + <function name="RasterPos4d" offset="78" vectorequiv="RasterPos4dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + <param name="w" type="GLdouble"/> + </function> + + <function name="RasterPos4dv" offset="79" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="4"/> + <glx rop="41"/> + </function> + + <function name="RasterPos4f" offset="80" vectorequiv="RasterPos4fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <param name="w" type="GLfloat"/> + </function> + + <function name="RasterPos4fv" offset="81" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="4"/> + <glx rop="42"/> + </function> + + <function name="RasterPos4i" offset="82" vectorequiv="RasterPos4iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + <param name="w" type="GLint"/> + </function> + + <function name="RasterPos4iv" offset="83" static_dispatch="false"> + <param name="v" type="const GLint *" count="4"/> + <glx rop="43"/> + </function> + + <function name="RasterPos4s" offset="84" vectorequiv="RasterPos4sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + <param name="z" type="GLshort"/> + <param name="w" type="GLshort"/> + </function> + + <function name="RasterPos4sv" offset="85" static_dispatch="false"> + <param name="v" type="const GLshort *" count="4"/> + <glx rop="44"/> + </function> + + <function name="Rectd" offset="86" vectorequiv="Rectdv" static_dispatch="false"> + <param name="x1" type="GLdouble"/> + <param name="y1" type="GLdouble"/> + <param name="x2" type="GLdouble"/> + <param name="y2" type="GLdouble"/> + </function> + + <function name="Rectdv" offset="87" static_dispatch="false"> + <param name="v1" type="const GLdouble *" count="2"/> + <param name="v2" type="const GLdouble *" count="2"/> + <glx rop="45"/> + </function> + + <function name="Rectf" offset="88" vectorequiv="Rectfv" static_dispatch="false"> + <param name="x1" type="GLfloat"/> + <param name="y1" type="GLfloat"/> + <param name="x2" type="GLfloat"/> + <param name="y2" type="GLfloat"/> + </function> + + <function name="Rectfv" offset="89" static_dispatch="false"> + <param name="v1" type="const GLfloat *" count="2"/> + <param name="v2" type="const GLfloat *" count="2"/> + <glx rop="46"/> + </function> + + <function name="Recti" offset="90" vectorequiv="Rectiv" static_dispatch="false"> + <param name="x1" type="GLint"/> + <param name="y1" type="GLint"/> + <param name="x2" type="GLint"/> + <param name="y2" type="GLint"/> + </function> + + <function name="Rectiv" offset="91" static_dispatch="false"> + <param name="v1" type="const GLint *" count="2"/> + <param name="v2" type="const GLint *" count="2"/> + <glx rop="47"/> + </function> + + <function name="Rects" offset="92" vectorequiv="Rectsv" static_dispatch="false"> + <param name="x1" type="GLshort"/> + <param name="y1" type="GLshort"/> + <param name="x2" type="GLshort"/> + <param name="y2" type="GLshort"/> + </function> + + <function name="Rectsv" offset="93" static_dispatch="false"> + <param name="v1" type="const GLshort *" count="2"/> + <param name="v2" type="const GLshort *" count="2"/> + <glx rop="48"/> + </function> + + <function name="TexCoord1d" offset="94" vectorequiv="TexCoord1dv" static_dispatch="false"> + <param name="s" type="GLdouble"/> + </function> + + <function name="TexCoord1dv" offset="95" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="1"/> + <glx rop="49"/> + </function> + + <function name="TexCoord1f" offset="96" vectorequiv="TexCoord1fv" static_dispatch="false"> + <param name="s" type="GLfloat"/> + </function> + + <function name="TexCoord1fv" offset="97" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="1"/> + <glx rop="50"/> + </function> + + <function name="TexCoord1i" offset="98" vectorequiv="TexCoord1iv" static_dispatch="false"> + <param name="s" type="GLint"/> + </function> + + <function name="TexCoord1iv" offset="99" static_dispatch="false"> + <param name="v" type="const GLint *" count="1"/> + <glx rop="51"/> + </function> + + <function name="TexCoord1s" offset="100" vectorequiv="TexCoord1sv" static_dispatch="false"> + <param name="s" type="GLshort"/> + </function> + + <function name="TexCoord1sv" offset="101" static_dispatch="false"> + <param name="v" type="const GLshort *" count="1"/> + <glx rop="52"/> + </function> + + <function name="TexCoord2d" offset="102" vectorequiv="TexCoord2dv" static_dispatch="false"> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + </function> + + <function name="TexCoord2dv" offset="103" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="2"/> + <glx rop="53"/> + </function> + + <function name="TexCoord2f" offset="104" vectorequiv="TexCoord2fv" static_dispatch="false"> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + </function> + + <function name="TexCoord2fv" offset="105" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="2"/> + <glx rop="54"/> + </function> + + <function name="TexCoord2i" offset="106" vectorequiv="TexCoord2iv" static_dispatch="false"> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + </function> + + <function name="TexCoord2iv" offset="107" static_dispatch="false"> + <param name="v" type="const GLint *" count="2"/> + <glx rop="55"/> + </function> + + <function name="TexCoord2s" offset="108" vectorequiv="TexCoord2sv" static_dispatch="false"> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + </function> + + <function name="TexCoord2sv" offset="109" static_dispatch="false"> + <param name="v" type="const GLshort *" count="2"/> + <glx rop="56"/> + </function> + + <function name="TexCoord3d" offset="110" vectorequiv="TexCoord3dv" static_dispatch="false"> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + <param name="r" type="GLdouble"/> + </function> + + <function name="TexCoord3dv" offset="111" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="57"/> + </function> + + <function name="TexCoord3f" offset="112" vectorequiv="TexCoord3fv" static_dispatch="false"> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + </function> + + <function name="TexCoord3fv" offset="113" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="58"/> + </function> + + <function name="TexCoord3i" offset="114" vectorequiv="TexCoord3iv" static_dispatch="false"> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + <param name="r" type="GLint"/> + </function> + + <function name="TexCoord3iv" offset="115" static_dispatch="false"> + <param name="v" type="const GLint *" count="3"/> + <glx rop="59"/> + </function> + + <function name="TexCoord3s" offset="116" vectorequiv="TexCoord3sv" static_dispatch="false"> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + <param name="r" type="GLshort"/> + </function> + + <function name="TexCoord3sv" offset="117" static_dispatch="false"> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="60"/> + </function> + + <function name="TexCoord4d" offset="118" vectorequiv="TexCoord4dv" static_dispatch="false"> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + <param name="r" type="GLdouble"/> + <param name="q" type="GLdouble"/> + </function> + + <function name="TexCoord4dv" offset="119" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="4"/> + <glx rop="61"/> + </function> + + <function name="TexCoord4f" offset="120" vectorequiv="TexCoord4fv" static_dispatch="false"> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + <param name="q" type="GLfloat"/> + </function> + + <function name="TexCoord4fv" offset="121" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="4"/> + <glx rop="62"/> + </function> + + <function name="TexCoord4i" offset="122" vectorequiv="TexCoord4iv" static_dispatch="false"> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + <param name="r" type="GLint"/> + <param name="q" type="GLint"/> + </function> + + <function name="TexCoord4iv" offset="123" static_dispatch="false"> + <param name="v" type="const GLint *" count="4"/> + <glx rop="63"/> + </function> + + <function name="TexCoord4s" offset="124" vectorequiv="TexCoord4sv" static_dispatch="false"> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + <param name="r" type="GLshort"/> + <param name="q" type="GLshort"/> + </function> + + <function name="TexCoord4sv" offset="125" static_dispatch="false"> + <param name="v" type="const GLshort *" count="4"/> + <glx rop="64"/> + </function> + + <function name="Vertex2d" offset="126" vectorequiv="Vertex2dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + </function> + + <function name="Vertex2dv" offset="127" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="2"/> + <glx rop="65"/> + </function> + + <function name="Vertex2f" offset="128" vectorequiv="Vertex2fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + </function> + + <function name="Vertex2fv" offset="129" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="2"/> + <glx rop="66"/> + </function> + + <function name="Vertex2i" offset="130" vectorequiv="Vertex2iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + </function> + + <function name="Vertex2iv" offset="131" static_dispatch="false"> + <param name="v" type="const GLint *" count="2"/> + <glx rop="67"/> + </function> + + <function name="Vertex2s" offset="132" vectorequiv="Vertex2sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + </function> + + <function name="Vertex2sv" offset="133" static_dispatch="false"> + <param name="v" type="const GLshort *" count="2"/> + <glx rop="68"/> + </function> + + <function name="Vertex3d" offset="134" vectorequiv="Vertex3dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + </function> + + <function name="Vertex3dv" offset="135" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="69"/> + </function> + + <function name="Vertex3f" offset="136" vectorequiv="Vertex3fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + </function> + + <function name="Vertex3fv" offset="137" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="70"/> + </function> + + <function name="Vertex3i" offset="138" vectorequiv="Vertex3iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + </function> + + <function name="Vertex3iv" offset="139" static_dispatch="false"> + <param name="v" type="const GLint *" count="3"/> + <glx rop="71"/> + </function> + + <function name="Vertex3s" offset="140" vectorequiv="Vertex3sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + <param name="z" type="GLshort"/> + </function> + + <function name="Vertex3sv" offset="141" static_dispatch="false"> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="72"/> + </function> + + <function name="Vertex4d" offset="142" vectorequiv="Vertex4dv" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + <param name="w" type="GLdouble"/> + </function> + + <function name="Vertex4dv" offset="143" static_dispatch="false"> + <param name="v" type="const GLdouble *" count="4"/> + <glx rop="73"/> + </function> + + <function name="Vertex4f" offset="144" vectorequiv="Vertex4fv" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <param name="w" type="GLfloat"/> + </function> + + <function name="Vertex4fv" offset="145" static_dispatch="false"> + <param name="v" type="const GLfloat *" count="4"/> + <glx rop="74"/> + </function> + + <function name="Vertex4i" offset="146" vectorequiv="Vertex4iv" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + <param name="w" type="GLint"/> + </function> + + <function name="Vertex4iv" offset="147" static_dispatch="false"> + <param name="v" type="const GLint *" count="4"/> + <glx rop="75"/> + </function> + + <function name="Vertex4s" offset="148" vectorequiv="Vertex4sv" static_dispatch="false"> + <param name="x" type="GLshort"/> + <param name="y" type="GLshort"/> + <param name="z" type="GLshort"/> + <param name="w" type="GLshort"/> + </function> + + <function name="Vertex4sv" offset="149" static_dispatch="false"> + <param name="v" type="const GLshort *" count="4"/> + <glx rop="76"/> + </function> + + <function name="ClipPlane" offset="150" static_dispatch="false"> + <param name="plane" type="GLenum"/> + <param name="equation" type="const GLdouble *" count="4"/> + <glx rop="77"/> + </function> + + <function name="ColorMaterial" offset="151" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="mode" type="GLenum"/> + <glx rop="78"/> + </function> + + <!--function name="CullFace" offset="152" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="79"/> + </function> + + <function name="Fogf" offset="153" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="80"/> + </function> + + <function name="Fogfv" offset="154" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="81"/> + </function--> + + <function name="Fogi" offset="155" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="82"/> + </function> + + <function name="Fogiv" offset="156" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="83"/> + </function> + + <!--function name="FrontFace" offset="157" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="84"/> + </function> + + <function name="Hint" offset="158" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="mode" type="GLenum"/> + <glx rop="85"/> + </function> + + <function name="Lightf" offset="159" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="86"/> + </function> + + <function name="Lightfv" offset="160" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="87"/> + </function--> + + <function name="Lighti" offset="161" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="88"/> + </function> + + <function name="Lightiv" offset="162" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="89"/> + </function> + + <!--function name="LightModelf" offset="163" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="90"/> + </function> + + <function name="LightModelfv" offset="164" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="91"/> + </function--> + + <function name="LightModeli" offset="165" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="92"/> + </function> + + <function name="LightModeliv" offset="166" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="93"/> + </function> + + <function name="LineStipple" offset="167" static_dispatch="false"> + <param name="factor" type="GLint"/> + <param name="pattern" type="GLushort"/> + <glx rop="94"/> + </function> + + <!--function name="LineWidth" offset="168" static_dispatch="false"> + <param name="width" type="GLfloat"/> + <glx rop="95"/> + </function> + + <function name="Materialf" offset="169" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="96"/> + </function> + + <function name="Materialfv" offset="170" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="97"/> + </function--> + + <function name="Materiali" offset="171" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="98"/> + </function> + + <function name="Materialiv" offset="172" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="99"/> + </function> + + <!--function name="PointSize" offset="173" static_dispatch="false"> + <param name="size" type="GLfloat"/> + <glx rop="100"/> + </function--> + + <function name="PolygonMode" offset="174" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="mode" type="GLenum"/> + <glx rop="101"/> + </function> + + <function name="PolygonStipple" offset="175" static_dispatch="false"> + <param name="mask" type="const GLubyte *" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/> + <glx rop="102"/> + </function> + + <!--function name="Scissor" offset="176" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="103"/> + </function> + + <function name="ShadeModel" offset="177" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="104"/> + </function> + + <function name="TexParameterf" offset="178" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="105"/> + </function> + + <function name="TexParameterfv" offset="179" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="106"/> + </function> + + <function name="TexParameteri" offset="180" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="107"/> + </function> + + <function name="TexParameteriv" offset="181" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="108"/> + </function--> + + <function name="TexImage1D" offset="182" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/> + <glx rop="109" large="true"/> + </function> + + <!--function name="TexImage2D" offset="183" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/> + <glx rop="110" large="true"/> + </function> + + <function name="TexEnvf" offset="184" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="111"/> + </function> + + <function name="TexEnvfv" offset="185" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="112"/> + </function> + + <function name="TexEnvi" offset="186" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="113"/> + </function> + + <function name="TexEnviv" offset="187" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="114"/> + </function--> + + <function name="TexGend" offset="188" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLdouble"/> + <glx rop="115"/> + </function> + + <function name="TexGendv" offset="189" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLdouble *" variable_param="pname"/> + <glx rop="116"/> + </function> + + <!--function name="TexGenf" offset="190" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="117"/> + </function> + + <function name="TexGenfv" offset="191" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="118"/> + </function> + + <function name="TexGeni" offset="192" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="119"/> + </function> + + <function name="TexGeniv" offset="193" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="120"/> + </function--> + + <function name="FeedbackBuffer" offset="194" static_dispatch="false"> + <param name="size" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="buffer" type="GLfloat *" output="true"/> + <glx sop="105" handcode="true"/> + </function> + + <function name="SelectBuffer" offset="195" static_dispatch="false"> + <param name="size" type="GLsizei"/> + <param name="buffer" type="GLuint *" output="true"/> + <glx sop="106" handcode="true"/> + </function> + + <function name="RenderMode" offset="196" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <return type="GLint"/> + <glx sop="107" handcode="true"/> + </function> + + <function name="InitNames" offset="197" static_dispatch="false"> + <glx rop="121"/> + </function> + + <function name="LoadName" offset="198" static_dispatch="false"> + <param name="name" type="GLuint"/> + <glx rop="122"/> + </function> + + <function name="PassThrough" offset="199" static_dispatch="false"> + <param name="token" type="GLfloat"/> + <glx rop="123"/> + </function> + + <function name="PopName" offset="200" static_dispatch="false"> + <glx rop="124"/> + </function> + + <function name="PushName" offset="201" static_dispatch="false"> + <param name="name" type="GLuint"/> + <glx rop="125"/> + </function> + + <function name="DrawBuffer" offset="202" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="126"/> + </function> + + <!--function name="Clear" offset="203" static_dispatch="false"> + <param name="mask" type="GLbitfield"/> + <glx rop="127"/> + </function--> + + <function name="ClearAccum" offset="204" static_dispatch="false"> + <param name="red" type="GLfloat"/> + <param name="green" type="GLfloat"/> + <param name="blue" type="GLfloat"/> + <param name="alpha" type="GLfloat"/> + <glx rop="128"/> + </function> + + <function name="ClearIndex" offset="205" static_dispatch="false"> + <param name="c" type="GLfloat"/> + <glx rop="129"/> + </function> + + <!--function name="ClearColor" offset="206" static_dispatch="false"> + <param name="red" type="GLclampf"/> + <param name="green" type="GLclampf"/> + <param name="blue" type="GLclampf"/> + <param name="alpha" type="GLclampf"/> + <glx rop="130"/> + </function> + + <function name="ClearStencil" offset="207" static_dispatch="false"> + <param name="s" type="GLint"/> + <glx rop="131"/> + </function--> + + <function name="ClearDepth" offset="208" static_dispatch="false"> + <param name="depth" type="GLclampd"/> + <glx rop="132"/> + </function> + + <!--function name="StencilMask" offset="209" static_dispatch="false"> + <param name="mask" type="GLuint"/> + <glx rop="133"/> + </function> + + <function name="ColorMask" offset="210" static_dispatch="false"> + <param name="red" type="GLboolean"/> + <param name="green" type="GLboolean"/> + <param name="blue" type="GLboolean"/> + <param name="alpha" type="GLboolean"/> + <glx rop="134"/> + </function> + + <function name="DepthMask" offset="211" static_dispatch="false"> + <param name="flag" type="GLboolean"/> + <glx rop="135"/> + </function--> + + <function name="IndexMask" offset="212" static_dispatch="false"> + <param name="mask" type="GLuint"/> + <glx rop="136"/> + </function> + + <function name="Accum" offset="213" static_dispatch="false"> + <param name="op" type="GLenum"/> + <param name="value" type="GLfloat"/> + <glx rop="137"/> + </function> + + <!--function name="Disable" offset="214" static_dispatch="false"> + <param name="cap" type="GLenum"/> + <glx rop="138" handcode="client"/> + </function> + + <function name="Enable" offset="215" static_dispatch="false"> + <param name="cap" type="GLenum"/> + <glx rop="139" handcode="client"/> + </function> + + <function name="Finish" offset="216" static_dispatch="false"> + <glx sop="108" handcode="true"/> + </function> + + <function name="Flush" offset="217" static_dispatch="false"> + <glx sop="142" handcode="true"/> + </function--> + + <function name="PopAttrib" offset="218" static_dispatch="false"> + <glx rop="141"/> + </function> + + <function name="PushAttrib" offset="219" static_dispatch="false"> + <param name="mask" type="GLbitfield"/> + <glx rop="142"/> + </function> + + <function name="Map1d" offset="220" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="u1" type="GLdouble"/> + <param name="u2" type="GLdouble"/> + <param name="stride" type="GLint" client_only="true"/> + <param name="order" type="GLint"/> + <param name="points" type="const GLdouble *" variable_param="order"/> + <glx rop="143" handcode="true"/> + </function> + + <function name="Map1f" offset="221" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="u1" type="GLfloat"/> + <param name="u2" type="GLfloat"/> + <param name="stride" type="GLint" client_only="true"/> + <param name="order" type="GLint"/> + <param name="points" type="const GLfloat *" variable_param="order"/> + <glx rop="144" handcode="true"/> + </function> + + <function name="Map2d" offset="222" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="u1" type="GLdouble"/> + <param name="u2" type="GLdouble"/> + <param name="ustride" type="GLint" client_only="true"/> + <param name="uorder" type="GLint"/> + <param name="v1" type="GLdouble"/> + <param name="v2" type="GLdouble"/> + <param name="vstride" type="GLint" client_only="true"/> + <param name="vorder" type="GLint"/> + <param name="points" type="const GLdouble *" variable_param="uorder"/> + <glx rop="145" handcode="true"/> + </function> + + <function name="Map2f" offset="223" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="u1" type="GLfloat"/> + <param name="u2" type="GLfloat"/> + <param name="ustride" type="GLint" client_only="true"/> + <param name="uorder" type="GLint"/> + <param name="v1" type="GLfloat"/> + <param name="v2" type="GLfloat"/> + <param name="vstride" type="GLint" client_only="true"/> + <param name="vorder" type="GLint"/> + <param name="points" type="const GLfloat *" variable_param="uorder"/> + <glx rop="146" handcode="true"/> + </function> + + <function name="MapGrid1d" offset="224" static_dispatch="false"> + <param name="un" type="GLint"/> + <param name="u1" type="GLdouble"/> + <param name="u2" type="GLdouble"/> + <glx rop="147"/> + </function> + + <function name="MapGrid1f" offset="225" static_dispatch="false"> + <param name="un" type="GLint"/> + <param name="u1" type="GLfloat"/> + <param name="u2" type="GLfloat"/> + <glx rop="148"/> + </function> + + <function name="MapGrid2d" offset="226" static_dispatch="false"> + <param name="un" type="GLint"/> + <param name="u1" type="GLdouble"/> + <param name="u2" type="GLdouble"/> + <param name="vn" type="GLint"/> + <param name="v1" type="GLdouble"/> + <param name="v2" type="GLdouble"/> + <glx rop="149"/> + </function> + + <function name="MapGrid2f" offset="227" static_dispatch="false"> + <param name="un" type="GLint"/> + <param name="u1" type="GLfloat"/> + <param name="u2" type="GLfloat"/> + <param name="vn" type="GLint"/> + <param name="v1" type="GLfloat"/> + <param name="v2" type="GLfloat"/> + <glx rop="150"/> + </function> + + <function name="EvalCoord1d" offset="228" vectorequiv="EvalCoord1dv" static_dispatch="false"> + <param name="u" type="GLdouble"/> + </function> + + <function name="EvalCoord1dv" offset="229" static_dispatch="false"> + <param name="u" type="const GLdouble *" count="1"/> + <glx rop="151"/> + </function> + + <function name="EvalCoord1f" offset="230" vectorequiv="EvalCoord1fv" static_dispatch="false"> + <param name="u" type="GLfloat"/> + </function> + + <function name="EvalCoord1fv" offset="231" static_dispatch="false"> + <param name="u" type="const GLfloat *" count="1"/> + <glx rop="152"/> + </function> + + <function name="EvalCoord2d" offset="232" vectorequiv="EvalCoord2dv" static_dispatch="false"> + <param name="u" type="GLdouble"/> + <param name="v" type="GLdouble"/> + </function> + + <function name="EvalCoord2dv" offset="233" static_dispatch="false"> + <param name="u" type="const GLdouble *" count="2"/> + <glx rop="153"/> + </function> + + <function name="EvalCoord2f" offset="234" vectorequiv="EvalCoord2fv" static_dispatch="false"> + <param name="u" type="GLfloat"/> + <param name="v" type="GLfloat"/> + </function> + + <function name="EvalCoord2fv" offset="235" static_dispatch="false"> + <param name="u" type="const GLfloat *" count="2"/> + <glx rop="154"/> + </function> + + <function name="EvalMesh1" offset="236" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <param name="i1" type="GLint"/> + <param name="i2" type="GLint"/> + <glx rop="155"/> + </function> + + <function name="EvalPoint1" offset="237" static_dispatch="false"> + <param name="i" type="GLint"/> + <glx rop="156"/> + </function> + + <function name="EvalMesh2" offset="238" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <param name="i1" type="GLint"/> + <param name="i2" type="GLint"/> + <param name="j1" type="GLint"/> + <param name="j2" type="GLint"/> + <glx rop="157"/> + </function> + + <function name="EvalPoint2" offset="239" static_dispatch="false"> + <param name="i" type="GLint"/> + <param name="j" type="GLint"/> + <glx rop="158"/> + </function> + + <!--function name="AlphaFunc" offset="240" static_dispatch="false"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLclampf"/> + <glx rop="159"/> + </function> + + <function name="BlendFunc" offset="241" static_dispatch="false"> + <param name="sfactor" type="GLenum"/> + <param name="dfactor" type="GLenum"/> + <glx rop="160"/> + </function> + + <function name="LogicOp" offset="242" static_dispatch="false"> + <param name="opcode" type="GLenum"/> + <glx rop="161"/> + </function> + + <function name="StencilFunc" offset="243" static_dispatch="false"> + <param name="func" type="GLenum"/> + <param name="ref" type="GLint"/> + <param name="mask" type="GLuint"/> + <glx rop="162"/> + </function> + + <function name="StencilOp" offset="244" static_dispatch="false"> + <param name="fail" type="GLenum"/> + <param name="zfail" type="GLenum"/> + <param name="zpass" type="GLenum"/> + <glx rop="163"/> + </function> + + <function name="DepthFunc" offset="245" static_dispatch="false"> + <param name="func" type="GLenum"/> + <glx rop="164"/> + </function--> + + <function name="PixelZoom" offset="246" static_dispatch="false"> + <param name="xfactor" type="GLfloat"/> + <param name="yfactor" type="GLfloat"/> + <glx rop="165"/> + </function> + + <function name="PixelTransferf" offset="247" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx rop="166"/> + </function> + + <function name="PixelTransferi" offset="248" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx rop="167"/> + </function> + + <function name="PixelStoref" offset="249" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLfloat"/> + <glx sop="109" handcode="client"/> + </function> + + <!--function name="PixelStorei" offset="250" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint"/> + <glx sop="110" handcode="client"/> + </function--> + + <function name="PixelMapfv" offset="251" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="mapsize" type="GLsizei" counter="true"/> + <param name="values" type="const GLfloat *" count="mapsize"/> + <glx rop="168" large="true"/> + </function> + + <function name="PixelMapuiv" offset="252" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="mapsize" type="GLsizei" counter="true"/> + <param name="values" type="const GLuint *" count="mapsize"/> + <glx rop="169" large="true"/> + </function> + + <function name="PixelMapusv" offset="253" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="mapsize" type="GLsizei" counter="true"/> + <param name="values" type="const GLushort *" count="mapsize"/> + <glx rop="170" large="true"/> + </function> + + <function name="ReadBuffer" offset="254" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="171"/> + </function> + + <function name="CopyPixels" offset="255" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="type" type="GLenum"/> + <glx rop="172"/> + </function> + + <!--function name="ReadPixels" offset="256" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/> + <glx sop="111"/> + </function--> + + <function name="DrawPixels" offset="257" static_dispatch="false"> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0" img_pad_dimensions="false"/> + <glx rop="173" large="true"/> + </function> + + <!--function name="GetBooleanv" offset="258" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLboolean *" output="true" variable_param="pname"/> + <glx sop="112" handcode="client"/> + </function--> + + <function name="GetClipPlane" offset="259" static_dispatch="false"> + <param name="plane" type="GLenum"/> + <param name="equation" type="GLdouble *" output="true" count="4"/> + <glx sop="113" always_array="true"/> + </function> + + <function name="GetDoublev" offset="260" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLdouble *" output="true" variable_param="pname"/> + <glx sop="114" handcode="client"/> + </function> + + <!--function name="GetError" offset="261" static_dispatch="false"> + <return type="GLenum"/> + <glx sop="115" handcode="client"/> + </function> + + <function name="GetFloatv" offset="262" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="116" handcode="client"/> + </function> + + <function name="GetIntegerv" offset="263" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="117" handcode="client"/> + </function> + + <function name="GetLightfv" offset="264" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="118"/> + </function--> + + <function name="GetLightiv" offset="265" static_dispatch="false"> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="119"/> + </function> + + <function name="GetMapdv" offset="266" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="query" type="GLenum"/> + <param name="v" type="GLdouble *" output="true" variable_param="target query"/> + <glx sop="120"/> + </function> + + <function name="GetMapfv" offset="267" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="query" type="GLenum"/> + <param name="v" type="GLfloat *" output="true" variable_param="target query"/> + <glx sop="121"/> + </function> + + <function name="GetMapiv" offset="268" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="query" type="GLenum"/> + <param name="v" type="GLint *" output="true" variable_param="target query"/> + <glx sop="122"/> + </function> + + <!--function name="GetMaterialfv" offset="269" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="123"/> + </function--> + + <function name="GetMaterialiv" offset="270" static_dispatch="false"> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="124"/> + </function> + + <function name="GetPixelMapfv" offset="271" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="values" type="GLfloat *" output="true" variable_param="map"/> + <glx sop="125"/> + </function> + + <function name="GetPixelMapuiv" offset="272" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="values" type="GLuint *" output="true" variable_param="map"/> + <glx sop="126"/> + </function> + + <function name="GetPixelMapusv" offset="273" static_dispatch="false"> + <param name="map" type="GLenum"/> + <param name="values" type="GLushort *" output="true" variable_param="map"/> + <glx sop="127"/> + </function> + + <function name="GetPolygonStipple" offset="274" static_dispatch="false"> + <param name="mask" type="GLubyte *" output="true" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP"/> + <glx sop="128"/> + </function> + + <!--function name="GetString" offset="275" static_dispatch="false"> + <param name="name" type="GLenum"/> + <return type="const GLubyte *"/> + <glx sop="129" handcode="true"/> + </function> + + <function name="GetTexEnvfv" offset="276" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="130"/> + </function> + + <function name="GetTexEnviv" offset="277" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="131"/> + </function--> + + <function name="GetTexGendv" offset="278" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLdouble *" output="true" variable_param="pname"/> + <glx sop="132"/> + </function> + + <!--function name="GetTexGenfv" offset="279" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="133"/> + </function> + + <function name="GetTexGeniv" offset="280" static_dispatch="false"> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="134"/> + </function--> + + <function name="GetTexImage" offset="281" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type"/> + <glx sop="135" dimensions_in_reply="true"/> + </function> + + <!--function name="GetTexParameterfv" offset="282" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="136"/> + </function> + + <function name="GetTexParameteriv" offset="283" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="137"/> + </function--> + + <function name="GetTexLevelParameterfv" offset="284" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="138"/> + </function> + + <function name="GetTexLevelParameteriv" offset="285" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="139"/> + </function> + + <!--function name="IsEnabled" offset="286" static_dispatch="false"> + <param name="cap" type="GLenum"/> + <return type="GLboolean"/> + <glx sop="140" handcode="client"/> + </function--> + + <function name="IsList" offset="287" static_dispatch="false"> + <param name="list" type="GLuint"/> + <return type="GLboolean"/> + <glx sop="141"/> + </function> + + <function name="DepthRange" offset="288" static_dispatch="false"> + <param name="zNear" type="GLclampd"/> + <param name="zFar" type="GLclampd"/> + <glx rop="174"/> + </function> + + <function name="Frustum" offset="289" static_dispatch="false"> + <param name="left" type="GLdouble"/> + <param name="right" type="GLdouble"/> + <param name="bottom" type="GLdouble"/> + <param name="top" type="GLdouble"/> + <param name="zNear" type="GLdouble"/> + <param name="zFar" type="GLdouble"/> + <glx rop="175"/> + </function> + + <!--function name="LoadIdentity" offset="290" static_dispatch="false"> + <glx rop="176"/> + </function> + + <function name="LoadMatrixf" offset="291" static_dispatch="false"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="177"/> + </function--> + + <function name="LoadMatrixd" offset="292" static_dispatch="false"> + <param name="m" type="const GLdouble *" count="16"/> + <glx rop="178"/> + </function> + + <!--function name="MatrixMode" offset="293" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="179"/> + </function> + + <function name="MultMatrixf" offset="294" static_dispatch="false"> + <param name="m" type="const GLfloat *" count="16"/> + <glx rop="180"/> + </function--> + + <function name="MultMatrixd" offset="295" static_dispatch="false"> + <param name="m" type="const GLdouble *" count="16"/> + <glx rop="181"/> + </function> + + <function name="Ortho" offset="296" static_dispatch="false"> + <param name="left" type="GLdouble"/> + <param name="right" type="GLdouble"/> + <param name="bottom" type="GLdouble"/> + <param name="top" type="GLdouble"/> + <param name="zNear" type="GLdouble"/> + <param name="zFar" type="GLdouble"/> + <glx rop="182"/> + </function> + + <!--function name="PopMatrix" offset="297" static_dispatch="false"> + <glx rop="183"/> + </function> + + <function name="PushMatrix" offset="298" static_dispatch="false"> + <glx rop="184"/> + </function--> + + <function name="Rotated" offset="299" static_dispatch="false"> + <param name="angle" type="GLdouble"/> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + <glx rop="185"/> + </function> + + <!--function name="Rotatef" offset="300" static_dispatch="false"> + <param name="angle" type="GLfloat"/> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="186"/> + </function--> + + <function name="Scaled" offset="301" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + <glx rop="187"/> + </function> + + <!--function name="Scalef" offset="302" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="188"/> + </function--> + + <function name="Translated" offset="303" static_dispatch="false"> + <param name="x" type="GLdouble"/> + <param name="y" type="GLdouble"/> + <param name="z" type="GLdouble"/> + <glx rop="189"/> + </function> + + <!--function name="Translatef" offset="304" static_dispatch="false"> + <param name="x" type="GLfloat"/> + <param name="y" type="GLfloat"/> + <param name="z" type="GLfloat"/> + <glx rop="190"/> + </function> + + <function name="Viewport" offset="305" static_dispatch="false"> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="191"/> + </function--> +</category> + +<category name="1.1"> + <function name="ArrayElement" offset="306" static_dispatch="false"> + <param name="i" type="GLint"/> + <glx handcode="true"/> + </function> + + <!--function name="ColorPointer" offset="308" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="DisableClientState" offset="309" static_dispatch="false"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="DrawArrays" offset="310" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <param name="first" type="GLint"/> + <param name="count" type="GLsizei"/> + <glx rop="193" handcode="true"/> + </function> + + <function name="DrawElements" offset="311" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + <glx handcode="true"/> + </function--> + + <function name="EdgeFlagPointer" offset="312" static_dispatch="false"> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <!--function name="EnableClientState" offset="313" static_dispatch="false"> + <param name="array" type="GLenum"/> + <glx handcode="true"/> + </function> + + <function name="GetPointerv" offset="329" static_dispatch="false"> + <param name="pname" type="GLenum"/> + <param name="params" type="GLvoid **" output="true"/> + <glx handcode="true"/> + </function--> + + <function name="IndexPointer" offset="314" static_dispatch="false"> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="InterleavedArrays" offset="317" static_dispatch="false"> + <param name="format" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <!--function name="NormalPointer" offset="318" static_dispatch="false"> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="TexCoordPointer" offset="320" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="VertexPointer" offset="321" static_dispatch="false"> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="PolygonOffset" offset="319" static_dispatch="false"> + <param name="factor" type="GLfloat"/> + <param name="units" type="GLfloat"/> + <glx rop="192"/> + </function--> + + <function name="CopyTexImage1D" offset="323" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="border" type="GLint"/> + <glx rop="4119"/> + </function> + + <!--function name="CopyTexImage2D" offset="324" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <glx rop="4120"/> + </function--> + + <function name="CopyTexSubImage1D" offset="325" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <glx rop="4121"/> + </function> + + <!--function name="CopyTexSubImage2D" offset="326" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4122"/> + </function--> + + <function name="TexSubImage1D" offset="332" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_xoff="xoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4099" large="true"/> + </function> + + <!--function name="TexSubImage2D" offset="333" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4100" large="true"/> + </function--> + + <function name="AreTexturesResident" offset="322" static_dispatch="false"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="const GLuint *" count="n"/> + <param name="residences" type="GLboolean *" output="true" count="n"/> + <return type="GLboolean"/> + <glx sop="143" handcode="client" always_array="true"/> + </function> + + <!--function name="BindTexture" offset="307" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="texture" type="GLuint"/> + <glx rop="4117"/> + </function> + + <function name="DeleteTextures" offset="327" static_dispatch="false"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="const GLuint *" count="n"/> + <glx sop="144"/> + </function> + + <function name="GenTextures" offset="328" static_dispatch="false"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="GLuint *" output="true" count="n"/> + <glx sop="145" always_array="true"/> + </function> + + <function name="IsTexture" offset="330" static_dispatch="false"> + <param name="texture" type="GLuint"/> + <return type="GLboolean"/> + <glx sop="146"/> + </function--> + + <function name="PrioritizeTextures" offset="331" static_dispatch="false"> + <param name="n" type="GLsizei" counter="true"/> + <param name="textures" type="const GLuint *" count="n"/> + <param name="priorities" type="const GLclampf *" count="n"/> + <glx rop="4118"/> + </function> + + <function name="Indexub" offset="315" vectorequiv="Indexubv" static_dispatch="false"> + <param name="c" type="GLubyte"/> + </function> + + <function name="Indexubv" offset="316" static_dispatch="false"> + <param name="c" type="const GLubyte *" count="1"/> + <glx rop="194"/> + </function> + + <function name="PopClientAttrib" offset="334" static_dispatch="false"> + <glx handcode="true"/> + </function> + + <function name="PushClientAttrib" offset="335" static_dispatch="false"> + <param name="mask" type="GLbitfield"/> + <glx handcode="true"/> + </function> +</category> + +<category name="1.2"> + <!--function name="BlendColor" offset="336" static_dispatch="false"> + <param name="red" type="GLclampf"/> + <param name="green" type="GLclampf"/> + <param name="blue" type="GLclampf"/> + <param name="alpha" type="GLclampf"/> + <glx rop="4096"/> + </function> + + <function name="BlendEquation" offset="337" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <glx rop="4097"/> + </function--> + + <function name="DrawRangeElements" offset="338" static_dispatch="false"> + <param name="mode" type="GLenum"/> + <param name="start" type="GLuint"/> + <param name="end" type="GLuint"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + <glx handcode="true"/> + </function> + + <function name="ColorTable" offset="339" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="table" type="const GLvoid *" img_width="width" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/> + <glx rop="2053" large="true"/> + </function> + + <function name="ColorTableParameterfv" offset="340" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="2054"/> + </function> + + <function name="ColorTableParameteriv" offset="341" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="2055"/> + </function> + + <function name="CopyColorTable" offset="342" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <glx rop="2056"/> + </function> + + <function name="GetColorTable" offset="343" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/> + <glx sop="147" dimensions_in_reply="true"/> + </function> + + <function name="GetColorTableParameterfv" offset="344" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="148"/> + </function> + + <function name="GetColorTableParameteriv" offset="345" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="149"/> + </function> + + <function name="ColorSubTable" offset="346" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="start" type="GLsizei"/> + <param name="count" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="data" type="const GLvoid *" img_width="count" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/> + <glx rop="195" large="true"/> + </function> + + <function name="CopyColorSubTable" offset="347" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="start" type="GLsizei"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <glx rop="196"/> + </function> + + <function name="ConvolutionFilter1D" offset="348" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="image" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4101" large="true"/> + </function> + + <function name="ConvolutionFilter2D" offset="349" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="image" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4102" large="true"/> + </function> + + <function name="ConvolutionParameterf" offset="350" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat"/> + <glx rop="4103"/> + </function> + + <function name="ConvolutionParameterfv" offset="351" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLfloat *" variable_param="pname"/> + <glx rop="4104"/> + </function> + + <function name="ConvolutionParameteri" offset="352" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint"/> + <glx rop="4105"/> + </function> + + <function name="ConvolutionParameteriv" offset="353" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="const GLint *" variable_param="pname"/> + <glx rop="4106"/> + </function> + + <function name="CopyConvolutionFilter1D" offset="354" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <glx rop="4107"/> + </function> + + <function name="CopyConvolutionFilter2D" offset="355" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4108"/> + </function> + + <function name="GetConvolutionFilter" offset="356" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/> + <glx sop="150" dimensions_in_reply="true"/> + </function> + + <function name="GetConvolutionParameterfv" offset="357" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="151"/> + </function> + + <function name="GetConvolutionParameteriv" offset="358" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="152"/> + </function> + + <function name="GetSeparableFilter" offset="359" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="row" type="GLvoid *" output="true"/> + <param name="column" type="GLvoid *" output="true"/> + <param name="span" type="GLvoid *" output="true"/> + <glx sop="153" handcode="true"/> + </function> + + <function name="SeparableFilter2D" offset="360" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="row" type="const GLvoid *"/> + <param name="column" type="const GLvoid *"/> + <glx rop="4109" handcode="true"/> + </function> + + <function name="GetHistogram" offset="361" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="reset" type="GLboolean"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/> + <glx sop="154" dimensions_in_reply="true" img_reset="reset"/> + </function> + + <function name="GetHistogramParameterfv" offset="362" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="155"/> + </function> + + <function name="GetHistogramParameteriv" offset="363" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="156"/> + </function> + + <function name="GetMinmax" offset="364" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="reset" type="GLboolean"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/> + <glx sop="157" img_reset="reset"/> + </function> + + <function name="GetMinmaxParameterfv" offset="365" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLfloat *" output="true" variable_param="pname"/> + <glx sop="158"/> + </function> + + <function name="GetMinmaxParameteriv" offset="366" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *" output="true" variable_param="pname"/> + <glx sop="159"/> + </function> + + <function name="Histogram" offset="367" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="internalformat" type="GLenum"/> + <param name="sink" type="GLboolean"/> + <glx rop="4110"/> + </function> + + <function name="Minmax" offset="368" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="sink" type="GLboolean"/> + <glx rop="4111"/> + </function> + + <function name="ResetHistogram" offset="369" static_dispatch="false"> + <param name="target" type="GLenum"/> + <glx rop="4112"/> + </function> + + <function name="ResetMinmax" offset="370" static_dispatch="false"> + <param name="target" type="GLenum"/> + <glx rop="4113"/> + </function> + + <!--function name="TexImage3D" offset="371" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalformat" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/> + <glx rop="4114" large="true"/> + </function> + + <function name="TexSubImage3D" offset="372" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="UNUSED" type="GLuint" padding="true"/> + <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/> + <glx rop="4115" large="true"/> + </function> + + <function name="CopyTexSubImage3D" offset="373" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <glx rop="4123"/> + </function--> +</category> + +<category name="GL_ARB_multitexture" number="1"> + <!--function name="ActiveTextureARB" offset="374" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx rop="197"/> + </function> + + <function name="ClientActiveTextureARB" offset="375" static_dispatch="false"> + <param name="texture" type="GLenum"/> + <glx handcode="true"/> + </function--> + + <function name="MultiTexCoord1dARB" offset="376" vectorequiv="MultiTexCoord1dvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLdouble"/> + </function> + + <function name="MultiTexCoord1dvARB" offset="377" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLdouble *" count="1"/> + <glx rop="198"/> + </function> + + <function name="MultiTexCoord1fARB" offset="378" vectorequiv="MultiTexCoord1fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + </function> + + <function name="MultiTexCoord1fvARB" offset="379" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLfloat *" count="1"/> + <glx rop="199"/> + </function> + + <function name="MultiTexCoord1iARB" offset="380" vectorequiv="MultiTexCoord1ivARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLint"/> + </function> + + <function name="MultiTexCoord1ivARB" offset="381" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLint *" count="1"/> + <glx rop="200"/> + </function> + + <function name="MultiTexCoord1sARB" offset="382" vectorequiv="MultiTexCoord1svARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLshort"/> + </function> + + <function name="MultiTexCoord1svARB" offset="383" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLshort *" count="1"/> + <glx rop="201"/> + </function> + + <function name="MultiTexCoord2dARB" offset="384" vectorequiv="MultiTexCoord2dvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + </function> + + <function name="MultiTexCoord2dvARB" offset="385" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLdouble *" count="2"/> + <glx rop="202"/> + </function> + + <function name="MultiTexCoord2fARB" offset="386" vectorequiv="MultiTexCoord2fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + </function> + + <function name="MultiTexCoord2fvARB" offset="387" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLfloat *" count="2"/> + <glx rop="203"/> + </function> + + <function name="MultiTexCoord2iARB" offset="388" vectorequiv="MultiTexCoord2ivARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + </function> + + <function name="MultiTexCoord2ivARB" offset="389" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLint *" count="2"/> + <glx rop="204"/> + </function> + + <function name="MultiTexCoord2sARB" offset="390" vectorequiv="MultiTexCoord2svARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + </function> + + <function name="MultiTexCoord2svARB" offset="391" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLshort *" count="2"/> + <glx rop="205"/> + </function> + + <function name="MultiTexCoord3dARB" offset="392" vectorequiv="MultiTexCoord3dvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + <param name="r" type="GLdouble"/> + </function> + + <function name="MultiTexCoord3dvARB" offset="393" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLdouble *" count="3"/> + <glx rop="206"/> + </function> + + <function name="MultiTexCoord3fARB" offset="394" vectorequiv="MultiTexCoord3fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + </function> + + <function name="MultiTexCoord3fvARB" offset="395" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLfloat *" count="3"/> + <glx rop="207"/> + </function> + + <function name="MultiTexCoord3iARB" offset="396" vectorequiv="MultiTexCoord3ivARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + <param name="r" type="GLint"/> + </function> + + <function name="MultiTexCoord3ivARB" offset="397" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLint *" count="3"/> + <glx rop="208"/> + </function> + + <function name="MultiTexCoord3sARB" offset="398" vectorequiv="MultiTexCoord3svARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + <param name="r" type="GLshort"/> + </function> + + <function name="MultiTexCoord3svARB" offset="399" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLshort *" count="3"/> + <glx rop="209"/> + </function> + + <function name="MultiTexCoord4dARB" offset="400" vectorequiv="MultiTexCoord4dvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLdouble"/> + <param name="t" type="GLdouble"/> + <param name="r" type="GLdouble"/> + <param name="q" type="GLdouble"/> + </function> + + <function name="MultiTexCoord4dvARB" offset="401" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLdouble *" count="4"/> + <glx rop="210"/> + </function> + + <!--function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLfloat"/> + <param name="t" type="GLfloat"/> + <param name="r" type="GLfloat"/> + <param name="q" type="GLfloat"/> + </function--> + + <function name="MultiTexCoord4fvARB" offset="403" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLfloat *" count="4"/> + <glx rop="211"/> + </function> + + <function name="MultiTexCoord4iARB" offset="404" vectorequiv="MultiTexCoord4ivARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLint"/> + <param name="t" type="GLint"/> + <param name="r" type="GLint"/> + <param name="q" type="GLint"/> + </function> + + <function name="MultiTexCoord4ivARB" offset="405" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLint *" count="4"/> + <glx rop="212"/> + </function> + + <function name="MultiTexCoord4sARB" offset="406" vectorequiv="MultiTexCoord4svARB" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="s" type="GLshort"/> + <param name="t" type="GLshort"/> + <param name="r" type="GLshort"/> + <param name="q" type="GLshort"/> + </function> + + <function name="MultiTexCoord4svARB" offset="407" static_dispatch="false"> + <param name="target" type="GLenum"/> + <param name="v" type="const GLshort *" count="4"/> + <glx rop="213"/> + </function> +</category> + +<xi:include href="../../glapi/APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/es_EXT.xml b/src/mesa/es/glapi/es_EXT.xml new file mode 100644 index 0000000000..b76cda929a --- /dev/null +++ b/src/mesa/es/glapi/es_EXT.xml @@ -0,0 +1,122 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "../../glapi/gl_API.dtd"> + +<!-- OpenGL ES extensions --> + +<OpenGLAPI> + +<category name="GL_OES_compressed_paletted_texture" number="6"> + <enum name="PALETTE4_RGB8_OES" value="0x8B90"/> + <enum name="PALETTE4_RGBA8_OES" value="0x8B91"/> + <enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/> + <enum name="PALETTE4_RGBA4_OES" value="0x8B93"/> + <enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/> + <enum name="PALETTE8_RGB8_OES" value="0x8B95"/> + <enum name="PALETTE8_RGBA8_OES" value="0x8B96"/> + <enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/> + <enum name="PALETTE8_RGBA4_OES" value="0x8B98"/> + <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/> +</category> + +<category name="GL_OES_depth24" number="24"> + <enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/> +</category> + +<category name="GL_OES_depth32" number="25"> + <enum name="DEPTH_COMPONENT32_OES" value="0x81A7"/> +</category> + +<category name="GL_OES_element_index_uint" number="26"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_OES_fbo_render_mipmap" number="27"> + <!-- No new functions, types, enums. --> +</category> + +<category name="GL_OES_mapbuffer" number="29"> + <enum name="WRITE_ONLY_OES" value="0x88B9"/> + <enum name="BUFFER_ACCESS_OES" value="0x88BB"/> + <enum name="BUFFER_MAPPED_OES" value="0x88BC"/> + <enum name="BUFFER_MAP_POINTER_OES" value="0x88BD"/> + + <function name="GetBufferPointervOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLvoid **"/> + </function> + + <function name="MapBufferOES" offset="assign"> + <param name="target" type="GLenum"/> + <param name="access" type="GLenum"/> + <return type="GLvoid *"/> + </function> + + <function name="UnmapBufferOES" offset="assign"> + <param name="target" type="GLenum"/> + <return type="GLboolean"/> + </function> +</category> + +<category name="GL_OES_rgb8_rgba8" number="30"> + <enum name="RGB8_OES" value="0x8051"/> + <enum name="RGBA8_OES" value="0x8058"/> +</category> + +<category name="GL_OES_stencil1" number="31"> + <enum name="STENCIL_INDEX1_OES" value="0x8D46"/> +</category> + +<category name="GL_OES_stencil4" number="32"> + <enum name="STENCIL_INDEX4_OES" value="0x8D47"/> +</category> + +<category name="GL_OES_stencil8" number="33"> + <enum name="STENCIL_INDEX8_OES" value="0x8D48"/> +</category> + +<category name="GL_EXT_texture_filter_anisotropic" number="41"> + <enum name="TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FE"/> + <enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" value="0x84FF"/> +</category> + +<category name="GL_EXT_texture_compression_dxt1" number="49"> + <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/> + <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/> +</category> + +<category name="GL_EXT_texture_format_BGRA8888" number="51"> + <enum name="BGRA_EXT" value="0x80E1"/> +</category> + +<category name="GL_EXT_blend_minmax" number="65"> + <enum name="MIN_EXT" value="0x8007"/> + <enum name="MAX_EXT" value="0x8008"/> +</category> + +<category name="GL_EXT_read_format_bgra" number="66"> + <enum name="BGRA_EXT" value="0x80E1"/> + <enum name="UNSIGNED_SHORT_4_4_4_4_REV_EXT" value="0x8365"/> + <enum name="UNSIGNED_SHORT_1_5_5_5_REV_EXT" value="0x8366"/> +</category> + +<category name="GL_EXT_multi_draw_arrays" number="69"> + <function name="MultiDrawArraysEXT" offset="assign"> + <param name="mode" type="GLenum"/> + <param name="first" type="GLint *"/> <!-- Spec bug. Should be const. --> + <param name="count" type="GLsizei *"/> <!-- Spec bug. Should be const. --> + <param name="primcount" type="GLsizei"/> + <glx handcode="true"/> + </function> + + <function name="MultiDrawElementsEXT" offset="assign"> + <param name="mode" type="GLenum"/> + <param name="count" type="const GLsizei *"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid **"/> + <param name="primcount" type="GLsizei"/> + <glx handcode="true"/> + </function> +</category> + +</OpenGLAPI> diff --git a/src/mesa/es/glapi/gl_compare.py b/src/mesa/es/glapi/gl_compare.py new file mode 100644 index 0000000000..7a2148cb1f --- /dev/null +++ b/src/mesa/es/glapi/gl_compare.py @@ -0,0 +1,354 @@ +#!/usr/bin/python +# +# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import sys +import os.path +import getopt + +GLAPI = "../../glapi" +sys.path.append(GLAPI) + +import gl_XML +import glX_XML + +class ApiSet(object): + def __init__(self, api, elts=["enum", "type", "function"]): + self.api = api + self.elts = elts + + def _check_enum(self, e1, e2, strict=True): + if e1.name != e2.name: + raise ValueError("%s: name mismatch" % e1.name) + if e1.value != e2.value: + raise ValueError("%s: value 0x%04x != 0x%04x" + % (e1.name, e1.value, e2.value)) + + def _check_type(self, t1, t2, strict=True): + if t1.name != t2.name: + raise ValueError("%s: name mismatch" % t1.name) + if t1.type_expr.string() != t2.type_expr.string(): + raise ValueError("%s: type %s != %s" + % (t1.name, t1.type_expr.string(), t2.type_expr.string())) + + def _check_function(self, f1, f2, strict=True): + if f1.name != f2.name: + raise ValueError("%s: name mismatch" % f1.name) + if f1.return_type != f2.return_type: + raise ValueError("%s: return type %s != %s" + % (f1.name, f1.return_type, f2.return_type)) + # there might be padded parameters + if strict and len(f1.parameters) != len(f2.parameters): + raise ValueError("%s: parameter length %d != %d" + % (f1.name, len(f1.parameters), len(f2.parameters))) + if f1.assign_offset != f2.assign_offset: + if ((f1.assign_offset and f2.offset < 0) or + (f2.assign_offset and f1.offset < 0)): + raise ValueError("%s: assign offset %d != %d" + % (f1.name, f1.assign_offset, f2.assign_offset)) + elif not f1.assign_offset: + if f1.offset != f2.offset: + raise ValueError("%s: offset %d != %d" + % (f1.name, f1.offset, f2.offset)) + + if strict: + l1 = f1.entry_points + l2 = f2.entry_points + l1.sort() + l2.sort() + if l1 != l2: + raise ValueError("%s: entry points %s != %s" + % (f1.name, l1, l2)) + + l1 = f1.static_entry_points + l2 = f2.static_entry_points + l1.sort() + l2.sort() + if l1 != l2: + raise ValueError("%s: static entry points %s != %s" + % (f1.name, l1, l2)) + + pad = 0 + for i in xrange(len(f1.parameters)): + p1 = f1.parameters[i] + p2 = f2.parameters[i + pad] + + if not strict and p1.is_padding != p2.is_padding: + if p1.is_padding: + pad -= 1 + continue + else: + pad += 1 + p2 = f2.parameters[i + pad] + + if strict and p1.name != p2.name: + raise ValueError("%s: parameter %d name %s != %s" + % (f1.name, i, p1.name, p2.name)) + if p1.type_expr.string() != p2.type_expr.string(): + if (strict or + # special case + f1.name == "TexImage2D" and p1.name != "internalformat"): + raise ValueError("%s: parameter %s type %s != %s" + % (f1.name, p1.name, p1.type_expr.string(), + p2.type_expr.string())) + + def union(self, other): + union = gl_XML.gl_api(None) + + if "enum" in self.elts: + union.enums_by_name = other.enums_by_name.copy() + for key, val in self.api.enums_by_name.iteritems(): + if key not in union.enums_by_name: + union.enums_by_name[key] = val + else: + self._check_enum(val, other.enums_by_name[key]) + + if "type" in self.elts: + union.types_by_name = other.types_by_name.copy() + for key, val in self.api.types_by_name.iteritems(): + if key not in union.types_by_name: + union.types_by_name[key] = val + else: + self._check_type(val, other.types_by_name[key]) + + if "function" in self.elts: + union.functions_by_name = other.functions_by_name.copy() + for key, val in self.api.functions_by_name.iteritems(): + if key not in union.functions_by_name: + union.functions_by_name[key] = val + else: + self._check_function(val, other.functions_by_name[key]) + + return union + + def intersection(self, other): + intersection = gl_XML.gl_api(None) + + if "enum" in self.elts: + for key, val in self.api.enums_by_name.iteritems(): + if key in other.enums_by_name: + self._check_enum(val, other.enums_by_name[key]) + intersection.enums_by_name[key] = val + + if "type" in self.elts: + for key, val in self.api.types_by_name.iteritems(): + if key in other.types_by_name: + self._check_type(val, other.types_by_name[key]) + intersection.types_by_name[key] = val + + if "function" in self.elts: + for key, val in self.api.functions_by_name.iteritems(): + if key in other.functions_by_name: + self._check_function(val, other.functions_by_name[key]) + intersection.functions_by_name[key] = val + + return intersection + + def difference(self, other): + difference = gl_XML.gl_api(None) + + if "enum" in self.elts: + for key, val in self.api.enums_by_name.iteritems(): + if key not in other.enums_by_name: + difference.enums_by_name[key] = val + else: + self._check_enum(val, other.enums_by_name[key]) + + if "type" in self.elts: + for key, val in self.api.types_by_name.iteritems(): + if key not in other.types_by_name: + difference.types_by_name[key] = val + else: + self._check_type(val, other.types_by_name[key]) + + if "function" in self.elts: + for key, val in self.api.functions_by_name.iteritems(): + if key not in other.functions_by_name: + difference.functions_by_name[key] = val + else: + self._check_function(val, other.functions_by_name[key], False) + + return difference + +def cmp_enum(e1, e2): + if e1.value < e2.value: + return -1 + elif e1.value > e2.value: + return 1 + else: + return 0 + +def cmp_type(t1, t2): + return t1.size - t2.size + +def cmp_function(f1, f2): + if f1.name > f2.name: + return 1 + elif f1.name < f2.name: + return -1 + else: + return 0 + +def spaces(n, str=""): + spaces = n - len(str) + if spaces < 1: + spaces = 1 + return " " * spaces + +def output_enum(e, indent=0): + attrs = 'name="%s"' % e.name + if e.default_count > 0: + tab = spaces(37, attrs) + attrs += '%scount="%d"' % (tab, e.default_count) + tab = spaces(48, attrs) + val = "%04x" % e.value + val = "0x" + val.upper() + attrs += '%svalue="%s"' % (tab, val) + + # no child + if not e.functions: + print '%s<enum %s/>' % (spaces(indent), attrs) + return + + print '%s<enum %s>' % (spaces(indent), attrs) + for key, val in e.functions.iteritems(): + attrs = 'name="%s"' % key + if val[0] != e.default_count: + attrs += ' count="%d"' % val[0] + if not val[1]: + attrs += ' mode="get"' + + print '%s<size %s/>' % (spaces(indent * 2), attrs) + + print '%s</enum>' % spaces(indent) + +def output_type(t, indent=0): + tab = spaces(16, t.name) + attrs = 'name="%s"%ssize="%d"' % (t.name, tab, t.size) + ctype = t.type_expr.string() + if ctype.find("unsigned") != -1: + attrs += ' unsigned="true"' + elif ctype.find("signed") == -1: + attrs += ' float="true"' + print '%s<type %s/>' % (spaces(indent), attrs) + +def output_function(f, indent=0): + attrs = 'name="%s"' % f.name + if f.offset > 0: + if f.assign_offset: + attrs += ' offset="assign"' + else: + attrs += ' offset="%d"' % f.offset + print '%s<function %s>' % (spaces(indent), attrs) + + for p in f.parameters: + attrs = 'name="%s" type="%s"' \ + % (p.name, p.type_expr.original_string) + print '%s<param %s/>' % (spaces(indent * 2), attrs) + if f.return_type != "void": + attrs = 'type="%s"' % f.return_type + print '%s<return %s/>' % (spaces(indent * 2), attrs) + + print '%s</function>' % spaces(indent) + +def output_category(api, indent=0): + enums = api.enums_by_name.values() + enums.sort(cmp_enum) + types = api.types_by_name.values() + types.sort(cmp_type) + functions = api.functions_by_name.values() + functions.sort(cmp_function) + + for e in enums: + output_enum(e, indent) + if enums and types: + print + for t in types: + output_type(t, indent) + if enums or types: + print + for f in functions: + output_function(f, indent) + if f != functions[-1]: + print + +def is_api_empty(api): + return bool(not api.enums_by_name and + not api.types_by_name and + not api.functions_by_name) + +def show_usage(ops): + print "Usage: %s [-k elts] <%s> <file1> <file2>" % (sys.argv[0], "|".join(ops)) + print " -k elts A comma separated string of types of elements to" + print " skip. Possible types are enum, type, and function." + sys.exit(1) + +def main(): + ops = ["union", "intersection", "difference"] + elts = ["enum", "type", "function"] + + try: + options, args = getopt.getopt(sys.argv[1:], "k:") + except Exception, e: + show_usage(ops) + + if len(args) != 3: + show_usage(ops) + op, file1, file2 = args + if op not in ops: + show_usage(ops) + + skips = [] + for opt, val in options: + if opt == "-k": + skips = val.split(",") + + for elt in skips: + try: + elts.remove(elt) + except ValueError: + show_usage(ops) + + api1 = gl_XML.parse_GL_API(file1, glX_XML.glx_item_factory()) + api2 = gl_XML.parse_GL_API(file2, glX_XML.glx_item_factory()) + + set = ApiSet(api1, elts) + func = getattr(set, op) + result = func(api2) + + if not is_api_empty(result): + cat_name = "%s_of_%s_and_%s" \ + % (op, os.path.basename(file1), os.path.basename(file2)) + + print '<?xml version="1.0"?>' + print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI + print + print '<OpenGLAPI>' + print + print '<category name="%s">' % (cat_name) + output_category(result, 4) + print '</category>' + print + print '</OpenGLAPI>' + +if __name__ == "__main__": + main() diff --git a/src/mesa/es/glapi/gl_parse_header.py b/src/mesa/es/glapi/gl_parse_header.py new file mode 100644 index 0000000000..8b8d16b395 --- /dev/null +++ b/src/mesa/es/glapi/gl_parse_header.py @@ -0,0 +1,450 @@ +#!/usr/bin/python +# +# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import sys +import os.path +import getopt +import re + +GLAPI = "../../glapi" +sys.path.append(GLAPI) + +class HeaderParser(object): + """Parser for GL header files.""" + + def __init__(self, verbose=0): + # match #if and #ifdef + self.IFDEF = re.compile('#\s*if(n?def\s+(?P<ifdef>\w+)|\s+(?P<if>.+))') + # match #endif + self.ENDIF = re.compile('#\s*endif') + # match typedef abc def; + self.TYPEDEF = re.compile('typedef\s+(?P<from>[\w ]+)\s+(?P<to>\w+);') + # match #define XYZ VAL + self.DEFINE = re.compile('#\s*define\s+(?P<key>\w+)(?P<value>\s+[\w"]*)?') + # match GLAPI + self.GLAPI = re.compile('^GL_?API(CALL)?\s+(?P<return>[\w\s*]+[\w*])\s+(GL)?_?APIENTRY\s+(?P<name>\w+)\s*\((?P<params>[\w\s(,*\[\])]+)\)\s*;') + + self.split_params = re.compile('\s*,\s*') + self.split_ctype = re.compile('(\W)') + # ignore GL_VERSION_X_Y + self.ignore_enum = re.compile('GL(_ES)?_VERSION(_ES_C[ML])?_\d_\d') + + self.verbose = verbose + self._reset() + + def _reset(self): + """Reset to initial state.""" + self.ifdef_levels = [] + self.need_char = False + + # use typeexpr? + def _format_ctype(self, ctype, fix=True): + """Format a ctype string, optionally fix it.""" + # split the type string + tmp = self.split_ctype.split(ctype) + tmp = [s for s in tmp if s and s != " "] + + pretty = "" + for i in xrange(len(tmp)): + # add missing GL prefix + if (fix and tmp[i] != "const" and tmp[i] != "*" and + not tmp[i].startswith("GL")): + tmp[i] = "GL" + tmp[i] + + if i == 0: + pretty = tmp[i] + else: + sep = " " + if tmp[i - 1] == "*": + sep = "" + pretty += sep + tmp[i] + return pretty + + # use typeexpr? + def _get_ctype_attrs(self, ctype): + """Get the attributes of a ctype.""" + is_float = (ctype.find("float") != -1 or ctype.find("double") != -1) + is_signed = not (ctype.find("unsigned") != -1) + + size = 0 + if ctype.find("char") != -1: + size = 1 + elif ctype.find("short") != -1: + size = 2 + elif ctype.find("int") != -1: + size = 4 + elif is_float: + if ctype.find("float") != -1: + size = 4 + else: + size = 8 + + return (size, is_float, is_signed) + + def _parse_define(self, line): + """Parse a #define line for an <enum>.""" + m = self.DEFINE.search(line) + if not m: + if self.verbose and line.find("#define") >= 0: + print "ignore %s" % (line) + return None + + key = m.group("key").strip() + val = m.group("value").strip() + + # enum must begin with GL_ and be all uppercase + if ((not (key.startswith("GL_") and key.isupper())) or + (self.ignore_enum.match(key) and val == "1")): + if self.verbose: + print "ignore enum %s" % (key) + return None + + return (key, val) + + def _parse_typedef(self, line): + """Parse a typedef line for a <type>.""" + m = self.TYPEDEF.search(line) + if not m: + if self.verbose and line.find("typedef") >= 0: + print "ignore %s" % (line) + return None + + f = m.group("from").strip() + t = m.group("to").strip() + if not t.startswith("GL"): + if self.verbose: + print "ignore type %s" % (t) + return None + attrs = self._get_ctype_attrs(f) + + return (f, t, attrs) + + def _parse_gl_api(self, line): + """Parse a GLAPI line for a <function>.""" + m = self.GLAPI.search(line) + if not m: + if self.verbose and line.find("APIENTRY") >= 0: + print "ignore %s" % (line) + return None + + rettype = m.group("return") + rettype = self._format_ctype(rettype) + if rettype == "GLvoid": + rettype = "" + + name = m.group("name") + + param_str = m.group("params") + chunks = self.split_params.split(param_str) + chunks = [s.strip() for s in chunks] + if len(chunks) == 1 and (chunks[0] == "void" or chunks[0] == "GLvoid"): + chunks = [] + + params = [] + for c in chunks: + # split type and variable name + idx = c.rfind("*") + if idx < 0: + idx = c.rfind(" ") + if idx >= 0: + idx += 1 + ctype = c[:idx] + var = c[idx:] + else: + ctype = c + var = "unnamed" + + # convert array to pointer + idx = var.find("[") + if idx >= 0: + var = var[:idx] + ctype += "*" + + ctype = self._format_ctype(ctype) + var = var.strip() + + if not self.need_char and ctype.find("GLchar") >= 0: + self.need_char = True + + params.append((ctype, var)) + + return (rettype, name, params) + + def _change_level(self, line): + """Parse a #ifdef line and change level.""" + m = self.IFDEF.search(line) + if m: + ifdef = m.group("ifdef") + if not ifdef: + ifdef = m.group("if") + self.ifdef_levels.append(ifdef) + return True + m = self.ENDIF.search(line) + if m: + self.ifdef_levels.pop() + return True + return False + + def _read_header(self, header): + """Open a header file and read its contents.""" + lines = [] + try: + fp = open(header, "rb") + lines = fp.readlines() + fp.close() + except IOError, e: + print "failed to read %s: %s" % (header, e) + return lines + + def _cmp_enum(self, enum1, enum2): + """Compare two enums.""" + # sort by length of the values as strings + val1 = enum1[1] + val2 = enum2[1] + ret = len(val1) - len(val2) + # sort by the values + if not ret: + val1 = int(val1, 16) + val2 = int(val2, 16) + ret = val1 - val2 + # in case int cannot hold the result + if ret > 0: + ret = 1 + elif ret < 0: + ret = -1 + # sort by the names + if not ret: + if enum1[0] < enum2[0]: + ret = -1 + elif enum1[0] > enum2[0]: + ret = 1 + return ret + + def _cmp_type(self, type1, type2): + """Compare two types.""" + attrs1 = type1[2] + attrs2 = type2[2] + # sort by type size + ret = attrs1[0] - attrs2[0] + # float is larger + if not ret: + ret = attrs1[1] - attrs2[1] + # signed is larger + if not ret: + ret = attrs1[2] - attrs2[2] + # reverse + ret = -ret + return ret + + def _cmp_function(self, func1, func2): + """Compare two functions.""" + name1 = func1[1] + name2 = func2[1] + ret = 0 + # sort by the names + if name1 < name2: + ret = -1 + elif name1 > name2: + ret = 1 + return ret + + def _postprocess_dict(self, hdict): + """Post-process a header dict and return an ordered list.""" + hlist = [] + largest = 0 + for key, cat in hdict.iteritems(): + size = len(cat["enums"]) + len(cat["types"]) + len(cat["functions"]) + # ignore empty category + if not size: + continue + + cat["enums"].sort(self._cmp_enum) + # remove duplicates + dup = [] + for i in xrange(1, len(cat["enums"])): + if cat["enums"][i] == cat["enums"][i - 1]: + dup.insert(0, i) + for i in dup: + e = cat["enums"].pop(i) + if self.verbose: + print "remove duplicate enum %s" % e[0] + + cat["types"].sort(self._cmp_type) + cat["functions"].sort(self._cmp_function) + + # largest category comes first + if size > largest: + hlist.insert(0, (key, cat)) + largest = size + else: + hlist.append((key, cat)) + return hlist + + def parse(self, header): + """Parse a header file.""" + self._reset() + + if self.verbose: + print "Parsing %s" % (header) + + hdict = {} + lines = self._read_header(header) + for line in lines: + if self._change_level(line): + continue + + # skip until the first ifdef (i.e. __gl_h_) + if not self.ifdef_levels: + continue + + cat_name = os.path.basename(header) + # check if we are in an extension + if (len(self.ifdef_levels) > 1 and + self.ifdef_levels[-1].startswith("GL_")): + cat_name = self.ifdef_levels[-1] + + try: + cat = hdict[cat_name] + except KeyError: + cat = { + "enums": [], + "types": [], + "functions": [] + } + hdict[cat_name] = cat + + key = "enums" + elem = self._parse_define(line) + if not elem: + key = "types" + elem = self._parse_typedef(line) + if not elem: + key = "functions" + elem = self._parse_gl_api(line) + + if elem: + cat[key].append(elem) + + if self.need_char: + if self.verbose: + print "define GLchar" + elem = self._parse_typedef("typedef char GLchar;") + cat["types"].append(elem) + return self._postprocess_dict(hdict) + +def spaces(n, str=""): + spaces = n - len(str) + if spaces < 1: + spaces = 1 + return " " * spaces + +def output_xml(name, hlist): + """Output a parsed header in OpenGLAPI XML.""" + + for i in xrange(len(hlist)): + cat_name, cat = hlist[i] + + print '<category name="%s">' % (cat_name) + indent = 4 + + for enum in cat["enums"]: + name = enum[0][3:] + value = enum[1] + tab = spaces(41, name) + attrs = 'name="%s"%svalue="%s"' % (name, tab, value) + print '%s<enum %s/>' % (spaces(indent), attrs) + + if cat["enums"] and cat["types"]: + print + + for type in cat["types"]: + ctype = type[0] + size, is_float, is_signed = type[2] + + attrs = 'name="%s"' % (type[1][2:]) + attrs += spaces(16, attrs) + 'size="%d"' % (size) + if is_float: + attrs += ' float="true"' + elif not is_signed: + attrs += ' unsigned="true"' + + print '%s<type %s/>' % (spaces(indent), attrs) + + for func in cat["functions"]: + print + ret = func[0] + name = func[1][2:] + params = func[2] + + attrs = 'name="%s" offset="assign"' % name + print '%s<function %s>' % (spaces(indent), attrs) + + for param in params: + attrs = 'name="%s" type="%s"' % (param[1], param[0]) + print '%s<param %s/>' % (spaces(indent * 2), attrs) + if ret: + attrs = 'type="%s"' % ret + print '%s<return %s/>' % (spaces(indent * 2), attrs) + + print '%s</function>' % spaces(indent) + + print '</category>' + print + +def show_usage(): + print "Usage: %s [-v] <header> ..." % sys.argv[0] + sys.exit(1) + +def main(): + try: + args, headers = getopt.getopt(sys.argv[1:], "v") + except Exception, e: + show_usage() + if not headers: + show_usage() + + verbose = 0 + for arg in args: + if arg[0] == "-v": + verbose += 1 + + need_xml_header = True + parser = HeaderParser(verbose) + for h in headers: + h = os.path.abspath(h) + hlist = parser.parse(h) + + if need_xml_header: + print '<?xml version="1.0"?>' + print '<!DOCTYPE OpenGLAPI SYSTEM "%s/gl_API.dtd">' % GLAPI + need_xml_header = False + + print + print '<!-- %s -->' % (h) + print '<OpenGLAPI>' + print + output_xml(h, hlist) + print '</OpenGLAPI>' + +if __name__ == '__main__': + main() diff --git a/src/mesa/es/main/APIspec.dtd b/src/mesa/es/main/APIspec.dtd new file mode 100644 index 0000000000..efcfa31f10 --- /dev/null +++ b/src/mesa/es/main/APIspec.dtd @@ -0,0 +1,52 @@ +<!ELEMENT apispec (template|api)+> + +<!ELEMENT api (category*, function*)> +<!ELEMENT category EMPTY> +<!ELEMENT function EMPTY> + +<!ELEMENT template (proto, desc*)> +<!ELEMENT proto (return, (param|vector)*)> +<!ELEMENT return EMPTY> +<!ELEMENT param EMPTY> +<!ELEMENT vector (param*)> +<!ELEMENT desc ((value|range)*, desc*)> +<!ELEMENT value EMPTY> +<!ELEMENT range EMPTY> + +<!ATTLIST api name NMTOKEN #REQUIRED + implementation (true | false) "false"> +<!ATTLIST category name NMTOKEN #REQUIRED> +<!ATTLIST function name NMTOKEN #REQUIRED + default_prefix NMTOKEN "_mesa_" + external (true | false) "false" + template NMTOKEN #REQUIRED + gltype CDATA #IMPLIED + vector_size NMTOKEN #IMPLIED + expand_vector (true | false) "false" + skip_desc (true | false) "false"> + +<!ATTLIST template name NMTOKEN #REQUIRED + direction (set | get) "set"> + +<!ATTLIST return type CDATA #REQUIRED> +<!ATTLIST param name NMTOKEN #REQUIRED + type CDATA #REQUIRED + hide_if_expanded (true | false) "false" + category NMTOKEN #IMPLIED> +<!ATTLIST vector name NMTOKEN #REQUIRED + type CDATA #REQUIRED + size NMTOKEN #REQUIRED + category NMTOKEN #IMPLIED> + +<!ATTLIST desc name NMTOKEN #REQUIRED + vector_size CDATA #IMPLIED + convert (true | false) #IMPLIED + error NMTOKEN "GL_INVALID_ENUM" + category NMTOKEN #IMPLIED> + +<!ATTLIST value name CDATA #REQUIRED + category NMTOKEN #IMPLIED> +<!ATTLIST range from NMTOKEN #REQUIRED + to NMTOKEN #REQUIRED + base NMTOKEN #IMPLIED + category NMTOKEN #IMPLIED> diff --git a/src/mesa/es/main/APIspec.py b/src/mesa/es/main/APIspec.py new file mode 100644 index 0000000000..6947f7301c --- /dev/null +++ b/src/mesa/es/main/APIspec.py @@ -0,0 +1,617 @@ +#!/usr/bin/python +# +# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +""" +A parser for APIspec. +""" + +class SpecError(Exception): + """Error in the spec file.""" + + +class Spec(object): + """A Spec is an abstraction of the API spec.""" + + def __init__(self, doc): + self.doc = doc + + self.spec_node = doc.getRootElement() + self.tmpl_nodes = {} + self.api_nodes = {} + self.impl_node = None + + # parse <apispec> + node = self.spec_node.children + while node: + if node.type == "element": + if node.name == "template": + self.tmpl_nodes[node.prop("name")] = node + elif node.name == "api": + self.api_nodes[node.prop("name")] = node + else: + raise SpecError("unexpected node %s in apispec" % + node.name) + node = node.next + + # find an implementation + for name, node in self.api_nodes.iteritems(): + if node.prop("implementation") == "true": + self.impl_node = node + break + if not self.impl_node: + raise SpecError("unable to find an implementation") + + def get_impl(self): + """Return the implementation.""" + return API(self, self.impl_node) + + def get_api(self, name): + """Return an API.""" + return API(self, self.api_nodes[name]) + + +class API(object): + """An API consists of categories and functions.""" + + def __init__(self, spec, api_node): + self.name = api_node.prop("name") + self.is_impl = (api_node.prop("implementation") == "true") + + self.categories = [] + self.functions = [] + + # parse <api> + func_nodes = [] + node = api_node.children + while node: + if node.type == "element": + if node.name == "category": + cat = node.prop("name") + self.categories.append(cat) + elif node.name == "function": + func_nodes.append(node) + else: + raise SpecError("unexpected node %s in api" % node.name) + node = node.next + + # realize functions + for func_node in func_nodes: + tmpl_node = spec.tmpl_nodes[func_node.prop("template")] + try: + func = Function(tmpl_node, func_node, self.is_impl, + self.categories) + except SpecError, e: + func_name = func_node.prop("name") + raise SpecError("failed to parse %s: %s" % (func_name, e)) + self.functions.append(func) + + def match(self, func, conversions={}): + """Find a matching function in the API.""" + match = None + need_conv = False + for f in self.functions: + matched, conv = f.match(func, conversions) + if matched: + match = f + need_conv = conv + # exact match + if not need_conv: + break + return (match, need_conv) + + +class Function(object): + """Parse and realize a <template> node.""" + + def __init__(self, tmpl_node, func_node, force_skip_desc=False, categories=[]): + self.tmpl_name = tmpl_node.prop("name") + self.direction = tmpl_node.prop("direction") + + self.name = func_node.prop("name") + self.prefix = func_node.prop("default_prefix") + self.is_external = (func_node.prop("external") == "true") + + if force_skip_desc: + self._skip_desc = True + else: + self._skip_desc = (func_node.prop("skip_desc") == "true") + + self._categories = categories + + # these attributes decide how the template is realized + self._gltype = func_node.prop("gltype") + if func_node.hasProp("vector_size"): + self._vector_size = int(func_node.prop("vector_size")) + else: + self._vector_size = 0 + self._expand_vector = (func_node.prop("expand_vector") == "true") + + self.return_type = "void" + param_nodes = [] + + # find <proto> + proto_node = tmpl_node.children + while proto_node: + if proto_node.type == "element" and proto_node.name == "proto": + break + proto_node = proto_node.next + if not proto_node: + raise SpecError("no proto") + # and parse it + node = proto_node.children + while node: + if node.type == "element": + if node.name == "return": + self.return_type = node.prop("type") + elif node.name == "param" or node.name == "vector": + if self.support_node(node): + # make sure the node is not hidden + if not (self._expand_vector and + (node.prop("hide_if_expanded") == "true")): + param_nodes.append(node) + else: + raise SpecError("unexpected node %s in proto" % node.name) + node = node.next + + self._init_params(param_nodes) + self._init_descs(tmpl_node, param_nodes) + + def __str__(self): + return "%s %s%s(%s)" % (self.return_type, self.prefix, self.name, + self.param_string(True)) + + def _init_params(self, param_nodes): + """Parse and initialize parameters.""" + self.params = [] + + for param_node in param_nodes: + size = self.param_node_size(param_node) + # when no expansion, vector is just like param + if param_node.name == "param" or not self._expand_vector: + param = Parameter(param_node, self._gltype, size) + self.params.append(param) + continue + + if not size or size > param_node.lsCountNode(): + raise SpecError("could not expand %s with unknown or " + "mismatch sizes" % param.name) + + # expand the vector + expanded_params = [] + child = param_node.children + while child: + if (child.type == "element" and child.name == "param" and + self.support_node(child)): + expanded_params.append(Parameter(child, self._gltype)) + if len(expanded_params) == size: + break + child = child.next + # just in case that lsCountNode counts unknown nodes + if len(expanded_params) < size: + raise SpecError("not enough named parameters") + + self.params.extend(expanded_params) + + def _init_descs(self, tmpl_node, param_nodes): + """Parse and initialize parameter descriptions.""" + self.checker = Checker() + if self._skip_desc: + return + + node = tmpl_node.children + while node: + if node.type == "element" and node.name == "desc": + if self.support_node(node): + # parse <desc> + desc = Description(node, self._categories) + self.checker.add_desc(desc) + node = node.next + + self.checker.validate(self, param_nodes) + + def support_node(self, node): + """Return true if a node is in the supported category.""" + return (not node.hasProp("category") or + node.prop("category") in self._categories) + + def get_param(self, name): + """Return the named parameter.""" + for param in self.params: + if param.name == name: + return param + return None + + def param_node_size(self, param): + """Return the size of a vector.""" + if param.name != "vector": + return 0 + + size = param.prop("size") + if size.isdigit(): + size = int(size) + else: + size = 0 + if not size: + size = self._vector_size + if not size and self._expand_vector: + # return the number of named parameters + size = param.lsCountNode() + return size + + def param_string(self, declaration): + """Return the C code of the parameters.""" + args = [] + if declaration: + for param in self.params: + sep = "" if param.type.endswith("*") else " " + args.append("%s%s%s" % (param.type, sep, param.name)) + if not args: + args.append("void") + else: + for param in self.params: + args.append(param.name) + return ", ".join(args) + + def match(self, other, conversions={}): + """Return true if the functions match, probably with a conversion.""" + if (self.tmpl_name != other.tmpl_name or + self.return_type != other.return_type or + len(self.params) != len(other.params)): + return (False, False) + + need_conv = False + for i in xrange(len(self.params)): + src = other.params[i] + dst = self.params[i] + if (src.is_vector != dst.is_vector or src.size != dst.size): + return (False, False) + if src.type != dst.type: + if dst.base_type() in conversions.get(src.base_type(), []): + need_conv = True + else: + # unable to convert + return (False, False) + + return (True, need_conv) + + +class Parameter(object): + """A parameter of a function.""" + + def __init__(self, param_node, gltype=None, size=0): + self.is_vector = (param_node.name == "vector") + + self.name = param_node.prop("name") + self.size = size + + type = param_node.prop("type") + if gltype: + type = type.replace("GLtype", gltype) + elif type.find("GLtype") != -1: + raise SpecError("parameter %s has unresolved type" % self.name) + + self.type = type + + def base_type(self): + """Return the base GL type by stripping qualifiers.""" + return [t for t in self.type.split(" ") if t.startswith("GL")][0] + + +class Checker(object): + """A checker is the collection of all descriptions on the same level. + Descriptions of the same parameter are concatenated. + """ + + def __init__(self): + self.switches = {} + self.switch_constants = {} + + def add_desc(self, desc): + """Add a description.""" + # TODO allow index to vary + const_attrs = ["index", "error", "convert", "size_str"] + if desc.name not in self.switches: + self.switches[desc.name] = [] + self.switch_constants[desc.name] = {} + for attr in const_attrs: + self.switch_constants[desc.name][attr] = None + + # some attributes, like error code, should be the same for all descs + consts = self.switch_constants[desc.name] + for attr in const_attrs: + if getattr(desc, attr) is not None: + if (consts[attr] is not None and + consts[attr] != getattr(desc, attr)): + raise SpecError("mismatch %s for %s" % (attr, desc.name)) + consts[attr] = getattr(desc, attr) + + self.switches[desc.name].append(desc) + + def validate(self, func, param_nodes): + """Validate the checker against a function.""" + tmp = Checker() + + for switch in self.switches.itervalues(): + valid_descs = [] + for desc in switch: + if desc.validate(func, param_nodes): + valid_descs.append(desc) + # no possible values + if not valid_descs: + return False + for desc in valid_descs: + if not desc._is_noop: + tmp.add_desc(desc) + + self.switches = tmp.switches + self.switch_constants = tmp.switch_constants + return True + + def flatten(self, name=None): + """Return a flat list of all descriptions of the named parameter.""" + flat_list = [] + for switch in self.switches.itervalues(): + for desc in switch: + if not name or desc.name == name: + flat_list.append(desc) + flat_list.extend(desc.checker.flatten(name)) + return flat_list + + def always_check(self, name): + """Return true if the parameter is checked in all possible pathes.""" + if name in self.switches: + return True + + # a param is always checked if any of the switch always checks it + for switch in self.switches.itervalues(): + # a switch always checks it if all of the descs always check it + always = True + for desc in switch: + if not desc.checker.always_check(name): + always = False + break + if always: + return True + return False + + def _c_switch(self, name, indent="\t"): + """Output C switch-statement for the named parameter, for debug.""" + switch = self.switches.get(name, []) + # make sure there are valid values + need_switch = False + for desc in switch: + if desc.values: + need_switch = True + if not need_switch: + return [] + + stmts = [] + var = switch[0].name + if switch[0].index >= 0: + var += "[%d]" % switch[0].index + stmts.append("switch (%s) { /* assume GLenum */" % var) + + for desc in switch: + if desc.values: + for val in desc.values: + stmts.append("case %s:" % val) + for dep_name in desc.checker.switches.iterkeys(): + dep_stmts = [indent + s for s in desc.checker._c_switch(dep_name, indent)] + stmts.extend(dep_stmts) + stmts.append(indent + "break;") + + stmts.append("default:") + stmts.append(indent + "ON_ERROR(%s);" % switch[0].error); + stmts.append(indent + "break;") + stmts.append("}") + + return stmts + + def dump(self, indent="\t"): + """Dump the descriptions in C code.""" + stmts = [] + for name in self.switches.iterkeys(): + c_switch = self._c_switch(name) + print "\n".join(c_switch) + + +class Description(object): + """A description desribes a parameter and its relationship with other + parameters. + """ + + def __init__(self, desc_node, categories=[]): + self._categories = categories + self._is_noop = False + + self.name = desc_node.prop("name") + self.index = -1 + + self.error = desc_node.prop("error") or "GL_INVALID_ENUM" + # vector_size may be C code + self.size_str = desc_node.prop("vector_size") + + self._has_enum = False + self.values = [] + dep_nodes = [] + + # parse <desc> + valid_names = ["value", "range", "desc"] + node = desc_node.children + while node: + if node.type == "element": + if node.name in valid_names: + # ignore nodes that require unsupported categories + if (node.prop("category") and + node.prop("category") not in self._categories): + node = node.next + continue + else: + raise SpecError("unexpected node %s in desc" % node.name) + + if node.name == "value": + val = node.prop("name") + if not self._has_enum and val.startswith("GL_"): + self._has_enum = True + self.values.append(val) + elif node.name == "range": + first = int(node.prop("from")) + last = int(node.prop("to")) + base = node.prop("base") or "" + if not self._has_enum and base.startswith("GL_"): + self._has_enum = True + # expand range + for i in xrange(first, last + 1): + self.values.append("%s%d" % (base, i)) + else: # dependent desc + dep_nodes.append(node) + node = node.next + + # default to convert if there is no enum + self.convert = not self._has_enum + if desc_node.hasProp("convert"): + self.convert = (desc_node.prop("convert") == "true") + + self._init_deps(dep_nodes) + + def _init_deps(self, dep_nodes): + """Parse and initialize dependents.""" + self.checker = Checker() + + for dep_node in dep_nodes: + # recursion! + dep = Description(dep_node, self._categories) + self.checker.add_desc(dep) + + def _search_param_node(self, param_nodes, name=None): + """Search the template parameters for the named node.""" + param_node = None + param_index = -1 + + if not name: + name = self.name + for node in param_nodes: + if name == node.prop("name"): + param_node = node + elif node.name == "vector": + child = node.children + idx = 0 + while child: + if child.type == "element" and child.name == "param": + if name == child.prop("name"): + param_node = node + param_index = idx + break + idx += 1 + child = child.next + if param_node: + break + return (param_node, param_index) + + def _find_final(self, func, param_nodes): + """Find the final parameter.""" + param = func.get_param(self.name) + param_index = -1 + + # the described param is not in the final function + if not param: + # search the template parameters + node, index = self._search_param_node(param_nodes) + if not node: + raise SpecError("invalid desc %s in %s" % + (self.name, func.name)) + + # a named parameter of a vector + if index >= 0: + param = func.get_param(node.prop("name")) + param_index = index + elif node.name == "vector": + # must be an expanded vector, check its size + if self.size_str and self.size_str.isdigit(): + size = int(self.size_str) + expanded_size = func.param_node_size(node) + if size != expanded_size: + return (False, None, -1) + # otherwise, it is a valid, but no-op, description + + return (True, param, param_index) + + def validate(self, func, param_nodes): + """Validate a description against certain function.""" + if self.checker.switches and not self.values: + raise SpecError("no valid values for %s" % self.name) + + valid, param, param_index = self._find_final(func, param_nodes) + if not valid: + return False + + # the description is valid, but the param is gone + # mark it no-op so that it will be skipped + if not param: + self._is_noop = True + return True + + if param.is_vector: + # if param was known, this should have been done in __init__ + if self._has_enum: + self.size_str = "1" + # size mismatch + if (param.size and self.size_str and self.size_str.isdigit() and + param.size != int(self.size_str)): + return False + elif self.size_str: + # only vector accepts vector_size + raise SpecError("vector_size is invalid for %s" % param.name) + + if not self.checker.validate(func, param_nodes): + return False + + # update the description + self.name = param.name + self.index = param_index + + return True + + +def main(): + import libxml2 + + filename = "APIspec.xml" + apinames = ["GLES1.1", "GLES2.0"] + + doc = libxml2.readFile(filename, None, + libxml2.XML_PARSE_DTDLOAD + + libxml2.XML_PARSE_DTDVALID + + libxml2.XML_PARSE_NOBLANKS) + + spec = Spec(doc) + impl = spec.get_impl() + for apiname in apinames: + spec.get_api(apiname) + + doc.freeDoc() + + print "%s is successfully parsed" % filename + + +if __name__ == "__main__": + main() diff --git a/src/mesa/es/main/APIspec.xml b/src/mesa/es/main/APIspec.xml new file mode 100644 index 0000000000..f6f33130b1 --- /dev/null +++ b/src/mesa/es/main/APIspec.xml @@ -0,0 +1,4297 @@ +<?xml version="1.0"?> +<!DOCTYPE apispec SYSTEM "APIspec.dtd"> + +<!-- A function is generated from a template. Multiple functions can be + generated from a single template with different arguments. For example, + glColor3f can be generated from + + <function name="Color3f" template="Color" gltype="GLfloat" vector_size="3" expand_vector="true"/> + + and glColor4iv can be generated from + + <function name="Color4iv" template="Color" gltype="GLint" vector_size="4"/> + + In a template, there are <desc>s that describe the properties of + parameters. A <desc> can enumerate the valid values of a parameter. It + can also specify the error code when an invalid value is given, and etc. + By nesting <desc>s, they can create dependency between parameters. + + A function can be marked as external. It means that the function cannot + be dispatched to the corresponding mesa function, if one exists, directly, + and requires an external implementation. +--> + +<apispec> + +<template name="Color"> + <proto> + <return type="void"/> + <vector name="v" type="const GLtype *" size="dynamic"> + <param name="red" type="GLtype"/> + <param name="green" type="GLtype"/> + <param name="blue" type="GLtype"/> + <param name="alpha" type="GLtype"/> + </vector> + </proto> +</template> + +<template name="ClipPlane"> + <proto> + <return type="void"/> + <param name="plane" type="GLenum"/> + <vector name="equation" type="const GLtype *" size="4"/> + </proto> + + <desc name="plane"> + <range base="GL_CLIP_PLANE" from="0" to="5"/> + </desc> +</template> + +<template name="CullFace"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="mode"> + <value name="GL_FRONT"/> + <value name="GL_BACK"/> + <value name="GL_FRONT_AND_BACK"/> + </desc> +</template> + +<template name="Fog"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="pname"> + <value name="GL_FOG_MODE"/> + <desc name="param"> + <value name="GL_EXP"/> + <value name="GL_EXP2"/> + <value name="GL_LINEAR"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_FOG_COLOR"/> + + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_FOG_DENSITY"/> + <value name="GL_FOG_START"/> + <value name="GL_FOG_END"/> + + <desc name="params" vector_size="1"/> + </desc> +</template> + +<template name="FrontFace"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="mode"> + <value name="GL_CW"/> + <value name="GL_CCW"/> + </desc> +</template> + +<template name="Hint"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="target" category="GLES1.1"> + <value name="GL_FOG_HINT"/> + <value name="GL_LINE_SMOOTH_HINT"/> + <value name="GL_PERSPECTIVE_CORRECTION_HINT"/> + <value name="GL_POINT_SMOOTH_HINT"/> + </desc> + <desc name="target" category="OES_standard_derivatives"> + <value name="GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES"/> + </desc> + <desc name="target"> + <value name="GL_GENERATE_MIPMAP_HINT"/> + </desc> + + <desc name="mode"> + <value name="GL_FASTEST"/> + <value name="GL_NICEST"/> + <value name="GL_DONT_CARE"/> + </desc> +</template> + +<template name="Light"> + <proto> + <return type="void"/> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="light"> + <range base="GL_LIGHT" from="0" to="7"/> + </desc> + + <desc name="pname"> + <value name="GL_AMBIENT"/> + <value name="GL_DIFFUSE"/> + <value name="GL_SPECULAR"/> + <value name="GL_POSITION"/> + + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_SPOT_DIRECTION"/> + + <desc name="params" vector_size="3"/> + </desc> + + <desc name="pname"> + <value name="GL_SPOT_EXPONENT"/> + <value name="GL_SPOT_CUTOFF"/> + <value name="GL_CONSTANT_ATTENUATION"/> + <value name="GL_LINEAR_ATTENUATION"/> + <value name="GL_QUADRATIC_ATTENUATION"/> + + <desc name="params" vector_size="1"/> + </desc> +</template> + +<template name="LightModel"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="pname"> + <value name="GL_LIGHT_MODEL_AMBIENT"/> + + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_LIGHT_MODEL_TWO_SIDE"/> + <desc name="param"> + <value name="GL_TRUE"/> + <value name="GL_FALSE"/> + </desc> + </desc> +</template> + +<template name="LineWidth"> + <proto> + <return type="void"/> + <param name="width" type="GLtype"/> + </proto> +</template> + +<template name="Material"> + <proto> + <return type="void"/> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="face"> + <value name="GL_FRONT_AND_BACK"/> + </desc> + + <desc name="pname"> + <value name="GL_AMBIENT"/> + <value name="GL_DIFFUSE"/> + <value name="GL_AMBIENT_AND_DIFFUSE"/> + <value name="GL_SPECULAR"/> + <value name="GL_EMISSION"/> + + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_SHININESS"/> + + <desc name="params" vector_size="1"/> + </desc> +</template> + +<template name="PointSize"> + <proto> + <return type="void"/> + <param name="size" type="GLtype"/> + </proto> +</template> + +<template name="PointSizePointer"> + <proto> + <return type="void"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="type"> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + </desc> +</template> + +<template name="Scissor"> + <proto> + <return type="void"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </proto> +</template> + +<template name="ShadeModel"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="mode"> + <value name="GL_FLAT"/> + <value name="GL_SMOOTH"/> + </desc> +</template> + +<template name="TexParameter"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_WRAP_S"/> + <value name="GL_TEXTURE_WRAP_T"/> + <value name="GL_TEXTURE_WRAP_R_OES" category="OES_texture_3D"/> + + <desc name="param"> + <value name="GL_CLAMP_TO_EDGE"/> + <value name="GL_REPEAT"/> + <value name="GL_MIRRORED_REPEAT" category="GLES2.0"/> + <value name="GL_MIRRORED_REPEAT_OES" category="OES_texture_mirrored_repeat"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_MIN_FILTER"/> + + <desc name="param"> + <value name="GL_NEAREST"/> + <value name="GL_LINEAR"/> + <value name="GL_NEAREST_MIPMAP_NEAREST"/> + <value name="GL_NEAREST_MIPMAP_LINEAR"/> + <value name="GL_LINEAR_MIPMAP_NEAREST"/> + <value name="GL_LINEAR_MIPMAP_LINEAR"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_MAG_FILTER"/> + + <desc name="param"> + <value name="GL_NEAREST"/> + <value name="GL_LINEAR"/> + </desc> + </desc> + + <desc name="pname" category="GLES1.1"> + <value name="GL_GENERATE_MIPMAP"/> + + <desc name="param"> + <value name="GL_TRUE"/> + <value name="GL_FALSE"/> + </desc> + </desc> + + <desc name="pname" category="EXT_texture_filter_anisotropic"> + <value name="GL_TEXTURE_MAX_ANISOTROPY_EXT"/> + <desc name="params" vector_size="1"/> + </desc> + + <desc name="pname" category="OES_draw_texture"> + <value name="GL_TEXTURE_CROP_RECT_OES"/> + <desc name="params" vector_size="4"/> + </desc> +</template> + +<template name="TexImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalFormat" type="GLint"/> <!-- should be GLenum --> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="internalFormat" error="GL_INVALID_VALUE"> + <value name="GL_ALPHA"/> + <value name="GL_RGB"/> + <value name="GL_RGBA"/> + <value name="GL_LUMINANCE"/> + <value name="GL_LUMINANCE_ALPHA"/> + <value name="GL_DEPTH_COMPONENT" category="OES_depth_texture"/> + <value name="GL_DEPTH_STENCIL_OES" category="OES_packed_depth_stencil"/> + </desc> + + <desc name="border" error="GL_INVALID_VALUE"> + <value name="0"/> + </desc> + + <desc name="format"> + <value name="GL_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGB"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_5_6_5"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGBA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4"/> + <value name="GL_UNSIGNED_SHORT_5_5_5_1"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format" category="OES_depth_texture"> + <value name="GL_DEPTH_COMPONENT"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_SHORT"/> + <value name="GL_UNSIGNED_INT"/> + </desc> + </desc> + + <desc name="format" category="OES_packed_depth_stencil"> + <value name="GL_DEPTH_STENCIL_OES"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_INT_24_8_OES"/> + </desc> + </desc> +</template> + +<template name="TexEnv"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="target" category="OES_point_sprite"> + <value name="GL_POINT_SPRITE_OES"/> + + <desc name="pname"> + <value name="GL_COORD_REPLACE_OES"/> + </desc> + </desc> + + <desc name="pname" category="OES_point_sprite"> + <value name="GL_COORD_REPLACE_OES"/> + + <desc name="param"> + <value name="GL_TRUE"/> + <value name="GL_FALSE"/> + </desc> + </desc> + + <desc name="target" category="EXT_texture_lod_bias"> + <value name="GL_TEXTURE_FILTER_CONTROL_EXT"/> + + <desc name="pname"> + <value name="GL_TEXTURE_LOD_BIAS_EXT"/> + </desc> + </desc> + + <desc name="pname" category="EXT_texture_lod_bias"> + <value name="GL_TEXTURE_LOD_BIAS_EXT"/> + <desc name="params" vector_size="1"/> + </desc> + + <desc name="target"> + <value name="GL_TEXTURE_ENV"/> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_MODE"/> + <value name="GL_COMBINE_RGB"/> + <value name="GL_COMBINE_ALPHA"/> + <value name="GL_RGB_SCALE"/> + <value name="GL_ALPHA_SCALE"/> + <value name="GL_SRC0_RGB"/> + <value name="GL_SRC1_RGB"/> + <value name="GL_SRC2_RGB"/> + <value name="GL_SRC0_ALPHA"/> + <value name="GL_SRC1_ALPHA"/> + <value name="GL_SRC2_ALPHA"/> + <value name="GL_OPERAND0_RGB"/> + <value name="GL_OPERAND1_RGB"/> + <value name="GL_OPERAND2_RGB"/> + <value name="GL_OPERAND0_ALPHA"/> + <value name="GL_OPERAND1_ALPHA"/> + <value name="GL_OPERAND2_ALPHA"/> + <value name="GL_TEXTURE_ENV_COLOR"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_MODE"/> + + <desc name="param"> + <value name="GL_REPLACE"/> + <value name="GL_MODULATE"/> + <value name="GL_DECAL"/> + <value name="GL_BLEND"/> + <value name="GL_ADD"/> + <value name="GL_COMBINE"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_COMBINE_RGB"/> + + <desc name="param"> + <value name="GL_REPLACE"/> + <value name="GL_MODULATE"/> + <value name="GL_ADD"/> + <value name="GL_ADD_SIGNED"/> + <value name="GL_INTERPOLATE"/> + <value name="GL_SUBTRACT"/> + <value name="GL_DOT3_RGB"/> + <value name="GL_DOT3_RGBA"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_COMBINE_ALPHA"/> + + <desc name="param"> + <value name="GL_REPLACE"/> + <value name="GL_MODULATE"/> + <value name="GL_ADD"/> + <value name="GL_ADD_SIGNED"/> + <value name="GL_INTERPOLATE"/> + <value name="GL_SUBTRACT"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_RGB_SCALE"/> + <value name="GL_ALPHA_SCALE"/> + + <desc name="param" convert="true" error="GL_INVALID_VALUE"> + <value name="1.0"/> + <value name="2.0"/> + <value name="4.0"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_SRC0_RGB"/> + <value name="GL_SRC1_RGB"/> + <value name="GL_SRC2_RGB"/> + <value name="GL_SRC0_ALPHA"/> + <value name="GL_SRC1_ALPHA"/> + <value name="GL_SRC2_ALPHA"/> + + <desc name="param"> + <value name="GL_TEXTURE"/> + <value name="GL_CONSTANT"/> + <value name="GL_PRIMARY_COLOR"/> + <value name="GL_PREVIOUS"/> + + <range base="GL_TEXTURE" from="0" to="31" category="OES_texture_env_crossbar"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_OPERAND0_RGB"/> + <value name="GL_OPERAND1_RGB"/> + <value name="GL_OPERAND2_RGB"/> + + <desc name="param"> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_OPERAND0_ALPHA"/> + <value name="GL_OPERAND1_ALPHA"/> + <value name="GL_OPERAND2_ALPHA"/> + + <desc name="param"> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_COLOR"/> + + <desc name="params" vector_size="4"/> + </desc> +</template> + +<template name="TexGen"> + <proto> + <return type="void"/> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="coord" category="OES_texture_cube_map"> + <value name="GL_TEXTURE_GEN_STR_OES"/> + </desc> + + <desc name="pname" category="OES_texture_cube_map"> + <value name="GL_TEXTURE_GEN_MODE_OES"/> + + <desc name="param"> + <value name="GL_NORMAL_MAP_OES"/> + <value name="GL_REFLECTION_MAP_OES"/> + </desc> + </desc> +</template> + +<template name="Clear"> + <proto> + <return type="void"/> + <param name="mask" type="GLbitfield"/> + </proto> + + <desc name="mask" error="GL_INVALID_VALUE"> + <value name="0"/> + <value name="(GL_COLOR_BUFFER_BIT)"/> + <value name="(GL_DEPTH_BUFFER_BIT)"/> + <value name="(GL_STENCIL_BUFFER_BIT)"/> + <value name="(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)"/> + <value name="(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/> + <value name="(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/> + <value name="(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)"/> + </desc> +</template> + +<template name="ClearColor"> + <proto> + <return type="void"/> + <param name="red" type="GLtype"/> + <param name="green" type="GLtype"/> + <param name="blue" type="GLtype"/> + <param name="alpha" type="GLtype"/> + </proto> +</template> + +<template name="ClearStencil"> + <proto> + <return type="void"/> + <param name="s" type="GLint"/> + </proto> +</template> + +<template name="ClearDepth"> + <proto> + <return type="void"/> + <param name="depth" type="GLtype"/> + </proto> +</template> + +<template name="StencilMask"> + <proto> + <return type="void"/> + <param name="mask" type="GLuint"/> + </proto> +</template> + +<template name="StencilMaskSeparate"> + <proto> + <return type="void"/> + <param name="face" type="GLenum"/> + <param name="mask" type="GLuint"/> + </proto> + + <desc name="face"> + <value name="GL_FRONT"/> + <value name="GL_BACK"/> + <value name="GL_FRONT_AND_BACK"/> + </desc> +</template> + +<template name="ColorMask"> + <proto> + <return type="void"/> + <param name="red" type="GLboolean"/> + <param name="green" type="GLboolean"/> + <param name="blue" type="GLboolean"/> + <param name="alpha" type="GLboolean"/> + </proto> +</template> + +<template name="DepthMask"> + <proto> + <return type="void"/> + <param name="flag" type="GLboolean"/> + </proto> +</template> + +<template name="Disable"> + <proto> + <return type="void"/> + <param name="cap" type="GLenum"/> + </proto> + + <desc name="cap" category="GLES1.1"> + <value name="GL_NORMALIZE"/> + <value name="GL_RESCALE_NORMAL"/> + + <range base="GL_CLIP_PLANE" from="0" to="5"/> + + <value name="GL_FOG"/> + <value name="GL_LIGHTING"/> + <value name="GL_COLOR_MATERIAL"/> + + <range base="GL_LIGHT" from="0" to="7"/> + + <value name="GL_POINT_SMOOTH"/> + <value name="GL_LINE_SMOOTH"/> + <value name="GL_CULL_FACE"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_MULTISAMPLE"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_ALPHA_TO_ONE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_TEXTURE_2D"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_ALPHA_TEST"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_BLEND"/> + <value name="GL_DITHER"/> + <value name="GL_COLOR_LOGIC_OP"/> + + <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/> + <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="cap" category="GLES2.0"> + <value name="GL_CULL_FACE"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_DITHER"/> + <value name="GL_BLEND"/> + </desc> +</template> + +<!-- it is exactly the same as Disable --> +<template name="Enable"> + <proto> + <return type="void"/> + <param name="cap" type="GLenum"/> + </proto> + + <desc name="cap" category="GLES1.1"> + <value name="GL_NORMALIZE"/> + <value name="GL_RESCALE_NORMAL"/> + + <range base="GL_CLIP_PLANE" from="0" to="5"/> + + <value name="GL_FOG"/> + <value name="GL_LIGHTING"/> + <value name="GL_COLOR_MATERIAL"/> + + <range base="GL_LIGHT" from="0" to="7"/> + + <value name="GL_POINT_SMOOTH"/> + <value name="GL_LINE_SMOOTH"/> + <value name="GL_CULL_FACE"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_MULTISAMPLE"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_ALPHA_TO_ONE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_TEXTURE_2D"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_ALPHA_TEST"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_BLEND"/> + <value name="GL_DITHER"/> + <value name="GL_COLOR_LOGIC_OP"/> + + <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/> + <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="cap" category="GLES2.0"> + <value name="GL_CULL_FACE"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_DITHER"/> + <value name="GL_BLEND"/> + </desc> +</template> + +<template name="Finish"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="Flush"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="AlphaFunc"> + <proto> + <return type="void"/> + <param name="func" type="GLenum"/> + <param name="ref" type="GLtype"/> + </proto> + <desc name="func"> + <value name="GL_NEVER"/> + <value name="GL_LESS"/> + <value name="GL_EQUAL"/> + <value name="GL_LEQUAL"/> + <value name="GL_GREATER"/> + <value name="GL_NOTEQUAL"/> + <value name="GL_GEQUAL"/> + <value name="GL_ALWAYS"/> + </desc> +</template> + +<template name="BlendFunc"> + <proto> + <return type="void"/> + <param name="sfactor" type="GLenum"/> + <param name="dfactor" type="GLenum"/> + </proto> + + <desc name="sfactor"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + <value name="GL_SRC_ALPHA_SATURATE"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> + + <desc name="dfactor"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> +</template> + +<template name="LogicOp"> + <proto> + <return type="void"/> + <param name="opcode" type="GLenum"/> + </proto> + + <desc name="opcode"> + <value name="GL_CLEAR"/> + <value name="GL_SET"/> + <value name="GL_COPY"/> + <value name="GL_COPY_INVERTED"/> + <value name="GL_NOOP"/> + <value name="GL_INVERT"/> + <value name="GL_AND"/> + <value name="GL_NAND"/> + <value name="GL_OR"/> + <value name="GL_NOR"/> + <value name="GL_XOR"/> + <value name="GL_EQUIV"/> + <value name="GL_AND_REVERSE"/> + <value name="GL_AND_INVERTED"/> + <value name="GL_OR_REVERSE"/> + <value name="GL_OR_INVERTED"/> + </desc> +</template> + +<template name="StencilFunc"> + <proto> + <return type="void"/> + <param name="func" type="GLenum"/> + <param name="ref" type="GLint"/> + <param name="mask" type="GLuint"/> + </proto> + + <desc name="func"> + <value name="GL_NEVER"/> + <value name="GL_LESS"/> + <value name="GL_LEQUAL"/> + <value name="GL_GREATER"/> + <value name="GL_GEQUAL"/> + <value name="GL_EQUAL"/> + <value name="GL_NOTEQUAL"/> + <value name="GL_ALWAYS"/> + </desc> +</template> + +<template name="StencilFuncSeparate"> + <proto> + <return type="void"/> + <param name="face" type="GLenum"/> + <param name="func" type="GLenum"/> + <param name="ref" type="GLint"/> + <param name="mask" type="GLuint"/> + </proto> + + <desc name="face"> + <value name="GL_FRONT"/> + <value name="GL_BACK"/> + <value name="GL_FRONT_AND_BACK"/> + </desc> + + <desc name="func"> + <value name="GL_NEVER"/> + <value name="GL_LESS"/> + <value name="GL_LEQUAL"/> + <value name="GL_GREATER"/> + <value name="GL_GEQUAL"/> + <value name="GL_EQUAL"/> + <value name="GL_NOTEQUAL"/> + <value name="GL_ALWAYS"/> + </desc> +</template> + +<template name="StencilOp"> + <proto> + <return type="void"/> + <param name="fail" type="GLenum"/> + <param name="zfail" type="GLenum"/> + <param name="zpass" type="GLenum"/> + </proto> + + <desc name="fail"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP" category="GLES2.0"/> + <value name="GL_DECR_WRAP" category="GLES2.0"/> + <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/> + <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/> + </desc> + + <desc name="zfail"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP" category="GLES2.0"/> + <value name="GL_DECR_WRAP" category="GLES2.0"/> + <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/> + <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/> + </desc> + + <desc name="zpass"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP" category="GLES2.0"/> + <value name="GL_DECR_WRAP" category="GLES2.0"/> + <value name="GL_INCR_WRAP_OES" category="OES_stencil_wrap"/> + <value name="GL_DECR_WRAP_OES" category="OES_stencil_wrap"/> + </desc> +</template> + +<template name="StencilOpSeparate"> + <proto> + <return type="void"/> + <param name="face" type="GLenum"/> + <param name="fail" type="GLenum"/> + <param name="zfail" type="GLenum"/> + <param name="zpass" type="GLenum"/> + </proto> + + <desc name="face"> + <value name="GL_FRONT"/> + <value name="GL_BACK"/> + <value name="GL_FRONT_AND_BACK"/> + </desc> + + <desc name="fail"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP"/> + <value name="GL_DECR_WRAP"/> + </desc> + + <desc name="zfail"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP"/> + <value name="GL_DECR_WRAP"/> + </desc> + + <desc name="zpass"> + <value name="GL_KEEP"/> + <value name="GL_ZERO"/> + <value name="GL_REPLACE"/> + <value name="GL_INCR"/> + <value name="GL_DECR"/> + <value name="GL_INVERT"/> + <value name="GL_INCR_WRAP"/> + <value name="GL_DECR_WRAP"/> + </desc> +</template> + +<template name="DepthFunc"> + <proto> + <return type="void"/> + <param name="func" type="GLenum"/> + </proto> + + <desc name="func"> + <value name="GL_NEVER"/> + <value name="GL_LESS"/> + <value name="GL_EQUAL"/> + <value name="GL_LEQUAL"/> + <value name="GL_GREATER"/> + <value name="GL_NOTEQUAL"/> + <value name="GL_GEQUAL"/> + <value name="GL_ALWAYS"/> + </desc> +</template> + +<template name="PixelStore"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLtype"/> + </proto> + + <desc name="pname"> + <value name="GL_PACK_ALIGNMENT"/> + <value name="GL_UNPACK_ALIGNMENT"/> + </desc> + + <desc name="param" error="GL_INVALID_VALUE"> + <value name="1"/> + <value name="2"/> + <value name="4"/> + <value name="8"/> + </desc> +</template> + +<template name="ReadPixels" direction="get"> + <proto> + <return type="void"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="GLvoid *"/> + </proto> + + <!-- Technically, only two combinations are actually allowed: + GL_RGBA/GL_UNSIGNED_BYTE, and some implementation-specific + internal preferred combination. I don't know what that is, so I'm + allowing any valid combination for now; the underlying support + should fail when necessary.--> + <desc name="format"> + <value name="GL_ALPHA"/> + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGB"/> + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_5_6_5"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGBA"/> + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4"/> + <value name="GL_UNSIGNED_SHORT_5_5_5_1"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE"/> + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE_ALPHA"/> + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + </desc> + </desc> + + <desc name="format" category="EXT_read_format_bgra"> + <value name="GL_BGRA_EXT"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT"/> + <value name="GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT"/> + </desc> + </desc> +</template> + +<template name="GetClipPlane" direction="get"> + <proto> + <return type="void"/> + <param name="plane" type="GLenum"/> + <vector name="equation" type="GLtype *" size="4"/> + </proto> + + <desc name="plane"> + <range base="GL_CLIP_PLANE" from="0" to="5"/> + </desc> +</template> + +<template name="GetError" direction="get"> + <proto> + <return type="GLenum"/> + </proto> +</template> + +<!-- template for GetFloatv, GetIntegerv, GetBoolean, and GetFixedv --> +<template name="GetState" direction="get"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + <!-- param checking is done in mesa --> +</template> + +<template name="GetLight" direction="get"> + <proto> + <return type="void"/> + <param name="light" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="light"> + <range base="GL_LIGHT" from="0" to="7"/> + </desc> + + <desc name="pname"> + <value name="GL_AMBIENT"/> + <value name="GL_DIFFUSE"/> + <value name="GL_SPECULAR"/> + <value name="GL_POSITION"/> + + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_SPOT_DIRECTION"/> + + <desc name="params" vector_size="3"/> + </desc> + + <desc name="pname"> + <value name="GL_SPOT_EXPONENT"/> + <value name="GL_SPOT_CUTOFF"/> + <value name="GL_CONSTANT_ATTENUATION"/> + <value name="GL_LINEAR_ATTENUATION"/> + <value name="GL_QUADRATIC_ATTENUATION"/> + + <desc name="params" vector_size="1"/> + </desc> +</template> + +<template name="GetMaterial" direction="get"> + <proto> + <return type="void"/> + <param name="face" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="face"> + <value name="GL_FRONT"/> + <value name="GL_BACK"/> + </desc> + + <desc name="pname"> + <value name="GL_SHININESS"/> + <desc name="params" vector_size="1"/> + </desc> + + <desc name="pname"> + <value name="GL_AMBIENT"/> + <value name="GL_DIFFUSE"/> + <value name="GL_AMBIENT_AND_DIFFUSE"/> + <value name="GL_SPECULAR"/> + <value name="GL_EMISSION"/> + + <desc name="params" vector_size="4"/> + </desc> +</template> + +<template name="GetString" direction="get"> + <proto> + <return type="const GLubyte *"/> + <param name="name" type="GLenum"/> + </proto> + + <desc name="name"> + <value name="GL_VENDOR"/> + <value name="GL_RENDERER"/> + <value name="GL_VERSION"/> + <value name="GL_EXTENSIONS"/> + <value name="GL_SHADING_LANGUAGE_VERSION" category="GLES2.0"/> + </desc> +</template> + +<template name="GetTexEnv" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="target" category="OES_point_sprite"> + <value name="GL_POINT_SPRITE_OES"/> + <desc name="pname"> + <value name="GL_COORD_REPLACE_OES"/> + </desc> + </desc> + + <desc name="pname" category="OES_point_sprite"> + <value name="GL_COORD_REPLACE_OES"/> + <desc name="params" vector_size="1" convert="false"/> + </desc> + + <desc name="target" category="EXT_texture_lod_bias"> + <value name="GL_TEXTURE_FILTER_CONTROL_EXT"/> + + <desc name="pname"> + <value name="GL_TEXTURE_LOD_BIAS_EXT"/> + </desc> + </desc> + + <desc name="pname" category="EXT_texture_lod_bias"> + <value name="GL_TEXTURE_LOD_BIAS_EXT"/> + <desc name="params" vector_size="1"/> + </desc> + + <desc name="target"> + <value name="GL_TEXTURE_ENV"/> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_COLOR"/> + <value name="GL_RGB_SCALE"/> + <value name="GL_ALPHA_SCALE"/> + <value name="GL_TEXTURE_ENV_MODE"/> + <value name="GL_COMBINE_RGB"/> + <value name="GL_COMBINE_ALPHA"/> + <value name="GL_SRC0_RGB"/> + <value name="GL_SRC1_RGB"/> + <value name="GL_SRC2_RGB"/> + <value name="GL_SRC0_ALPHA"/> + <value name="GL_SRC1_ALPHA"/> + <value name="GL_SRC2_ALPHA"/> + <value name="GL_OPERAND0_RGB"/> + <value name="GL_OPERAND1_RGB"/> + <value name="GL_OPERAND2_RGB"/> + <value name="GL_OPERAND0_ALPHA"/> + <value name="GL_OPERAND1_ALPHA"/> + <value name="GL_OPERAND2_ALPHA"/> + </desc> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_COLOR"/> + <desc name="params" vector_size="4"/> + </desc> + + <desc name="pname"> + <value name="GL_RGB_SCALE"/> + <value name="GL_ALPHA_SCALE"/> + + <desc name="params" vector_size="1"/> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_ENV_MODE"/> + <value name="GL_COMBINE_RGB"/> + <value name="GL_COMBINE_ALPHA"/> + <value name="GL_SRC0_RGB"/> + <value name="GL_SRC1_RGB"/> + <value name="GL_SRC2_RGB"/> + <value name="GL_SRC0_ALPHA"/> + <value name="GL_SRC1_ALPHA"/> + <value name="GL_SRC2_ALPHA"/> + <value name="GL_OPERAND0_RGB"/> + <value name="GL_OPERAND1_RGB"/> + <value name="GL_OPERAND2_RGB"/> + <value name="GL_OPERAND0_ALPHA"/> + <value name="GL_OPERAND1_ALPHA"/> + <value name="GL_OPERAND2_ALPHA"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> +</template> + +<template name="GetTexGen" direction="get"> + <proto> + <return type="void"/> + <param name="coord" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="coord"> + <value name="GL_TEXTURE_GEN_STR_OES"/> + </desc> + <desc name="pname"> + <value name="GL_TEXTURE_GEN_MODE_OES"/> + <desc name="params" vector_size="1" convert="false"/> + </desc> +</template> + +<template name="GetTexParameter" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/> + </desc> + + <desc name="pname"> + <value name="GL_TEXTURE_WRAP_S"/> + <value name="GL_TEXTURE_WRAP_T"/> + <value name="GL_TEXTURE_WRAP_R_OES" category="OES_texture_3D"/> + <value name="GL_TEXTURE_MIN_FILTER"/> + <value name="GL_TEXTURE_MAG_FILTER"/> + <value name="GL_GENERATE_MIPMAP" category="GLES1.1"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> + + <desc name="pname" category="OES_draw_texture"> + <value name="GL_TEXTURE_CROP_RECT_OES"/> + <desc name="params" vector_size="4"/> + </desc> +</template> + +<template name="IsEnabled" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="cap" type="GLenum"/> + </proto> + + <desc name="cap" category="GLES1.1"> + <value name="GL_NORMALIZE"/> + <value name="GL_RESCALE_NORMAL"/> + + <range base="GL_CLIP_PLANE" from="0" to="5"/> + + <value name="GL_FOG"/> + <value name="GL_LIGHTING"/> + <value name="GL_COLOR_MATERIAL"/> + + <range base="GL_LIGHT" from="0" to="7"/> + + <value name="GL_POINT_SMOOTH"/> + <value name="GL_LINE_SMOOTH"/> + <value name="GL_CULL_FACE"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_MULTISAMPLE"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_ALPHA_TO_ONE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_TEXTURE_2D"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_ALPHA_TEST"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_BLEND"/> + <value name="GL_DITHER"/> + <value name="GL_COLOR_LOGIC_OP"/> + + <value name="GL_POINT_SPRITE_OES" category="OES_point_sprite"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_GEN_STR_OES" category="OES_texture_cube_map"/> + + <value name="GL_VERTEX_ARRAY"/> + <value name="GL_NORMAL_ARRAY"/> + <value name="GL_COLOR_ARRAY"/> + <value name="GL_TEXTURE_COORD_ARRAY"/> + <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/> + </desc> + + <desc name="cap" category="GLES2.0"> + <value name="GL_CULL_FACE"/> + <value name="GL_SCISSOR_TEST"/> + <value name="GL_POLYGON_OFFSET_FILL"/> + <value name="GL_SAMPLE_ALPHA_TO_COVERAGE"/> + <value name="GL_SAMPLE_COVERAGE"/> + <value name="GL_STENCIL_TEST"/> + <value name="GL_DEPTH_TEST"/> + <value name="GL_DITHER"/> + <value name="GL_BLEND"/> + </desc> +</template> + +<template name="DepthRange"> + <proto> + <return type="void"/> + <param name="zNear" type="GLtype"/> + <param name="zFar" type="GLtype"/> + </proto> +</template> + +<template name="Frustum"> + <proto> + <return type="void"/> + <param name="left" type="GLtype"/> + <param name="right" type="GLtype"/> + <param name="bottom" type="GLtype"/> + <param name="top" type="GLtype"/> + <param name="zNear" type="GLtype"/> + <param name="zFar" type="GLtype"/> + </proto> +</template> + +<template name="LoadIdentity"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="LoadMatrix"> + <proto> + <return type="void"/> + <vector name="m" type="const GLtype *" size="16"/> + </proto> +</template> + +<template name="MatrixMode"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="mode"> + <value name="GL_MODELVIEW"/> + <value name="GL_PROJECTION"/> + <value name="GL_TEXTURE"/> + <value name="GL_MATRIX_PALETTE_OES" category="OES_matrix_palette"/> + </desc> +</template> + +<template name="MultMatrix"> + <proto> + <return type="void"/> + <vector name="m" type="const GLtype *" size="16"/> + </proto> +</template> + +<template name="Ortho"> + <proto> + <return type="void"/> + <param name="left" type="GLtype"/> + <param name="right" type="GLtype"/> + <param name="bottom" type="GLtype"/> + <param name="top" type="GLtype"/> + <param name="zNear" type="GLtype"/> + <param name="zFar" type="GLtype"/> + </proto> +</template> + +<template name="PopMatrix"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="PushMatrix"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="Rotate"> + <proto> + <return type="void"/> + <param name="angle" type="GLtype"/> + <param name="x" type="GLtype"/> + <param name="y" type="GLtype"/> + <param name="z" type="GLtype"/> + </proto> +</template> + +<template name="Scale"> + <proto> + <return type="void"/> + <param name="x" type="GLtype"/> + <param name="y" type="GLtype"/> + <param name="z" type="GLtype"/> + </proto> +</template> + +<template name="Translate"> + <proto> + <return type="void"/> + <param name="x" type="GLtype"/> + <param name="y" type="GLtype"/> + <param name="z" type="GLtype"/> + </proto> +</template> + +<template name="Viewport"> + <proto> + <return type="void"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </proto> +</template> + +<template name="ColorPointer"> + <proto> + <return type="void"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="size" error="GL_INVALID_VALUE"> + <value name="4"/> + </desc> + + <desc name="type"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/> + </desc> +</template> + +<template name="DisableClientState"> + <proto> + <return type="void"/> + <param name="array" type="GLenum"/> + </proto> + + <desc name="array"> + <value name="GL_VERTEX_ARRAY"/> + <value name="GL_NORMAL_ARRAY"/> + <value name="GL_COLOR_ARRAY"/> + <value name="GL_TEXTURE_COORD_ARRAY"/> + <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/> + </desc> +</template> + +<template name="DrawArrays"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + <param name="first" type="GLint"/> + <param name="count" type="GLsizei"/> + </proto> + + <desc name="mode"> + <value name="GL_POINTS"/> + <value name="GL_LINES"/> + <value name="GL_LINE_LOOP"/> + <value name="GL_LINE_STRIP"/> + <value name="GL_TRIANGLES"/> + <value name="GL_TRIANGLE_STRIP"/> + <value name="GL_TRIANGLE_FAN"/> + </desc> +</template> + +<template name="DrawElements"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + </proto> + + <desc name="mode"> + <value name="GL_POINTS"/> + <value name="GL_LINES"/> + <value name="GL_LINE_LOOP"/> + <value name="GL_LINE_STRIP"/> + <value name="GL_TRIANGLES"/> + <value name="GL_TRIANGLE_STRIP"/> + <value name="GL_TRIANGLE_FAN"/> + </desc> + + <desc name="type"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT"/> + <!-- GL_UNSIGNED_INT is not defined in GLES1.1 headers --> + <value name="(0x1405 /* GL_UNSIGNED_INT */)" category="OES_element_index_uint"/> + </desc> +</template> + +<template name="EnableClientState"> + <proto> + <return type="void"/> + <param name="array" type="GLenum"/> + </proto> + + <desc name="array"> + <value name="GL_VERTEX_ARRAY"/> + <value name="GL_NORMAL_ARRAY"/> + <value name="GL_COLOR_ARRAY"/> + <value name="GL_TEXTURE_COORD_ARRAY"/> + <value name="GL_MATRIX_INDEX_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_WEIGHT_ARRAY_OES" category="OES_matrix_palette"/> + <value name="GL_POINT_SIZE_ARRAY_OES" category="OES_point_size_array"/> + </desc> +</template> + +<template name="GetPointer" direction="get"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLvoid **" size="dynamic"/> + </proto> + + <desc name="pname"> + <value name="GL_VERTEX_ARRAY_POINTER"/> + <value name="GL_NORMAL_ARRAY_POINTER"/> + <value name="GL_COLOR_ARRAY_POINTER"/> + <value name="GL_TEXTURE_COORD_ARRAY_POINTER"/> + <value name="GL_MATRIX_INDEX_ARRAY_POINTER_OES" category="OES_matrix_palette"/> + <value name="GL_WEIGHT_ARRAY_POINTER_OES" category="OES_matrix_palette"/> + <value name="GL_POINT_SIZE_ARRAY_POINTER_OES" category="OES_point_size_array"/> + </desc> +</template> + +<template name="Normal"> + <proto> + <return type="void"/> + <vector name="v" type="const GLtype *" size="3"> + <param name="nx" type="GLtype"/> + <param name="ny" type="GLtype"/> + <param name="nz" type="GLtype"/> + </vector> + </proto> +</template> + +<template name="NormalPointer"> + <proto> + <return type="void"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="type"> + <value name="GL_BYTE"/> + <value name="GL_SHORT"/> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/> + </desc> +</template> + +<template name="TexCoordPointer"> + <proto> + <return type="void"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="size" error="GL_INVALID_VALUE"> + <value name="2"/> + <value name="3"/> + <value name="4"/> + </desc> + + <desc name="type"> + <value name="GL_BYTE"/> + <value name="GL_SHORT"/> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/> + </desc> +</template> + +<template name="VertexPointer"> + <proto> + <return type="void"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="size" error="GL_INVALID_VALUE"> + <value name="2"/> + <value name="3"/> + <value name="4"/> + </desc> + + <desc name="type"> + <value name="GL_BYTE"/> + <value name="GL_SHORT"/> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/> + </desc> +</template> + +<template name="PolygonOffset"> + <proto> + <return type="void"/> + <param name="factor" type="GLtype"/> + <param name="units" type="GLtype"/> + </proto> +</template> + +<template name="CopyTexImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalFormat" type="GLenum"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="internalFormat" error="GL_INVALID_VALUE"> + <value name="GL_ALPHA"/> + <value name="GL_RGB"/> + <value name="GL_RGBA"/> + <value name="GL_LUMINANCE"/> + <value name="GL_LUMINANCE_ALPHA"/> + </desc> + + <desc name="border" error="GL_INVALID_VALUE"> + <value name="0"/> + </desc> +</template> + +<template name="CopyTexSubImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> +</template> + +<template name="TexSubImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="format"> + <value name="GL_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGB"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_5_6_5"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGBA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4"/> + <value name="GL_UNSIGNED_SHORT_5_5_5_1"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format" category="OES_depth_texture"> + <value name="GL_DEPTH_COMPONENT"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_SHORT"/> + <value name="GL_UNSIGNED_INT"/> + </desc> + </desc> + + <desc name="format" category="OES_packed_depth_stencil"> + <value name="GL_DEPTH_STENCIL_OES"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_INT_24_8_OES"/> + </desc> + </desc> +</template> + +<template name="BindTexture"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="texture" type="GLuint"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/> + </desc> +</template> + +<template name="DeleteTextures"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="textures" type="const GLuint *"/> + </proto> +</template> + +<template name="GenTextures" direction="get"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="textures" type="GLuint *"/> + </proto> +</template> + +<template name="IsTexture" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="texture" type="GLuint"/> + </proto> +</template> + +<template name="BlendColor"> + <proto> + <return type="void"/> + <param name="red" type="GLtype"/> + <param name="green" type="GLtype"/> + <param name="blue" type="GLtype"/> + <param name="alpha" type="GLtype"/> + </proto> +</template> + +<template name="BlendEquation"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + </proto> + + <desc name="mode"> + <value name="GL_FUNC_ADD" category="GLES2.0"/> + <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/> + + <value name="GL_MIN_EXT" category="EXT_blend_minmax"/> + <value name="GL_MAX_EXT" category="EXT_blend_minmax"/> + </desc> +</template> + +<template name="BlendEquationSeparate"> + <proto> + <return type="void"/> + <param name="modeRGB" type="GLenum"/> + <param name="modeAlpha" type="GLenum"/> + </proto> + + <desc name="modeRGB"> + <value name="GL_FUNC_ADD" category="GLES2.0"/> + <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/> + + <value name="GL_MIN_EXT" category="EXT_blend_minmax"/> + <value name="GL_MAX_EXT" category="EXT_blend_minmax"/> + </desc> + + <desc name="modeAlpha"> + <value name="GL_FUNC_ADD" category="GLES2.0"/> + <value name="GL_FUNC_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_REVERSE_SUBTRACT" category="GLES2.0"/> + <value name="GL_FUNC_ADD_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_SUBTRACT_OES" category="OES_blend_subtract"/> + <value name="GL_FUNC_REVERSE_SUBTRACT_OES" category="OES_blend_subtract"/> + + <value name="GL_MIN_EXT" category="EXT_blend_minmax"/> + <value name="GL_MAX_EXT" category="EXT_blend_minmax"/> + </desc> +</template> + +<template name="TexImage3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalFormat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_3D_OES"/> + </desc> + + <desc name="internalFormat"> + <value name="GL_ALPHA"/> + <value name="GL_RGB"/> + <value name="GL_RGBA"/> + <value name="GL_LUMINANCE"/> + <value name="GL_LUMINANCE_ALPHA"/> + </desc> + + <desc name="format"> + <value name="GL_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGB"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_5_6_5"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGBA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4"/> + <value name="GL_UNSIGNED_SHORT_5_5_5_1"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> +</template> + +<template name="TexSubImage3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="pixels" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_3D_OES"/> + </desc> + + <desc name="format"> + <value name="GL_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGB"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_5_6_5"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_RGBA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT_4_4_4_4"/> + <value name="GL_UNSIGNED_SHORT_5_5_5_1"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + <value name="GL_UNSIGNED_INT_2_10_10_10_REV_EXT" category="EXT_texture_type_2_10_10_10_REV"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> + + <desc name="format"> + <value name="GL_LUMINANCE_ALPHA"/> + + <desc name="type" error="GL_INVALID_OPERATION"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_FLOAT" category="OES_texture_float"/> + <value name="GL_HALF_FLOAT_OES" category="OES_texture_half_float"/> + </desc> + </desc> +</template> + +<template name="CopyTexSubImage3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_3D_OES"/> + </desc> +</template> + +<template name="MultiTexCoord"> + <proto> + <return type="void"/> + <param name="texture" type="GLenum"/> + <vector name="v" type="const GLtype *" size="dynamic"> + <param name="s" type="GLtype"/> + <param name="t" type="GLtype"/> + <param name="r" type="GLtype"/> + <param name="q" type="GLtype"/> + </vector> + </proto> + + <desc name="texture"> + <range base="GL_TEXTURE" from="0" to="31"/> + </desc> +</template> + +<template name="CompressedTexImage3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalFormat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="imagesize" type="GLsizei"/> + <param name="data" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_3D_OES"/> + </desc> + + <desc name="internalFormat"> + <value name="GL_3DC_X_AMD" category="AMD_compressed_3DC_texture"/> + <value name="GL_3DC_XY_AMD" category="AMD_compressed_3DC_texture"/> + <value name="GL_ATC_RGB_AMD" category="AMD_compressed_ATC_texture"/> + <value name="GL_ATC_RGBA_EXPLICIT_ALPHA_AMD" category="AMD_compressed_ATC_texture"/> + <value name="GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD" category="AMD_compressed_ATC_texture"/> + </desc> +</template> + +<template name="CompressedTexSubImage3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="zoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="depth" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="imagesize" type="GLsizei"/> + <param name="data" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_3D_OES"/> + </desc> +</template> + +<template name="ActiveTexture"> + <proto> + <return type="void"/> + <param name="texture" type="GLenum"/> + </proto> + + <desc name="texture"> + <range base="GL_TEXTURE" from="0" to="31"/> + </desc> +</template> + +<template name="ClientActiveTexture"> + <proto> + <return type="void"/> + <param name="texture" type="GLenum"/> + </proto> + + <desc name="texture"> + <range base="GL_TEXTURE" from="0" to="31"/> + </desc> +</template> + +<template name="SampleCoverage"> + <proto> + <return type="void"/> + <param name="value" type="GLtype"/> + <param name="invert" type="GLboolean"/> + </proto> +</template> + +<template name="CompressedTexImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="internalFormat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="border" type="GLint"/> + <param name="imageSize" type="GLsizei"/> + <param name="data" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="internalFormat"> + <value name="GL_ETC1_RGB8_OES" category="OES_compressed_ETC1_RGB8_texture"/> + + <value name="GL_PALETTE4_RGB8_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE4_RGBA8_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE4_R5_G6_B5_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE4_RGBA4_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE4_RGB5_A1_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE8_RGB8_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE8_RGBA8_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE8_R5_G6_B5_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE8_RGBA4_OES" category="OES_compressed_paletted_texture"/> + <value name="GL_PALETTE8_RGB5_A1_OES" category="OES_compressed_paletted_texture"/> + + <value name="GL_3DC_X_AMD" category="AMD_compressed_3DC_texture"/> + <value name="GL_3DC_XY_AMD" category="AMD_compressed_3DC_texture"/> + + <value name="GL_ATC_RGB_AMD" category="AMD_compressed_ATC_texture"/> + <value name="GL_ATC_RGBA_EXPLICIT_ALPHA_AMD" category="AMD_compressed_ATC_texture"/> + <value name="GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD" category="AMD_compressed_ATC_texture"/> + + <value name="GL_COMPRESSED_RGB_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/> + <value name="GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/> + </desc> + + <desc name="border" error="GL_INVALID_VALUE"> + <value name="0"/> + </desc> +</template> + +<template name="CompressedTexSubImage2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="level" type="GLint"/> + <param name="xoffset" type="GLint"/> + <param name="yoffset" type="GLint"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + <param name="format" type="GLenum"/> + <param name="imageSize" type="GLsizei"/> + <param name="data" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + + <desc name="format"> + <value name="GL_COMPRESSED_RGB_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/> + <value name="GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" category="EXT_texture_compression_dxt1"/> + </desc> +</template> + +<template name="BlendFuncSeparate"> + <proto> + <return type="void"/> + <param name="srcRGB" type="GLenum"/> + <param name="dstRGB" type="GLenum"/> + <param name="srcAlpha" type="GLenum"/> + <param name="dstAlpha" type="GLenum"/> + </proto> + + <desc name="srcRGB"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + <value name="GL_SRC_ALPHA_SATURATE"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> + + <desc name="dstRGB"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> + + <desc name="srcAlpha"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + <value name="GL_SRC_ALPHA_SATURATE"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> + + <desc name="dstAlpha"> + <value name="GL_ZERO"/> + <value name="GL_ONE"/> + <value name="GL_SRC_COLOR"/> + <value name="GL_ONE_MINUS_SRC_COLOR"/> + <value name="GL_SRC_ALPHA"/> + <value name="GL_ONE_MINUS_SRC_ALPHA"/> + <value name="GL_DST_ALPHA"/> + <value name="GL_ONE_MINUS_DST_ALPHA"/> + <value name="GL_DST_COLOR"/> + <value name="GL_ONE_MINUS_DST_COLOR"/> + + <value name="GL_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_COLOR" category="GLES2.0"/> + <value name="GL_CONSTANT_ALPHA" category="GLES2.0"/> + <value name="GL_ONE_MINUS_CONSTANT_ALPHA" category="GLES2.0"/> + </desc> +</template> + +<template name="PointParameter"> + <proto> + <return type="void"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="const GLtype *" size="dynamic"> + <param name="param" type="GLtype"/> + </vector> + </proto> + + <desc name="pname"> + <value name="GL_POINT_SIZE_MIN"/> + <value name="GL_POINT_SIZE_MAX"/> + <value name="GL_POINT_FADE_THRESHOLD_SIZE"/> + + <desc name="params" vector_size="1"/> + </desc> + + <desc name="pname"> + <value name="GL_POINT_DISTANCE_ATTENUATION"/> + <desc name="params" vector_size="3"/> + </desc> +</template> + +<template name="VertexAttrib"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + <vector name="v" type="const GLtype *" size="dynamic"> + <param name="x" type="GLtype"/> + <param name="y" type="GLtype"/> + <param name="z" type="GLtype"/> + <param name="w" type="GLtype"/> + </vector> + </proto> +</template> + +<template name="VertexAttribPointer"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="normalized" type="GLboolean"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </proto> + + <desc name="size" error="GL_INVALID_VALUE"> + <value name="1"/> + <value name="2"/> + <value name="3"/> + <value name="4"/> + </desc> + + <desc name="type" error="GL_INVALID_VALUE"> + <value name="GL_BYTE"/> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_SHORT"/> + <value name="GL_UNSIGNED_SHORT"/> + <value name="GL_FLOAT"/> + <value name="GL_FIXED"/> + <value name="GL_HALF_FLOAT_OES" category="OES_vertex_half_float"/> + <value name="GL_UNSIGNED_INT_10_10_10_2_OES" category="OES_vertex_type_10_10_10_2"/> + <value name="GL_INT_10_10_10_2_OES" category="OES_vertex_type_10_10_10_2"/> + </desc> + + <desc name="type" category="OES_vertex_type_10_10_10_2"> + <value name="GL_UNSIGNED_INT_10_10_10_2_OES"/> + <value name="GL_INT_10_10_10_2_OES"/> + + <desc name="size"> + <value name="3"/> + <value name="4"/> + </desc> + </desc> +</template> + +<template name="EnableVertexAttribArray"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + </proto> +</template> + +<template name="DisableVertexAttribArray"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + </proto> +</template> + +<template name="IsProgram" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="program" type="GLuint"/> + </proto> +</template> + +<template name="GetProgram" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="pname"> + <value name="GL_DELETE_STATUS"/> + <value name="GL_LINK_STATUS"/> + <value name="GL_VALIDATE_STATUS"/> + <value name="GL_INFO_LOG_LENGTH"/> + <value name="GL_ATTACHED_SHADERS"/> + <value name="GL_ACTIVE_ATTRIBUTES"/> + <value name="GL_ACTIVE_ATTRIBUTE_MAX_LENGTH"/> + <value name="GL_ACTIVE_UNIFORMS"/> + <value name="GL_ACTIVE_UNIFORM_MAX_LENGTH"/> + <value name="GL_PROGRAM_BINARY_LENGTH_OES" category="OES_get_program_binary"/> + + <desc name="params" convert="false"/> + </desc> +</template> + +<template name="GetVertexAttrib" direction="get"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="pname"> + <value name="GL_VERTEX_ATTRIB_ARRAY_ENABLED"/> + <value name="GL_VERTEX_ATTRIB_ARRAY_SIZE"/> + <value name="GL_VERTEX_ATTRIB_ARRAY_STRIDE"/> + <value name="GL_VERTEX_ATTRIB_ARRAY_TYPE"/> + <value name="GL_VERTEX_ATTRIB_ARRAY_NORMALIZED"/> + <value name="GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> + + <desc name="pname"> + <value name="GL_CURRENT_VERTEX_ATTRIB"/> + <desc name="params" vector_size="16?" convert="false"/> + </desc> +</template> + +<template name="GetVertexAttribPointer" direction="get"> + <proto> + <return type="void"/> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <vector name="pointer" type="GLvoid **" size="dynamic"/> + </proto> + + <desc name="pname"> + <value name="GL_VERTEX_ATTRIB_ARRAY_POINTER"/> + </desc> +</template> + +<template name="GetBufferPointer" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLvoid **" size="dynamic"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> + + <desc name="pname"> + <value name="GL_BUFFER_MAP_POINTER_OES"/> + </desc> +</template> + +<template name="MapBuffer" direction="get"> + <proto> + <return type="void *"/> + <param name="target" type="GLenum"/> + <param name="access" type="GLenum"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> + + <desc name="access"> + <value name="GL_WRITE_ONLY_OES"/> + </desc> +</template> + +<template name="UnmapBuffer" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="target" type="GLenum"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> +</template> + +<template name="BindBuffer"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="buffer" type="GLuint"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> +</template> + +<template name="BufferData"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="size" type="GLsizeiptr"/> + <param name="data" type="const GLvoid *"/> + <param name="usage" type="GLenum"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> + + <desc name="usage"> + <value name="GL_STATIC_DRAW"/> + <value name="GL_DYNAMIC_DRAW"/> + <value name="GL_STREAM_DRAW" category="GLES2.0"/> + </desc> +</template> + +<template name="BufferSubData"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="offset" type="GLintptr"/> + <param name="size" type="GLsizeiptr"/> + <param name="data" type="const GLvoid *"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> +</template> + +<template name="DeleteBuffers"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="buffer" type="const GLuint *"/> + </proto> +</template> + +<template name="GenBuffers" direction="get"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="buffer" type="GLuint *"/> + </proto> +</template> + +<template name="GetBufferParameter" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="target"> + <value name="GL_ARRAY_BUFFER"/> + <value name="GL_ELEMENT_ARRAY_BUFFER"/> + </desc> + + <desc name="pname"> + <value name="GL_BUFFER_SIZE"/> + <value name="GL_BUFFER_USAGE"/> + <value name="GL_BUFFER_ACCESS_OES" category="OES_mapbuffer"/> + <value name="GL_BUFFER_MAPPED_OES" category="OES_mapbuffer"/> + </desc> +</template> + +<template name="IsBuffer" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="buffer" type="GLuint"/> + </proto> +</template> + +<template name="CreateShader"> + <proto> + <return type="GLuint"/> + <param name="type" type="GLenum"/> + </proto> + + <desc name="type"> + <value name="GL_VERTEX_SHADER"/> + <value name="GL_FRAGMENT_SHADER"/> + </desc> +</template> + +<template name="ShaderSource"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + <param name="count" type="GLsizei"/> + <param name="string" type="const GLchar **"/> + <param name="length" type="const int *"/> + </proto> +</template> + +<template name="CompileShader"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + </proto> +</template> + +<template name="ReleaseShaderCompiler"> + <proto> + <return type="void"/> + </proto> +</template> + +<template name="DeleteShader"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + </proto> +</template> + +<template name="ShaderBinary"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="shaders" type="const GLuint *"/> + <param name="binaryformat" type="GLenum"/> + <param name="binary" type="const GLvoid *"/> + <param name="length" type="GLsizei"/> + </proto> +</template> + +<template name="CreateProgram"> + <proto> + <return type="GLuint"/> + </proto> +</template> + +<template name="AttachShader"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="shader" type="GLuint"/> + </proto> +</template> + +<template name="DetachShader"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="shader" type="GLuint"/> + </proto> +</template> + +<template name="LinkProgram"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + </proto> +</template> + +<template name="UseProgram"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + </proto> +</template> + +<template name="DeleteProgram"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + </proto> +</template> + +<template name="GetActiveAttrib" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="size" type="GLint *"/> + <param name="type" type="GLenum *"/> + <param name="name" type="GLchar *"/> + </proto> +</template> + +<template name="GetAttribLocation" direction="get"> + <proto> + <return type="GLint"/> + <param name="program" type="GLuint"/> + <param name="name" type="const char *"/> + </proto> +</template> + +<template name="BindAttribLocation"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="name" type="const char *"/> + </proto> +</template> + +<template name="GetUniformLocation" direction="get"> + <proto> + <return type="GLint"/> + <param name="program" type="GLuint"/> + <param name="name" type="const char *"/> + </proto> +</template> + +<template name="GetActiveUniform" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="index" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="size" type="GLint *"/> + <param name="type" type="GLenum *"/> + <param name="name" type="GLchar *"/> + </proto> +</template> + +<template name="Uniform"> + <proto> + <return type="void"/> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei" hide_if_expanded="true"/> + <vector name="values" type="const GLtype *" size="dynamic"> + <param name="v0" type="GLtype"/> + <param name="v1" type="GLtype"/> + <param name="v2" type="GLtype"/> + <param name="v3" type="GLtype"/> + </vector> + </proto> +</template> + +<template name="UniformMatrix"> + <proto> + <return type="void"/> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="transpose" type="GLboolean"/> + <vector name="value" type="const GLtype *" size="dynamic"/> + </proto> +</template> + +<template name="ValidateProgram"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + </proto> +</template> + +<template name="GenerateMipmap"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/> + </desc> +</template> + +<template name="BindFramebuffer"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="framebuffer" type="GLuint"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> +</template> + +<template name="DeleteFramebuffers"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="framebuffers" type="const GLuint *"/> + </proto> +</template> + +<template name="GenFramebuffers"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="ids" type="GLuint *"/> + </proto> +</template> + +<template name="BindRenderbuffer"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </proto> + + <desc name="target"> + <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_RENDERBUFFER" category="GLES2.0"/> + </desc> +</template> + +<template name="DeleteRenderbuffers"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="renderbuffers" type="const GLuint *"/> + </proto> +</template> + +<template name="GenRenderbuffers"> + <proto> + <return type="void"/> + <param name="n" type="GLsizei"/> + <param name="renderbuffers" type="GLuint *"/> + </proto> +</template> + +<template name="RenderbufferStorage"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="internalFormat" type="GLenum"/> + <param name="width" type="GLsizei"/> + <param name="height" type="GLsizei"/> + </proto> + + <desc name="target"> + <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_RENDERBUFFER" category="GLES2.0"/> + </desc> + + <desc name="internalFormat"> + <value name="GL_DEPTH_COMPONENT16_OES" category="OES_framebuffer_object"/> + <value name="GL_RGBA4_OES" category="OES_framebuffer_object"/> + <value name="GL_RGB5_A1_OES" category="OES_framebuffer_object"/> + <value name="GL_RGB565_OES" category="OES_framebuffer_object"/> + <value name="GL_STENCIL_INDEX8_OES" category="OES_stencil8"/> + + <value name="GL_DEPTH_COMPONENT16" category="GLES2.0"/> + <value name="GL_RGBA4" category="GLES2.0"/> + <value name="GL_RGB5_A1" category="GLES2.0"/> + <value name="GL_RGB565" category="GLES2.0"/> + <value name="GL_STENCIL_INDEX8" category="GLES2.0"/> + + <value name="GL_DEPTH_COMPONENT24_OES" category="OES_depth24"/> + <value name="GL_DEPTH_COMPONENT32_OES" category="OES_depth32"/> + <value name="GL_RGB8_OES" category="OES_rgb8_rgba8"/> + <value name="GL_RGBA8_OES" category="OES_rgb8_rgba8"/> + <value name="GL_STENCIL_INDEX1_OES" category="OES_stencil1"/> + <value name="GL_STENCIL_INDEX4_OES" category="OES_stencil4"/> + <value name="GL_DEPTH24_STENCIL8_OES" category="OES_packed_depth_stencil"/> + </desc> +</template> + +<template name="FramebufferRenderbuffer"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="renderbuffertarget" type="GLenum"/> + <param name="renderbuffer" type="GLuint"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> + + <desc name="attachment"> + <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/> + <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/> + <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/> + <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/> + </desc> + + <desc name="renderbuffertarget"> + <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_RENDERBUFFER" category="GLES2.0"/> + </desc> +</template> + +<template name="FramebufferTexture2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="textarget" type="GLenum"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> + + <desc name="attachment"> + <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/> + <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/> + <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/> + <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/> + </desc> + + <desc name="textarget" error="GL_INVALID_OPERATION"> + <value name="GL_TEXTURE_2D"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/> + <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/> + </desc> + <!-- According to the base specification, "level" must be 0. But + extension GL_OES_fbo_render_mipmap lifts that restriction, + so no restriction is placed here. --> +</template> + +<template name="FramebufferTexture3D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="textarget" type="GLenum"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + <param name="zoffset" type="GLint"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> + + <desc name="attachment"> + <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/> + <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/> + <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/> + <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/> + <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/> + </desc> + + <desc name="textarget" error="GL_INVALID_OPERATION"> + <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/> + </desc> +</template> + +<template name="CheckFramebufferStatus" direction="get"> + <proto> + <return type="GLenum"/> + <param name="target" type="GLenum"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> +</template> + +<template name="GetFramebufferAttachmentParameter" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="attachment" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="target"> + <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER" category="GLES2.0"/> + </desc> + + <desc name="pname"> + <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" category="OES_framebuffer_object"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" category="OES_framebuffer_object"/> + + <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" category="GLES2.0"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" category="GLES2.0"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" category="GLES2.0"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" category="GLES2.0"/> + <value name="GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" category="OES_texture_3D"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> +</template> + +<template name="GetRenderbufferParameter" direction="get"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="target"> + <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_RENDERBUFFER" category="GLES2.0"/> + </desc> + + <desc name="pname" category="OES_framebuffer_object"> + <value name="GL_RENDERBUFFER_WIDTH_OES"/> + <value name="GL_RENDERBUFFER_HEIGHT_OES"/> + <value name="GL_RENDERBUFFER_INTERNAL_FORMAT_OES"/> + <value name="GL_RENDERBUFFER_RED_SIZE_OES"/> + <value name="GL_RENDERBUFFER_GREEN_SIZE_OES"/> + <value name="GL_RENDERBUFFER_BLUE_SIZE_OES"/> + <value name="GL_RENDERBUFFER_ALPHA_SIZE_OES"/> + <value name="GL_RENDERBUFFER_DEPTH_SIZE_OES"/> + <value name="GL_RENDERBUFFER_STENCIL_SIZE_OES"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> + + <desc name="pname" category="GLES2.0"> + <value name="GL_RENDERBUFFER_WIDTH"/> + <value name="GL_RENDERBUFFER_HEIGHT"/> + <value name="GL_RENDERBUFFER_INTERNAL_FORMAT"/> + <value name="GL_RENDERBUFFER_RED_SIZE"/> + <value name="GL_RENDERBUFFER_GREEN_SIZE"/> + <value name="GL_RENDERBUFFER_BLUE_SIZE"/> + <value name="GL_RENDERBUFFER_ALPHA_SIZE"/> + <value name="GL_RENDERBUFFER_DEPTH_SIZE"/> + <value name="GL_RENDERBUFFER_STENCIL_SIZE"/> + + <desc name="params" vector_size="1" convert="false"/> + </desc> +</template> + +<template name="IsRenderbuffer" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="renderbuffer" type="GLuint"/> + </proto> +</template> + +<template name="IsFramebuffer" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="framebuffer" type="GLuint"/> + </proto> +</template> + +<template name="IsShader" direction="get"> + <proto> + <return type="GLboolean"/> + <param name="shader" type="GLuint"/> + </proto> +</template> + +<template name="GetShader" direction="get"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + <param name="pname" type="GLenum"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> + + <desc name="pname"> + <value name="GL_SHADER_TYPE"/> + <value name="GL_COMPILE_STATUS"/> + <value name="GL_DELETE_STATUS"/> + <value name="GL_INFO_LOG_LENGTH"/> + <value name="GL_SHADER_SOURCE_LENGTH"/> + </desc> +</template> + +<template name="GetAttachedShaders" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="maxCount" type="GLsizei"/> + <param name="count" type="GLsizei *"/> + <param name="shaders" type="GLuint *"/> + </proto> +</template> + +<template name="GetShaderInfoLog" direction="get"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="infoLog" type="GLchar *"/> + </proto> +</template> + +<template name="GetProgramInfoLog" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="infoLog" type="GLchar *"/> + </proto> +</template> + +<template name="GetShaderSource" direction="get"> + <proto> + <return type="void"/> + <param name="shader" type="GLuint"/> + <param name="bufSize" type="GLsizei"/> + <param name="length" type="GLsizei *"/> + <param name="source" type="GLchar *"/> + </proto> +</template> + +<template name="GetShaderPrecisionFormat" direction="get"> + <proto> + <return type="void"/> + <param name="shadertype" type="GLenum"/> + <param name="precisiontype" type="GLenum"/> + <param name="range" type="GLint *"/> + <param name="precision" type="GLint *"/> + </proto> + + <desc name="shadertype"> + <value name="GL_VERTEX_SHADER"/> + <value name="GL_FRAGMENT_SHADER"/> + </desc> + + <desc name="precisiontype"> + <value name="GL_LOW_FLOAT"/> + <value name="GL_MEDIUM_FLOAT"/> + <value name="GL_HIGH_FLOAT"/> + <value name="GL_LOW_INT"/> + <value name="GL_MEDIUM_INT"/> + <value name="GL_HIGH_INT"/> + </desc> +</template> + +<template name="GetUniform" direction="get"> + <proto> + <return type="void"/> + <param name="program" type="GLuint"/> + <param name="location" type="GLint"/> + <vector name="params" type="GLtype *" size="dynamic"/> + </proto> +</template> + +<template name="QueryMatrix" direction="get"> + <proto> + <return type="GLbitfield"/> + <vector name="mantissa" type="GLtype *" size="16"/> + <vector name="exponent" type="GLint *" size="16"/> + </proto> +</template> + +<template name="DrawTex"> + <proto> + <return type="void"/> + <vector name="coords" type="const GLtype *" size="5"> + <param name="x" type="GLtype"/> + <param name="y" type="GLtype"/> + <param name="z" type="GLtype"/> + <param name="w" type="GLtype"/> + <param name="h" type="GLtype"/> + </vector> + </proto> +</template> + +<template name="MultiDrawArrays"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + <param name="first" type="GLint *"/> + <param name="count" type="GLsizei *"/> + <param name="primcount" type="GLsizei"/> + </proto> + + <desc name="mode"> + <value name="GL_POINTS"/> + <value name="GL_LINES"/> + <value name="GL_LINE_LOOP"/> + <value name="GL_LINE_STRIP"/> + <value name="GL_TRIANGLES"/> + <value name="GL_TRIANGLE_STRIP"/> + <value name="GL_TRIANGLE_FAN"/> + </desc> +</template> + +<template name="MultiDrawElements"> + <proto> + <return type="void"/> + <param name="mode" type="GLenum"/> + <param name="count" type="const GLsizei *"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid **"/> + <param name="primcount" type="GLsizei"/> + </proto> + + <desc name="mode"> + <value name="GL_POINTS"/> + <value name="GL_LINES"/> + <value name="GL_LINE_LOOP"/> + <value name="GL_LINE_STRIP"/> + <value name="GL_TRIANGLES"/> + <value name="GL_TRIANGLE_STRIP"/> + <value name="GL_TRIANGLE_FAN"/> + </desc> + + <desc name="type"> + <value name="GL_UNSIGNED_BYTE"/> + <value name="GL_UNSIGNED_SHORT"/> + <!-- GL_UNSIGNED_INT is not defined in GLES1.1 headers --> + <value name="(0x1405 /* GL_UNSIGNED_INT */)" category="OES_element_index_uint"/> + </desc> +</template> + +<api name="mesa" implementation="true"> + <category name="MESA"/> + + <function name="Color4f" default_prefix="_vbo_" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="ClipPlane" template="ClipPlane" gltype="GLdouble"/> + <function name="CullFace" template="CullFace"/> + + <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/> + <function name="Fogfv" template="Fog" gltype="GLfloat"/> + + <function name="FrontFace" template="FrontFace"/> + <function name="Hint" template="Hint"/> + + <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/> + <function name="Lightfv" template="Light" gltype="GLfloat"/> + + <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/> + <function name="LightModelfv" template="LightModel" gltype="GLfloat"/> + + <function name="LineWidth" template="LineWidth" gltype="GLfloat"/> + + <function name="Materialf" default_prefix="_vbo_" template="Material" gltype="GLfloat" expand_vector="true"/> + <function name="Materialfv" default_prefix="_vbo_" template="Material" gltype="GLfloat"/> + + <function name="PointSize" template="PointSize" gltype="GLfloat"/> + <function name="PointSizePointer" template="PointSizePointer"/> + + <function name="Scissor" template="Scissor"/> + <function name="ShadeModel" template="ShadeModel"/> + + <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/> + <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/> + <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/> + <function name="TexParameteriv" template="TexParameter" gltype="GLint"/> + + <function name="TexImage2D" template="TexImage2D"/> + + <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/> + <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/> + <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/> + <function name="TexEnviv" template="TexEnv" gltype="GLint"/> + + <function name="TexGenf" template="TexGen" gltype="GLfloat" expand_vector="true"/> + <function name="TexGenfv" template="TexGen" gltype="GLfloat"/> + + <function name="Clear" template="Clear"/> + <function name="ClearColor" template="ClearColor" gltype="GLclampf"/> + <function name="ClearStencil" template="ClearStencil"/> + <function name="ClearDepth" template="ClearDepth" gltype="GLclampd"/> + + <function name="StencilMask" template="StencilMask"/> + <function name="StencilMaskSeparate" template="StencilMaskSeparate"/> + <function name="ColorMask" template="ColorMask"/> + <function name="DepthMask" template="DepthMask"/> + <function name="Disable" template="Disable"/> + <function name="Enable" template="Enable"/> + <function name="Finish" template="Finish"/> + <function name="Flush" template="Flush"/> + + <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/> + + <function name="BlendFunc" template="BlendFunc"/> + <function name="LogicOp" template="LogicOp"/> + <function name="StencilFunc" template="StencilFunc"/> + <function name="StencilFuncSeparate" template="StencilFuncSeparate"/> + <function name="StencilOp" template="StencilOp"/> + <function name="StencilOpSeparate" template="StencilOpSeparate"/> + <function name="DepthFunc" template="DepthFunc"/> + <function name="PixelStorei" template="PixelStore" gltype="GLint"/> + + <function name="ReadPixels" template="ReadPixels"/> + <function name="GetBooleanv" template="GetState" gltype="GLboolean"/> + <function name="GetClipPlane" template="GetClipPlane" gltype="GLdouble"/> + <function name="GetError" template="GetError"/> + <function name="GetFloatv" template="GetState" gltype="GLfloat"/> + <function name="GetFixedv" template="GetState" gltype="GLfixed"/> + <function name="GetIntegerv" template="GetState" gltype="GLint"/> + + <function name="GetLightfv" template="GetLight" gltype="GLfloat"/> + <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/> + <function name="GetMaterialiv" template="GetMaterial" gltype="GLint"/> + + <function name="GetString" template="GetString"/> + + <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/> + <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/> + <function name="GetTexGenfv" template="GetTexGen" gltype="GLfloat"/> + <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/> + <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/> + + <function name="IsEnabled" template="IsEnabled"/> + + <function name="DepthRange" template="DepthRange" gltype="GLclampd"/> + <function name="Frustum" template="Frustum" gltype="GLdouble"/> + + <function name="LoadIdentity" template="LoadIdentity"/> + <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/> + <function name="MatrixMode" template="MatrixMode"/> + + <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/> + <function name="Ortho" template="Ortho" gltype="GLdouble"/> + <function name="PopMatrix" template="PopMatrix"/> + <function name="PushMatrix" template="PushMatrix"/> + + <function name="Rotatef" template="Rotate" gltype="GLfloat"/> + <function name="Scalef" template="Scale" gltype="GLfloat"/> + <function name="Translatef" template="Translate" gltype="GLfloat"/> + + <function name="Viewport" template="Viewport"/> + + <function name="ColorPointer" template="ColorPointer"/> + <function name="DisableClientState" template="DisableClientState"/> + <function name="DrawArrays" template="DrawArrays"/> + <function name="DrawElements" template="DrawElements"/> + <function name="EnableClientState" template="EnableClientState"/> + + <function name="GetPointerv" template="GetPointer"/> + <function name="Normal3f" default_prefix="_vbo_" template="Normal" gltype="GLfloat" expand_vector="true"/> + <function name="NormalPointer" template="NormalPointer"/> + <function name="TexCoordPointer" template="TexCoordPointer"/> + <function name="VertexPointer" template="VertexPointer"/> + + <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/> + <function name="CopyTexImage2D" template="CopyTexImage2D"/> + <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/> + <function name="TexSubImage2D" template="TexSubImage2D"/> + + <function name="BindTexture" template="BindTexture"/> + <function name="DeleteTextures" template="DeleteTextures"/> + <function name="GenTextures" template="GenTextures"/> + <function name="IsTexture" template="IsTexture"/> + + <function name="BlendColor" template="BlendColor" gltype="GLclampf"/> + <function name="BlendEquation" template="BlendEquation"/> + <function name="BlendEquationSeparateEXT" template="BlendEquationSeparate"/> + + <function name="TexImage3D" template="TexImage3D"/> + <function name="TexSubImage3D" template="TexSubImage3D"/> + <function name="CopyTexSubImage3D" template="CopyTexSubImage3D"/> + + <function name="CompressedTexImage3DARB" template="CompressedTexImage3D"/> + <function name="CompressedTexSubImage3DARB" template="CompressedTexSubImage3D"/> + + <function name="ActiveTextureARB" template="ActiveTexture"/> + <function name="ClientActiveTextureARB" template="ClientActiveTexture"/> + + <function name="MultiTexCoord4f" default_prefix="_vbo_" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> + + <function name="SampleCoverageARB" template="SampleCoverage" gltype="GLclampf"/> + + <function name="CompressedTexImage2DARB" template="CompressedTexImage2D"/> + <function name="CompressedTexSubImage2DARB" template="CompressedTexSubImage2D"/> + + <function name="BlendFuncSeparateEXT" template="BlendFuncSeparate"/> + + <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/> + <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/> + + <function name="VertexAttrib1f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="VertexAttrib2f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="VertexAttrib3f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="VertexAttrib4f" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="VertexAttrib1fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> + <function name="VertexAttrib2fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> + <function name="VertexAttrib3fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> + <function name="VertexAttrib4fv" default_prefix="_vbo_" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> + + <function name="VertexAttribPointerARB" template="VertexAttribPointer"/> + <function name="EnableVertexAttribArrayARB" template="EnableVertexAttribArray"/> + <function name="DisableVertexAttribArrayARB" template="DisableVertexAttribArray"/> + + <function name="IsProgram" template="IsProgram"/> + <function name="GetProgramiv" template="GetProgram" gltype="GLint"/> + + <function name="GetVertexAttribfvARB" template="GetVertexAttrib" gltype="GLfloat"/> + <function name="GetVertexAttribivARB" template="GetVertexAttrib" gltype="GLint"/> + <function name="GetVertexAttribPointervARB" template="GetVertexAttribPointer"/> + + <function name="GetBufferPointervARB" template="GetBufferPointer"/> + <function name="MapBufferARB" template="MapBuffer"/> + <function name="UnmapBufferARB" template="UnmapBuffer"/> + <function name="BindBufferARB" template="BindBuffer"/> + <function name="BufferDataARB" template="BufferData"/> + <function name="BufferSubDataARB" template="BufferSubData"/> + <function name="DeleteBuffersARB" template="DeleteBuffers"/> + <function name="GenBuffersARB" template="GenBuffers"/> + <function name="GetBufferParameterivARB" template="GetBufferParameter" gltype="GLint"/> + <function name="IsBufferARB" template="IsBuffer"/> + + <function name="CreateShader" template="CreateShader"/> + <function name="ShaderSourceARB" template="ShaderSource"/> + <function name="CompileShaderARB" template="CompileShader"/> + <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/> + <function name="DeleteShader" template="DeleteShader"/> + <function name="ShaderBinary" template="ShaderBinary"/> + <function name="CreateProgram" template="CreateProgram"/> + <function name="AttachShader" template="AttachShader"/> + <function name="DetachShader" template="DetachShader"/> + <function name="LinkProgramARB" template="LinkProgram"/> + <function name="UseProgramObjectARB" template="UseProgram"/> + <function name="DeleteProgram" template="DeleteProgram"/> + + <function name="GetActiveAttribARB" template="GetActiveAttrib"/> + <function name="GetAttribLocationARB" template="GetAttribLocation"/> + <function name="BindAttribLocationARB" template="BindAttribLocation"/> + <function name="GetUniformLocationARB" template="GetUniformLocation"/> + <function name="GetActiveUniformARB" template="GetActiveUniform"/> + + <function name="Uniform1fARB" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="Uniform2fARB" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="Uniform3fARB" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="Uniform4fARB" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="Uniform1iARB" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/> + <function name="Uniform2iARB" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/> + <function name="Uniform3iARB" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/> + <function name="Uniform4iARB" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/> + <function name="Uniform1fvARB" template="Uniform" gltype="GLfloat" vector_size="1"/> + <function name="Uniform2fvARB" template="Uniform" gltype="GLfloat" vector_size="2"/> + <function name="Uniform3fvARB" template="Uniform" gltype="GLfloat" vector_size="3"/> + <function name="Uniform4fvARB" template="Uniform" gltype="GLfloat" vector_size="4"/> + <function name="Uniform1ivARB" template="Uniform" gltype="GLint" vector_size="1"/> + <function name="Uniform2ivARB" template="Uniform" gltype="GLint" vector_size="2"/> + <function name="Uniform3ivARB" template="Uniform" gltype="GLint" vector_size="3"/> + <function name="Uniform4ivARB" template="Uniform" gltype="GLint" vector_size="4"/> + + <function name="UniformMatrix2fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="2"/> + <function name="UniformMatrix3fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="3"/> + <function name="UniformMatrix4fvARB" template="UniformMatrix" gltype="GLfloat" vector_size="4"/> + + <function name="ValidateProgramARB" template="ValidateProgram"/> + + <function name="GenerateMipmapEXT" template="GenerateMipmap"/> + <function name="BindFramebufferEXT" template="BindFramebuffer"/> + <function name="DeleteFramebuffersEXT" template="DeleteFramebuffers"/> + <function name="GenFramebuffersEXT" template="GenFramebuffers"/> + <function name="BindRenderbufferEXT" template="BindRenderbuffer"/> + <function name="DeleteRenderbuffersEXT" template="DeleteRenderbuffers"/> + <function name="GenRenderbuffersEXT" template="GenRenderbuffers"/> + <function name="RenderbufferStorageEXT" template="RenderbufferStorage"/> + <function name="FramebufferRenderbufferEXT" template="FramebufferRenderbuffer"/> + <function name="FramebufferTexture2DEXT" template="FramebufferTexture2D"/> + <function name="FramebufferTexture3DEXT" template="FramebufferTexture3D"/> + <function name="CheckFramebufferStatusEXT" template="CheckFramebufferStatus"/> + <function name="GetFramebufferAttachmentParameterivEXT" template="GetFramebufferAttachmentParameter" gltype="GLint"/> + <function name="GetRenderbufferParameterivEXT" template="GetRenderbufferParameter" gltype="GLint"/> + <function name="IsRenderbufferEXT" template="IsRenderbuffer"/> + <function name="IsFramebufferEXT" template="IsFramebuffer"/> + + <function name="IsShader" template="IsShader"/> + <function name="GetShaderiv" template="GetShader" gltype="GLint"/> + <function name="GetAttachedShaders" template="GetAttachedShaders"/> + <function name="GetShaderInfoLog" template="GetShaderInfoLog"/> + <function name="GetProgramInfoLog" template="GetProgramInfoLog"/> + <function name="GetShaderSourceARB" template="GetShaderSource"/> + <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/> + <function name="GetUniformfvARB" template="GetUniform" gltype="GLfloat"/> + <function name="GetUniformivARB" template="GetUniform" gltype="GLint"/> + + <function name="DrawTexf" template="DrawTex" gltype="GLfloat" expand_vector="true"/> + <function name="DrawTexfv" template="DrawTex" gltype="GLfloat"/> + <function name="DrawTexi" template="DrawTex" gltype="GLint" expand_vector="true"/> + <function name="DrawTexiv" template="DrawTex" gltype="GLint"/> + <function name="DrawTexs" template="DrawTex" gltype="GLshort" expand_vector="true"/> + <function name="DrawTexsv" template="DrawTex" gltype="GLshort"/> + + <!-- EXT_multi_draw_arrays --> + <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> + <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> +</api> + +<api name="GLES1.1"> + <category name="GLES1.1"/> + + <category name="OES_byte_coordinates"/> + <category name="OES_fixed_point"/> + <category name="OES_single_precision"/> + <category name="OES_matrix_get"/> + <category name="OES_read_format"/> + <category name="OES_compressed_paletted_texture"/> + <category name="OES_point_size_array"/> + <category name="OES_point_sprite"/> + <category name="OES_query_matrix"/> + <category name="OES_draw_texture"/> + <category name="OES_blend_equation_separate"/> + <category name="OES_blend_func_separate"/> + <category name="OES_blend_subtract"/> + <category name="OES_stencil_wrap"/> + <category name="OES_texture_cube_map"/> + <category name="OES_texture_env_crossbar"/> + <category name="OES_texture_mirrored_repeat"/> + <category name="OES_framebuffer_object"/> + <category name="OES_depth24"/> + <category name="OES_depth32"/> + <category name="OES_fbo_render_mipmap"/> + <category name="OES_rgb8_rgba8"/> + <category name="OES_stencil1"/> + <category name="OES_stencil4"/> + <category name="OES_stencil8"/> + <category name="OES_element_index_uint"/> + <category name="OES_mapbuffer"/> + <category name="EXT_texture_filter_anisotropic"/> + + <category name="ARB_texture_non_power_of_two"/> + <!-- disabled due to missing enums + <category name="EXT_texture_compression_dxt1"/> + <category name="EXT_texture_lod_bias"/> + <category name="EXT_blend_minmax"/> + --> + <category name="EXT_multi_draw_arrays"/> + + <category name="OES_matrix_palette"/> + + <function name="Color4f" template="Color" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="Color4ub" template="Color" gltype="GLubyte" vector_size="4" expand_vector="true"/> + <function name="Color4x" template="Color" gltype="GLfixed" vector_size="4" expand_vector="true"/> + + <function name="ClipPlanef" template="ClipPlane" gltype="GLfloat"/> + <function name="ClipPlanex" template="ClipPlane" gltype="GLfixed"/> + + <function name="CullFace" template="CullFace"/> + + <function name="Fogf" template="Fog" gltype="GLfloat" expand_vector="true"/> + <function name="Fogx" template="Fog" gltype="GLfixed" expand_vector="true"/> + <function name="Fogfv" template="Fog" gltype="GLfloat"/> + <function name="Fogxv" template="Fog" gltype="GLfixed"/> + + <function name="FrontFace" template="FrontFace"/> + <function name="Hint" template="Hint"/> + + <function name="Lightf" template="Light" gltype="GLfloat" expand_vector="true"/> + <function name="Lightx" template="Light" gltype="GLfixed" expand_vector="true"/> + <function name="Lightfv" template="Light" gltype="GLfloat"/> + <function name="Lightxv" template="Light" gltype="GLfixed"/> + + <function name="LightModelf" template="LightModel" gltype="GLfloat" expand_vector="true"/> + <function name="LightModelx" template="LightModel" gltype="GLfixed" expand_vector="true"/> + <function name="LightModelfv" template="LightModel" gltype="GLfloat"/> + <function name="LightModelxv" template="LightModel" gltype="GLfixed"/> + + <function name="LineWidth" template="LineWidth" gltype="GLfloat"/> + <function name="LineWidthx" template="LineWidth" gltype="GLfixed"/> + + <function name="Materialf" template="Material" gltype="GLfloat" expand_vector="true"/> + <function name="Materialfv" template="Material" gltype="GLfloat"/> + <function name="Materialx" template="Material" gltype="GLfixed" expand_vector="true"/> + <function name="Materialxv" template="Material" gltype="GLfixed"/> + + <function name="PointSize" template="PointSize" gltype="GLfloat"/> + <function name="PointSizex" template="PointSize" gltype="GLfixed"/> + <function name="PointSizePointerOES" template="PointSizePointer"/> + + <function name="Scissor" template="Scissor"/> + <function name="ShadeModel" template="ShadeModel"/> + + <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/> + <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/> + <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/> + <function name="TexParameteriv" template="TexParameter" gltype="GLint"/> + <function name="TexParameterx" template="TexParameter" gltype="GLfixed" expand_vector="true"/> + <function name="TexParameterxv" template="TexParameter" gltype="GLfixed"/> + + <function name="TexImage2D" template="TexImage2D"/> + + <function name="TexEnvf" template="TexEnv" gltype="GLfloat" expand_vector="true"/> + <function name="TexEnvfv" template="TexEnv" gltype="GLfloat"/> + <function name="TexEnvi" template="TexEnv" gltype="GLint" expand_vector="true"/> + <function name="TexEnviv" template="TexEnv" gltype="GLint"/> + <function name="TexEnvx" template="TexEnv" gltype="GLfixed" expand_vector="true"/> + <function name="TexEnvxv" template="TexEnv" gltype="GLfixed"/> + + <function name="TexGenfOES" external="true" template="TexGen" gltype="GLfloat" expand_vector="true"/> + <function name="TexGenfvOES" external="true" template="TexGen" gltype="GLfloat"/> + <function name="TexGeniOES" external="true" template="TexGen" gltype="GLint" expand_vector="true"/> + <function name="TexGenivOES" external="true" template="TexGen" gltype="GLint"/> + <function name="TexGenxOES" external="true" template="TexGen" gltype="GLfixed" expand_vector="true"/> + <function name="TexGenxvOES" external="true" template="TexGen" gltype="GLfixed"/> + + <function name="Clear" template="Clear"/> + <function name="ClearColor" template="ClearColor" gltype="GLclampf"/> + <function name="ClearColorx" template="ClearColor" gltype="GLclampx"/> + + <function name="ClearStencil" template="ClearStencil"/> + <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/> + <function name="ClearDepthx" template="ClearDepth" gltype="GLclampx"/> + + <function name="StencilMask" template="StencilMask"/> + <function name="ColorMask" template="ColorMask"/> + <function name="DepthMask" template="DepthMask"/> + + <function name="Disable" external="true" template="Disable"/> + <function name="Enable" external="true" template="Enable"/> + <function name="Finish" template="Finish"/> + <function name="Flush" template="Flush"/> + + <function name="AlphaFunc" template="AlphaFunc" gltype="GLclampf"/> + <function name="AlphaFuncx" template="AlphaFunc" gltype="GLclampx"/> + + <function name="BlendFunc" template="BlendFunc"/> + <function name="LogicOp" template="LogicOp"/> + <function name="StencilFunc" template="StencilFunc"/> + + <function name="StencilOp" template="StencilOp"/> + <function name="DepthFunc" template="DepthFunc"/> + + <function name="PixelStorei" template="PixelStore" gltype="GLint"/> + <function name="ReadPixels" template="ReadPixels"/> + + <function name="GetBooleanv" template="GetState" gltype="GLboolean"/> + + <function name="GetClipPlanef" template="GetClipPlane" gltype="GLfloat"/> + <function name="GetClipPlanex" template="GetClipPlane" gltype="GLfixed"/> + + <function name="GetError" template="GetError"/> + <function name="GetFloatv" template="GetState" gltype="GLfloat"/> + <function name="GetFixedv" template="GetState" gltype="GLfixed"/> + <function name="GetIntegerv" template="GetState" gltype="GLint"/> + + <function name="GetLightfv" template="GetLight" gltype="GLfloat"/> + <function name="GetLightxv" template="GetLight" gltype="GLfixed"/> + + <function name="GetMaterialfv" template="GetMaterial" gltype="GLfloat"/> + <function name="GetMaterialxv" template="GetMaterial" gltype="GLfixed"/> + + <function name="GetString" external="true" template="GetString"/> + + <function name="GetTexEnvfv" template="GetTexEnv" gltype="GLfloat"/> + <function name="GetTexEnviv" template="GetTexEnv" gltype="GLint"/> + <function name="GetTexEnvxv" template="GetTexEnv" gltype="GLfixed"/> + + <function name="GetTexGenfvOES" external="true" template="GetTexGen" gltype="GLfloat"/> + <function name="GetTexGenivOES" external="true" template="GetTexGen" gltype="GLint"/> + <function name="GetTexGenxvOES" external="true" template="GetTexGen" gltype="GLfixed"/> + + <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/> + <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/> + <function name="GetTexParameterxv" template="GetTexParameter" gltype="GLfixed"/> + + <function name="IsEnabled" external="true" template="IsEnabled"/> + + <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/> + <function name="DepthRangex" template="DepthRange" gltype="GLclampx"/> + + <function name="Frustumf" template="Frustum" gltype="GLfloat"/> + <function name="Frustumx" template="Frustum" gltype="GLfixed"/> + + <function name="LoadIdentity" template="LoadIdentity"/> + <function name="LoadMatrixf" template="LoadMatrix" gltype="GLfloat"/> + <function name="LoadMatrixx" template="LoadMatrix" gltype="GLfixed"/> + <function name="MatrixMode" template="MatrixMode"/> + + <function name="MultMatrixf" template="MultMatrix" gltype="GLfloat"/> + <function name="MultMatrixx" template="MultMatrix" gltype="GLfixed"/> + <function name="Orthof" template="Ortho" gltype="GLfloat"/> + <function name="Orthox" template="Ortho" gltype="GLfixed"/> + + <function name="PopMatrix" template="PopMatrix"/> + <function name="PushMatrix" template="PushMatrix"/> + + <function name="Rotatef" template="Rotate" gltype="GLfloat"/> + <function name="Rotatex" template="Rotate" gltype="GLfixed"/> + <function name="Scalef" template="Scale" gltype="GLfloat"/> + <function name="Scalex" template="Scale" gltype="GLfixed"/> + <function name="Translatef" template="Translate" gltype="GLfloat"/> + <function name="Translatex" template="Translate" gltype="GLfixed"/> + + <function name="Viewport" template="Viewport"/> + <function name="ColorPointer" template="ColorPointer"/> + <function name="DisableClientState" template="DisableClientState"/> + <function name="DrawArrays" template="DrawArrays"/> + <function name="DrawElements" template="DrawElements"/> + <function name="EnableClientState" template="EnableClientState"/> + + <function name="GetPointerv" template="GetPointer"/> + + <function name="Normal3f" template="Normal" gltype="GLfloat" expand_vector="true"/> + <function name="Normal3x" template="Normal" gltype="GLfixed" expand_vector="true"/> + <function name="NormalPointer" template="NormalPointer"/> + <function name="TexCoordPointer" template="TexCoordPointer"/> + <function name="VertexPointer" template="VertexPointer"/> + + <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/> + <function name="PolygonOffsetx" template="PolygonOffset" gltype="GLfixed"/> + + <function name="CopyTexImage2D" template="CopyTexImage2D"/> + <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/> + + <function name="TexSubImage2D" template="TexSubImage2D"/> + + <function name="BindTexture" template="BindTexture"/> + <function name="DeleteTextures" template="DeleteTextures"/> + <function name="GenTextures" template="GenTextures"/> + <function name="IsTexture" template="IsTexture"/> + + <function name="BlendEquationOES" template="BlendEquation"/> + <function name="BlendEquationSeparateOES" template="BlendEquationSeparate"/> + + <function name="MultiTexCoord4x" template="MultiTexCoord" gltype="GLfixed" vector_size="4" expand_vector="true"/> + + <function name="ActiveTexture" template="ActiveTexture"/> + <function name="ClientActiveTexture" template="ClientActiveTexture"/> + + <function name="MultiTexCoord4f" template="MultiTexCoord" gltype="GLfloat" vector_size="4" expand_vector="true"/> + + <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/> + <function name="SampleCoveragex" template="SampleCoverage" gltype="GLclampx"/> + + <!-- CompressedTexImage2D calls out to two different functions based on + whether the image is a paletted image or not --> + <function name="CompressedTexImage2D" external="true" template="CompressedTexImage2D"/> + <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/> + + <function name="BlendFuncSeparateOES" template="BlendFuncSeparate"/> + + <function name="PointParameterf" template="PointParameter" gltype="GLfloat" expand_vector="true"/> + <function name="PointParameterfv" template="PointParameter" gltype="GLfloat"/> + <function name="PointParameterx" template="PointParameter" gltype="GLfixed" expand_vector="true"/> + <function name="PointParameterxv" template="PointParameter" gltype="GLfixed"/> + + <!-- OES_mapbuffer --> + <function name="GetBufferPointervOES" template="GetBufferPointer"/> + <function name="MapBufferOES" template="MapBuffer"/> + <function name="UnmapBufferOES" template="UnmapBuffer"/> + + <function name="BindBuffer" template="BindBuffer"/> + <function name="BufferData" template="BufferData"/> + <function name="BufferSubData" template="BufferSubData"/> + <function name="DeleteBuffers" template="DeleteBuffers"/> + <function name="GenBuffers" template="GenBuffers"/> + <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/> + <function name="IsBuffer" template="IsBuffer"/> + + <!-- OES_framebuffer_object --> + <function name="GenerateMipmapOES" template="GenerateMipmap"/> + <function name="BindFramebufferOES" template="BindFramebuffer"/> + <function name="DeleteFramebuffersOES" template="DeleteFramebuffers"/> + <function name="GenFramebuffersOES" template="GenFramebuffers"/> + <function name="BindRenderbufferOES" template="BindRenderbuffer"/> + <function name="DeleteRenderbuffersOES" template="DeleteRenderbuffers"/> + <function name="GenRenderbuffersOES" template="GenRenderbuffers"/> + <function name="RenderbufferStorageOES" external="true" template="RenderbufferStorage"/> + <function name="FramebufferRenderbufferOES" template="FramebufferRenderbuffer"/> + <function name="FramebufferTexture2DOES" template="FramebufferTexture2D"/> + <function name="CheckFramebufferStatusOES" template="CheckFramebufferStatus"/> + <function name="GetFramebufferAttachmentParameterivOES" template="GetFramebufferAttachmentParameter" gltype="GLint"/> + <function name="GetRenderbufferParameterivOES" template="GetRenderbufferParameter" gltype="GLint"/> + <function name="IsRenderbufferOES" template="IsRenderbuffer"/> + <function name="IsFramebufferOES" template="IsFramebuffer"/> + + <!-- OES_query_matrix --> + <!-- QueryMatrixx returns values in an unusual, decomposed, fixed-value + form; it has its own code for this --> + <function name="QueryMatrixxOES" external="true" template="QueryMatrix" gltype="GLfixed"/> + + <!-- OES_draw_texture --> + <function name="DrawTexfOES" template="DrawTex" gltype="GLfloat" expand_vector="true"/> + <function name="DrawTexiOES" template="DrawTex" gltype="GLint" expand_vector="true"/> + <function name="DrawTexsOES" template="DrawTex" gltype="GLshort" expand_vector="true"/> + <function name="DrawTexxOES" template="DrawTex" gltype="GLfixed" expand_vector="true"/> + <function name="DrawTexfvOES" template="DrawTex" gltype="GLfloat"/> + <function name="DrawTexivOES" template="DrawTex" gltype="GLint"/> + <function name="DrawTexsvOES" template="DrawTex" gltype="GLshort"/> + <function name="DrawTexxvOES" template="DrawTex" gltype="GLfixed"/> + + <!-- EXT_multi_draw_arrays --> + <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> + <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> +</api> + +<api name="GLES2.0"> + <category name="GLES2.0"/> + + <category name="OES_compressed_paletted_texture"/> + <category name="OES_depth24"/> + <category name="OES_depth32"/> + <category name="OES_fbo_render_mipmap"/> + <category name="OES_rgb8_rgba8"/> + <category name="OES_stencil1"/> + <category name="OES_stencil4"/> + <category name="OES_element_index_uint"/> + <category name="OES_mapbuffer"/> + <category name="OES_texture_3D"/> + <category name="OES_texture_npot"/> + <category name="EXT_texture_filter_anisotropic"/> + <category name="EXT_texture_type_2_10_10_10_REV"/> + <category name="OES_depth_texture"/> + <category name="OES_packed_depth_stencil"/> + <category name="OES_standard_derivatives"/> + + <!-- disabled due to missing enums + <category name="EXT_texture_compression_dxt1"/> + <category name="EXT_blend_minmax"/> + --> + <category name="EXT_multi_draw_arrays"/> + + <function name="CullFace" template="CullFace"/> + + <function name="FrontFace" template="FrontFace"/> + <function name="Hint" template="Hint"/> + + <function name="LineWidth" template="LineWidth" gltype="GLfloat"/> + + <function name="Scissor" template="Scissor"/> + + <function name="TexParameterf" template="TexParameter" gltype="GLfloat" expand_vector="true"/> + <function name="TexParameterfv" template="TexParameter" gltype="GLfloat"/> + <function name="TexParameteri" template="TexParameter" gltype="GLint" expand_vector="true"/> + <function name="TexParameteriv" template="TexParameter" gltype="GLint"/> + + <function name="TexImage2D" template="TexImage2D"/> + + <function name="Clear" template="Clear"/> + <function name="ClearColor" template="ClearColor" gltype="GLclampf"/> + <function name="ClearStencil" template="ClearStencil"/> + <function name="ClearDepthf" template="ClearDepth" gltype="GLclampf"/> + + <function name="StencilMask" template="StencilMask"/> + <function name="StencilMaskSeparate" template="StencilMaskSeparate"/> + <function name="ColorMask" template="ColorMask"/> + <function name="DepthMask" template="DepthMask"/> + <function name="Disable" template="Disable"/> + <function name="Enable" template="Enable"/> + <function name="Finish" template="Finish"/> + <function name="Flush" template="Flush"/> + + <function name="BlendFunc" template="BlendFunc"/> + + <function name="StencilFunc" template="StencilFunc"/> + <function name="StencilFuncSeparate" template="StencilFuncSeparate"/> + <function name="StencilOp" template="StencilOp"/> + <function name="StencilOpSeparate" template="StencilOpSeparate"/> + + <function name="DepthFunc" template="DepthFunc"/> + + <function name="PixelStorei" template="PixelStore" gltype="GLint"/> + <function name="ReadPixels" template="ReadPixels"/> + + <function name="GetBooleanv" template="GetState" gltype="GLboolean"/> + <function name="GetError" template="GetError"/> + <function name="GetFloatv" template="GetState" gltype="GLfloat"/> + <function name="GetIntegerv" template="GetState" gltype="GLint"/> + + <function name="GetString" external="true" template="GetString"/> + + <function name="GetTexParameterfv" template="GetTexParameter" gltype="GLfloat"/> + <function name="GetTexParameteriv" template="GetTexParameter" gltype="GLint"/> + + <function name="IsEnabled" template="IsEnabled"/> + + <function name="DepthRangef" template="DepthRange" gltype="GLclampf"/> + + <function name="Viewport" template="Viewport"/> + + <function name="DrawArrays" template="DrawArrays"/> + <function name="DrawElements" template="DrawElements"/> + + <function name="PolygonOffset" template="PolygonOffset" gltype="GLfloat"/> + <function name="CopyTexImage2D" template="CopyTexImage2D"/> + <function name="CopyTexSubImage2D" template="CopyTexSubImage2D"/> + <function name="TexSubImage2D" template="TexSubImage2D"/> + + <function name="BindTexture" template="BindTexture"/> + <function name="DeleteTextures" template="DeleteTextures"/> + <function name="GenTextures" template="GenTextures"/> + <function name="IsTexture" template="IsTexture"/> + + <function name="BlendColor" template="BlendColor" gltype="GLclampf"/> + <function name="BlendEquation" template="BlendEquation"/> + <function name="BlendEquationSeparate" template="BlendEquationSeparate"/> + + <function name="TexImage3DOES" template="TexImage3D"/> + <function name="TexSubImage3DOES" template="TexSubImage3D"/> + <function name="CopyTexSubImage3DOES" template="CopyTexSubImage3D"/> + + <function name="CompressedTexImage3DOES" template="CompressedTexImage3D"/> + <function name="CompressedTexSubImage3DOES" template="CompressedTexSubImage3D"/> + + <function name="ActiveTexture" template="ActiveTexture"/> + + <function name="SampleCoverage" template="SampleCoverage" gltype="GLclampf"/> + + <function name="CompressedTexImage2D" external="true" template="CompressedTexImage2D"/> + <function name="CompressedTexSubImage2D" template="CompressedTexSubImage2D"/> + + <function name="BlendFuncSeparate" template="BlendFuncSeparate"/> + + <function name="VertexAttrib1f" template="VertexAttrib" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="VertexAttrib2f" template="VertexAttrib" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="VertexAttrib3f" template="VertexAttrib" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="VertexAttrib4f" template="VertexAttrib" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="VertexAttrib1fv" template="VertexAttrib" gltype="GLfloat" vector_size="1"/> + <function name="VertexAttrib2fv" template="VertexAttrib" gltype="GLfloat" vector_size="2"/> + <function name="VertexAttrib3fv" template="VertexAttrib" gltype="GLfloat" vector_size="3"/> + <function name="VertexAttrib4fv" template="VertexAttrib" gltype="GLfloat" vector_size="4"/> + + <function name="VertexAttribPointer" template="VertexAttribPointer"/> + + <function name="EnableVertexAttribArray" template="EnableVertexAttribArray"/> + <function name="DisableVertexAttribArray" template="DisableVertexAttribArray"/> + + <function name="IsProgram" template="IsProgram"/> + <function name="GetProgramiv" template="GetProgram" gltype="GLint"/> + + <function name="GetVertexAttribfv" template="GetVertexAttrib" gltype="GLfloat"/> + <function name="GetVertexAttribiv" template="GetVertexAttrib" gltype="GLint"/> + <function name="GetVertexAttribPointerv" template="GetVertexAttribPointer"/> + + <function name="GetBufferPointervOES" template="GetBufferPointer"/> + <function name="MapBufferOES" template="MapBuffer"/> + <function name="UnmapBufferOES" template="UnmapBuffer"/> + <function name="BindBuffer" template="BindBuffer"/> + <function name="BufferData" template="BufferData"/> + <function name="BufferSubData" template="BufferSubData"/> + <function name="DeleteBuffers" template="DeleteBuffers"/> + <function name="GenBuffers" template="GenBuffers"/> + <function name="GetBufferParameteriv" template="GetBufferParameter" gltype="GLint"/> + <function name="IsBuffer" template="IsBuffer"/> + + <function name="CreateShader" template="CreateShader"/> + <function name="ShaderSource" template="ShaderSource"/> + <function name="CompileShader" template="CompileShader"/> + <function name="ReleaseShaderCompiler" template="ReleaseShaderCompiler"/> + <function name="DeleteShader" template="DeleteShader"/> + <function name="ShaderBinary" template="ShaderBinary"/> + <function name="CreateProgram" template="CreateProgram"/> + <function name="AttachShader" template="AttachShader"/> + <function name="DetachShader" template="DetachShader"/> + <function name="LinkProgram" template="LinkProgram"/> + <function name="UseProgram" template="UseProgram"/> + <function name="DeleteProgram" template="DeleteProgram"/> + + <function name="GetActiveAttrib" template="GetActiveAttrib"/> + <function name="GetAttribLocation" template="GetAttribLocation"/> + <function name="BindAttribLocation" template="BindAttribLocation"/> + <function name="GetUniformLocation" template="GetUniformLocation"/> + <function name="GetActiveUniform" template="GetActiveUniform"/> + + <function name="Uniform1f" template="Uniform" gltype="GLfloat" vector_size="1" expand_vector="true"/> + <function name="Uniform2f" template="Uniform" gltype="GLfloat" vector_size="2" expand_vector="true"/> + <function name="Uniform3f" template="Uniform" gltype="GLfloat" vector_size="3" expand_vector="true"/> + <function name="Uniform4f" template="Uniform" gltype="GLfloat" vector_size="4" expand_vector="true"/> + <function name="Uniform1i" template="Uniform" gltype="GLint" vector_size="1" expand_vector="true"/> + <function name="Uniform2i" template="Uniform" gltype="GLint" vector_size="2" expand_vector="true"/> + <function name="Uniform3i" template="Uniform" gltype="GLint" vector_size="3" expand_vector="true"/> + <function name="Uniform4i" template="Uniform" gltype="GLint" vector_size="4" expand_vector="true"/> + + <function name="Uniform1fv" template="Uniform" gltype="GLfloat" vector_size="1"/> + <function name="Uniform2fv" template="Uniform" gltype="GLfloat" vector_size="2"/> + <function name="Uniform3fv" template="Uniform" gltype="GLfloat" vector_size="3"/> + <function name="Uniform4fv" template="Uniform" gltype="GLfloat" vector_size="4"/> + <function name="Uniform1iv" template="Uniform" gltype="GLint" vector_size="1"/> + <function name="Uniform2iv" template="Uniform" gltype="GLint" vector_size="2"/> + <function name="Uniform3iv" template="Uniform" gltype="GLint" vector_size="3"/> + <function name="Uniform4iv" template="Uniform" gltype="GLint" vector_size="4"/> + + <function name="UniformMatrix2fv" template="UniformMatrix" gltype="GLfloat" vector_size="2"/> + <function name="UniformMatrix3fv" template="UniformMatrix" gltype="GLfloat" vector_size="3"/> + <function name="UniformMatrix4fv" template="UniformMatrix" gltype="GLfloat" vector_size="4"/> + + <function name="ValidateProgram" template="ValidateProgram"/> + + <function name="GenerateMipmap" template="GenerateMipmap"/> + <function name="BindFramebuffer" template="BindFramebuffer"/> + <function name="DeleteFramebuffers" template="DeleteFramebuffers"/> + <function name="GenFramebuffers" template="GenFramebuffers"/> + <function name="BindRenderbuffer" template="BindRenderbuffer"/> + <function name="DeleteRenderbuffers" template="DeleteRenderbuffers"/> + <function name="GenRenderbuffers" template="GenRenderbuffers"/> + <function name="RenderbufferStorage" external="true" template="RenderbufferStorage"/> + <function name="FramebufferRenderbuffer" template="FramebufferRenderbuffer"/> + <function name="FramebufferTexture2D" template="FramebufferTexture2D"/> + <function name="FramebufferTexture3DOES" template="FramebufferTexture3D"/> + <function name="CheckFramebufferStatus" template="CheckFramebufferStatus"/> + <function name="GetFramebufferAttachmentParameteriv" template="GetFramebufferAttachmentParameter" gltype="GLint"/> + <function name="GetRenderbufferParameteriv" template="GetRenderbufferParameter" gltype="GLint"/> + <function name="IsRenderbuffer" template="IsRenderbuffer"/> + <function name="IsFramebuffer" template="IsFramebuffer"/> + + <function name="IsShader" template="IsShader"/> + <function name="GetShaderiv" template="GetShader" gltype="GLint"/> + <function name="GetAttachedShaders" template="GetAttachedShaders"/> + <function name="GetShaderInfoLog" template="GetShaderInfoLog"/> + <function name="GetProgramInfoLog" template="GetProgramInfoLog"/> + <function name="GetShaderSource" template="GetShaderSource"/> + <function name="GetShaderPrecisionFormat" template="GetShaderPrecisionFormat"/> + <function name="GetUniformfv" template="GetUniform" gltype="GLfloat"/> + <function name="GetUniformiv" template="GetUniform" gltype="GLint"/> + + <!-- EXT_multi_draw_arrays --> + <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> + <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> +</api> + +</apispec> diff --git a/src/mesa/es/main/APIspecutil.py b/src/mesa/es/main/APIspecutil.py new file mode 100644 index 0000000000..27a8fe8a6d --- /dev/null +++ b/src/mesa/es/main/APIspecutil.py @@ -0,0 +1,265 @@ +#!/usr/bin/python +# +# Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +""" +Minimal apiutil.py interface for use by es_generator.py. +""" + +import sys +import libxml2 + +import APIspec + +__spec = {} +__functions = {} +__aliases = {} + +def _ParseXML(filename, apiname): + conversions = { + # from to + 'GLfloat': [ 'GLdouble' ], + 'GLclampf': [ 'GLclampd' ], + 'GLubyte': [ 'GLfloat', 'GLdouble' ], + 'GLint': [ 'GLfloat', 'GLdouble' ], + 'GLfixed': [ 'GLfloat', 'GLdouble' ], + 'GLclampx': [ 'GLclampf', 'GLclampd' ], + } + + doc = libxml2.readFile(filename, None, + libxml2.XML_PARSE_DTDLOAD + + libxml2.XML_PARSE_DTDVALID + + libxml2.XML_PARSE_NOBLANKS) + spec = APIspec.Spec(doc) + impl = spec.get_impl() + api = spec.get_api(apiname) + doc.freeDoc() + + __spec["impl"] = impl + __spec["api"] = api + + for func in api.functions: + alias, need_conv = impl.match(func, conversions) + if not alias: + # external functions are manually dispatched + if not func.is_external: + print >>sys.stderr, "Error: unable to dispatch %s" % func.name + alias = func + need_conv = False + + __functions[func.name] = func + __aliases[func.name] = (alias, need_conv) + + +def AllSpecials(notused=None): + """Return a list of all external functions in the API.""" + api = __spec["api"] + + specials = [] + for func in api.functions: + if func.is_external: + specials.append(func.name) + + return specials + + +def GetAllFunctions(filename, api): + """Return sorted list of all functions in the API.""" + if not __spec: + _ParseXML(filename, api) + + api = __spec["api"] + names = [] + for func in api.functions: + names.append(func.name) + names.sort() + return names + + +def ReturnType(funcname): + """Return the C return type of named function.""" + func = __functions[funcname] + return func.return_type + + +def Properties(funcname): + """Return list of properties of the named GL function.""" + func = __functions[funcname] + return [func.direction] + + +def _ValidValues(func, param): + """Return the valid values of a parameter.""" + valid_values = [] + switch = func.checker.switches.get(param.name, []) + for desc in switch: + # no dependent vector + if not desc.checker.switches: + for val in desc.values: + valid_values.append((val, None, None, [], desc.error, None)) + continue + + items = desc.checker.switches.items() + if len(items) > 1: + print >>sys.stderr, "%s: more than one parameter depend on %s" % \ + (func.name, desc.name) + dep_name, dep_switch = items[0] + + for dep_desc in dep_switch: + if dep_desc.index >= 0 and dep_desc.index != 0: + print >>sys.stderr, "%s: not first element of a vector" % func.name + if dep_desc.checker.switches: + print >>sys.stderr, "%s: deep nested dependence" % func.name + + convert = None if dep_desc.convert else "noconvert" + for val in desc.values: + valid_values.append((val, dep_desc.size_str, dep_desc.name, + dep_desc.values, dep_desc.error, convert)) + return valid_values + + +def _Conversion(func, src_param): + """Return the destination type of the conversion, or None.""" + alias, need_conv = __aliases[func.name] + if need_conv: + dst_param = alias.get_param(src_param.name) + if src_param.type == dst_param.type: + need_conv = False + if not need_conv: + return (None, "none") + + converts = { True: 0, False: 0 } + + # In Fogx, for example, pname may be GL_FOG_DENSITY/GL_FOG_START/GL_FOG_END + # or GL_FOG_MODE. In the former three cases, param is not checked and the + # default is to convert. + if not func.checker.always_check(src_param.name): + converts[True] += 1 + + for desc in func.checker.flatten(src_param.name): + converts[desc.convert] += 1 + if converts[True] and converts[False]: + break + + # it should be "never", "sometimes", and "always"... + if converts[False]: + if converts[True]: + conversion = "some" + else: + conversion = "none" + else: + conversion = "all" + + return (dst_param.base_type(), conversion) + + +def _MaxVecSize(func, param): + """Return the largest possible size of a vector.""" + if not param.is_vector: + return 0 + if param.size: + return param.size + + # need to look at all descriptions + size = 0 + for desc in func.checker.flatten(param.name): + if desc.size_str and desc.size_str.isdigit(): + s = int(desc.size_str) + if s > size: + size = s + if not size: + need_conv = __aliases[func.name][1] + if need_conv: + print >>sys.stderr, \ + "Error: unable to dicide the max size of %s in %s" % \ + (param.name, func.name) + return size + + +def _ParameterTuple(func, param): + """Return a parameter tuple. + + [0] -- parameter name + [1] -- parameter type + [2] -- max vector size or 0 + [3] -- dest type the parameter converts to, or None + [4] -- valid values + [5] -- how often does the conversion happen + + """ + vec_size = _MaxVecSize(func, param) + dst_type, conversion = _Conversion(func, param) + valid_values = _ValidValues(func, param) + + return (param.name, param.type, vec_size, dst_type, valid_values, conversion) + + +def Parameters(funcname): + """Return list of tuples of function parameters.""" + func = __functions[funcname] + params = [] + for param in func.params: + params.append(_ParameterTuple(func, param)) + + return params + + +def FindParamIndex(params, paramname): + """Find the index of a named parameter.""" + for i in xrange(len(params)): + if params[i][0] == paramname: + return i + return None + + +def MakeDeclarationString(params): + """Return a C-style parameter declaration string.""" + string = [] + for p in params: + sep = "" if p[1].endswith("*") else " " + string.append("%s%s%s" % (p[1], sep, p[0])) + if not string: + return "void" + return ", ".join(string) + + +def AliasPrefix(funcname): + """Return the prefix of the function the named function is an alias of.""" + alias = __aliases[funcname][0] + return alias.prefix + + +def Alias(funcname): + """Return the name of the function the named function is an alias of.""" + alias, need_conv = __aliases[funcname] + return alias.name if not need_conv else None + + +def ConversionFunction(funcname): + """Return the name of the function the named function converts to.""" + alias, need_conv = __aliases[funcname] + return alias.name if need_conv else None + + +def Categories(funcname): + """Return all the categories of the named GL function.""" + api = __spec["api"] + return [api.name] diff --git a/src/mesa/es/main/drawtex.c b/src/mesa/es/main/drawtex.c new file mode 100644 index 0000000000..cbd41ca975 --- /dev/null +++ b/src/mesa/es/main/drawtex.c @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "drawtex.h" +#include "main/state.h" +#include "main/imports.h" + +#include "glapi/dispatch.h" + + +#if FEATURE_OES_draw_texture + + +static void +draw_texture(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, + GLfloat width, GLfloat height) +{ + if (!ctx->Extensions.OES_draw_texture) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawTex(unsupported)"); + return; + } + if (width <= 0.0f || height <= 0.0f) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTex(width or height <= 0)"); + return; + } + + if (ctx->NewState) + _mesa_update_state(ctx); + + ASSERT(ctx->Driver.DrawTex); + ctx->Driver.DrawTex(ctx, x, y, z, width, height); +} + + +void GLAPIENTRY +_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, x, y, z, width, height); +} + + +void GLAPIENTRY +_mesa_DrawTexfv(const GLfloat *coords) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, coords[0], coords[1], coords[2], coords[3], coords[4]); +} + + +void GLAPIENTRY +_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z, + (GLfloat) width, (GLfloat) height); +} + + +void GLAPIENTRY +_mesa_DrawTexiv(const GLint *coords) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1], + (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]); +} + + +void GLAPIENTRY +_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, (GLfloat) x, (GLfloat) y, (GLfloat) z, + (GLfloat) width, (GLfloat) height); +} + + +void GLAPIENTRY +_mesa_DrawTexsv(const GLshort *coords) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, (GLfloat) coords[0], (GLfloat) coords[1], + (GLfloat) coords[2], (GLfloat) coords[3], (GLfloat) coords[4]); +} + + +void GLAPIENTRY +_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, + (GLfloat) x / 65536.0f, + (GLfloat) y / 65536.0f, + (GLfloat) z / 65536.0f, + (GLfloat) width / 65536.0f, + (GLfloat) height / 65536.0f); +} + + +void GLAPIENTRY +_mesa_DrawTexxv(const GLfixed *coords) +{ + GET_CURRENT_CONTEXT(ctx); + draw_texture(ctx, + (GLfloat) coords[0] / 65536.0f, + (GLfloat) coords[1] / 65536.0f, + (GLfloat) coords[2] / 65536.0f, + (GLfloat) coords[3] / 65536.0f, + (GLfloat) coords[4] / 65536.0f); +} + + +void +_mesa_init_drawtex_dispatch(struct _glapi_table *disp) +{ + SET_DrawTexfOES(disp, _mesa_DrawTexf); + SET_DrawTexfvOES(disp, _mesa_DrawTexfv); + SET_DrawTexiOES(disp, _mesa_DrawTexi); + SET_DrawTexivOES(disp, _mesa_DrawTexiv); + SET_DrawTexsOES(disp, _mesa_DrawTexs); + SET_DrawTexsvOES(disp, _mesa_DrawTexsv); + SET_DrawTexxOES(disp, _mesa_DrawTexx); + SET_DrawTexxvOES(disp, _mesa_DrawTexxv); +} + + +#endif /* FEATURE_OES_draw_texture */ diff --git a/src/mesa/es/main/drawtex.h b/src/mesa/es/main/drawtex.h new file mode 100644 index 0000000000..0f3bac38c7 --- /dev/null +++ b/src/mesa/es/main/drawtex.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef DRAWTEX_H +#define DRAWTEX_H + + +#include "main/mtypes.h" + + +#if FEATURE_OES_draw_texture + +#define _MESA_INIT_DRAWTEX_FUNCTIONS(driver, impl) \ + do { \ + (driver)->DrawTex = impl ## DrawTex; \ + } while (0) + +extern void GLAPIENTRY +_mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); + +extern void GLAPIENTRY +_mesa_DrawTexfv(const GLfloat *coords); + +extern void GLAPIENTRY +_mesa_DrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height); + +extern void GLAPIENTRY +_mesa_DrawTexiv(const GLint *coords); + +extern void GLAPIENTRY +_mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); + +extern void GLAPIENTRY +_mesa_DrawTexsv(const GLshort *coords); + +extern void GLAPIENTRY +_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); + +extern void GLAPIENTRY +_mesa_DrawTexxv(const GLfixed *coords); + +extern void +_mesa_init_drawtex_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_OES_draw_texture */ + +#define _MESA_INIT_DRAWTEX_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_init_drawtex_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_OES_draw_texture */ + + +#endif /* DRAWTEX_H */ diff --git a/src/mesa/es/main/es_cpaltex.c b/src/mesa/es/main/es_cpaltex.c new file mode 100644 index 0000000000..0c497774ff --- /dev/null +++ b/src/mesa/es/main/es_cpaltex.c @@ -0,0 +1,231 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + **************************************************************************/ + + +/** + * Code to convert compressed/paletted texture images to ordinary images. + * See the GL_OES_compressed_paletted_texture spec at + * http://khronos.org/registry/gles/extensions/OES/OES_compressed_paletted_texture.txt + * + * XXX this makes it impossible to add hardware support... + */ + + +#include "GLES/gl.h" +#include "GLES/glext.h" + +#include "main/compiler.h" /* for ASSERT */ + + +void GL_APIENTRY _es_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); + +void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params); +void GL_APIENTRY _mesa_PixelStorei(GLenum pname, GLint param); +void GL_APIENTRY _mesa_TexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +void GL_APIENTRY _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); + +void *_mesa_get_current_context(void); +void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... ); + + +static const struct cpal_format_info { + GLenum cpal_format; + GLenum format; + GLenum type; + GLuint palette_size; + GLuint size; +} formats[] = { + { GL_PALETTE4_RGB8_OES, GL_RGB, GL_UNSIGNED_BYTE, 16, 3 }, + { GL_PALETTE4_RGBA8_OES, GL_RGBA, GL_UNSIGNED_BYTE, 16, 4 }, + { GL_PALETTE4_R5_G6_B5_OES, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 16, 2 }, + { GL_PALETTE4_RGBA4_OES, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 16, 2 }, + { GL_PALETTE4_RGB5_A1_OES, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 16, 2 }, + { GL_PALETTE8_RGB8_OES, GL_RGB, GL_UNSIGNED_BYTE, 256, 3 }, + { GL_PALETTE8_RGBA8_OES, GL_RGBA, GL_UNSIGNED_BYTE, 256, 4 }, + { GL_PALETTE8_R5_G6_B5_OES, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 256, 2 }, + { GL_PALETTE8_RGBA4_OES, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 256, 2 }, + { GL_PALETTE8_RGB5_A1_OES, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 256, 2 } +}; + + +/** + * Get a color/entry from the palette. + */ +static GLuint +get_palette_entry(const struct cpal_format_info *info, const GLubyte *palette, + GLuint index, GLubyte *pixel) +{ + memcpy(pixel, palette + info->size * index, info->size); + return info->size; +} + + +/** + * Convert paletted texture to color texture. + */ +static void +paletted_to_color(const struct cpal_format_info *info, const GLubyte *palette, + const void *indices, GLuint num_pixels, GLubyte *image) +{ + GLubyte *pix = image; + GLuint remain, i; + + if (info->palette_size == 16) { + /* 4 bits per index */ + const GLubyte *ind = (const GLubyte *) indices; + + /* two pixels per iteration */ + remain = num_pixels % 2; + for (i = 0; i < num_pixels / 2; i++) { + pix += get_palette_entry(info, palette, (ind[i] >> 4) & 0xf, pix); + pix += get_palette_entry(info, palette, ind[i] & 0xf, pix); + } + if (remain) { + get_palette_entry(info, palette, (ind[i] >> 4) & 0xf, pix); + } + } + else { + /* 8 bits per index */ + const GLubyte *ind = (const GLubyte *) indices; + for (i = 0; i < num_pixels; i++) + pix += get_palette_entry(info, palette, ind[i], pix); + } +} + + +static const struct cpal_format_info * +cpal_get_info(GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei imageSize) +{ + const struct cpal_format_info *info; + GLint lvl, num_levels; + GLsizei w, h, expect_size; + + info = &formats[internalFormat - GL_PALETTE4_RGB8_OES]; + ASSERT(info->cpal_format == internalFormat); + + if (level > 0) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, + "glCompressedTexImage2D(level=%d)", level); + return NULL; + } + + num_levels = -level + 1; + expect_size = info->palette_size * info->size; + for (lvl = 0; lvl < num_levels; lvl++) { + w = width >> lvl; + if (!w) + w = 1; + h = height >> lvl; + if (!h) + h = 1; + + if (info->palette_size == 16) + expect_size += (w * h + 1) / 2; + else + expect_size += w * h; + } + if (expect_size > imageSize) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, + "glCompressedTexImage2D(imageSize=%d)", imageSize); + return NULL; + } + return info; +} + +/** + * Convert a call to glCompressedTexImage2D() where internalFormat is a + * compressed palette format into a regular GLubyte/RGBA glTexImage2D() call. + */ +static void +cpal_compressed_teximage2d(GLenum target, GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei imageSize, + const void *palette) +{ + const struct cpal_format_info *info; + GLint lvl, num_levels; + const GLubyte *indices; + GLint saved_align, align; + + info = cpal_get_info(level, internalFormat, width, height, imageSize); + if (!info) + return; + + info = &formats[internalFormat - GL_PALETTE4_RGB8_OES]; + ASSERT(info->cpal_format == internalFormat); + num_levels = -level + 1; + + /* first image follows the palette */ + indices = (const GLubyte *) palette + info->palette_size * info->size; + + _mesa_GetIntegerv(GL_UNPACK_ALIGNMENT, &saved_align); + align = saved_align; + + for (lvl = 0; lvl < num_levels; lvl++) { + GLsizei w, h; + GLuint num_texels; + GLubyte *image = NULL; + + w = width >> lvl; + if (!w) + w = 1; + h = height >> lvl; + if (!h) + h = 1; + num_texels = w * h; + if (w * info->size % align) { + _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1); + align = 1; + } + + /* allocate and fill dest image buffer */ + if (palette) { + image = (GLubyte *) malloc(num_texels * info->size); + paletted_to_color(info, palette, indices, num_texels, image); + } + + _mesa_TexImage2D(target, lvl, info->format, w, h, 0, + info->format, info->type, image); + if (image) + free(image); + + /* advance index pointer to point to next src mipmap */ + if (info->palette_size == 16) + indices += (num_texels + 1) / 2; + else + indices += num_texels; + } + + if (saved_align != align) + _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, saved_align); +} + + +void GL_APIENTRY +_es_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, + GLsizei width, GLsizei height, GLint border, + GLsizei imageSize, const GLvoid *data) +{ + switch (internalFormat) { + case GL_PALETTE4_RGB8_OES: + case GL_PALETTE4_RGBA8_OES: + case GL_PALETTE4_R5_G6_B5_OES: + case GL_PALETTE4_RGBA4_OES: + case GL_PALETTE4_RGB5_A1_OES: + case GL_PALETTE8_RGB8_OES: + case GL_PALETTE8_RGBA8_OES: + case GL_PALETTE8_R5_G6_B5_OES: + case GL_PALETTE8_RGBA4_OES: + case GL_PALETTE8_RGB5_A1_OES: + cpal_compressed_teximage2d(target, level, internalFormat, + width, height, imageSize, data); + break; + default: + _mesa_CompressedTexImage2DARB(target, level, internalFormat, + width, height, border, imageSize, data); + } +} diff --git a/src/mesa/es/main/es_enable.c b/src/mesa/es/main/es_enable.c new file mode 100644 index 0000000000..351caacd77 --- /dev/null +++ b/src/mesa/es/main/es_enable.c @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "GLES/gl.h" +#include "GLES/glext.h" + +#include "main/compiler.h" /* for ASSERT */ + + +#ifndef GL_TEXTURE_GEN_S +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#endif + + +extern void GL_APIENTRY _es_Disable(GLenum cap); +extern void GL_APIENTRY _es_Enable(GLenum cap); +extern GLboolean GL_APIENTRY _es_IsEnabled(GLenum cap); + +extern void GL_APIENTRY _mesa_Disable(GLenum cap); +extern void GL_APIENTRY _mesa_Enable(GLenum cap); +extern GLboolean GL_APIENTRY _mesa_IsEnabled(GLenum cap); + + +void GL_APIENTRY +_es_Disable(GLenum cap) +{ + switch (cap) { + case GL_TEXTURE_GEN_STR_OES: + /* disable S, T, and R at the same time */ + _mesa_Disable(GL_TEXTURE_GEN_S); + _mesa_Disable(GL_TEXTURE_GEN_T); + _mesa_Disable(GL_TEXTURE_GEN_R); + break; + default: + _mesa_Disable(cap); + break; + } +} + + +void GL_APIENTRY +_es_Enable(GLenum cap) +{ + switch (cap) { + case GL_TEXTURE_GEN_STR_OES: + /* enable S, T, and R at the same time */ + _mesa_Enable(GL_TEXTURE_GEN_S); + _mesa_Enable(GL_TEXTURE_GEN_T); + _mesa_Enable(GL_TEXTURE_GEN_R); + break; + default: + _mesa_Enable(cap); + break; + } +} + + +GLboolean GL_APIENTRY +_es_IsEnabled(GLenum cap) +{ + switch (cap) { + case GL_TEXTURE_GEN_STR_OES: + cap = GL_TEXTURE_GEN_S; + default: + break; + } + + return _mesa_IsEnabled(cap); +} diff --git a/src/mesa/es/main/es_fbo.c b/src/mesa/es/main/es_fbo.c new file mode 100644 index 0000000000..1803637830 --- /dev/null +++ b/src/mesa/es/main/es_fbo.c @@ -0,0 +1,37 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + **************************************************************************/ + + +#include "GLES2/gl2.h" +#include "GLES2/gl2ext.h" + + +#ifndef GL_RGB5 +#define GL_RGB5 0x8050 +#endif + + +extern void GL_APIENTRY _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height); + +extern void GL_APIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height); + + +void GL_APIENTRY +_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + switch (internalFormat) { + case GL_RGB565: + /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */ + /* choose a closest format */ + internalFormat = GL_RGB5; + break; + default: + break; + } + _mesa_RenderbufferStorageEXT(target, internalFormat, width, height); +} diff --git a/src/mesa/es/main/es_generator.py b/src/mesa/es/main/es_generator.py new file mode 100644 index 0000000000..590f5940a7 --- /dev/null +++ b/src/mesa/es/main/es_generator.py @@ -0,0 +1,685 @@ +#************************************************************************* +# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +#************************************************************************* + + +import sys, os +import APIspecutil as apiutil + +# These dictionary entries are used for automatic conversion. +# The string will be used as a format string with the conversion +# variable. +Converters = { + 'GLfloat': { + 'GLdouble': "(GLdouble) (%s)", + 'GLfixed' : "(GLint) (%s * 65536)", + }, + 'GLfixed': { + 'GLfloat': "(GLfloat) (%s / 65536.0f)", + 'GLdouble': "(GLdouble) (%s / 65536.0)", + }, + 'GLdouble': { + 'GLfloat': "(GLfloat) (%s)", + 'GLfixed': "(GLfixed) (%s * 65536)", + }, + 'GLclampf': { + 'GLclampd': "(GLclampd) (%s)", + 'GLclampx': "(GLclampx) (%s * 65536)", + }, + 'GLclampx': { + 'GLclampf': "(GLclampf) (%s / 65536.0f)", + 'GLclampd': "(GLclampd) (%s / 65536.0)", + }, + 'GLubyte': { + 'GLfloat': "(GLfloat) (%s / 255.0f)", + }, +} + +def GetBaseType(type): + typeTokens = type.split(' ') + baseType = None + typeModifiers = [] + for t in typeTokens: + if t in ['const', '*']: + typeModifiers.append(t) + else: + baseType = t + return (baseType, typeModifiers) + +def ConvertValue(value, fromType, toType): + """Returns a string that represents the given parameter string, + type-converted if necessary.""" + + if not Converters.has_key(fromType): + print >> sys.stderr, "No base converter for type '%s' found. Ignoring." % fromType + return value + + if not Converters[fromType].has_key(toType): + print >> sys.stderr, "No converter found for type '%s' to type '%s'. Ignoring." % (fromType, toType) + return value + + # This part is simple. Return the proper conversion. + conversionString = Converters[fromType][toType] + return conversionString % value + +FormatStrings = { + 'GLenum' : '0x%x', + 'GLfloat' : '%f', + 'GLint' : '%d', + 'GLbitfield' : '0x%x', +} +def GetFormatString(type): + if FormatStrings.has_key(type): + return FormatStrings[type] + else: + return None + + +###################################################################### +# Version-specific values to be used in the main script +# header: which header file to include +# api: what text specifies an API-level function +VersionSpecificValues = { + 'GLES1.1' : { + 'description' : 'GLES1.1 functions', + 'header' : 'GLES/gl.h', + 'extheader' : 'GLES/glext.h', + }, + 'GLES2.0': { + 'description' : 'GLES2.0 functions', + 'header' : 'GLES2/gl2.h', + 'extheader' : 'GLES2/gl2ext.h', + } +} + + +###################################################################### +# Main code for the script begins here. + +# Get the name of the program (without the directory part) for use in +# error messages. +program = os.path.basename(sys.argv[0]) + +# Set default values +verbose = 0 +functionList = "APIspec.xml" +version = "GLES1.1" + +# Allow for command-line switches +import getopt, time +options = "hvV:S:" +try: + optlist, args = getopt.getopt(sys.argv[1:], options) +except getopt.GetoptError, message: + sys.stderr.write("%s: %s. Use -h for help.\n" % (program, message)) + sys.exit(1) + +for option, optarg in optlist: + if option == "-h": + sys.stderr.write("Usage: %s [-%s]\n" % (program, options)) + sys.stderr.write("Parse an API specification file and generate wrapper functions for a given GLES version\n") + sys.stderr.write("-h gives help\n") + sys.stderr.write("-v is verbose\n") + sys.stderr.write("-V specifies GLES version to generate [%s]:\n" % version) + for key in VersionSpecificValues.keys(): + sys.stderr.write(" %s - %s\n" % (key, VersionSpecificValues[key]['description'])) + sys.stderr.write("-S specifies API specification file to use [%s]\n" % functionList) + sys.exit(1) + elif option == "-v": + verbose += 1 + elif option == "-V": + version = optarg + elif option == "-S": + functionList = optarg + +# Beyond switches, we support no further command-line arguments +if len(args) > 0: + sys.stderr.write("%s: only switch arguments are supported - use -h for help\n" % program) + sys.exit(1) + +# If we don't have a valid version, abort. +if not VersionSpecificValues.has_key(version): + sys.stderr.write("%s: version '%s' is not valid - use -h for help\n" % (program, version)) + sys.exit(1) + +# Grab the version-specific items we need to use +versionHeader = VersionSpecificValues[version]['header'] +versionExtHeader = VersionSpecificValues[version]['extheader'] + +# If we get to here, we're good to go. The "version" parameter +# directs GetDispatchedFunctions to only allow functions from +# that "category" (version in our parlance). This allows +# functions with different declarations in different categories +# to exist (glTexImage2D, for example, is different between +# GLES1 and GLES2). +keys = apiutil.GetAllFunctions(functionList, version) + +allSpecials = apiutil.AllSpecials() + +print """/* DO NOT EDIT ************************************************* + * THIS FILE AUTOMATICALLY GENERATED BY THE %s SCRIPT + * API specification file: %s + * GLES version: %s + * date: %s + */ +""" % (program, functionList, version, time.strftime("%Y-%m-%d %H:%M:%S")) + +# The headers we choose are version-specific. +print """ +#include "%s" +#include "%s" +""" % (versionHeader, versionExtHeader) + +# Everyone needs these types. +print """ +/* These types are needed for the Mesa veneer, but are not defined in + * the standard GLES headers. + */ +typedef double GLdouble; +typedef double GLclampd; + +/* This type is normally in glext.h, but needed here */ +typedef char GLchar; + +/* Mesa error handling requires these */ +extern void *_mesa_get_current_context(void); +extern void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... ); + +#include "main/compiler.h" +#include "main/api_exec.h" + +#include "glapi/dispatch.h" + +typedef void (*_glapi_proc)(void); /* generic function pointer */ +""" + +# Finally we get to the all-important functions +print """/************************************************************* + * Generated functions begin here + */ +""" +for funcName in keys: + if verbose > 0: sys.stderr.write("%s: processing function %s\n" % (program, funcName)) + + # start figuring out what this function will look like. + returnType = apiutil.ReturnType(funcName) + props = apiutil.Properties(funcName) + params = apiutil.Parameters(funcName) + declarationString = apiutil.MakeDeclarationString(params) + + # In case of error, a function may have to return. Make + # sure we have valid return values in this case. + if returnType == "void": + errorReturn = "return" + elif returnType == "GLboolean": + errorReturn = "return GL_FALSE" + else: + errorReturn = "return (%s) 0" % returnType + + # These are the output of this large calculation block. + # passthroughDeclarationString: a typed set of parameters that + # will be used to create the "extern" reference for the + # underlying Mesa or support function. Note that as generated + # these have an extra ", " at the beginning, which will be + # removed before use. + # + # passthroughDeclarationString: an untyped list of parameters + # that will be used to call the underlying Mesa or support + # function (including references to converted parameters). + # This will also be generated with an extra ", " at the + # beginning, which will be removed before use. + # + # variables: C code to create any local variables determined to + # be necessary. + # conversionCodeOutgoing: C code to convert application parameters + # to a necessary type before calling the underlying support code. + # May be empty if no conversion is required. + # conversionCodeIncoming: C code to do the converse: convert + # values returned by underlying Mesa code to the types needed + # by the application. + # Note that *either* the conversionCodeIncoming will be used (for + # generated query functions), *or* the conversionCodeOutgoing will + # be used (for generated non-query functions), never both. + passthroughFuncName = "" + passthroughDeclarationString = "" + passthroughCallString = "" + variables = [] + conversionCodeOutgoing = [] + conversionCodeIncoming = [] + switchCode = [] + + # Calculate the name of the underlying support function to call. + # By default, the passthrough function is named _mesa_<funcName>. + # We're allowed to override the prefix and/or the function name + # for each function record, though. The "ConversionFunction" + # utility is poorly named, BTW... + if funcName in allSpecials: + # perform checks and pass through + funcPrefix = "_check_" + aliasprefix = "_es_" + else: + funcPrefix = "_es_" + aliasprefix = apiutil.AliasPrefix(funcName) + alias = apiutil.ConversionFunction(funcName) + if not alias: + # There may still be a Mesa alias for the function + if apiutil.Alias(funcName): + passthroughFuncName = "%s%s" % (aliasprefix, apiutil.Alias(funcName)) + else: + passthroughFuncName = "%s%s" % (aliasprefix, funcName) + else: # a specific alias is provided + passthroughFuncName = "%s%s" % (aliasprefix, alias) + + # Look at every parameter: each one may have only specific + # allowed values, or dependent parameters to check, or + # variant-sized vector arrays to calculate + for (paramName, paramType, paramMaxVecSize, paramConvertToType, paramValidValues, paramValueConversion) in params: + # We'll need this below if we're doing conversions + (paramBaseType, paramTypeModifiers) = GetBaseType(paramType) + + # Conversion management. + # We'll handle three cases, easiest to hardest: a parameter + # that doesn't require conversion, a scalar parameter that + # requires conversion, and a vector parameter that requires + # conversion. + if paramConvertToType == None: + # Unconverted parameters are easy, whether they're vector + # or scalar - just add them to the call list. No conversions + # or anything to worry about. + passthroughDeclarationString += ", %s %s" % (paramType, paramName) + passthroughCallString += ", %s" % paramName + + elif paramMaxVecSize == 0: # a scalar parameter that needs conversion + # A scalar to hold a converted parameter + variables.append(" %s converted_%s;" % (paramConvertToType, paramName)) + + # Outgoing conversion depends on whether we have to conditionally + # perform value conversion. + if paramValueConversion == "none": + conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName)) + elif paramValueConversion == "some": + # We'll need a conditional variable to keep track of + # whether we're converting values or not. + if (" int convert_%s_value = 1;" % paramName) not in variables: + variables.append(" int convert_%s_value = 1;" % paramName) + + # Write code based on that conditional. + conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName) + conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType))) + conversionCodeOutgoing.append(" } else {") + conversionCodeOutgoing.append(" converted_%s = (%s) %s;" % (paramName, paramConvertToType, paramName)) + conversionCodeOutgoing.append(" }") + else: # paramValueConversion == "all" + conversionCodeOutgoing.append(" converted_%s = %s;" % (paramName, ConvertValue(paramName, paramBaseType, paramConvertToType))) + + # Note that there can be no incoming conversion for a + # scalar parameter; changing the scalar will only change + # the local value, and won't ultimately change anything + # that passes back to the application. + + # Call strings. The unusual " ".join() call will join the + # array of parameter modifiers with spaces as separators. + passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName) + passthroughCallString += ", converted_%s" % paramName + + else: # a vector parameter that needs conversion + # We'll need an index variable for conversions + if " register unsigned int i;" not in variables: + variables.append(" register unsigned int i;") + + # This variable will hold the (possibly variant) size of + # this array needing conversion. By default, we'll set + # it to the maximal size (which is correct for functions + # with a constant-sized vector parameter); for true + # variant arrays, we'll modify it with other code. + variables.append(" unsigned int n_%s = %d;" % (paramName, paramMaxVecSize)) + + # This array will hold the actual converted values. + variables.append(" %s converted_%s[%d];" % (paramConvertToType, paramName, paramMaxVecSize)) + + # Again, we choose the conversion code based on whether we + # have to always convert values, never convert values, or + # conditionally convert values. + if paramValueConversion == "none": + conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName)) + conversionCodeOutgoing.append(" }") + elif paramValueConversion == "some": + # We'll need a conditional variable to keep track of + # whether we're converting values or not. + if (" int convert_%s_value = 1;" % paramName) not in variables: + variables.append(" int convert_%s_value = 1;" % paramName) + # Write code based on that conditional. + conversionCodeOutgoing.append(" if (convert_%s_value) {" % paramName) + conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType))) + conversionCodeOutgoing.append(" }") + conversionCodeOutgoing.append(" } else {") + conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeOutgoing.append(" converted_%s[i] = (%s) %s[i];" % (paramName, paramConvertToType, paramName)) + conversionCodeOutgoing.append(" }") + conversionCodeOutgoing.append(" }") + else: # paramValueConversion == "all" + conversionCodeOutgoing.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeOutgoing.append(" converted_%s[i] = %s;" % (paramName, ConvertValue("%s[i]" % paramName, paramBaseType, paramConvertToType))) + + conversionCodeOutgoing.append(" }") + + # If instead we need an incoming conversion (i.e. results + # from Mesa have to be converted before handing back + # to the application), this is it. Fortunately, we don't + # have to worry about conditional value conversion - the + # functions that do (e.g. glGetFixedv()) are handled + # specially, outside this code generation. + # + # Whether we use incoming conversion or outgoing conversion + # is determined later - we only ever use one or the other. + + if paramValueConversion == "none": + conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramConvertToType, paramName)) + conversionCodeIncoming.append(" }") + elif paramValueConversion == "some": + # We'll need a conditional variable to keep track of + # whether we're converting values or not. + if (" int convert_%s_value = 1;" % paramName) not in variables: + variables.append(" int convert_%s_value = 1;" % paramName) + + # Write code based on that conditional. + conversionCodeIncoming.append(" if (convert_%s_value) {" % paramName) + conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType))) + conversionCodeIncoming.append(" }") + conversionCodeIncoming.append(" } else {") + conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeIncoming.append(" %s[i] = (%s) converted_%s[i];" % (paramName, paramBaseType, paramName)) + conversionCodeIncoming.append(" }") + conversionCodeIncoming.append(" }") + else: # paramValueConversion == "all" + conversionCodeIncoming.append(" for (i = 0; i < n_%s; i++) {" % paramName) + conversionCodeIncoming.append(" %s[i] = %s;" % (paramName, ConvertValue("converted_%s[i]" % paramName, paramConvertToType, paramBaseType))) + conversionCodeIncoming.append(" }") + + # Call strings. The unusual " ".join() call will join the + # array of parameter modifiers with spaces as separators. + passthroughDeclarationString += ", %s %s %s" % (paramConvertToType, " ".join(paramTypeModifiers), paramName) + passthroughCallString += ", converted_%s" % paramName + + # endif conversion management + + # Parameter checking. If the parameter has a specific list of + # valid values, we have to make sure that the passed-in values + # match these, or we make an error. + if len(paramValidValues) > 0: + # We're about to make a big switch statement with an + # error at the end. By default, the error is GL_INVALID_ENUM, + # unless we find a "case" statement in the middle with a + # non-GLenum value. + errorDefaultCase = "GL_INVALID_ENUM" + + # This parameter has specific valid values. Make a big + # switch statement to handle it. Note that the original + # parameters are always what is checked, not the + # converted parameters. + switchCode.append(" switch(%s) {" % paramName) + + for valueIndex in range(len(paramValidValues)): + (paramValue, dependentVecSize, dependentParamName, dependentValidValues, errorCode, valueConvert) = paramValidValues[valueIndex] + + # We're going to need information on the dependent param + # as well. + if dependentParamName: + depParamIndex = apiutil.FindParamIndex(params, dependentParamName) + if depParamIndex == None: + sys.stderr.write("%s: can't find dependent param '%s' for function '%s'\n" % (program, dependentParamName, funcName)) + + (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = params[depParamIndex] + else: + (depParamName, depParamType, depParamMaxVecSize, depParamConvertToType, depParamValidValues, depParamValueConversion) = (None, None, None, None, [], None) + + # This is a sneaky trick. It's valid syntax for a parameter + # that is *not* going to be converted to be declared + # with a dependent vector size; but in this case, the + # dependent vector size is unused and unnecessary. + # So check for this and ignore the dependent vector size + # if the parameter is not going to be converted. + if depParamConvertToType: + usedDependentVecSize = dependentVecSize + else: + usedDependentVecSize = None + + # We'll peek ahead at the next parameter, to see whether + # we can combine cases + if valueIndex + 1 < len(paramValidValues) : + (nextParamValue, nextDependentVecSize, nextDependentParamName, nextDependentValidValues, nextErrorCode, nextValueConvert) = paramValidValues[valueIndex + 1] + if depParamConvertToType: + usedNextDependentVecSize = nextDependentVecSize + else: + usedNextDependentVecSize = None + + # Create a case for this value. As a mnemonic, + # if we have a dependent vector size that we're ignoring, + # add it as a comment. + if usedDependentVecSize == None and dependentVecSize != None: + switchCode.append(" case %s: /* size %s */" % (paramValue, dependentVecSize)) + else: + switchCode.append(" case %s:" % paramValue) + + # If this is not a GLenum case, then switch our error + # if no value is matched to be GL_INVALID_VALUE instead + # of GL_INVALID_ENUM. (Yes, this does get confused + # if there are both values and GLenums in the same + # switch statement, which shouldn't happen.) + if paramValue[0:3] != "GL_": + errorDefaultCase = "GL_INVALID_VALUE" + + # If all the remaining parameters are identical to the + # next set, then we're done - we'll just create the + # official code on the next pass through, and the two + # cases will share the code. + if valueIndex + 1 < len(paramValidValues) and usedDependentVecSize == usedNextDependentVecSize and dependentParamName == nextDependentParamName and dependentValidValues == nextDependentValidValues and errorCode == nextErrorCode and valueConvert == nextValueConvert: + continue + + # Otherwise, we'll have to generate code for this case. + # Start off with a check: if there is a dependent parameter, + # and a list of valid values for that parameter, we need + # to generate an error if something other than one + # of those values is passed. + if len(dependentValidValues) > 0: + conditional="" + + # If the parameter being checked is actually an array, + # check only its first element. + if depParamMaxVecSize == 0: + valueToCheck = dependentParamName + else: + valueToCheck = "%s[0]" % dependentParamName + + for v in dependentValidValues: + conditional += " && %s != %s" % (valueToCheck, v) + switchCode.append(" if (%s) {" % conditional[4:]) + if errorCode == None: + errorCode = "GL_INVALID_ENUM" + switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=0x%s)", %s);' % (errorCode, funcName, paramName, "%x", paramName)) + switchCode.append(" %s;" % errorReturn) + switchCode.append(" }") + # endif there are dependent valid values + + # The dependent parameter may require conditional + # value conversion. If it does, and we don't want + # to convert values, we'll have to generate code for that + if depParamValueConversion == "some" and valueConvert == "noconvert": + switchCode.append(" convert_%s_value = 0;" % dependentParamName) + + # If there's a dependent vector size for this parameter + # that we're actually going to use (i.e. we need conversion), + # mark it. + if usedDependentVecSize: + switchCode.append(" n_%s = %s;" % (dependentParamName, dependentVecSize)) + + # In all cases, break out of the switch if any valid + # value is found. + switchCode.append(" break;") + + + # Need a default case to catch all the other, invalid + # parameter values. These will all generate errors. + switchCode.append(" default:") + if errorCode == None: + errorCode = "GL_INVALID_ENUM" + formatString = GetFormatString(paramType) + if formatString == None: + switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s)");' % (errorCode, funcName, paramName)) + else: + switchCode.append(' _mesa_error(_mesa_get_current_context(), %s, "gl%s(%s=%s)", %s);' % (errorCode, funcName, paramName, formatString, paramName)) + switchCode.append(" %s;" % errorReturn) + + # End of our switch code. + switchCode.append(" }") + + # endfor every recognized parameter value + + # endfor every param + + # Here, the passthroughDeclarationString and passthroughCallString + # are complete; remove the extra ", " at the front of each. + passthroughDeclarationString = passthroughDeclarationString[2:] + passthroughCallString = passthroughCallString[2:] + + # The Mesa functions are scattered across all the Mesa + # header files. The easiest way to manage declarations + # is to create them ourselves. + if funcName in allSpecials: + print "/* this function is special and is defined elsewhere */" + print "extern %s GLAPIENTRY %s(%s);" % (returnType, passthroughFuncName, passthroughDeclarationString) + + # A function may be a core function (i.e. it exists in + # the core specification), a core addition (extension + # functions added officially to the core), a required + # extension (usually an extension for an earlier version + # that has been officially adopted), or an optional extension. + # + # Core functions have a simple category (e.g. "GLES1.1"); + # we generate only a simple callback for them. + # + # Core additions have two category listings, one simple + # and one compound (e.g. ["GLES1.1", "GLES1.1:OES_fixed_point"]). + # We generate the core function, and also an extension function. + # + # Required extensions and implemented optional extensions + # have a single compound category "GLES1.1:OES_point_size_array". + # For these we generate just the extension function. + for categorySpec in apiutil.Categories(funcName): + compoundCategory = categorySpec.split(":") + + # This category isn't for us, if the base category doesn't match + # our version + if compoundCategory[0] != version: + continue + + # Otherwise, determine if we're writing code for a core + # function (no suffix) or an extension function. + if len(compoundCategory) == 1: + # This is a core function + extensionName = None + extensionSuffix = "" + else: + # This is an extension function. We'll need to append + # the extension suffix. + extensionName = compoundCategory[1] + extensionSuffix = extensionName.split("_")[0] + fullFuncName = funcPrefix + funcName + extensionSuffix + + # Now the generated function. The text used to mark an API-level + # function, oddly, is version-specific. + if extensionName: + print "/* Extension %s */" % extensionName + + if (not variables and + not switchCode and + not conversionCodeOutgoing and + not conversionCodeIncoming): + # pass through directly + print "#define %s %s" % (fullFuncName, passthroughFuncName) + print + continue + + print "static %s %s(%s)" % (returnType, fullFuncName, declarationString) + print "{" + + # Start printing our code pieces. Start with any local + # variables we need. This unusual syntax joins the + # lines in the variables[] array with the "\n" separator. + if len(variables) > 0: + print "\n".join(variables) + "\n" + + # If there's any sort of parameter checking or variable + # array sizing, the switch code will contain it. + if len(switchCode) > 0: + print "\n".join(switchCode) + "\n" + + # In the case of an outgoing conversion (i.e. parameters must + # be converted before calling the underlying Mesa function), + # use the appropriate code. + if "get" not in props and len(conversionCodeOutgoing) > 0: + print "\n".join(conversionCodeOutgoing) + "\n" + + # Call the Mesa function. Note that there are very few functions + # that return a value (i.e. returnType is not "void"), and that + # none of them require incoming translation; so we're safe + # to generate code that directly returns in those cases, + # even though it's not completely independent. + + if returnType == "void": + print " %s(%s);" % (passthroughFuncName, passthroughCallString) + else: + print " return %s(%s);" % (passthroughFuncName, passthroughCallString) + + # If the function is one that returns values (i.e. "get" in props), + # it might return values of a different type than we need, that + # require conversion before passing back to the application. + if "get" in props and len(conversionCodeIncoming) > 0: + print "\n".join(conversionCodeIncoming) + + # All done. + print "}" + print + # end for each category provided for a function + +# end for each function + +print "void" +print "_mesa_init_exec_table(struct _glapi_table *exec)" +print "{" +for func in keys: + prefix = "_es_" if func not in allSpecials else "_check_" + for spec in apiutil.Categories(func): + ext = spec.split(":") + # version does not match + if ext.pop(0) != version: + continue + entry = func + if ext: + suffix = ext[0].split("_")[0] + entry += suffix + print " SET_%s(exec, %s%s);" % (entry, prefix, entry) +print "}" diff --git a/src/mesa/es/main/es_query_matrix.c b/src/mesa/es/main/es_query_matrix.c new file mode 100644 index 0000000000..82b6fe7ab9 --- /dev/null +++ b/src/mesa/es/main/es_query_matrix.c @@ -0,0 +1,199 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + **************************************************************************/ + + +/** + * Code to implement GL_OES_query_matrix. See the spec at: + * http://www.khronos.org/registry/gles/extensions/OES/OES_query_matrix.txt + */ + + +#include <stdlib.h> +#include <math.h> +#include "GLES/gl.h" +#include "GLES/glext.h" + + +/** + * This is from the GL_OES_query_matrix extension specification: + * + * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16], + * GLint exponent[16] ) + * mantissa[16] contains the contents of the current matrix in GLfixed + * format. exponent[16] contains the unbiased exponents applied to the + * matrix components, so that the internal representation of component i + * is close to mantissa[i] * 2^exponent[i]. The function returns a status + * word which is zero if all the components are valid. If + * status & (1<<i) != 0, the component i is invalid (e.g., NaN, Inf). + * The implementations are not required to keep track of overflows. In + * that case, the invalid bits are never set. + */ + +#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16)) +#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0)) + +#if defined(WIN32) || defined(_WIN32_WCE) +/* Oddly, the fpclassify() function doesn't exist in such a form + * on Windows. This is an implementation using slightly different + * lower-level Windows functions. + */ +#include <float.h> + +enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL} +fpclassify(double x) +{ + switch(_fpclass(x)) { + case _FPCLASS_SNAN: /* signaling NaN */ + case _FPCLASS_QNAN: /* quiet NaN */ + return FP_NAN; + case _FPCLASS_NINF: /* negative infinity */ + case _FPCLASS_PINF: /* positive infinity */ + return FP_INFINITE; + case _FPCLASS_NN: /* negative normal */ + case _FPCLASS_PN: /* positive normal */ + return FP_NORMAL; + case _FPCLASS_ND: /* negative denormalized */ + case _FPCLASS_PD: /* positive denormalized */ + return FP_SUBNORMAL; + case _FPCLASS_NZ: /* negative zero */ + case _FPCLASS_PZ: /* positive zero */ + return FP_ZERO; + default: + /* Should never get here; but if we do, this will guarantee + * that the pattern is not treated like a number. + */ + return FP_NAN; + } +} +#endif + +extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]); + +/* The Mesa functions we'll need */ +extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params); +extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params); + +GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) +{ + GLfloat matrix[16]; + GLint tmp; + GLenum currentMode = GL_FALSE; + GLenum desiredMatrix = GL_FALSE; + /* The bitfield returns 1 for each component that is invalid (i.e. + * NaN or Inf). In case of error, everything is invalid. + */ + GLbitfield rv; + register unsigned int i; + unsigned int bit; + + /* This data structure defines the mapping between the current matrix + * mode and the desired matrix identifier. + */ + static struct { + GLenum currentMode; + GLenum desiredMatrix; + } modes[] = { + {GL_MODELVIEW, GL_MODELVIEW_MATRIX}, + {GL_PROJECTION, GL_PROJECTION_MATRIX}, + {GL_TEXTURE, GL_TEXTURE_MATRIX}, +#if 0 + /* this doesn't exist in GLES */ + {GL_COLOR, GL_COLOR_MATRIX}, +#endif + }; + + /* Call Mesa to get the current matrix in floating-point form. First, + * we have to figure out what the current matrix mode is. + */ + _mesa_GetIntegerv(GL_MATRIX_MODE, &tmp); + currentMode = (GLenum) tmp; + + /* The mode is either GL_FALSE, if for some reason we failed to query + * the mode, or a given mode from the above table. Search for the + * returned mode to get the desired matrix; if we don't find it, + * we can return immediately, as _mesa_GetInteger() will have + * logged the necessary error already. + */ + for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) { + if (modes[i].currentMode == currentMode) { + desiredMatrix = modes[i].desiredMatrix; + break; + } + } + if (desiredMatrix == GL_FALSE) { + /* Early error means all values are invalid. */ + return 0xffff; + } + + /* Now pull the matrix itself. */ + _mesa_GetFloatv(desiredMatrix, matrix); + + rv = 0; + for (i = 0, bit = 1; i < 16; i++, bit<<=1) { + float normalizedFraction; + int exp; + + switch (fpclassify(matrix[i])) { + /* A "subnormal" or denormalized number is too small to be + * represented in normal format; but despite that it's a + * valid floating point number. FP_ZERO and FP_NORMAL + * are both valid as well. We should be fine treating + * these three cases as legitimate floating-point numbers. + */ + case FP_SUBNORMAL: + case FP_NORMAL: + case FP_ZERO: + normalizedFraction = (GLfloat)frexp(matrix[i], &exp); + mantissa[i] = FLOAT_TO_FIXED(normalizedFraction); + exponent[i] = (GLint) exp; + break; + + /* If the entry is not-a-number or an infinity, then the + * matrix component is invalid. The invalid flag for + * the component is already set; might as well set the + * other return values to known values. We'll set + * distinct values so that a savvy end user could determine + * whether the matrix component was a NaN or an infinity, + * but this is more useful for debugging than anything else + * since the standard doesn't specify any such magic + * values to return. + */ + case FP_NAN: + mantissa[i] = INT_TO_FIXED(0); + exponent[i] = (GLint) 0; + rv |= bit; + break; + + case FP_INFINITE: + /* Return +/- 1 based on whether it's a positive or + * negative infinity. + */ + if (matrix[i] > 0) { + mantissa[i] = INT_TO_FIXED(1); + } + else { + mantissa[i] = -INT_TO_FIXED(1); + } + exponent[i] = (GLint) 0; + rv |= bit; + break; + + /* We should never get here; but here's a catching case + * in case fpclassify() is returnings something unexpected. + */ + default: + mantissa[i] = INT_TO_FIXED(2); + exponent[i] = (GLint) 0; + rv |= bit; + break; + } + + } /* for each component */ + + /* All done */ + return rv; +} diff --git a/src/mesa/es/main/es_texgen.c b/src/mesa/es/main/es_texgen.c new file mode 100644 index 0000000000..c29a0a7f13 --- /dev/null +++ b/src/mesa/es/main/es_texgen.c @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "GLES/gl.h" +#include "GLES/glext.h" + +#include "main/compiler.h" /* for ASSERT */ + + +#ifndef GL_S +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#endif + + +extern void GL_APIENTRY _es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params); +extern void GL_APIENTRY _es_TexGenf(GLenum coord, GLenum pname, GLfloat param); +extern void GL_APIENTRY _es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params); + +extern void GL_APIENTRY _mesa_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params); +extern void GL_APIENTRY _mesa_TexGenf(GLenum coord, GLenum pname, GLfloat param); +extern void GL_APIENTRY _mesa_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params); + + +void GL_APIENTRY +_es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params) +{ + ASSERT(coord == GL_TEXTURE_GEN_STR_OES); + _mesa_GetTexGenfv(GL_S, pname, params); +} + + +void GL_APIENTRY +_es_TexGenf(GLenum coord, GLenum pname, GLfloat param) +{ + ASSERT(coord == GL_TEXTURE_GEN_STR_OES); + /* set S, T, and R at the same time */ + _mesa_TexGenf(GL_S, pname, param); + _mesa_TexGenf(GL_T, pname, param); + _mesa_TexGenf(GL_R, pname, param); +} + + +void GL_APIENTRY +_es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params) +{ + ASSERT(coord == GL_TEXTURE_GEN_STR_OES); + /* set S, T, and R at the same time */ + _mesa_TexGenfv(GL_S, pname, params); + _mesa_TexGenfv(GL_T, pname, params); + _mesa_TexGenfv(GL_R, pname, params); +} diff --git a/src/mesa/es/main/get_gen.py b/src/mesa/es/main/get_gen.py new file mode 100644 index 0000000000..b820157be0 --- /dev/null +++ b/src/mesa/es/main/get_gen.py @@ -0,0 +1,810 @@ +#!/usr/bin/env python + +# Mesa 3-D graphics library +# +# 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. + + +# This script is used to generate the get.c file: +# python get_gen.py > get.c + + +import string +import sys + + +GLint = 1 +GLenum = 2 +GLfloat = 3 +GLdouble = 4 +GLboolean = 5 +GLfloatN = 6 # A normalized value, such as a color or depth range +GLfixed = 7 + + +TypeStrings = { + GLint : "GLint", + GLenum : "GLenum", + GLfloat : "GLfloat", + GLdouble : "GLdouble", + GLboolean : "GLboolean", + GLfixed : "GLfixed" +} + + +# Each entry is a tuple of: +# - the GL state name, such as GL_CURRENT_COLOR +# - the state datatype, one of GLint, GLfloat, GLboolean or GLenum +# - list of code fragments to get the state, such as ["ctx->Foo.Bar"] +# - optional extra code or empty string +# - optional extensions to check, or None +# + +# Present in ES 1.x and 2.x: +StateVars_common = [ + ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"], + "", None ), + ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ), + ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), + ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ), + ( "GL_COLOR_CLEAR_VALUE", GLfloatN, + [ "ctx->Color.ClearColor[0]", + "ctx->Color.ClearColor[1]", + "ctx->Color.ClearColor[2]", + "ctx->Color.ClearColor[3]" ], "", None ), + ( "GL_COLOR_WRITEMASK", GLint, + [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0", + "ctx->Color.ColorMask[GCOMP] ? 1 : 0", + "ctx->Color.ColorMask[BCOMP] ? 1 : 0", + "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ), + ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ), + ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ), + ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], + "", None ), + ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["ctx->Depth.Clear"], "", None ), + ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), + ( "GL_DEPTH_RANGE", GLfloatN, + [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ), + ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ), + ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ), + ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ), + ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ), + ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"], + "", None ), + ( "GL_LINE_WIDTH", GLfloat, ["ctx->Line.Width"], "", None ), + ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat, + ["ctx->Const.MinLineWidth", + "ctx->Const.MaxLineWidth"], "", None ), + ( "GL_MAX_ELEMENTS_INDICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), + ( "GL_MAX_ELEMENTS_VERTICES", GLint, ["ctx->Const.MaxArrayLockSize"], "", None ), + + ( "GL_MAX_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ), + ( "GL_MAX_VIEWPORT_DIMS", GLint, + ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"], + "", None ), + ( "GL_PACK_ALIGNMENT", GLint, ["ctx->Pack.Alignment"], "", None ), + ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat, + ["ctx->Const.MinPointSize", + "ctx->Const.MaxPointSize"], "", None ), + ( "GL_POLYGON_OFFSET_FACTOR", GLfloat, ["ctx->Polygon.OffsetFactor "], "", None ), + ( "GL_POLYGON_OFFSET_UNITS", GLfloat, ["ctx->Polygon.OffsetUnits "], "", None ), + ( "GL_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.redBits"], "", None ), + ( "GL_SCISSOR_BOX", GLint, + ["ctx->Scissor.X", + "ctx->Scissor.Y", + "ctx->Scissor.Width", + "ctx->Scissor.Height"], "", None ), + ( "GL_SCISSOR_TEST", GLboolean, ["ctx->Scissor.Enabled"], "", None ), + ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ), + ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ), + ( "GL_STENCIL_FAIL", GLenum, + ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_FUNC", GLenum, + ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum, + ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum, + ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_REF", GLint, + ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_TEST", GLboolean, ["ctx->Stencil.Enabled"], "", None ), + ( "GL_STENCIL_VALUE_MASK", GLint, + ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_STENCIL_WRITEMASK", GLint, + ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ), + ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ), + ( "GL_TEXTURE_BINDING_2D", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name"], "", None ), + ( "GL_UNPACK_ALIGNMENT", GLint, ["ctx->Unpack.Alignment"], "", None ), + ( "GL_VIEWPORT", GLint, [ "ctx->Viewport.X", "ctx->Viewport.Y", + "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ), + + # GL_ARB_multitexture + ( "GL_ACTIVE_TEXTURE_ARB", GLint, + [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", ["ARB_multitexture"] ), + + # Note that all the OES_* extensions require that the Mesa + # "struct gl_extensions" include a member with the name of + # the extension. That structure does not yet include OES + # extensions (and we're not sure whether it will). If + # it does, all the OES_* extensions below should mark the + # dependency. + + # OES_texture_cube_map + ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name"], + "", None), + ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint, + ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"], + "", None), + + # OES_blend_subtract + ( "GL_BLEND_SRC_RGB_EXT", GLenum, ["ctx->Color.BlendSrcRGB"], "", None), + ( "GL_BLEND_DST_RGB_EXT", GLenum, ["ctx->Color.BlendDstRGB"], "", None), + ( "GL_BLEND_SRC_ALPHA_EXT", GLenum, ["ctx->Color.BlendSrcA"], "", None), + ( "GL_BLEND_DST_ALPHA_EXT", GLenum, ["ctx->Color.BlendDstA"], "", None), + + # GL_BLEND_EQUATION_RGB, which is what we're really after, + # is defined identically to GL_BLEND_EQUATION. + ( "GL_BLEND_EQUATION", GLenum, ["ctx->Color.BlendEquationRGB "], "", None), + ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum, ["ctx->Color.BlendEquationA "], + "", None), + + # GL_ARB_texture_compression */ +# ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, +# ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"], +# "", ["ARB_texture_compression"] ), +# ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum, +# [], +# """GLint formats[100]; +# GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); +# ASSERT(n <= 100); +# for (i = 0; i < n; i++) +# params[i] = ENUM_TO_INT(formats[i]);""", +# ["ARB_texture_compression"] ), + + # GL_ARB_multisample + ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean, + ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_ARB", GLboolean, + ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat, + ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, + ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_BUFFERS_ARB", GLint, + ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ), + ( "GL_SAMPLES_ARB", GLint, + ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ), + + + # GL_SGIS_generate_mipmap + ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum, ["ctx->Hint.GenerateMipmap"], + "", ["SGIS_generate_mipmap"] ), + + # GL_ARB_vertex_buffer_object + ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported + ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ElementArrayBufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + + # GL_OES_read_format + ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint, + ["_mesa_get_color_read_type(ctx)"], "", ["OES_read_format"] ), + ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint, + ["_mesa_get_color_read_format(ctx)"], "", ["OES_read_format"] ), + + # GL_OES_framebuffer_object + ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "", + None), + ( "GL_RENDERBUFFER_BINDING_EXT", GLint, + ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "", + None), + ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint, + ["ctx->Const.MaxRenderbufferSize"], "", + None), + + # OpenGL ES 1/2 special: + ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, + [ "ARRAY_SIZE(compressed_formats)" ], + "", + None ), + + ("GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, + [], + """ + int i; + for (i = 0; i < ARRAY_SIZE(compressed_formats); i++) { + params[i] = compressed_formats[i]; + }""", + None ), + + ( "GL_POLYGON_OFFSET_FILL", GLboolean, ["ctx->Polygon.OffsetFill"], "", None ), + +] + +# Only present in ES 1.x: +StateVars_es1 = [ + ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ), + ( "GL_LIGHT0", GLboolean, ["ctx->Light.Light[0].Enabled"], "", None ), + ( "GL_LIGHT1", GLboolean, ["ctx->Light.Light[1].Enabled"], "", None ), + ( "GL_LIGHT2", GLboolean, ["ctx->Light.Light[2].Enabled"], "", None ), + ( "GL_LIGHT3", GLboolean, ["ctx->Light.Light[3].Enabled"], "", None ), + ( "GL_LIGHT4", GLboolean, ["ctx->Light.Light[4].Enabled"], "", None ), + ( "GL_LIGHT5", GLboolean, ["ctx->Light.Light[5].Enabled"], "", None ), + ( "GL_LIGHT6", GLboolean, ["ctx->Light.Light[6].Enabled"], "", None ), + ( "GL_LIGHT7", GLboolean, ["ctx->Light.Light[7].Enabled"], "", None ), + ( "GL_LIGHTING", GLboolean, ["ctx->Light.Enabled"], "", None ), + ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN, + ["ctx->Light.Model.Ambient[0]", + "ctx->Light.Model.Ambient[1]", + "ctx->Light.Model.Ambient[2]", + "ctx->Light.Model.Ambient[3]"], "", None ), + ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean, ["ctx->Light.Model.TwoSide"], "", None ), + ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ), + ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ), + ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ), + ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), + ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ), + ( "GL_CLIP_PLANE0", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ), + ( "GL_CLIP_PLANE1", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ), + ( "GL_CLIP_PLANE2", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ), + ( "GL_CLIP_PLANE3", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ), + ( "GL_CLIP_PLANE4", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ), + ( "GL_CLIP_PLANE5", GLboolean, + [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ), + ( "GL_COLOR_MATERIAL", GLboolean, + ["ctx->Light.ColorMaterialEnabled"], "", None ), + ( "GL_CURRENT_COLOR", GLfloatN, + [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]", + "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_CURRENT_NORMAL", GLfloatN, + [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]", + "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]", + "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"], + "FLUSH_CURRENT(ctx, 0);", None ), + ( "GL_CURRENT_TEXTURE_COORDS", GLfloat, + ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]", + "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"], + "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ), + ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat, + ["ctx->Point.Params[0]", + "ctx->Point.Params[1]", + "ctx->Point.Params[2]"], "", None ), + ( "GL_FOG", GLboolean, ["ctx->Fog.Enabled"], "", None ), + ( "GL_FOG_COLOR", GLfloatN, + [ "ctx->Fog.Color[0]", + "ctx->Fog.Color[1]", + "ctx->Fog.Color[2]", + "ctx->Fog.Color[3]" ], "", None ), + ( "GL_FOG_DENSITY", GLfloat, ["ctx->Fog.Density"], "", None ), + ( "GL_FOG_END", GLfloat, ["ctx->Fog.End"], "", None ), + ( "GL_FOG_HINT", GLenum, ["ctx->Hint.Fog"], "", None ), + ( "GL_FOG_MODE", GLenum, ["ctx->Fog.Mode"], "", None ), + ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ), + ( "GL_LINE_SMOOTH", GLboolean, ["ctx->Line.SmoothFlag"], "", None ), + ( "GL_LINE_SMOOTH_HINT", GLenum, ["ctx->Hint.LineSmooth"], "", None ), + ( "GL_LINE_WIDTH_RANGE", GLfloat, + ["ctx->Const.MinLineWidthAA", + "ctx->Const.MaxLineWidthAA"], "", None ), + ( "GL_COLOR_LOGIC_OP", GLboolean, ["ctx->Color.ColorLogicOpEnabled"], "", None ), + ( "GL_LOGIC_OP_MODE", GLenum, ["ctx->Color.LogicOp"], "", None ), + ( "GL_MATRIX_MODE", GLenum, ["ctx->Transform.MatrixMode"], "", None ), + + ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ), + ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint, ["MAX_PROJECTION_STACK_DEPTH"], "", None ), + ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint, ["MAX_TEXTURE_STACK_DEPTH"], "", None ), + ( "GL_MODELVIEW_MATRIX", GLfloat, + [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ), + ( "GL_MODELVIEW_STACK_DEPTH", GLint, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ), + ( "GL_NORMALIZE", GLboolean, ["ctx->Transform.Normalize"], "", None ), + ( "GL_PACK_SKIP_IMAGES_EXT", GLint, ["ctx->Pack.SkipImages"], "", None ), + ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum, + ["ctx->Hint.PerspectiveCorrection"], "", None ), + ( "GL_POINT_SIZE", GLfloat, ["ctx->Point.Size"], "", None ), + ( "GL_POINT_SIZE_RANGE", GLfloat, + ["ctx->Const.MinPointSizeAA", + "ctx->Const.MaxPointSizeAA"], "", None ), + ( "GL_POINT_SMOOTH", GLboolean, ["ctx->Point.SmoothFlag"], "", None ), + ( "GL_POINT_SMOOTH_HINT", GLenum, ["ctx->Hint.PointSmooth"], "", None ), + ( "GL_POINT_SIZE_MIN_EXT", GLfloat, ["ctx->Point.MinSize"], "", None ), + ( "GL_POINT_SIZE_MAX_EXT", GLfloat, ["ctx->Point.MaxSize"], "", None ), + ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat, + ["ctx->Point.Threshold"], "", None ), + ( "GL_PROJECTION_MATRIX", GLfloat, + [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ), + ( "GL_PROJECTION_STACK_DEPTH", GLint, + ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ), + ( "GL_RESCALE_NORMAL", GLboolean, + ["ctx->Transform.RescaleNormals"], "", None ), + ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ), + ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ), + ( "GL_TEXTURE_MATRIX", GLfloat, + ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ), + ( "GL_TEXTURE_STACK_DEPTH", GLint, + ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ), + ( "GL_VERTEX_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ), + ( "GL_VERTEX_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ), + ( "GL_VERTEX_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ), + ( "GL_VERTEX_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ), + ( "GL_NORMAL_ARRAY", GLenum, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ), + ( "GL_NORMAL_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Normal.Type"], "", None ), + ( "GL_NORMAL_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ), + ( "GL_COLOR_ARRAY", GLboolean, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ), + ( "GL_COLOR_ARRAY_SIZE", GLint, ["ctx->Array.ArrayObj->Color.Size"], "", None ), + ( "GL_COLOR_ARRAY_TYPE", GLenum, ["ctx->Array.ArrayObj->Color.Type"], "", None ), + ( "GL_COLOR_ARRAY_STRIDE", GLint, ["ctx->Array.ArrayObj->Color.Stride"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY", GLboolean, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ), + ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ), + # GL_ARB_multitexture + ( "GL_MAX_TEXTURE_UNITS_ARB", GLint, + ["ctx->Const.MaxTextureUnits"], "", ["ARB_multitexture"] ), + ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint, + ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", ["ARB_multitexture"] ), + # OES_texture_cube_map + ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean, + ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", None), + ( "GL_TEXTURE_GEN_STR_OES", GLboolean, + # S, T, and R are always set at the same time + ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None), + # ARB_multisample + ( "GL_MULTISAMPLE_ARB", GLboolean, + ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ), + ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean, + ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ), + + ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, + ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], + "", ["ARB_vertex_buffer_object"] ), + + # OES_point_sprite + ( "GL_POINT_SPRITE_NV", GLboolean, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB + "", None), + + # GL_ARB_fragment_shader + ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint, + ["ctx->Const.FragmentProgram.MaxUniformComponents"], "", + ["ARB_fragment_shader"] ), + + # GL_ARB_vertex_shader + ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint, + ["ctx->Const.VertexProgram.MaxUniformComponents"], "", + ["ARB_vertex_shader"] ), + ( "GL_MAX_VARYING_FLOATS_ARB", GLint, + ["ctx->Const.MaxVarying * 4"], "", ["ARB_vertex_shader"] ), + + # OES_matrix_get + ( "GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [], + """ + /* See GL_OES_matrix_get */ + { + const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m; + memcpy(params, matrix, 16 * sizeof(GLint)); + }""", + None), + + ( "GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [], + """ + /* See GL_OES_matrix_get */ + { + const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m; + memcpy(params, matrix, 16 * sizeof(GLint)); + }""", + None), + + ( "GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES", GLint, [], + """ + /* See GL_OES_matrix_get */ + { + const GLfloat *matrix = + ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m; + memcpy(params, matrix, 16 * sizeof(GLint)); + }""", + None), + + # OES_point_size_array + ("GL_POINT_SIZE_ARRAY_OES", GLboolean, + ["ctx->Array.ArrayObj->PointSize.Enabled"], "", None), + ("GL_POINT_SIZE_ARRAY_TYPE_OES", GLenum, + ["ctx->Array.ArrayObj->PointSize.Type"], "", None), + ("GL_POINT_SIZE_ARRAY_STRIDE_OES", GLint, + ["ctx->Array.ArrayObj->PointSize.Stride"], "", None), + ("GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES", GLint, + ["ctx->Array.ArrayObj->PointSize.BufferObj->Name"], "", None), + + # GL_EXT_texture_lod_bias + ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat, + ["ctx->Const.MaxTextureLodBias"], "", ["EXT_texture_lod_bias"]), + + # GL_EXT_texture_filter_anisotropic + ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat, + ["ctx->Const.MaxTextureMaxAnisotropy"], "", ["EXT_texture_filter_anisotropic"]), + +] + +# Only present in ES 2.x: +StateVars_es2 = [ + # XXX These entries are not spec'ed for GLES 2, but are + # needed for Mesa's GLSL: + ( "GL_MAX_LIGHTS", GLint, ["ctx->Const.MaxLights"], "", None ), + ( "GL_MAX_CLIP_PLANES", GLint, ["ctx->Const.MaxClipPlanes"], "", None ), + ( "GL_MAX_TEXTURE_COORDS_ARB", GLint, # == GL_MAX_TEXTURE_COORDS_NV + ["ctx->Const.MaxTextureCoordUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), + ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, + ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ), + ( "GL_BLEND_COLOR_EXT", GLfloatN, + [ "ctx->Color.BlendColor[0]", + "ctx->Color.BlendColor[1]", + "ctx->Color.BlendColor[2]", + "ctx->Color.BlendColor[3]"], "", None ), + + # This is required for GLES2, but also needed for GLSL: + ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint, # == GL_MAX_TEXTURE_IMAGE_UNI + ["ctx->Const.MaxTextureImageUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), + + ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint, + ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ), + ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint, + ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ), + + # GL_ARB_shader_objects + # Actually, this token isn't part of GL_ARB_shader_objects, but is + # close enough for now. + ( "GL_CURRENT_PROGRAM", GLint, + ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"], + "", ["ARB_shader_objects"] ), + + # OpenGL 2.0 + ( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ), + ( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ), + ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ), + ( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ), + ( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ), + ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ), + ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ), + + ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint, + ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ), + + # OES_texture_3D + ( "GL_TEXTURE_BINDING_3D", GLint, + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name"], "", None), + ( "GL_MAX_3D_TEXTURE_SIZE", GLint, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None), + + # OES_standard_derivatives + ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum, + ["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ), + + # Unique to ES 2 (not in full GL) + ( "GL_MAX_FRAGMENT_UNIFORM_VECTORS", GLint, + ["ctx->Const.FragmentProgram.MaxUniformComponents / 4"], "", None), + ( "GL_MAX_VARYING_VECTORS", GLint, + ["ctx->Const.MaxVarying"], "", None), + ( "GL_MAX_VERTEX_UNIFORM_VECTORS", GLint, + ["ctx->Const.VertexProgram.MaxUniformComponents / 4"], "", None), + ( "GL_SHADER_COMPILER", GLint, ["1"], "", None), + # OES_get_program_binary + ( "GL_NUM_SHADER_BINARY_FORMATS", GLint, ["0"], "", None), + ( "GL_SHADER_BINARY_FORMATS", GLint, [], "", None), +] + + + +def ConversionFunc(fromType, toType): + """Return the name of the macro to convert between two data types.""" + if fromType == toType: + return "" + elif fromType == GLfloat and toType == GLint: + return "IROUND" + elif fromType == GLfloatN and toType == GLfloat: + return "" + elif fromType == GLint and toType == GLfloat: # but not GLfloatN! + return "(GLfloat)" + else: + if fromType == GLfloatN: + fromType = GLfloat + fromStr = TypeStrings[fromType] + fromStr = string.upper(fromStr[2:]) + toStr = TypeStrings[toType] + toStr = string.upper(toStr[2:]) + return fromStr + "_TO_" + toStr + + +def EmitGetFunction(stateVars, returnType): + """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv.""" + assert (returnType == GLboolean or + returnType == GLint or + returnType == GLfloat or + returnType == GLfixed) + + strType = TypeStrings[returnType] + # Capitalize first letter of return type + if returnType == GLint: + function = "_mesa_GetIntegerv" + elif returnType == GLboolean: + function = "_mesa_GetBooleanv" + elif returnType == GLfloat: + function = "_mesa_GetFloatv" + elif returnType == GLfixed: + function = "_mesa_GetFixedv" + else: + abort() + + print "void GLAPIENTRY" + print "%s( GLenum pname, %s *params )" % (function, strType) + print "{" + print " GET_CURRENT_CONTEXT(ctx);" + print " ASSERT_OUTSIDE_BEGIN_END(ctx);" + print "" + print " if (!params)" + print " return;" + print "" + print " if (ctx->NewState)" + print " _mesa_update_state(ctx);" + print "" + print " switch (pname) {" + + for (name, varType, state, optionalCode, extensions) in stateVars: + print " case " + name + ":" + if extensions: + if len(extensions) == 1: + print (' CHECK_EXT1(%s, "%s");' % + (extensions[0], function)) + elif len(extensions) == 2: + print (' CHECK_EXT2(%s, %s, "%s");' % + (extensions[0], extensions[1], function)) + elif len(extensions) == 3: + print (' CHECK_EXT3(%s, %s, %s, "%s");' % + (extensions[0], extensions[1], extensions[2], function)) + else: + assert len(extensions) == 4 + print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' % + (extensions[0], extensions[1], extensions[2], extensions[3], function)) + if optionalCode: + print " {" + print " " + optionalCode + conversion = ConversionFunc(varType, returnType) + n = len(state) + for i in range(n): + if conversion: + print " params[%d] = %s(%s);" % (i, conversion, state[i]) + else: + print " params[%d] = %s;" % (i, state[i]) + if optionalCode: + print " }" + print " break;" + + print " default:" + print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function + print " }" + print "}" + print "" + return + + + +def EmitHeader(): + """Print the get.c file header.""" + print """ +/*** + *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py + ***/ + +#include "main/glheader.h" +#include "main/context.h" +#include "main/enable.h" +#include "main/extensions.h" +#include "main/fbobject.h" +#include "main/get.h" +#include "main/macros.h" +#include "main/mtypes.h" +#include "main/state.h" +#include "main/texcompress.h" +#include "main/framebuffer.h" + + +/* ES1 tokens that should be in gl.h but aren't */ +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 + + +/* ES2 special tokens */ +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_SHADER_COMPILER 0x8DFA +#define GL_PLATFORM_BINARY 0x8D63 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + + +#ifndef GL_OES_matrix_get +#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D +#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E +#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F +#endif + +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_TEXTURE_GEN_STR_OES 0x8D60 +#endif + +#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) +#define FLOAT_TO_FIXED(F) ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : \\ + ((F) * 65536.0f < INT_MIN) ? INT_MIN : \\ + (GLint) ((F) * 65536.0f) ) + +#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) +#define INT_TO_FIXED(I) ( ((I) > SHRT_MAX) ? INT_MAX : \\ + ((I) < SHRT_MIN) ? INT_MIN : \\ + (GLint) ((I) * 65536) ) + +#define BOOLEAN_TO_INT(B) ( (GLint) (B) ) +#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) +#define BOOLEAN_TO_FIXED(B) ( (GLint) ((B) ? 1 : 0) << 16 ) + +#define ENUM_TO_FIXED(E) (E) + + +/* + * Check if named extension is enabled, if not generate error and return. + */ +#define CHECK_EXT1(EXT1, FUNC) \\ + if (!ctx->Extensions.EXT1) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of two extensions is enabled. + */ +#define CHECK_EXT2(EXT1, EXT2, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of three extensions is enabled. + */ +#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ + !ctx->Extensions.EXT3) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + +/* + * Check if either of four extensions is enabled. + */ +#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \\ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\ + !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \\ + _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\ + return; \\ + } + + + +/** + * List of compressed texture formats supported by ES. + */ +static GLenum compressed_formats[] = { + GL_PALETTE4_RGB8_OES, + GL_PALETTE4_RGBA8_OES, + GL_PALETTE4_R5_G6_B5_OES, + GL_PALETTE4_RGBA4_OES, + GL_PALETTE4_RGB5_A1_OES, + GL_PALETTE8_RGB8_OES, + GL_PALETTE8_RGBA8_OES, + GL_PALETTE8_R5_G6_B5_OES, + GL_PALETTE8_RGBA4_OES, + GL_PALETTE8_RGB5_A1_OES +}; + +#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0])) + +void GLAPIENTRY +_mesa_GetFixedv( GLenum pname, GLfixed *params ); + +""" + return + + +def EmitAll(stateVars, API): + EmitHeader() + EmitGetFunction(stateVars, GLboolean) + EmitGetFunction(stateVars, GLfloat) + EmitGetFunction(stateVars, GLint) + if API == 1: + EmitGetFunction(stateVars, GLfixed) + + +def main(args): + # Determine whether to generate ES1 or ES2 queries + if len(args) > 1 and args[1] == "1": + API = 1 + elif len(args) > 1 and args[1] == "2": + API = 2 + else: + API = 1 + #print "len args = %d API = %d" % (len(args), API) + + if API == 1: + vars = StateVars_common + StateVars_es1 + else: + vars = StateVars_common + StateVars_es2 + + EmitAll(vars, API) + + +main(sys.argv) diff --git a/src/mesa/es/main/mfeatures_es1.h b/src/mesa/es/main/mfeatures_es1.h new file mode 100644 index 0000000000..6c2ece2608 --- /dev/null +++ b/src/mesa/es/main/mfeatures_es1.h @@ -0,0 +1,116 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, 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 TUNGSTEN GRAPHICS 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. + * + **************************************************************************/ + +/** + * \file mfeatures.h + * + * The #defines in this file enable/disable Mesa features needed + * for OpenGL ES 1.1. + */ + + +#ifndef MFEATURES_ES1_H +#define MFEATURES_ES1_H + +/* this file replaces main/mfeatures.h */ +#ifdef FEATURES_H +#error "main/mfeatures.h was wrongly included" +#endif +#define FEATURES_H + +#define ASSERT_NO_FEATURE() ASSERT(0) + +/* + * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. + */ +#ifndef _HAVE_FULL_GL +#define _HAVE_FULL_GL 1 +#endif + +#ifdef IN_DRI_DRIVER +#define FEATURE_remap_table 1 +#else +#define FEATURE_remap_table 0 +#endif + +#define FEATURE_accum 0 +#define FEATURE_arrayelt 0 +#define FEATURE_attrib 0 +#define FEATURE_beginend 0 +#define FEATURE_colortable 0 +#define FEATURE_convolve 0 +#define FEATURE_dispatch 1 +#define FEATURE_dlist 0 +#define FEATURE_draw_read_buffer 0 +#define FEATURE_drawpix 0 +#define FEATURE_eval 0 +#define FEATURE_feedback 0 +#define FEATURE_fixedpt 1 +#define FEATURE_histogram 0 +#define FEATURE_pixel 0 +#define FEATURE_point_size_array 1 +#define FEATURE_queryobj 0 +#define FEATURE_rastpos 0 +#define FEATURE_texgen 1 +#define FEATURE_texture_fxt1 0 +#define FEATURE_texture_s3tc 0 +#define FEATURE_userclip 1 +#define FEATURE_vertex_array_byte 1 +#define FEATURE_es2_glsl 0 + +#define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL +#define FEATURE_ARB_vertex_program _HAVE_FULL_GL + +#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL +#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL +#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) +#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects +#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects + +#define FEATURE_EXT_framebuffer_blit 0 +#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL +#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL +#define FEATURE_EXT_texture_sRGB 0 +#define FEATURE_ATI_fragment_shader 0 +#define FEATURE_MESA_program_debug _HAVE_FULL_GL +#define FEATURE_NV_fence 0 +#define FEATURE_NV_fragment_program 0 +#define FEATURE_NV_vertex_program 0 + +#define FEATURE_OES_framebuffer_object 1 +#define FEATURE_OES_draw_texture 1 +#define FEATURE_OES_mapbuffer 1 + +#define FEATURE_extra_context_init 1 + +/*@}*/ + + + + +#endif /* MFEATURES_ES1_H */ diff --git a/src/mesa/es/main/mfeatures_es2.h b/src/mesa/es/main/mfeatures_es2.h new file mode 100644 index 0000000000..f34782fedb --- /dev/null +++ b/src/mesa/es/main/mfeatures_es2.h @@ -0,0 +1,116 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, 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 TUNGSTEN GRAPHICS 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. + * + **************************************************************************/ + +/** + * \file mfeatures.h + * + * The #defines in this file enable/disable Mesa features needed + * for OpenGL ES 2.0. + */ + + +#ifndef MFEATURES_ES2_H +#define MFEATURES_ES2_H + +/* this file replaces main/mfeatures.h */ +#ifdef FEATURES_H +#error "main/mfeatures.h was wrongly included" +#endif +#define FEATURES_H + +#define ASSERT_NO_FEATURE() ASSERT(0) + +/* + * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. + */ +#ifndef _HAVE_FULL_GL +#define _HAVE_FULL_GL 1 +#endif + +#ifdef IN_DRI_DRIVER +#define FEATURE_remap_table 1 +#else +#define FEATURE_remap_table 0 +#endif + +#define FEATURE_accum 0 +#define FEATURE_arrayelt 0 +#define FEATURE_attrib 0 +#define FEATURE_beginend 0 +#define FEATURE_colortable 0 +#define FEATURE_convolve 0 +#define FEATURE_dispatch 1 +#define FEATURE_dlist 0 +#define FEATURE_draw_read_buffer 0 +#define FEATURE_drawpix 0 +#define FEATURE_eval 0 +#define FEATURE_feedback 0 +#define FEATURE_fixedpt 1 +#define FEATURE_histogram 0 +#define FEATURE_pixel 0 +#define FEATURE_point_size_array 1 +#define FEATURE_queryobj 0 +#define FEATURE_rastpos 0 +#define FEATURE_texgen 1 +#define FEATURE_texture_fxt1 0 +#define FEATURE_texture_s3tc 0 +#define FEATURE_userclip 1 +#define FEATURE_vertex_array_byte 1 +#define FEATURE_es2_glsl 1 + +#define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL +#define FEATURE_ARB_vertex_program _HAVE_FULL_GL + +#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL +#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL +#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) +#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects +#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects + +#define FEATURE_EXT_framebuffer_blit 0 +#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL +#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL +#define FEATURE_EXT_texture_sRGB 0 +#define FEATURE_ATI_fragment_shader 0 +#define FEATURE_MESA_program_debug _HAVE_FULL_GL +#define FEATURE_NV_fence 0 +#define FEATURE_NV_fragment_program 0 +#define FEATURE_NV_vertex_program 0 + +#define FEATURE_OES_framebuffer_object 1 +#define FEATURE_OES_draw_texture 0 +#define FEATURE_OES_mapbuffer 1 + +#define FEATURE_extra_context_init 1 + +/*@}*/ + + + + +#endif /* MFEATURES_ES2_H */ diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c new file mode 100644 index 0000000000..a4f14490f3 --- /dev/null +++ b/src/mesa/es/main/specials_es1.c @@ -0,0 +1,213 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + **************************************************************************/ + + +#include "main/mtypes.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/get.h" + + +extern const GLubyte * GLAPIENTRY _es_GetString(GLenum name); + + +static const GLubyte * +compute_es_version(void) +{ + GET_CURRENT_CONTEXT(ctx); + static const char es_1_0[] = "OpenGL ES-CM 1.0"; + static const char es_1_1[] = "OpenGL ES-CM 1.1"; + /* OpenGL ES 1.0 is derived from OpenGL 1.3 */ + const GLboolean ver_1_0 = (ctx->Extensions.ARB_multisample && + ctx->Extensions.ARB_multitexture && + ctx->Extensions.ARB_texture_compression && + ctx->Extensions.EXT_texture_env_add && + ctx->Extensions.ARB_texture_env_combine && + ctx->Extensions.ARB_texture_env_dot3); + /* OpenGL ES 1.1 is derived from OpenGL 1.5 */ + const GLboolean ver_1_1 = (ver_1_0 && + ctx->Extensions.EXT_point_parameters && + ctx->Extensions.SGIS_generate_mipmap && + ctx->Extensions.ARB_vertex_buffer_object); + if (ver_1_1) + return (const GLubyte *) es_1_1; + + if (!ver_1_0) + _mesa_problem(ctx, "Incomplete OpenGL ES 1.0 support."); + return (const GLubyte *) es_1_0; +} + + +static size_t +append_extension(char **str, const char *ext) +{ + char *s = *str; + size_t len = strlen(ext); + + if (s) { + memcpy(s, ext, len); + s[len++] = ' '; + s[len] = '\0'; + + *str += len; + } + else { + len++; + } + + return len; +} + + +static size_t +make_extension_string(const GLcontext *ctx, char *str) +{ + size_t len = 0; + + /* Core additions */ + len += append_extension(&str, "GL_OES_byte_coordinates"); + len += append_extension(&str, "GL_OES_fixed_point"); + len += append_extension(&str, "GL_OES_single_precision"); + len += append_extension(&str, "GL_OES_matrix_get"); + + /* 1.1 required extensions */ + len += append_extension(&str, "GL_OES_read_format"); + len += append_extension(&str, "GL_OES_compressed_paletted_texture"); + len += append_extension(&str, "GL_OES_point_size_array"); + len += append_extension(&str, "GL_OES_point_sprite"); + + /* 1.1 deprecated extensions */ + len += append_extension(&str, "GL_OES_query_matrix"); + +#if FEATURE_OES_draw_texture + if (ctx->Extensions.OES_draw_texture) + len += append_extension(&str, "GL_OES_draw_texture"); +#endif + + if (ctx->Extensions.EXT_blend_equation_separate) + len += append_extension(&str, "GL_OES_blend_equation_separate"); + if (ctx->Extensions.EXT_blend_func_separate) + len += append_extension(&str, "GL_OES_blend_func_separate"); + if (ctx->Extensions.EXT_blend_subtract) + len += append_extension(&str, "GL_OES_blend_subtract"); + + if (ctx->Extensions.EXT_stencil_wrap) + len += append_extension(&str, "GL_OES_stencil_wrap"); + + if (ctx->Extensions.ARB_texture_cube_map) + len += append_extension(&str, "GL_OES_texture_cube_map"); + if (ctx->Extensions.ARB_texture_env_crossbar) + len += append_extension(&str, "GL_OES_texture_env_crossbar"); + if (ctx->Extensions.ARB_texture_mirrored_repeat) + len += append_extension(&str, "GL_OES_texture_mirrored_repeat"); + + if (ctx->Extensions.ARB_framebuffer_object) { + len += append_extension(&str, "GL_OES_framebuffer_object"); + len += append_extension(&str, "GL_OES_depth24"); + len += append_extension(&str, "GL_OES_depth32"); + len += append_extension(&str, "GL_OES_fbo_render_mipmap"); + len += append_extension(&str, "GL_OES_rgb8_rgba8"); + len += append_extension(&str, "GL_OES_stencil1"); + len += append_extension(&str, "GL_OES_stencil4"); + len += append_extension(&str, "GL_OES_stencil8"); + } + + if (ctx->Extensions.EXT_vertex_array) + len += append_extension(&str, "GL_OES_element_index_uint"); + if (ctx->Extensions.ARB_vertex_buffer_object) + len += append_extension(&str, "GL_OES_mapbuffer"); + if (ctx->Extensions.EXT_texture_filter_anisotropic) + len += append_extension(&str, "GL_EXT_texture_filter_anisotropic"); + + /* some applications check this for NPOT support */ + if (ctx->Extensions.ARB_texture_non_power_of_two) + len += append_extension(&str, "GL_ARB_texture_non_power_of_two"); + + if (ctx->Extensions.EXT_texture_compression_s3tc) + len += append_extension(&str, "GL_EXT_texture_compression_dxt1"); + if (ctx->Extensions.EXT_texture_lod_bias) + len += append_extension(&str, "GL_EXT_texture_lod_bias"); + if (ctx->Extensions.EXT_blend_minmax) + len += append_extension(&str, "GL_EXT_blend_minmax"); + if (ctx->Extensions.EXT_multi_draw_arrays) + len += append_extension(&str, "GL_EXT_multi_draw_arrays"); + + return len; +} + + +static const GLubyte * +compute_es_extensions(void) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!ctx->Extensions.String) { + char *s; + unsigned int len; + + len = make_extension_string(ctx, NULL); + s = (char *) _mesa_malloc(len + 1); + if (!s) + return NULL; + make_extension_string(ctx, s); + ctx->Extensions.String = (const GLubyte *) s; + } + + return ctx->Extensions.String; +} + + +const GLubyte * GLAPIENTRY +_es_GetString(GLenum name) +{ + switch (name) { + case GL_VERSION: + return compute_es_version(); + case GL_EXTENSIONS: + return compute_es_extensions(); + default: + return _mesa_GetString(name); + } +} + + +void +_mesa_initialize_context_extra(GLcontext *ctx) +{ + GLuint i; + + /** + * GL_OES_texture_cube_map says + * "Initially all texture generation modes are set to REFLECTION_MAP_OES" + */ + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; + texUnit->GenS.Mode = GL_REFLECTION_MAP_NV; + texUnit->GenT.Mode = GL_REFLECTION_MAP_NV; + texUnit->GenR.Mode = GL_REFLECTION_MAP_NV; + texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV; + texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV; + texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV; + } +} diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c new file mode 100644 index 0000000000..e11ade9b94 --- /dev/null +++ b/src/mesa/es/main/specials_es2.c @@ -0,0 +1,174 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + **************************************************************************/ + + +#include "main/mtypes.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/get.h" + + +const GLubyte * GLAPIENTRY _es_GetString(GLenum name); + + +static const GLubyte * +compute_es_version(void) +{ + GET_CURRENT_CONTEXT(ctx); + static const char es_2_0[] = "OpenGL ES 2.0"; + /* OpenGL ES 2.0 is derived from OpenGL 2.0 */ + const GLboolean ver_2_0 = (ctx->Extensions.ARB_multisample && + ctx->Extensions.ARB_multitexture && + ctx->Extensions.ARB_texture_compression && + ctx->Extensions.ARB_texture_cube_map && + ctx->Extensions.ARB_texture_mirrored_repeat && + ctx->Extensions.EXT_blend_color && + ctx->Extensions.EXT_blend_func_separate && + ctx->Extensions.EXT_blend_minmax && + ctx->Extensions.EXT_blend_subtract && + ctx->Extensions.EXT_stencil_wrap && + ctx->Extensions.ARB_vertex_buffer_object && + ctx->Extensions.ARB_shader_objects && + ctx->Extensions.ARB_vertex_shader && + ctx->Extensions.ARB_fragment_shader && + ctx->Extensions.ARB_texture_non_power_of_two && + ctx->Extensions.EXT_blend_equation_separate); + if (!ver_2_0) + _mesa_problem(ctx, "Incomplete OpenGL ES 2.0 support."); + return (const GLubyte *) es_2_0; +} + + +static size_t +append_extension(char **str, const char *ext) +{ + char *s = *str; + size_t len = strlen(ext); + + if (s) { + memcpy(s, ext, len); + s[len++] = ' '; + s[len] = '\0'; + + *str += len; + } + else { + len++; + } + + return len; +} + + +static size_t +make_extension_string(const GLcontext *ctx, char *str) +{ + size_t len = 0; + + len += append_extension(&str, "GL_OES_compressed_paletted_texture"); + + if (ctx->Extensions.ARB_framebuffer_object) { + len += append_extension(&str, "GL_OES_depth24"); + len += append_extension(&str, "GL_OES_depth32"); + len += append_extension(&str, "GL_OES_fbo_render_mipmap"); + len += append_extension(&str, "GL_OES_rgb8_rgba8"); + len += append_extension(&str, "GL_OES_stencil1"); + len += append_extension(&str, "GL_OES_stencil4"); + } + + if (ctx->Extensions.EXT_vertex_array) + len += append_extension(&str, "GL_OES_element_index_uint"); + if (ctx->Extensions.ARB_vertex_buffer_object) + len += append_extension(&str, "GL_OES_mapbuffer"); + + if (ctx->Extensions.EXT_texture3D) + len += append_extension(&str, "GL_OES_texture_3D"); + if (ctx->Extensions.ARB_texture_non_power_of_two) + len += append_extension(&str, "GL_OES_texture_npot"); + if (ctx->Extensions.EXT_texture_filter_anisotropic) + len += append_extension(&str, "GL_EXT_texture_filter_anisotropic"); + + len += append_extension(&str, "GL_EXT_texture_type_2_10_10_10_REV"); + if (ctx->Extensions.ARB_depth_texture) + len += append_extension(&str, "GL_OES_depth_texture"); + if (ctx->Extensions.EXT_packed_depth_stencil) + len += append_extension(&str, "GL_OES_packed_depth_stencil"); + if (ctx->Extensions.ARB_fragment_shader) + len += append_extension(&str, "GL_OES_standard_derivatives"); + + if (ctx->Extensions.EXT_texture_compression_s3tc) + len += append_extension(&str, "GL_EXT_texture_compression_dxt1"); + if (ctx->Extensions.EXT_blend_minmax) + len += append_extension(&str, "GL_EXT_blend_minmax"); + if (ctx->Extensions.EXT_multi_draw_arrays) + len += append_extension(&str, "GL_EXT_multi_draw_arrays"); + + return len; +} + + +static const GLubyte * +compute_es_extensions(void) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!ctx->Extensions.String) { + char *s; + unsigned int len; + + len = make_extension_string(ctx, NULL); + s = (char *) _mesa_malloc(len + 1); + if (!s) + return NULL; + make_extension_string(ctx, s); + ctx->Extensions.String = (const GLubyte *) s; + } + + return ctx->Extensions.String; +} + +const GLubyte * GLAPIENTRY +_es_GetString(GLenum name) +{ + switch (name) { + case GL_VERSION: + return compute_es_version(); + case GL_SHADING_LANGUAGE_VERSION: + return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16"; + case GL_EXTENSIONS: + return compute_es_extensions(); + default: + return _mesa_GetString(name); + } +} + + +void +_mesa_initialize_context_extra(GLcontext *ctx) +{ + ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; + ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; + + ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */ +} diff --git a/src/mesa/es/main/stubs.c b/src/mesa/es/main/stubs.c new file mode 100644 index 0000000000..e7b8bc780f --- /dev/null +++ b/src/mesa/es/main/stubs.c @@ -0,0 +1,138 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + **************************************************************************/ + + +/** + * Temporary stubs for "missing" mesa functions. + */ + + +#include "main/mtypes.h" +#include "main/imports.h" +#include "vbo/vbo.h" + +#define NEED_IMPLEMENT() do { \ + GET_CURRENT_CONTEXT(ctx); \ + _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); \ + } while (0) + +#if FEATURE_accum +/* This is a sanity check that to be sure we're using the correct mfeatures.h + * header. We don't want to accidentally use the one from mainline Mesa. + */ +#error "The wrong mfeatures.h file is being included!" +#endif + + +/* silence compiler warnings */ +extern void GLAPIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param); +extern void GLAPIENTRY _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +extern void GLAPIENTRY _mesa_ReleaseShaderCompiler(void); +extern void GLAPIENTRY _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length); +extern void GLAPIENTRY _vbo_VertexAttrib1f(GLuint indx, GLfloat x); +extern void GLAPIENTRY _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values); +extern void GLAPIENTRY _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); +extern void GLAPIENTRY _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values); +extern void GLAPIENTRY _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); +extern void GLAPIENTRY _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values); +extern void GLAPIENTRY _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values); + + +void GLAPIENTRY +_vbo_Materialf(GLenum face, GLenum pname, GLfloat param) +{ + _vbo_Materialfv(face, pname, ¶m); +} + + +void GLAPIENTRY +_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, + GLint* range, GLint* precision) +{ + NEED_IMPLEMENT(); +} + + +void GLAPIENTRY +_mesa_ReleaseShaderCompiler(void) +{ + NEED_IMPLEMENT(); +} + + +void GLAPIENTRY +_mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, + const void* binary, GLint length) +{ + NEED_IMPLEMENT(); +} + + +void GLAPIENTRY +_vbo_VertexAttrib1f(GLuint indx, GLfloat x) +{ + _vbo_VertexAttrib4f(indx, x, 0.0, 0.0, 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values) +{ + _vbo_VertexAttrib4f(indx, values[0], 0.0, 0.0, 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) +{ + _vbo_VertexAttrib4f(indx, x, y, 0.0, 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values) +{ + _vbo_VertexAttrib4f(indx, values[0], values[1], 0.0, 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) +{ + _vbo_VertexAttrib4f(indx, x, y, z, 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values) +{ + _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], 1.0f); +} + + +void GLAPIENTRY +_vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values) +{ + _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], values[3]); +} diff --git a/src/mesa/es/sources.mak b/src/mesa/es/sources.mak new file mode 100644 index 0000000000..55bb31b80d --- /dev/null +++ b/src/mesa/es/sources.mak @@ -0,0 +1,166 @@ +include $(MESA)/sources.mak + +# LOCAL sources + +LOCAL_ES1_SOURCES := \ + main/api_exec_es1.c \ + main/get_es1.c \ + main/specials_es1.c \ + main/drawtex.c \ + main/es_cpaltex.c \ + main/es_enable.c \ + main/es_fbo.c \ + main/es_query_matrix.c \ + main/es_texgen.c \ + main/stubs.c \ + glapi/glapi-es1/main/enums.c + +LOCAL_ES1_GALLIUM_SOURCES := \ + $(LOCAL_ES1_SOURCES) \ + state_tracker/st_cb_drawtex.c + +# always use local version of GLAPI_ASM_SOURCES +LOCAL_ES1_API_ASM := $(addprefix glapi/glapi-es1/, $(GLAPI_ASM_SOURCES)) + +LOCAL_ES1_INCLUDES := \ + -I. \ + -I./glapi/glapi-es1 \ + -I./state_tracker \ + -I$(MESA)/state_tracker + +LOCAL_ES2_SOURCES := \ + main/api_exec_es2.c \ + main/get_es2.c \ + main/specials_es2.c \ + main/es_cpaltex.c \ + main/es_fbo.c \ + main/stubs.c \ + glapi/glapi-es2/main/enums.c + +LOCAL_ES2_GALLIUM_SOURCES := \ + $(LOCAL_ES2_SOURCES) + +LOCAL_ES2_API_ASM := $(subst es1,es2, $(LOCAL_ES1_API_ASM)) +LOCAL_ES2_INCLUDES := $(subst es1,es2, $(LOCAL_ES1_INCLUDES)) + +# MESA sources +# Ideally, the omit list should be replaced by features. + +MAIN_OMITTED := \ + main/api_exec.c \ + main/condrender.c \ + main/dlopen.c \ + main/enums.c \ + main/get.c +MAIN_SOURCES := $(filter-out $(MAIN_OMITTED), $(MAIN_SOURCES)) + +VBO_OMITTED := \ + vbo/vbo_save.c \ + vbo/vbo_save_api.c \ + vbo/vbo_save_draw.c \ + vbo/vbo_save_loopback.c +VBO_SOURCES := $(filter-out $(VBO_OMITTED), $(VBO_SOURCES)) + +STATETRACKER_OMITTED := \ + state_tracker/st_api.c \ + state_tracker/st_cb_drawpixels.c \ + state_tracker/st_cb_feedback.c \ + state_tracker/st_cb_rasterpos.c \ + state_tracker/st_draw_feedback.c +STATETRACKER_SOURCES := $(filter-out $(STATETRACKER_OMITTED), $(STATETRACKER_SOURCES)) + +SHADER_OMITTED := \ + shader/atifragshader.c +SHADER_SOURCES := $(filter-out $(SHADER_OMITTED), $(SHADER_SOURCES)) + +MESA_ES1_SOURCES := \ + $(MAIN_SOURCES) \ + $(MATH_SOURCES) \ + $(MATH_XFORM_SOURCES) \ + $(VBO_SOURCES) \ + $(TNL_SOURCES) \ + $(SHADER_SOURCES) \ + $(SWRAST_SOURCES) \ + $(SWRAST_SETUP_SOURCES) \ + $(COMMON_DRIVER_SOURCES) \ + $(ASM_C_SOURCES) \ + $(SLANG_SOURCES) + +MESA_ES1_GALLIUM_SOURCES := \ + $(MAIN_SOURCES) \ + $(MATH_SOURCES) \ + $(VBO_SOURCES) \ + $(STATETRACKER_SOURCES) \ + $(SHADER_SOURCES) \ + ppc/common_ppc.c \ + x86/common_x86.c \ + $(SLANG_SOURCES) + +MESA_ES1_API_SOURCES := \ + $(GLAPI_SOURCES) + +MESA_ES1_INCLUDES := $(INCLUDE_DIRS) + +# remove LOCAL sources from MESA sources +MESA_ES1_SOURCES := $(filter-out $(LOCAL_ES1_SOURCES), $(MESA_ES1_SOURCES)) +MESA_ES1_GALLIUM_SOURCES := $(filter-out $(LOCAL_ES1_GALLIUM_SOURCES), $(MESA_ES1_GALLIUM_SOURCES)) + +# right now es2 and es1 share MESA sources +MESA_ES2_SOURCES := $(MESA_ES1_SOURCES) +MESA_ES2_GALLIUM_SOURCES := $(MESA_ES1_GALLIUM_SOURCES) +MESA_ES2_API_SOURCES := $(MESA_ES1_API_SOURCES) + +MESA_ES2_INCLUDES := $(MESA_ES1_INCLUDES) + +# asm is shared by any ES version and any library +MESA_ES_ASM := $(MESA_ASM_SOURCES) + +# collect sources, adjust the pathes +ES1_SOURCES := $(LOCAL_ES1_SOURCES) $(addprefix $(MESA)/,$(MESA_ES1_SOURCES)) +ES1_GALLIUM_SOURCES := $(LOCAL_ES1_GALLIUM_SOURCES) $(addprefix $(MESA)/,$(MESA_ES1_GALLIUM_SOURCES)) +ES1_API_SOURCES := $(addprefix $(MESA)/,$(MESA_ES1_API_SOURCES)) + +ES2_SOURCES := $(LOCAL_ES2_SOURCES) $(addprefix $(MESA)/,$(MESA_ES2_SOURCES)) +ES2_GALLIUM_SOURCES := $(LOCAL_ES2_GALLIUM_SOURCES) $(addprefix $(MESA)/,$(MESA_ES2_GALLIUM_SOURCES)) +ES2_API_SOURCES := $(addprefix $(MESA)/,$(MESA_ES2_API_SOURCES)) + +# collect includes +ES1_INCLUDES := $(LOCAL_ES1_INCLUDES) $(MESA_ES1_INCLUDES) +ES2_INCLUDES := $(LOCAL_ES2_INCLUDES) $(MESA_ES2_INCLUDES) + +# collect objects, including asm +ES1_OBJECTS := \ + $(LOCAL_ES1_SOURCES:.c=.o) \ + $(MESA_ES1_SOURCES:.c=.o) \ + $(MESA_ES_ASM:.S=.o) + +ES1_GALLIUM_OBJECTS := \ + $(LOCAL_ES1_GALLIUM_SOURCES:.c=.o) \ + $(MESA_ES1_GALLIUM_SOURCES:.c=.o) \ + $(MESA_ES_ASM:.S=.o) + +ES1_API_OBJECTS := \ + $(LOCAL_ES1_API_ASM:.S=.o) \ + $(MESA_ES1_API_SOURCES:.c=.o) + +ES2_OBJECTS := \ + $(LOCAL_ES2_SOURCES:.c=.o) \ + $(MESA_ES2_SOURCES:.c=.o) \ + $(MESA_ES_ASM:.S=.o) + +ES2_GALLIUM_OBJECTS := \ + $(LOCAL_ES2_GALLIUM_SOURCES:.c=.o) \ + $(MESA_ES2_GALLIUM_SOURCES:.c=.o) \ + $(MESA_ES_ASM:.S=.o) + +ES2_API_OBJECTS := \ + $(LOCAL_ES2_API_ASM:.S=.o) \ + $(MESA_ES2_API_SOURCES:.c=.o) + +# collect sources for makedepend +ES1_ALL_SOURCES := $(ES1_SOURCES) $(ES1_GALLIUM_SOURCES) $(ES1_API_SOURCES) +ES2_ALL_SOURCES := $(ES2_SOURCES) $(ES2_GALLIUM_SOURCES) $(ES2_API_SOURCES) + +# sort to remove duplicates +ES1_ALL_SOURCES := $(sort $(ES1_ALL_SOURCES)) +ES2_ALL_SOURCES := $(sort $(ES2_ALL_SOURCES)) diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c new file mode 100644 index 0000000000..3b98b9c40b --- /dev/null +++ b/src/mesa/es/state_tracker/st_cb_drawtex.c @@ -0,0 +1,297 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + **************************************************************************/ + + +/** + * Implementation of glDrawTex() for GL_OES_draw_tex + */ + + + +#include "main/imports.h" +#include "main/image.h" +#include "main/bufferobj.h" +#include "main/drawtex.h" +#include "main/macros.h" +#include "main/state.h" +#include "main/texformat.h" +#include "shader/program.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" + +#include "st_context.h" +#include "st_atom.h" +#include "st_atom_constbuf.h" +#include "st_draw.h" +#include "st_cb_drawtex.h" + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "pipe/p_shader_tokens.h" +#include "util/u_tile.h" +#include "util/u_draw_quad.h" +#include "util/u_simple_shaders.h" + +#include "cso_cache/cso_context.h" + + +struct cached_shader +{ + //struct pipe_shader_state shader; + void *handle; + + uint num_attribs; + uint semantic_names[2 + MAX_TEXTURE_UNITS]; + uint semantic_indexes[2 + MAX_TEXTURE_UNITS]; +}; + +#define MAX_SHADERS (2 * MAX_TEXTURE_UNITS) + +/** + * Simple linear list cache. + * Most of the time there'll only be one cached shader. + */ +static struct cached_shader CachedShaders[MAX_SHADERS]; +static GLuint NumCachedShaders = 0; + + +#if FEATURE_OES_draw_texture + + +static void * +lookup_shader(struct pipe_context *pipe, + uint num_attribs, + const uint *semantic_names, + const uint *semantic_indexes) +{ + GLuint i, j; + + /* look for existing shader with same attributes */ + for (i = 0; i < NumCachedShaders; i++) { + if (CachedShaders[i].num_attribs == num_attribs) { + GLboolean match = GL_TRUE; + for (j = 0; j < num_attribs; j++) { + if (semantic_names[j] != CachedShaders[i].semantic_names[j] || + semantic_indexes[j] != CachedShaders[i].semantic_indexes[j]) { + match = GL_FALSE; + break; + } + } + if (match) + return CachedShaders[i].handle; + } + } + + /* not found - create new one now */ + if (NumCachedShaders >= MAX_SHADERS) { + return NULL; + } + + CachedShaders[i].num_attribs = num_attribs; + for (j = 0; j < num_attribs; j++) { + CachedShaders[i].semantic_names[j] = semantic_names[j]; + CachedShaders[i].semantic_indexes[j] = semantic_indexes[j]; + } + + CachedShaders[i].handle = + util_make_vertex_passthrough_shader(pipe, + num_attribs, + semantic_names, + semantic_indexes); + NumCachedShaders++; + + return CachedShaders[i].handle; +} + +static void +st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, + GLfloat width, GLfloat height) +{ + struct st_context *st = ctx->st; + struct pipe_context *pipe = st->pipe; + struct cso_context *cso = ctx->st->cso_context; + struct pipe_buffer *vbuffer; + GLuint i, numTexCoords, numAttribs; + GLboolean emitColor; + uint semantic_names[2 + MAX_TEXTURE_UNITS]; + uint semantic_indexes[2 + MAX_TEXTURE_UNITS]; + GLbitfield inputs = VERT_BIT_POS; + + /* determine if we need vertex color */ + if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0) + emitColor = GL_TRUE; + else + emitColor = GL_FALSE; + + /* determine how many enabled sets of texcoords */ + numTexCoords = 0; + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) { + inputs |= VERT_BIT_TEX(i); + numTexCoords++; + } + } + + /* total number of attributes per vertex */ + numAttribs = 1 + emitColor + numTexCoords; + + + /* create the vertex buffer */ + vbuffer = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX, + numAttribs * 4 * 4 * sizeof(GLfloat)); + + /* load vertex buffer */ + { +#define SET_ATTRIB(VERT, ATTR, X, Y, Z, W) \ + do { \ + GLuint k = (((VERT) * numAttribs + (ATTR)) * 4); \ + assert(k < 4 * 4 * numAttribs); \ + vbuf[k + 0] = X; \ + vbuf[k + 1] = Y; \ + vbuf[k + 2] = Z; \ + vbuf[k + 3] = W; \ + } while (0) + + const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height; + GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe->screen, vbuffer, + PIPE_BUFFER_USAGE_CPU_WRITE); + GLuint attr; + + z = CLAMP(z, 0.0f, 1.0f); + + /* positions (in clip coords) */ + { + const struct gl_framebuffer *fb = st->ctx->DrawBuffer; + const GLfloat fb_width = (GLfloat)fb->Width; + const GLfloat fb_height = (GLfloat)fb->Height; + + const GLfloat clip_x0 = (GLfloat)(x0 / fb_width * 2.0 - 1.0); + const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0); + const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0); + const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0); + + SET_ATTRIB(0, 0, clip_x0, clip_y0, z, 1.0f); /* lower left */ + SET_ATTRIB(1, 0, clip_x1, clip_y0, z, 1.0f); /* lower right */ + SET_ATTRIB(2, 0, clip_x1, clip_y1, z, 1.0f); /* upper right */ + SET_ATTRIB(3, 0, clip_x0, clip_y1, z, 1.0f); /* upper left */ + + semantic_names[0] = TGSI_SEMANTIC_POSITION; + semantic_indexes[0] = 0; + } + + /* colors */ + if (emitColor) { + const GLfloat *c = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; + SET_ATTRIB(0, 1, c[0], c[1], c[2], c[3]); + SET_ATTRIB(1, 1, c[0], c[1], c[2], c[3]); + SET_ATTRIB(2, 1, c[0], c[1], c[2], c[3]); + SET_ATTRIB(3, 1, c[0], c[1], c[2], c[3]); + semantic_names[1] = TGSI_SEMANTIC_COLOR; + semantic_indexes[1] = 0; + attr = 2; + } + else { + attr = 1; + } + + /* texcoords */ + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) { + struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current; + struct gl_texture_image *img = obj->Image[0][obj->BaseLevel]; + const GLfloat wt = (GLfloat) img->Width; + const GLfloat ht = (GLfloat) img->Height; + const GLfloat s0 = obj->CropRect[0] / wt; + const GLfloat t0 = obj->CropRect[1] / ht; + const GLfloat s1 = (obj->CropRect[0] + obj->CropRect[2]) / wt; + const GLfloat t1 = (obj->CropRect[1] + obj->CropRect[3]) / ht; + + /*printf("crop texcoords: %g, %g .. %g, %g\n", s0, t0, s1, t1);*/ + SET_ATTRIB(0, attr, s0, t0, 0.0f, 1.0f); /* lower left */ + SET_ATTRIB(1, attr, s1, t0, 0.0f, 1.0f); /* lower right */ + SET_ATTRIB(2, attr, s1, t1, 0.0f, 1.0f); /* upper right */ + SET_ATTRIB(3, attr, s0, t1, 0.0f, 1.0f); /* upper left */ + + semantic_names[attr] = TGSI_SEMANTIC_GENERIC; + semantic_indexes[attr] = 0; + + attr++; + } + } + + pipe_buffer_unmap(pipe->screen, vbuffer); + +#undef SET_ATTRIB + } + + + cso_save_viewport(cso); + cso_save_vertex_shader(cso); + + { + void *vs = lookup_shader(pipe, numAttribs, + semantic_names, semantic_indexes); + cso_set_vertex_shader_handle(cso, vs); + } + + /* viewport state: viewport matching window dims */ + { + const struct gl_framebuffer *fb = st->ctx->DrawBuffer; + const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP); + const GLfloat width = (GLfloat)fb->Width; + const GLfloat height = (GLfloat)fb->Height; + struct pipe_viewport_state vp; + vp.scale[0] = 0.5f * width; + vp.scale[1] = height * (invert ? -0.5f : 0.5f); + vp.scale[2] = 1.0f; + vp.scale[3] = 1.0f; + vp.translate[0] = 0.5f * width; + vp.translate[1] = 0.5f * height; + vp.translate[2] = 0.0f; + vp.translate[3] = 0.0f; + cso_set_viewport(cso, &vp); + } + + + util_draw_vertex_buffer(pipe, vbuffer, + 0, /* offset */ + PIPE_PRIM_TRIANGLE_FAN, + 4, /* verts */ + numAttribs); /* attribs/vert */ + + + pipe_buffer_reference(&vbuffer, NULL); + + /* restore state */ + cso_restore_viewport(cso); + cso_restore_vertex_shader(cso); +} + + +#endif /* FEATURE_OES_draw_texture */ + + +void +st_init_drawtex_functions(struct dd_function_table *functions) +{ + _MESA_INIT_DRAWTEX_FUNCTIONS(functions, st_); +} + + +/** + * Free any cached shaders + */ +void +st_destroy_drawtex(struct st_context *st) +{ + GLuint i; + for (i = 0; i < NumCachedShaders; i++) { + cso_delete_vertex_shader(st->cso_context, CachedShaders[i].handle); + } + NumCachedShaders = 0; +} diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.h b/src/mesa/es/state_tracker/st_cb_drawtex.h new file mode 100644 index 0000000000..7b0da70279 --- /dev/null +++ b/src/mesa/es/state_tracker/st_cb_drawtex.h @@ -0,0 +1,18 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + **************************************************************************/ + + +#ifndef ST_CB_DRAWTEX_H +#define ST_CB_DRAWTEX_H + +extern void +st_init_drawtex_functions(struct dd_function_table *functions); + +extern void +st_destroy_drawtex(struct st_context *st); + +#endif /* ST_CB_DRAWTEX_H */ diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index 4db0ff1425..bfc3db4313 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -25,6 +25,7 @@ GLX_DIR = $(XORG_BASE)/glx SERVER_GLAPI_FILES = \ $(GLX_DIR)/glapi.h \ $(GLX_DIR)/glapi.c \ + $(GLX_DIR)/glapi_nop.c \ $(GLX_DIR)/glthread.c \ $(GLX_DIR)/glthread.h @@ -43,7 +44,6 @@ SERVER_OUTPUTS = \ $(GLX_DIR)/glapioffsets.h \ $(GLX_DIR)/glapidispatch.h \ $(GLX_DIR)/glprocs.h \ - $(GLX_DIR)/dispatch.h \ $(SERVER_GLAPI_FILES) API_XML = gl_API.xml \ diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 6623d52469..27f80a5062 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -30,8 +30,8 @@ #define _GLAPI_USE_REMAP_TABLE #endif -#include "glapitable.h" -#include "glapioffsets.h" -#include "glapidispatch.h" +#include "glapi/glapitable.h" +#include "glapi/glapioffsets.h" +#include "glapi/glapidispatch.h" #endif /* _DISPATCH_H */ diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 75d2f3c438..fbf8b0c3e4 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -866,6 +866,9 @@ <enum name="4_BYTES" count="4" value="0x1409"> <size name="CallLists"/> </enum> + <enum name="HALF_FLOAT" count="2" value="0x140B"> + <size name="CallLists"/> + </enum> <enum name="CLEAR" value="0x1500"/> <enum name="AND" value="0x1501"/> <enum name="AND_REVERSE" value="0x1502"/> diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py index b98919134f..a10a35e513 100644 --- a/src/mesa/glapi/gl_XML.py +++ b/src/mesa/glapi/gl_XML.py @@ -184,7 +184,7 @@ class gl_print_base: The name is also added to the file's undef_list. """ self.undef_list.append("PURE") - print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) + print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -224,7 +224,7 @@ class gl_print_base: """ self.undef_list.append(S) - print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) + print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define %s __attribute__((visibility("%s"))) # else # define %s @@ -244,7 +244,7 @@ class gl_print_base: """ self.undef_list.append("NOINLINE") - print """# if defined(__GNUC__) + print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define NOINLINE __attribute__((noinline)) # else # define NOINLINE @@ -738,6 +738,9 @@ class gl_function( gl_item ): return p_string + def is_abi(self): + return (self.offset >= 0 and not self.assign_offset) + def is_static_entry_point(self, name): return name in self.static_entry_points diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py index a37c08d6ce..41a40fbeb6 100644 --- a/src/mesa/glapi/gl_apitemp.py +++ b/src/mesa/glapi/gl_apitemp.py @@ -30,7 +30,7 @@ import license import sys, getopt class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self): + def __init__(self, es=False): gl_XML.gl_print_base.__init__(self) self.name = "gl_apitemp.py (from Mesa)" @@ -38,6 +38,8 @@ class PrintGlOffsets(gl_XML.gl_print_base): """Copyright (C) 1999-2001 Brian Paul All Rights Reserved. (C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + self.es = es + self.undef_list.append( "KEYWORD1" ) self.undef_list.append( "KEYWORD1_ALT" ) self.undef_list.append( "KEYWORD2" ) @@ -82,10 +84,14 @@ class PrintGlOffsets(gl_XML.gl_print_base): else: dispatch = "DISPATCH" - if f.has_different_protocol(name): - print '#ifndef GLX_INDIRECT_RENDERING' - + need_proto = False if not f.is_static_entry_point(name): + need_proto = True + elif self.es: + cat, num = api.get_category_for_name(name) + if (cat.startswith("es") or cat.startswith("GL_OES")): + need_proto = True + if need_proto: print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) print '' @@ -98,8 +104,6 @@ class PrintGlOffsets(gl_XML.gl_print_base): print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \ % (dispatch, f.name, p_string, name, t_string, o_string) print '}' - if f.has_different_protocol(name): - print '#endif /* GLX_INDIRECT_RENDERING */' print '' return @@ -172,7 +176,11 @@ class PrintGlOffsets(gl_XML.gl_print_base): #error TABLE_ENTRY must be defined #endif -static _glapi_proc DISPATCH_TABLE_NAME[] = {""" +#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined +#endif + +_glapi_proc DISPATCH_TABLE_NAME[] = {""" for f in api.functionIterateByOffset(): print ' TABLE_ENTRY(%s),' % (f.dispatch_name()) @@ -196,35 +204,90 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {""" * We list the functions which are not otherwise used. */ #ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = {""" +_glapi_proc UNUSED_TABLE_NAME[] = {""" + normal_entries = [] + proto_entries = [] for f in api.functionIterateByOffset(): - for n in f.entry_points: - if n != f.name: - if f.is_static_entry_point(n): - text = ' TABLE_ENTRY(%s),' % (n) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text + normal_ents, proto_ents = self.classifyEntryPoints(f) + + # exclude f.name + if f.name in normal_ents: + normal_ents.remove(f.name) + elif f.name in proto_ents: + proto_ents.remove(f.name) + + normal_ents = [f.static_name(ent) for ent in normal_ents] + proto_ents = [f.static_name(ent) for ent in proto_ents] + + normal_entries.extend(normal_ents) + proto_entries.extend(proto_ents) + + print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' + for ent in normal_entries: + print ' TABLE_ENTRY(%s),' % (ent) + print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' + print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' + for ent in proto_entries: + print ' TABLE_ENTRY(%s),' % (ent) + print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' + print '};' print '#endif /*UNUSED_TABLE_NAME*/' print '' return + def classifyEntryPoints(self, func): + normal_names = [] + normal_stubs = [] + proto_names = [] + proto_stubs = [] + # classify the entry points + for name in func.entry_points: + if func.has_different_protocol(name): + if func.is_static_entry_point(name): + proto_names.append(name) + else: + proto_stubs.append(name) + else: + if func.is_static_entry_point(name): + normal_names.append(name) + else: + normal_stubs.append(name) + # there can be at most one stub for a function + if normal_stubs: + normal_names.append(normal_stubs[0]) + elif proto_stubs: + proto_names.append(proto_stubs[0]) + + return (normal_names, proto_names) + def printBody(self, api): + normal_entry_points = [] + proto_entry_points = [] for func in api.functionIterateByOffset(): - got_stub = 0 - for n in func.entry_points: - if func.is_static_entry_point(n): - self.printFunction(func, n) - elif not got_stub: - self.printFunction(func, n) - got_stub = 1 + normal_ents, proto_ents = self.classifyEntryPoints(func) + normal_entry_points.append((func, normal_ents)) + proto_entry_points.append((func, proto_ents)) + + print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' + print '' + for func, ents in normal_entry_points: + for ent in ents: + self.printFunction(func, ent) + print '' + print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' + print '' + print '/* these entry points might require different protocols */' + print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' + print '' + for func, ents in proto_entry_points: + for ent in ents: + self.printFunction(func, ent) + print '' + print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' + print '' self.printInitDispatch(api) self.printAliasedTable(api) @@ -232,22 +295,26 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {""" def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] + print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] + print "-c Enable compatibility with OpenGL ES." sys.exit(1) if __name__ == '__main__': file_name = "gl_API.xml" try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") + (args, trail) = getopt.getopt(sys.argv[1:], "f:c") except Exception,e: show_usage() + es = False for (arg,val) in args: if arg == "-f": file_name = val + elif arg == "-c": + es = True api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer = PrintGlOffsets() + printer = PrintGlOffsets(es) printer.Print(api) diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index 27ab119537..acaa06ab37 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -42,10 +42,10 @@ class PrintGlEnums(gl_XML.gl_print_base): def printRealHeader(self): - print '#include "glheader.h"' - print '#include "mfeatures.h"' - print '#include "enums.h"' - print '#include "imports.h"' + print '#include "main/glheader.h"' + print '#include "main/mfeatures.h"' + print '#include "main/enums.h"' + print '#include "main/imports.h"' print '' print 'typedef struct {' print ' size_t offset;' diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py index ca6c90ffd8..54867b3463 100644 --- a/src/mesa/glapi/gl_offsets.py +++ b/src/mesa/glapi/gl_offsets.py @@ -30,9 +30,10 @@ import license import sys, getopt class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self): + def __init__(self, es=False): gl_XML.gl_print_base.__init__(self) + self.es = es self.name = "gl_offsets.py (from Mesa)" self.header_tag = '_GLAPI_OFFSETS_H_' self.license = license.bsd_license_template % ( \ @@ -41,22 +42,24 @@ class PrintGlOffsets(gl_XML.gl_print_base): return def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - print '/* this file should not be included directly in mesa */' print '' functions = [] abi_functions = [] + alias_functions = [] count = 0 for f in api.functionIterateByOffset(): - [category, num] = api.get_category_for_name( f.name ) - if category not in abi: + if not f.is_abi(): functions.append( [f, count] ) count += 1 else: abi_functions.append( f ) + if self.es: + # remember functions with aliases + if len(f.entry_points) > 1: + alias_functions.append(f) for f in abi_functions: print '#define _gloffset_%s %d' % (f.name, f.offset) @@ -81,26 +84,37 @@ class PrintGlOffsets(gl_XML.gl_print_base): print '' print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' + if alias_functions: + print '' + print '/* define aliases for compatibility */' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define _gloffset_%s _gloffset_%s' % (name, f.name) return def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] + print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] + print " -c Enable compatibility with OpenGL ES." sys.exit(1) if __name__ == '__main__': file_name = "gl_API.xml" try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") + (args, trail) = getopt.getopt(sys.argv[1:], "f:c") except Exception,e: show_usage() + es = False for (arg,val) in args: if arg == "-f": file_name = val + elif arg == "-c": + es = True api = gl_XML.parse_GL_API( file_name ) - printer = PrintGlOffsets() + printer = PrintGlOffsets(es) printer.Print( api ) diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py index cd1a68cee1..5de61fbdfe 100644 --- a/src/mesa/glapi/gl_procs.py +++ b/src/mesa/glapi/gl_procs.py @@ -30,9 +30,10 @@ import gl_XML, glX_XML import sys, getopt class PrintGlProcs(gl_XML.gl_print_base): - def __init__(self, long_strings): + def __init__(self, long_strings, es=False): gl_XML.gl_print_base.__init__(self) + self.es = es self.long_strings = long_strings self.name = "gl_procs.py (from Mesa)" self.license = license.bsd_license_template % ( \ @@ -141,6 +142,28 @@ typedef struct { print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string()) break + if self.es: + categories = {} + for func in api.functionIterateByOffset(): + for n in func.entry_points: + cat, num = api.get_category_for_name(n) + if (cat.startswith("es") or cat.startswith("GL_OES")): + if not categories.has_key(cat): + categories[cat] = [] + proto = 'GLAPI %s GLAPIENTRY %s(%s);' \ + % (func.return_type, "gl" + n, func.get_parameter_string(n)) + categories[cat].append(proto) + if categories: + print '' + print '/* OpenGL ES specific prototypes */' + print '' + keys = categories.keys() + keys.sort() + for key in keys: + print '/* category %s */' % key + print "\n".join(categories[key]) + print '' + print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */' print '' @@ -155,8 +178,9 @@ typedef struct { def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] - print "mode can be one of:" + print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] + print "-c Enable compatibility with OpenGL ES." + print "-m mode mode can be one of:" print " long - Create code for compilers that can handle very" print " long string constants. (default)" print " short - Create code for compilers that can only handle" @@ -167,11 +191,12 @@ if __name__ == '__main__': file_name = "gl_API.xml" try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") except Exception,e: show_usage() long_string = 1 + es = False for (arg,val) in args: if arg == "-f": file_name = val @@ -182,7 +207,9 @@ if __name__ == '__main__': long_string = 1 else: show_usage() + elif arg == "-c": + es = True api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer = PrintGlProcs(long_string) + printer = PrintGlProcs(long_string, es) printer.Print(api) diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py index 0e05b3431a..3bd7569e92 100644 --- a/src/mesa/glapi/gl_table.py +++ b/src/mesa/glapi/gl_table.py @@ -30,9 +30,10 @@ import license import sys, getopt class PrintGlTable(gl_XML.gl_print_base): - def __init__(self): + def __init__(self, es=False): gl_XML.gl_print_base.__init__(self) + self.es = es self.header_tag = '_GLAPI_TABLE_H_' self.name = "gl_table.py (from Mesa)" self.license = license.bsd_license_template % ( \ @@ -68,9 +69,10 @@ class PrintGlTable(gl_XML.gl_print_base): class PrintRemapTable(gl_XML.gl_print_base): - def __init__(self): + def __init__(self, es=False): gl_XML.gl_print_base.__init__(self) + self.es = es self.header_tag = '_GLAPI_DISPATCH_H_' self.name = "gl_table.py (from Mesa)" self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") @@ -113,19 +115,22 @@ class PrintRemapTable(gl_XML.gl_print_base): print ' } while(0)' print '' - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - functions = [] abi_functions = [] + alias_functions = [] count = 0 for f in api.functionIterateByOffset(): - [category, num] = api.get_category_for_name( f.name ) - if category not in abi: + if not f.is_abi(): functions.append( [f, count] ) count += 1 else: abi_functions.append( f ) + if self.es: + # remember functions with aliases + if len(f.entry_points) > 1: + alias_functions.append(f) + for f in abi_functions: print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) @@ -165,33 +170,57 @@ class PrintRemapTable(gl_XML.gl_print_base): print '' print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' + + if alias_functions: + print '' + print '/* define aliases for compatibility */' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define CALL_%s(disp, parameters) CALL_%s(disp, parameters)' % (name, f.name) + print '#define GET_%s(disp) GET_%s(disp)' % (name, f.name) + print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name) + print '' + + print '#if defined(_GLAPI_USE_REMAP_TABLE)' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define %s_remap_index %s_remap_index' % (name, f.name) + print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */' + print '' + return def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0] + print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] print " -m mode Mode can be 'table' or 'remap_table'." + print " -c Enable compatibility with OpenGL ES." sys.exit(1) if __name__ == '__main__': file_name = "gl_API.xml" try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") except Exception,e: show_usage() mode = "table" + es = False for (arg,val) in args: if arg == "-f": file_name = val elif arg == "-m": mode = val + elif arg == "-c": + es = True if mode == "table": - printer = PrintGlTable() + printer = PrintGlTable(es) elif mode == "remap_table": - printer = PrintRemapTable() + printer = PrintRemapTable(es) else: show_usage() diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py index f36ad3a5d8..31c1a2b93a 100644 --- a/src/mesa/glapi/gl_x86-64_asm.py +++ b/src/mesa/glapi/gl_x86-64_asm.py @@ -122,7 +122,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print " * the symbol visibility mode to 'default'." print ' */' print '' - print '#include "../x86/assyntax.h"' + print '#include "x86/assyntax.h"' print '' print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' print '# pragma GCC visibility push(default)' diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index 36f0e31fe2..d210f3a248 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -53,7 +53,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printRealHeader(self): - print '#include "assyntax.h"' + print '#include "x86/assyntax.h"' print '#include "glapi/glapioffsets.h"' print '' print '#if defined(STDCALL_API)' @@ -73,7 +73,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '' print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' print '' - print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)' + print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)' print '#define GLOBL_FN(x) GLOBL x ; .type x, function' print '#else' print '#define GLOBL_FN(x) GLOBL x' diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 84e5a8270a..469523d57c 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -69,89 +69,11 @@ #include <assert.h> #endif -#include "glapi.h" -#include "glapioffsets.h" -#include "glapitable.h" - -/***** BEGIN NO-OP DISPATCH *****/ - -static GLboolean WarnFlag = GL_FALSE; -static _glapi_warning_func warning_func; - -/* - * Enable/disable printing of warning messages. - */ -PUBLIC void -_glapi_noop_enable_warnings(GLboolean enable) -{ - WarnFlag = enable; -} - -/* - * Register a callback function for reporting errors. - */ -PUBLIC void -_glapi_set_warning_func( _glapi_warning_func func ) -{ - warning_func = func; -} - -static int -warn(const char *func) -{ -#if !defined(_WIN32_WCE) - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - warning_func(NULL, "GL User Error: called without context: %s", func); - } -#endif - return 0; -} - -#ifdef DEBUG - -#define KEYWORD1 static -#define KEYWORD1_ALT static -#define KEYWORD2 GLAPIENTRY -#define NAME(func) NoOp##func - -#define F NULL - -#define DISPATCH(func, args, msg) \ - warn(#func); - -#define RETURN_DISPATCH(func, args, msg) \ - return warn(#func); - -#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name - -#else - -static void -NoOpGeneric(void) -{ - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - warning_func(NULL, "GL User Error: calling GL function"); - } -} - -#define TABLE_ENTRY(name) (_glapi_proc) NoOpGeneric - -#endif - -#define DISPATCH_TABLE_NAME __glapi_noop_table -#define UNUSED_TABLE_NAME __unused_noop_functions - -static GLint NoOpUnused(void) -{ - return warn("extension function"); -} - -#include "glapitemp.h" - -/***** END NO-OP DISPATCH *****/ +#include "glapi/glapi.h" +#include "glapi/glapioffsets.h" +#include "glapi/glapitable.h" +extern _glapi_proc __glapi_noop_table[]; /** @@ -278,7 +200,6 @@ _glapi_check_multithread(void) PUBLIC void _glapi_set_context(void *context) { - (void) __unused_noop_functions; /* silence a warning */ #if defined(GLX_USE_TLS) _glapi_tls_Context = context; #elif defined(THREADS) diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 5fb5401229..47ea23e92b 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -55,8 +55,6 @@ struct _glapi_table; typedef void (*_glapi_proc)(void); /* generic function pointer */ -typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); - #if defined(USE_MGL_NAMESPACE) #define _glapi_set_dispatch _mglapi_set_dispatch @@ -107,12 +105,6 @@ extern struct _glapi_table *_glapi_Dispatch; **/ extern void -_glapi_noop_enable_warnings(GLboolean enable); - -extern void -_glapi_set_warning_func(_glapi_warning_func func); - -extern void _glapi_check_multithread(void); diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index 1401c1cb58..eecfb9c1ae 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -34,9 +34,9 @@ #include <string.h> #include "main/glheader.h" #include "main/compiler.h" -#include "glapi.h" -#include "glapioffsets.h" -#include "glapitable.h" +#include "glapi/glapi.h" +#include "glapi/glapioffsets.h" +#include "glapi/glapitable.h" static void @@ -75,7 +75,7 @@ str_dup(const char *str) #endif /* The code in this file is auto-generated with Python */ -#include "glprocs.h" +#include "glapi/glprocs.h" /** diff --git a/src/mesa/glapi/glapi_nop.c b/src/mesa/glapi/glapi_nop.c new file mode 100644 index 0000000000..5d2769c073 --- /dev/null +++ b/src/mesa/glapi/glapi_nop.c @@ -0,0 +1,91 @@ +/* + * Mesa 3-D graphics library + * Version: 7.8 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2010 VMWare, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/** + * No-op dispatch table. + * + * This file defines a special dispatch table which is loaded with no-op + * functions. + * + * When there's no current rendering context, calling a GL function like + * glBegin() is a no-op. Apps should never normally do this. So as a + * debugging aid, each of the no-op functions will emit a warning to + * stderr if the MESA_DEBUG or LIBGL_DEBUG env var is set. + */ + + + +#include "main/compiler.h" +#include "main/glheader.h" +#include "glapi/glapi.h" + + +/** + * Called by each of the no-op GL entrypoints. + */ +static int +Warn(const char *func) +{ +#if !defined(_WIN32_WCE) + if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) { + fprintf(stderr, "GL User Error: gl%s called without a rendering context\n", + func); + } +#endif + return 0; +} + + +/** + * This is called if the user somehow calls an unassigned GL dispatch function. + */ +static GLint +NoOpUnused(void) +{ + return Warn(" function"); +} + + +/* + * Defines for the glapitemp.h functions. + */ +#define KEYWORD1 static +#define KEYWORD1_ALT static +#define KEYWORD2 GLAPIENTRY +#define NAME(func) NoOp##func +#define DISPATCH(func, args, msg) Warn(#func); +#define RETURN_DISPATCH(func, args, msg) Warn(#func); return 0 + + +/* + * Defines for the table of no-op entry points. + */ +#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name +#define DISPATCH_TABLE_NAME __glapi_noop_table +#define UNUSED_TABLE_NAME __unused_noop_functions + + +#include "glapi/glapitemp.h" diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 96b2ac7268..2540ef6465 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -27,7 +27,7 @@ */ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN @@ -80,6 +80,8 @@ #endif +#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS + KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) { DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode)); @@ -1710,13 +1712,6 @@ KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) { DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); @@ -1762,25 +1757,11 @@ KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures) DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures) { DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params) { DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params)); @@ -1796,13 +1777,6 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture) RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities) { DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); @@ -1878,6 +1852,11 @@ KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GL DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); } +KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) +{ + DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); +} + KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) @@ -1885,11 +1864,6 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum intern DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); } -KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params) { DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); @@ -1931,64 +1905,16 @@ KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) { DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); @@ -2114,57 +2040,21 @@ KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) { DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) { DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); @@ -2182,85 +2072,31 @@ KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params) { DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params) { DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) { DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); @@ -5777,6 +5613,141 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLu } +#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */ + +/* these entry points might require different protocols */ +#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS + +KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) +{ + RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); +} + +KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) +{ + DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); +} + +KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) +{ + DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); +} + +KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) +{ + RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); +} + +KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) +{ + DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); +} + +KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) +{ + DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) +{ + DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +{ + DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) +{ + DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) +{ + DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + + +#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */ + + #endif /* defined( NAME ) */ /* @@ -5789,7 +5760,11 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLu #error TABLE_ENTRY must be defined #endif -static _glapi_proc DISPATCH_TABLE_NAME[] = { +#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined +#endif + +_glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(NewList), TABLE_ENTRY(EndList), TABLE_ENTRY(CallList), @@ -6705,27 +6680,16 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { * We list the functions which are not otherwise used. */ #ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = { +_glapi_proc UNUSED_TABLE_NAME[] = { +#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS TABLE_ENTRY(ArrayElementEXT), TABLE_ENTRY(BindTextureEXT), TABLE_ENTRY(DrawArraysEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(AreTexturesResidentEXT), -#endif TABLE_ENTRY(CopyTexImage1DEXT), TABLE_ENTRY(CopyTexImage2DEXT), TABLE_ENTRY(CopyTexSubImage1DEXT), TABLE_ENTRY(CopyTexSubImage2DEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(DeleteTexturesEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GenTexturesEXT), -#endif TABLE_ENTRY(GetPointervEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(IsTextureEXT), -#endif TABLE_ENTRY(PrioritizeTexturesEXT), TABLE_ENTRY(TexSubImage1DEXT), TABLE_ENTRY(TexSubImage2DEXT), @@ -6733,15 +6697,25 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(BlendEquationEXT), TABLE_ENTRY(DrawRangeElementsEXT), TABLE_ENTRY(ColorTableEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterfvEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterivEXT), -#endif + TABLE_ENTRY(_dispatch_stub_339), + TABLE_ENTRY(_dispatch_stub_340), + TABLE_ENTRY(_dispatch_stub_341), + TABLE_ENTRY(_dispatch_stub_342), + TABLE_ENTRY(_dispatch_stub_346), + TABLE_ENTRY(_dispatch_stub_347), + TABLE_ENTRY(_dispatch_stub_348), + TABLE_ENTRY(_dispatch_stub_349), + TABLE_ENTRY(_dispatch_stub_350), + TABLE_ENTRY(_dispatch_stub_351), + TABLE_ENTRY(_dispatch_stub_352), + TABLE_ENTRY(_dispatch_stub_353), + TABLE_ENTRY(_dispatch_stub_354), + TABLE_ENTRY(_dispatch_stub_355), + TABLE_ENTRY(_dispatch_stub_360), + TABLE_ENTRY(_dispatch_stub_367), + TABLE_ENTRY(_dispatch_stub_368), + TABLE_ENTRY(_dispatch_stub_369), + TABLE_ENTRY(_dispatch_stub_370), TABLE_ENTRY(TexImage3DEXT), TABLE_ENTRY(TexSubImage3DEXT), TABLE_ENTRY(CopyTexSubImage3DEXT), @@ -6779,6 +6753,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(MultiTexCoord4iv), TABLE_ENTRY(MultiTexCoord4s), TABLE_ENTRY(MultiTexCoord4sv), + TABLE_ENTRY(_dispatch_stub_423), TABLE_ENTRY(LoadTransposeMatrixd), TABLE_ENTRY(LoadTransposeMatrixf), TABLE_ENTRY(MultTransposeMatrixd), @@ -6893,8 +6868,10 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(RenderbufferStorageMultisampleEXT), TABLE_ENTRY(PointParameterf), TABLE_ENTRY(PointParameterfARB), + TABLE_ENTRY(_dispatch_stub_592), TABLE_ENTRY(PointParameterfv), TABLE_ENTRY(PointParameterfvARB), + TABLE_ENTRY(_dispatch_stub_593), TABLE_ENTRY(SecondaryColor3b), TABLE_ENTRY(SecondaryColor3bv), TABLE_ENTRY(SecondaryColor3d), @@ -6920,6 +6897,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(FogCoordf), TABLE_ENTRY(FogCoordfv), TABLE_ENTRY(BlendFuncSeparate), + TABLE_ENTRY(_dispatch_stub_623), TABLE_ENTRY(WindowPos2d), TABLE_ENTRY(WindowPos2dARB), TABLE_ENTRY(WindowPos2dv), @@ -6983,6 +6961,29 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(BlitFramebuffer), TABLE_ENTRY(FramebufferTextureLayer), TABLE_ENTRY(ProvokingVertex), +#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */ +#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS + TABLE_ENTRY(AreTexturesResidentEXT), + TABLE_ENTRY(DeleteTexturesEXT), + TABLE_ENTRY(GenTexturesEXT), + TABLE_ENTRY(IsTextureEXT), + TABLE_ENTRY(GetColorTableEXT), + TABLE_ENTRY(_dispatch_stub_343), + TABLE_ENTRY(GetColorTableParameterfvEXT), + TABLE_ENTRY(_dispatch_stub_344), + TABLE_ENTRY(GetColorTableParameterivEXT), + TABLE_ENTRY(_dispatch_stub_345), + TABLE_ENTRY(_dispatch_stub_356), + TABLE_ENTRY(_dispatch_stub_357), + TABLE_ENTRY(_dispatch_stub_358), + TABLE_ENTRY(_dispatch_stub_359), + TABLE_ENTRY(_dispatch_stub_361), + TABLE_ENTRY(_dispatch_stub_362), + TABLE_ENTRY(_dispatch_stub_363), + TABLE_ENTRY(_dispatch_stub_364), + TABLE_ENTRY(_dispatch_stub_365), + TABLE_ENTRY(_dispatch_stub_366), +#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */ }; #endif /*UNUSED_TABLE_NAME*/ diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index f480edff4e..1c2c386571 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -33,7 +33,7 @@ #endif #include "main/compiler.h" -#include "glthread.h" +#include "glapi/glthread.h" /* diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py index e47583a5d3..d93c7a4285 100644 --- a/src/mesa/glapi/remap_helper.py +++ b/src/mesa/glapi/remap_helper.py @@ -123,18 +123,26 @@ class PrintGlRemap(gl_XML.gl_print_base): print '};' print '' - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + # collect functions by versions/extensions extension_functions = {} - - # collect non-ABI functions + abi_extensions = [] for f in api.functionIterateAll(): for n in f.entry_points: category, num = api.get_category_for_name(n) - if category not in abi: - c = gl_XML.real_category_name(category) + # consider only GL_VERSION_X_Y or extensions + c = gl_XML.real_category_name(category) + if c.startswith("GL_"): if not extension_functions.has_key(c): extension_functions[c] = [] extension_functions[c].append(f) + # remember the ext names of the ABI + if (f.is_abi() and n == f.name and + c not in abi_extensions): + abi_extensions.append(c) + # ignore the ABI itself + for ext in abi_extensions: + extension_functions.pop(ext) + extensions = extension_functions.keys() extensions.sort() @@ -144,8 +152,8 @@ class PrintGlRemap(gl_XML.gl_print_base): for ext in extensions: funcs = [] for f in extension_functions[ext]: - # test if the function is in the ABI - if not f.assign_offset and f.offset >= 0: + # test if the function is in the ABI and has alt names + if f.is_abi() and len(f.entry_points) > 1: funcs.append(f) if not funcs: continue @@ -171,7 +179,7 @@ class PrintGlRemap(gl_XML.gl_print_base): remapped.append(f) else: # these functions are either in the - # abi, or have offset -1 + # abi, or have offset -1 funcs.append(f) print '#if defined(need_%s)' % (ext) diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index e71e5a6ce8..013048bbc1 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -190,9 +190,6 @@ _mesa_validate_DrawElements(GLcontext *ctx, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawElements")) return GL_FALSE; @@ -254,9 +251,6 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawRangeElements")) return GL_FALSE; @@ -304,9 +298,6 @@ _mesa_validate_DrawArrays(GLcontext *ctx, return GL_FALSE; } - if (ctx->NewState) - _mesa_update_state(ctx); - if (!check_valid_to_render(ctx, "glDrawArrays")) return GL_FALSE; diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0641b98b3b..3fbdba2b3f 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -33,7 +33,6 @@ #include "bufferobj.h" #include "clear.h" #include "colormac.h" -#include "colortab.h" #include "context.h" #include "depth.h" #include "enable.h" diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index b8170dd468..de60031cc8 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -35,7 +35,6 @@ #include "enums.h" #include "macros.h" #include "mtypes.h" -#include "glapi/glapitable.h" /** diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 97f0659758..fb30b59960 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -35,8 +35,6 @@ #include "colormac.h" #include "context.h" #include "enums.h" -#include "fbobject.h" -#include "state.h" #define BAD_MASK ~0u diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 4eb249b4af..9cef99f67a 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -173,7 +173,8 @@ extern "C" { * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ + || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else @@ -222,8 +223,8 @@ extern "C" { /** - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. - * Do not use them unless absolutely necessary! + * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32. + * Do not use these unless absolutely necessary! * Try to use a runtime test instead. * For now, only used by some DRI hardware drivers for color/texel packing. */ @@ -235,10 +236,13 @@ extern "C" { #include <CoreFoundation/CFByteOrder.h> #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) #elif (defined(_AIX) || defined(__blrts)) -#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \ - ((x & 0x0000ff00) << 8) | \ - ((x & 0x00ff0000) >> 8) | \ - ((x & 0xff000000) >> 24); +static INLINE GLuint CPU_TO_LE32(GLuint x) +{ + return (((x & 0x000000ff) << 24) | + ((x & 0x0000ff00) << 8) | + ((x & 0x00ff0000) >> 8) | + ((x & 0xff000000) >> 24)); +} #else /*__linux__ */ #include <sys/endian.h> #define CPU_TO_LE32( x ) bswap32( x ) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 320c59068c..eb6bc8e436 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -415,14 +415,6 @@ one_time_init( GLcontext *ctx ) _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F; } - if (_mesa_getenv("MESA_DEBUG")) { - _glapi_noop_enable_warnings(GL_TRUE); - _glapi_set_warning_func( (_glapi_warning_func) _mesa_warning ); - } - else { - _glapi_noop_enable_warnings(GL_FALSE); - } - #if defined(DEBUG) && defined(__DATE__) && defined(__TIME__) _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n", MESA_VERSION_STRING, __DATE__, __TIME__); @@ -1586,6 +1578,10 @@ _mesa_set_mvp_with_dp4( GLcontext *ctx, GLboolean _mesa_valid_to_render(GLcontext *ctx, const char *where) { + /* This depends on having up to date derived state (shaders) */ + if (ctx->NewState) + _mesa_update_state(ctx); + if (ctx->Shader.CurrentProgram) { /* using shaders */ if (!ctx->Shader.CurrentProgram->LinkStatus) { diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 8db3e79d38..5ed93e0c60 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -38,7 +38,6 @@ #include "context.h" #include "image.h" #include "mtypes.h" -#include "pixel.h" #include "state.h" #include "glapi/dispatch.h" diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index e99e87d905..6705c901dd 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1021,6 +1021,16 @@ struct dd_function_table { void (*BeginConditionalRender)(GLcontext *ctx, struct gl_query_object *q, GLenum mode); void (*EndConditionalRender)(GLcontext *ctx, struct gl_query_object *q); + +#if FEATURE_OES_draw_texture + /** + * \name GL_OES_draw_texture interface + */ + /*@{*/ + void (*DrawTex)(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, + GLfloat width, GLfloat height); + /*@}*/ +#endif }; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index a42113edca..9bad83487f 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -26,7 +26,6 @@ #include "mtypes.h" #include "attrib.h" #include "colormac.h" -#include "context.h" #include "enums.h" #include "formats.h" #include "hash.h" @@ -35,7 +34,6 @@ #include "get.h" #include "pixelstore.h" #include "readpix.h" -#include "texgetimage.h" #include "texobj.h" @@ -54,7 +52,7 @@ const char *_mesa_prim_name[GL_POLYGON+4] = { "GL_QUAD_STRIP", "GL_POLYGON", "outside begin/end", - "inside unkown primitive", + "inside unknown primitive", "unknown state" }; diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 193c7f8255..49946a6506 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -25,7 +25,6 @@ #include "glheader.h" #include "imports.h" #include "context.h" -#include "fbobject.h" #include "formats.h" #include "mtypes.h" #include "depthstencil.h" diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index eb0d1ff8a7..a6a57020cc 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -87,6 +87,10 @@ #define GLAPIENTRY #endif +#ifdef GLX_INDIRECT_RENDERING +/* those link to libglapi.a should provide the entry points */ +#define _GLAPI_SKIP_PROTO_ENTRY_POINTS +#endif #include "glapi/glapitemp.h" #endif /* USE_X86_ASM */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 21a8216254..b182bbe0d0 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -35,46 +35,25 @@ #include "api_loopback.h" #include "config.h" #include "mfeatures.h" -#include "attrib.h" -#include "blend.h" -#include "buffers.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" #endif #include "arrayobj.h" -#include "clip.h" -#include "colortab.h" #include "context.h" -#include "convolve.h" -#include "depth.h" #include "dlist.h" -#include "enable.h" #include "enums.h" #include "eval.h" -#include "extensions.h" -#include "feedback.h" #include "framebuffer.h" -#include "get.h" #include "glapi/glapi.h" #include "hash.h" -#include "histogram.h" #include "image.h" #include "light.h" -#include "lines.h" #include "dlist.h" #include "macros.h" -#include "matrix.h" -#include "pixel.h" -#include "points.h" -#include "polygon.h" #include "queryobj.h" -#include "state.h" -#include "texobj.h" #include "teximage.h" -#include "texstate.h" #include "mtypes.h" #include "varray.h" -#include "vtxfmt.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program #include "shader/arbprogram.h" #include "shader/program.h" @@ -3750,7 +3729,7 @@ save_TexEnvi(GLenum target, GLenum pname, GLint param) { GLfloat p[4]; p[0] = (GLfloat) param; - p[1] = p[2] = p[3] = 0.0; + p[1] = p[2] = p[3] = 0.0F; save_TexEnvfv(target, pname, p); } @@ -3884,7 +3863,7 @@ save_TexParameteri(GLenum target, GLenum pname, GLint param) { GLfloat fparam[4]; fparam[0] = (GLfloat) param; - fparam[1] = fparam[2] = fparam[3] = 0.0; + fparam[1] = fparam[2] = fparam[3] = 0.0F; save_TexParameterfv(target, pname, fparam); } @@ -3894,7 +3873,7 @@ save_TexParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparam[4]; fparam[0] = (GLfloat) params[0]; - fparam[1] = fparam[2] = fparam[3] = 0.0; + fparam[1] = fparam[2] = fparam[3] = 0.0F; save_TexParameterfv(target, pname, fparam); } diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 5d4b53af4c..0afd47b797 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -30,7 +30,6 @@ #include "enums.h" #include "feedback.h" #include "framebuffer.h" -#include "image.h" #include "readpix.h" #include "state.h" #include "glapi/dispatch.h" diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index cd6e881ad2..f5c88a63e6 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -32,7 +32,6 @@ #include "context.h" #include "enable.h" #include "light.h" -#include "macros.h" #include "simple_list.h" #include "mtypes.h" #include "enums.h" diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 2273138d23..1d495b7ae5 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -25,10 +25,10 @@ * SOFTWARE. */ -#include "glheader.h" -#include "mfeatures.h" -#include "enums.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/mfeatures.h" +#include "main/enums.h" +#include "main/imports.h" typedef struct { size_t offset; @@ -640,6 +640,7 @@ LONGSTRING static const char enum_string_table[] = "GL_GREEN_BIAS\0" "GL_GREEN_BITS\0" "GL_GREEN_SCALE\0" + "GL_HALF_FLOAT\0" "GL_HINT_BIT\0" "GL_HISTOGRAM\0" "GL_HISTOGRAM_ALPHA_SIZE\0" @@ -1922,7 +1923,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1884] = +static const enum_elt all_enums[1885] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2528,1365 +2529,1366 @@ static const enum_elt all_enums[1884] = { 12769, 0x00000D19 }, /* GL_GREEN_BIAS */ { 12783, 0x00000D53 }, /* GL_GREEN_BITS */ { 12797, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12812, 0x00008000 }, /* GL_HINT_BIT */ - { 12824, 0x00008024 }, /* GL_HISTOGRAM */ - { 12837, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12861, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12889, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12912, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12939, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12956, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12976, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 13000, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 13024, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 13052, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 13080, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 13112, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 13134, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 13160, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 13178, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 13200, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 13219, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 13242, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13257, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13277, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13317, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13355, 0x00001E02 }, /* GL_INCR */ - { 13363, 0x00008507 }, /* GL_INCR_WRAP */ - { 13376, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13393, 0x00008222 }, /* GL_INDEX */ - { 13402, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13417, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13447, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13481, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13504, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13526, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13546, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13560, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13581, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13599, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13613, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13629, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13644, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13663, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13682, 0x00001404 }, /* GL_INT */ - { 13689, 0x00008049 }, /* GL_INTENSITY */ - { 13702, 0x0000804C }, /* GL_INTENSITY12 */ - { 13717, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13736, 0x0000804D }, /* GL_INTENSITY16 */ - { 13751, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13770, 0x0000804A }, /* GL_INTENSITY4 */ - { 13784, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13802, 0x0000804B }, /* GL_INTENSITY8 */ - { 13816, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13834, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13851, 0x00008575 }, /* GL_INTERPOLATE */ - { 13866, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13885, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13904, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13916, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13932, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13944, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13960, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13972, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13988, 0x00000500 }, /* GL_INVALID_ENUM */ - { 14004, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 14037, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 14074, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 14095, 0x00000501 }, /* GL_INVALID_VALUE */ - { 14112, 0x0000862B }, /* GL_INVERSE_NV */ - { 14126, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 14150, 0x0000150A }, /* GL_INVERT */ - { 14160, 0x00001E00 }, /* GL_KEEP */ - { 14168, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ - { 14194, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 14224, 0x00000406 }, /* GL_LEFT */ - { 14232, 0x00000203 }, /* GL_LEQUAL */ - { 14242, 0x00000201 }, /* GL_LESS */ - { 14250, 0x00004000 }, /* GL_LIGHT0 */ - { 14260, 0x00004001 }, /* GL_LIGHT1 */ - { 14270, 0x00004002 }, /* GL_LIGHT2 */ - { 14280, 0x00004003 }, /* GL_LIGHT3 */ - { 14290, 0x00004004 }, /* GL_LIGHT4 */ - { 14300, 0x00004005 }, /* GL_LIGHT5 */ - { 14310, 0x00004006 }, /* GL_LIGHT6 */ - { 14320, 0x00004007 }, /* GL_LIGHT7 */ - { 14330, 0x00000B50 }, /* GL_LIGHTING */ - { 14342, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14358, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14381, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14410, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14443, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14471, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14495, 0x00001B01 }, /* GL_LINE */ - { 14503, 0x00002601 }, /* GL_LINEAR */ - { 14513, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14535, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14565, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14596, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14620, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14645, 0x00000001 }, /* GL_LINES */ - { 14654, 0x00000004 }, /* GL_LINE_BIT */ - { 14666, 0x00000002 }, /* GL_LINE_LOOP */ - { 14679, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14699, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14714, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14734, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14750, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14774, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14797, 0x00000003 }, /* GL_LINE_STRIP */ - { 14811, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14825, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14839, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14865, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14885, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14900, 0x00000B32 }, /* GL_LIST_BASE */ - { 14913, 0x00020000 }, /* GL_LIST_BIT */ - { 14925, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14939, 0x00000B30 }, /* GL_LIST_MODE */ - { 14952, 0x00000101 }, /* GL_LOAD */ - { 14960, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14972, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14989, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 15003, 0x00001909 }, /* GL_LUMINANCE */ - { 15016, 0x00008041 }, /* GL_LUMINANCE12 */ - { 15031, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 15054, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 15081, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 15103, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 15129, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 15148, 0x00008042 }, /* GL_LUMINANCE16 */ - { 15163, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 15186, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 15213, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 15232, 0x0000803F }, /* GL_LUMINANCE4 */ - { 15246, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 15267, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15292, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15310, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15331, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15356, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15370, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15391, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15416, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15434, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15453, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15469, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15489, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15511, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15525, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15540, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15564, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15588, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15612, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15636, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15653, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15670, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15698, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15727, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15756, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15785, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15814, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15843, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15872, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15900, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15928, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15956, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15984, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 16012, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 16040, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 16068, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 16096, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 16124, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 16140, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 16160, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 16182, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 16196, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 16211, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 16235, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 16259, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16283, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16307, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16324, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16341, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16369, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16398, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16427, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16456, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16485, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16514, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16543, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16571, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16599, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16627, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16655, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16683, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16711, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16739, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16767, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16795, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16808, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16834, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16863, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16891, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16907, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16922, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16948, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16965, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16980, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16994, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 17010, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 17026, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 17042, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 17058, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 17074, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 17090, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 17106, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 17122, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 17138, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 17154, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 17169, 0x00008631 }, /* GL_MATRIX1_NV */ - { 17183, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 17199, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 17215, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 17231, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 17247, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 17263, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 17279, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17295, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17311, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17327, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17343, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17358, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17372, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17388, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17404, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17419, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17433, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17448, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17462, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17477, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17491, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17506, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17520, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17535, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17549, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17564, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17579, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17605, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17639, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17670, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17703, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17734, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17749, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17771, 0x00008008 }, /* GL_MAX */ - { 17778, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17801, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17833, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17859, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17892, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17918, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17952, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17971, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ - { 17996, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 18025, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 18057, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 18093, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 18129, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 18169, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 18195, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 18225, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 18250, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 18279, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18308, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18341, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18361, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18385, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18409, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18433, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18458, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18476, 0x00008008 }, /* GL_MAX_EXT */ - { 18487, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18522, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18561, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18575, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18595, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18633, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18662, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18686, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18714, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18737, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18774, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18810, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18837, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18866, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18900, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18936, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18963, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18995, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 19031, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 19060, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 19089, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 19117, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 19155, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 19199, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 19242, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 19276, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19315, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19352, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19390, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19433, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19476, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19506, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19537, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19573, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19609, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19639, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19673, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19706, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ - { 19731, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19760, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19775, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ - { 19794, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19821, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19841, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19865, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19887, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19913, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19940, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19971, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19995, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 20029, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 20049, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 20076, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 20097, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 20122, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 20147, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 20182, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 20204, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 20230, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 20252, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 20278, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 20312, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 20350, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20383, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20420, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20444, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20465, 0x00008007 }, /* GL_MIN */ - { 20472, 0x0000802E }, /* GL_MINMAX */ - { 20482, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20496, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20513, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20534, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20549, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20568, 0x00008007 }, /* GL_MIN_EXT */ - { 20579, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20598, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20621, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20644, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20664, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20684, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20714, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20742, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20770, 0x00001700 }, /* GL_MODELVIEW */ - { 20783, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20801, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20820, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20839, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20858, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20877, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20896, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20915, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20934, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20953, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20972, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20991, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 21009, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 21028, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 21047, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 21066, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 21085, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 21104, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 21123, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 21142, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 21161, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 21180, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 21199, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 21217, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 21236, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 21255, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 21273, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 21291, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 21309, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 21327, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 21345, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21363, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21381, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21401, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21428, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21453, 0x00002100 }, /* GL_MODULATE */ - { 21465, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21485, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21512, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21537, 0x00000103 }, /* GL_MULT */ - { 21545, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21560, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21580, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21599, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21618, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21642, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21665, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21695, 0x00002A25 }, /* GL_N3F_V3F */ - { 21706, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21726, 0x0000150E }, /* GL_NAND */ - { 21734, 0x00002600 }, /* GL_NEAREST */ - { 21745, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21776, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21808, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21833, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21859, 0x00000200 }, /* GL_NEVER */ - { 21868, 0x00001102 }, /* GL_NICEST */ - { 21878, 0x00000000 }, /* GL_NONE */ - { 21886, 0x00001505 }, /* GL_NOOP */ - { 21894, 0x00001508 }, /* GL_NOR */ - { 21901, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21914, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21930, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21961, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21996, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 22020, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 22043, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 22064, 0x00008511 }, /* GL_NORMAL_MAP */ - { 22078, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 22096, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 22113, 0x00000205 }, /* GL_NOTEQUAL */ - { 22125, 0x00000000 }, /* GL_NO_ERROR */ - { 22137, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 22171, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 22209, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 22241, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 22283, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 22313, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22353, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22384, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22413, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22441, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22471, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22488, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22514, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22530, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22565, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22587, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22602, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22621, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22651, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22672, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22700, 0x00000001 }, /* GL_ONE */ - { 22707, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22735, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22767, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22795, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22827, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22850, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22873, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22896, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22919, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22937, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22959, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22981, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22997, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 23017, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 23037, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 23055, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 23077, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 23099, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 23115, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 23135, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 23155, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 23173, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 23195, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 23217, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 23233, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 23253, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 23273, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 23294, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 23313, 0x00001507 }, /* GL_OR */ - { 23319, 0x00000A01 }, /* GL_ORDER */ - { 23328, 0x0000150D }, /* GL_OR_INVERTED */ - { 23343, 0x0000150B }, /* GL_OR_REVERSE */ - { 23357, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23374, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23392, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23413, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23433, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23451, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23470, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23490, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23510, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23528, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23547, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23572, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23596, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23617, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23639, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23661, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23686, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23710, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23731, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23753, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23775, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23797, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23828, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23848, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23873, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23893, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23918, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23938, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23963, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23983, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 24008, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 24028, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 24053, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 24073, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 24098, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 24118, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 24143, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 24163, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 24188, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 24208, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 24233, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 24253, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 24278, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 24296, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 24317, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 24346, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24379, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24404, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24427, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24458, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24493, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24520, 0x00001B00 }, /* GL_POINT */ - { 24529, 0x00000000 }, /* GL_POINTS */ - { 24539, 0x00000002 }, /* GL_POINT_BIT */ - { 24552, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24582, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24616, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24650, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24685, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24714, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24747, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24780, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24814, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24828, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24854, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24872, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24894, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24916, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24939, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24957, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24979, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 25001, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 25024, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 25044, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 25060, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 25081, 0x00008861 }, /* GL_POINT_SPRITE */ - { 25097, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 25117, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 25146, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 25165, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 25191, 0x00000701 }, /* GL_POINT_TOKEN */ - { 25206, 0x00000009 }, /* GL_POLYGON */ - { 25217, 0x00000008 }, /* GL_POLYGON_BIT */ - { 25232, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 25248, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 25271, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 25296, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 25319, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 25342, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25366, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25390, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25408, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25431, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25450, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25473, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25490, 0x00001203 }, /* GL_POSITION */ - { 25502, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25534, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25570, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25603, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25640, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25671, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25706, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25738, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25774, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25807, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25839, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25875, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25908, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25945, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25975, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 26009, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 26040, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 26075, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 26106, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 26141, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 26173, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 26209, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 26239, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 26273, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 26304, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 26339, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26371, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26402, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26437, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26469, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26505, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26534, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26567, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26597, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26631, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26670, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26703, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26743, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26777, 0x00008578 }, /* GL_PREVIOUS */ - { 26789, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26805, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26821, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26838, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26859, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26880, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26913, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26945, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26968, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26991, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 27021, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 27050, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 27078, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 27100, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 27128, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 27156, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 27178, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 27199, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 27239, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 27278, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 27308, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 27343, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27376, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27410, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27449, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27488, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27510, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27536, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27560, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27583, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27605, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27626, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27647, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27674, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27706, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27738, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27773, 0x00001701 }, /* GL_PROJECTION */ - { 27787, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27808, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27834, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ - { 27854, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27878, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27899, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27918, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27941, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27980, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 28018, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 28038, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 28068, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 28092, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 28112, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 28142, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 28166, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 28186, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 28219, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 28245, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 28275, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 28306, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 28336, 0x00002003 }, /* GL_Q */ - { 28341, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 28366, 0x00000007 }, /* GL_QUADS */ - { 28375, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ - { 28419, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28467, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28484, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28498, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ - { 28528, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */ - { 28555, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28577, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28603, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */ - { 28623, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28639, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28659, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28685, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28715, 0x00008E13 }, /* GL_QUERY_WAIT_NV */ - { 28732, 0x00002002 }, /* GL_R */ - { 28737, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28749, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28782, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28797, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28817, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ - { 28845, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28877, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28901, 0x000088B8 }, /* GL_READ_ONLY */ - { 28914, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28931, 0x000088BA }, /* GL_READ_WRITE */ - { 28945, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28963, 0x00001903 }, /* GL_RED */ - { 28970, 0x00008016 }, /* GL_REDUCE */ - { 28980, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28994, 0x00000D15 }, /* GL_RED_BIAS */ - { 29006, 0x00000D52 }, /* GL_RED_BITS */ - { 29018, 0x00000D14 }, /* GL_RED_SCALE */ - { 29031, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 29049, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 29071, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 29092, 0x00001C00 }, /* GL_RENDER */ - { 29102, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 29118, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 29145, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ - { 29169, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 29197, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 29223, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 29250, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 29270, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 29297, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 29320, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 29347, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 29379, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 29415, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 29440, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 29464, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ - { 29492, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 29521, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 29543, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 29569, 0x00001F01 }, /* GL_RENDERER */ - { 29581, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29596, 0x00002901 }, /* GL_REPEAT */ - { 29606, 0x00001E01 }, /* GL_REPLACE */ - { 29617, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29632, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29655, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29673, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29695, 0x00000102 }, /* GL_RETURN */ - { 29705, 0x00001907 }, /* GL_RGB */ - { 29712, 0x00008052 }, /* GL_RGB10 */ - { 29721, 0x00008059 }, /* GL_RGB10_A2 */ - { 29733, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29749, 0x00008052 }, /* GL_RGB10_EXT */ - { 29762, 0x00008053 }, /* GL_RGB12 */ - { 29771, 0x00008053 }, /* GL_RGB12_EXT */ - { 29784, 0x00008054 }, /* GL_RGB16 */ - { 29793, 0x00008054 }, /* GL_RGB16_EXT */ - { 29806, 0x0000804E }, /* GL_RGB2_EXT */ - { 29818, 0x0000804F }, /* GL_RGB4 */ - { 29826, 0x0000804F }, /* GL_RGB4_EXT */ - { 29838, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29851, 0x00008050 }, /* GL_RGB5 */ - { 29859, 0x00008057 }, /* GL_RGB5_A1 */ - { 29870, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29885, 0x00008050 }, /* GL_RGB5_EXT */ - { 29897, 0x00008051 }, /* GL_RGB8 */ - { 29905, 0x00008051 }, /* GL_RGB8_EXT */ - { 29917, 0x00001908 }, /* GL_RGBA */ - { 29925, 0x0000805A }, /* GL_RGBA12 */ - { 29935, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29949, 0x0000805B }, /* GL_RGBA16 */ - { 29959, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29973, 0x00008055 }, /* GL_RGBA2 */ - { 29982, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29995, 0x00008056 }, /* GL_RGBA4 */ - { 30004, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 30023, 0x00008056 }, /* GL_RGBA4_EXT */ - { 30036, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 30050, 0x00008058 }, /* GL_RGBA8 */ - { 30059, 0x00008058 }, /* GL_RGBA8_EXT */ - { 30072, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 30087, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 30105, 0x00000C31 }, /* GL_RGBA_MODE */ - { 30118, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 30131, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 30145, 0x000083A0 }, /* GL_RGB_S3TC */ - { 30157, 0x00008573 }, /* GL_RGB_SCALE */ - { 30170, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 30187, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 30204, 0x00000407 }, /* GL_RIGHT */ - { 30213, 0x00002000 }, /* GL_S */ - { 30218, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 30232, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 30253, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 30267, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 30288, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 30302, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 30318, 0x000080A9 }, /* GL_SAMPLES */ - { 30329, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 30345, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 30360, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 30378, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 30400, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 30428, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 30460, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 30483, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 30510, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 30528, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 30551, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 30573, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30592, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30615, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30641, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30671, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30696, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30725, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30740, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30755, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30771, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30796, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30836, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30880, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30913, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30943, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30975, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 31005, 0x00001C02 }, /* GL_SELECT */ - { 31015, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 31043, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 31068, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 31084, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 31111, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 31142, 0x0000150F }, /* GL_SET */ - { 31149, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 31170, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 31194, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 31209, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 31224, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 31252, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 31275, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 31305, 0x00001601 }, /* GL_SHININESS */ - { 31318, 0x00001402 }, /* GL_SHORT */ - { 31327, 0x00009119 }, /* GL_SIGNALED */ - { 31339, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 31360, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 31376, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 31396, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 31415, 0x00008C46 }, /* GL_SLUMINANCE */ - { 31429, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 31444, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 31466, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 31486, 0x00001D01 }, /* GL_SMOOTH */ - { 31496, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 31529, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 31556, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31589, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31616, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31633, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31654, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31675, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31690, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31709, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31728, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31745, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31766, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31787, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31802, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31821, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31840, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31857, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31878, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31899, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31914, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31933, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31952, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31972, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 31990, 0x00001202 }, /* GL_SPECULAR */ - { 32002, 0x00002402 }, /* GL_SPHERE_MAP */ - { 32016, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 32031, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 32049, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 32066, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 32080, 0x00008580 }, /* GL_SRC0_RGB */ - { 32092, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 32106, 0x00008581 }, /* GL_SRC1_RGB */ - { 32118, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 32132, 0x00008582 }, /* GL_SRC2_RGB */ - { 32144, 0x00000302 }, /* GL_SRC_ALPHA */ - { 32157, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 32179, 0x00000300 }, /* GL_SRC_COLOR */ - { 32192, 0x00008C40 }, /* GL_SRGB */ - { 32200, 0x00008C41 }, /* GL_SRGB8 */ - { 32209, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 32225, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 32239, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 32257, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 32276, 0x000088E6 }, /* GL_STATIC_COPY */ - { 32291, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 32310, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 32325, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 32344, 0x000088E5 }, /* GL_STATIC_READ */ - { 32359, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 32378, 0x00001802 }, /* GL_STENCIL */ - { 32389, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 32411, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 32437, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 32458, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 32483, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 32504, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 32529, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 32561, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32597, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32629, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32665, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32685, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32712, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32738, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32754, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32776, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32799, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32815, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32831, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32848, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ - { 32866, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ - { 32885, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32908, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32930, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ - { 32948, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32970, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ - { 32988, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 33010, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 33031, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 33058, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 33085, 0x00000B97 }, /* GL_STENCIL_REF */ - { 33100, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 33116, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 33145, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 33167, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 33188, 0x00000C33 }, /* GL_STEREO */ - { 33198, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 33222, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 33247, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 33271, 0x000088E2 }, /* GL_STREAM_COPY */ - { 33286, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 33305, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 33320, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 33339, 0x000088E1 }, /* GL_STREAM_READ */ - { 33354, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 33373, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 33390, 0x000084E7 }, /* GL_SUBTRACT */ - { 33402, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 33418, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 33436, 0x00009116 }, /* GL_SYNC_FENCE */ - { 33450, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 33464, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 33491, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 33521, 0x00009114 }, /* GL_SYNC_STATUS */ - { 33536, 0x00002001 }, /* GL_T */ - { 33541, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 33556, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 33575, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 33591, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 33606, 0x00002A27 }, /* GL_T2F_V3F */ - { 33617, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 33636, 0x00002A28 }, /* GL_T4F_V4F */ - { 33647, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33670, 0x00001702 }, /* GL_TEXTURE */ - { 33681, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33693, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33709, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33721, 0x000084CA }, /* GL_TEXTURE10 */ - { 33734, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33751, 0x000084CB }, /* GL_TEXTURE11 */ - { 33764, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33781, 0x000084CC }, /* GL_TEXTURE12 */ - { 33794, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33811, 0x000084CD }, /* GL_TEXTURE13 */ - { 33824, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33841, 0x000084CE }, /* GL_TEXTURE14 */ - { 33854, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33871, 0x000084CF }, /* GL_TEXTURE15 */ - { 33884, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33901, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33914, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33931, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33944, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33961, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33974, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 33991, 0x000084D3 }, /* GL_TEXTURE19 */ - { 34004, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 34021, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 34037, 0x000084C2 }, /* GL_TEXTURE2 */ - { 34049, 0x000084D4 }, /* GL_TEXTURE20 */ - { 34062, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 34079, 0x000084D5 }, /* GL_TEXTURE21 */ - { 34092, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 34109, 0x000084D6 }, /* GL_TEXTURE22 */ - { 34122, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 34139, 0x000084D7 }, /* GL_TEXTURE23 */ - { 34152, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 34169, 0x000084D8 }, /* GL_TEXTURE24 */ - { 34182, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 34199, 0x000084D9 }, /* GL_TEXTURE25 */ - { 34212, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 34229, 0x000084DA }, /* GL_TEXTURE26 */ - { 34242, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 34259, 0x000084DB }, /* GL_TEXTURE27 */ - { 34272, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 34289, 0x000084DC }, /* GL_TEXTURE28 */ - { 34302, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 34319, 0x000084DD }, /* GL_TEXTURE29 */ - { 34332, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 34349, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 34365, 0x000084C3 }, /* GL_TEXTURE3 */ - { 34377, 0x000084DE }, /* GL_TEXTURE30 */ - { 34390, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 34407, 0x000084DF }, /* GL_TEXTURE31 */ - { 34420, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 34437, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 34453, 0x000084C4 }, /* GL_TEXTURE4 */ - { 34465, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 34481, 0x000084C5 }, /* GL_TEXTURE5 */ - { 34493, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 34509, 0x000084C6 }, /* GL_TEXTURE6 */ - { 34521, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 34537, 0x000084C7 }, /* GL_TEXTURE7 */ - { 34549, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 34565, 0x000084C8 }, /* GL_TEXTURE8 */ - { 34577, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 34593, 0x000084C9 }, /* GL_TEXTURE9 */ - { 34605, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 34621, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 34635, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 34659, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34673, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34697, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34711, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34733, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34759, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34781, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34803, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34835, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34857, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34889, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34911, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34939, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34971, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 35004, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 35036, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 35051, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 35072, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 35097, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 35115, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 35139, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 35170, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 35200, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 35230, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 35265, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 35296, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 35334, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 35361, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 35393, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 35427, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 35451, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 35479, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 35503, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 35531, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 35564, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 35588, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 35610, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 35632, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 35658, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35692, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35725, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35762, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35790, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35822, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35845, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35883, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35925, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35956, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35984, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 36014, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 36042, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 36062, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 36086, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 36117, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 36152, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 36183, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 36218, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 36249, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 36284, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 36315, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 36350, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 36381, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 36416, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 36447, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 36482, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 36511, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 36528, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 36550, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 36576, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 36591, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 36612, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 36632, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 36658, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36678, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36695, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36712, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36729, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36746, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36771, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36793, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36819, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36837, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36863, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36889, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36919, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36946, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36971, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 36991, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 37015, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 37042, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 37069, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 37096, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 37122, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 37152, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 37174, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 37192, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 37222, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 37250, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 37278, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 37306, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 37327, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 37346, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 37368, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 37387, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 37407, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 37437, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 37468, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 37493, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 37517, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 37537, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 37561, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 37581, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 37604, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 37628, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ - { 37656, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 37686, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37711, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37745, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37762, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37780, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37798, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37816, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37835, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37855, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37874, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37903, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37920, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37946, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37976, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 38008, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 38038, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 38072, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 38088, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 38119, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 38154, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 38182, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 38214, 0x00000004 }, /* GL_TRIANGLES */ - { 38227, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 38243, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 38264, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 38282, 0x00000001 }, /* GL_TRUE */ - { 38290, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 38310, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 38333, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 38353, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 38374, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 38396, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 38418, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 38438, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 38459, 0x00009118 }, /* GL_UNSIGNALED */ - { 38473, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 38490, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 38517, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 38540, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 38556, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 38583, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 38604, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ - { 38629, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 38653, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 38684, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38708, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38736, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38759, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38777, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38807, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38833, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38863, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38889, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38913, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38941, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38969, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 38996, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 39028, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 39059, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 39073, 0x00002A20 }, /* GL_V2F */ - { 39080, 0x00002A21 }, /* GL_V3F */ - { 39087, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 39106, 0x00001F00 }, /* GL_VENDOR */ - { 39116, 0x00001F02 }, /* GL_VERSION */ - { 39127, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 39143, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 39167, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 39197, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 39228, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 39263, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 39287, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 39308, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 39331, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 39352, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 39379, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 39407, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 39435, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 39463, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 39491, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 39519, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 39547, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 39574, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 39601, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 39628, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 39655, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 39682, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39709, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39736, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39763, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39790, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39828, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39870, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39901, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39936, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39970, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 40008, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 40039, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 40074, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 40102, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 40134, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 40164, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 40198, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 40226, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 40258, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 40278, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 40300, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 40329, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 40350, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 40379, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 40412, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 40444, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 40471, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 40502, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 40532, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 40549, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 40570, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 40597, 0x00000BA2 }, /* GL_VIEWPORT */ - { 40609, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 40625, 0x0000911D }, /* GL_WAIT_FAILED */ - { 40640, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 40660, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 40691, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40726, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40754, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40779, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40806, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40831, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40855, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40874, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40888, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40906, 0x00001506 }, /* GL_XOR */ - { 40913, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40932, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40946, 0x00000000 }, /* GL_ZERO */ - { 40954, 0x00000D16 }, /* GL_ZOOM_X */ - { 40964, 0x00000D17 }, /* GL_ZOOM_Y */ + { 12812, 0x0000140B }, /* GL_HALF_FLOAT */ + { 12826, 0x00008000 }, /* GL_HINT_BIT */ + { 12838, 0x00008024 }, /* GL_HISTOGRAM */ + { 12851, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12875, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12903, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12926, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12953, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12970, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12990, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 13014, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 13038, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 13066, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 13094, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 13126, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 13148, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 13174, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 13192, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 13214, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13233, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13256, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13271, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13291, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13331, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13369, 0x00001E02 }, /* GL_INCR */ + { 13377, 0x00008507 }, /* GL_INCR_WRAP */ + { 13390, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13407, 0x00008222 }, /* GL_INDEX */ + { 13416, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13431, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13461, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13495, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13518, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13540, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13560, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13574, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13595, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13613, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13627, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13643, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13658, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13677, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13696, 0x00001404 }, /* GL_INT */ + { 13703, 0x00008049 }, /* GL_INTENSITY */ + { 13716, 0x0000804C }, /* GL_INTENSITY12 */ + { 13731, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13750, 0x0000804D }, /* GL_INTENSITY16 */ + { 13765, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13784, 0x0000804A }, /* GL_INTENSITY4 */ + { 13798, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13816, 0x0000804B }, /* GL_INTENSITY8 */ + { 13830, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13848, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13865, 0x00008575 }, /* GL_INTERPOLATE */ + { 13880, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13899, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13918, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13930, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13946, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13958, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13974, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13986, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 14002, 0x00000500 }, /* GL_INVALID_ENUM */ + { 14018, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 14051, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 14088, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 14109, 0x00000501 }, /* GL_INVALID_VALUE */ + { 14126, 0x0000862B }, /* GL_INVERSE_NV */ + { 14140, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 14164, 0x0000150A }, /* GL_INVERT */ + { 14174, 0x00001E00 }, /* GL_KEEP */ + { 14182, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 14208, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14238, 0x00000406 }, /* GL_LEFT */ + { 14246, 0x00000203 }, /* GL_LEQUAL */ + { 14256, 0x00000201 }, /* GL_LESS */ + { 14264, 0x00004000 }, /* GL_LIGHT0 */ + { 14274, 0x00004001 }, /* GL_LIGHT1 */ + { 14284, 0x00004002 }, /* GL_LIGHT2 */ + { 14294, 0x00004003 }, /* GL_LIGHT3 */ + { 14304, 0x00004004 }, /* GL_LIGHT4 */ + { 14314, 0x00004005 }, /* GL_LIGHT5 */ + { 14324, 0x00004006 }, /* GL_LIGHT6 */ + { 14334, 0x00004007 }, /* GL_LIGHT7 */ + { 14344, 0x00000B50 }, /* GL_LIGHTING */ + { 14356, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14372, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14395, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14424, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14457, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14485, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14509, 0x00001B01 }, /* GL_LINE */ + { 14517, 0x00002601 }, /* GL_LINEAR */ + { 14527, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14549, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14579, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14610, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14634, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14659, 0x00000001 }, /* GL_LINES */ + { 14668, 0x00000004 }, /* GL_LINE_BIT */ + { 14680, 0x00000002 }, /* GL_LINE_LOOP */ + { 14693, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14713, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14728, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14748, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14764, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14788, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14811, 0x00000003 }, /* GL_LINE_STRIP */ + { 14825, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14839, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14853, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14879, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14899, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14914, 0x00000B32 }, /* GL_LIST_BASE */ + { 14927, 0x00020000 }, /* GL_LIST_BIT */ + { 14939, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14953, 0x00000B30 }, /* GL_LIST_MODE */ + { 14966, 0x00000101 }, /* GL_LOAD */ + { 14974, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14986, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 15003, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 15017, 0x00001909 }, /* GL_LUMINANCE */ + { 15030, 0x00008041 }, /* GL_LUMINANCE12 */ + { 15045, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 15068, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 15095, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 15117, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 15143, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 15162, 0x00008042 }, /* GL_LUMINANCE16 */ + { 15177, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 15200, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 15227, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15246, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15260, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15281, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15306, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15324, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15345, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15370, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15384, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15405, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15430, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15448, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15467, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15483, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15503, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15525, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15539, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15554, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15578, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15602, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15626, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15650, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15667, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15684, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15712, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15741, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15770, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15799, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15828, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15857, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15886, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15914, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15942, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15970, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15998, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 16026, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 16054, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 16082, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 16110, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 16138, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 16154, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 16174, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 16196, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 16210, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 16225, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16249, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16273, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16297, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16321, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16338, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16355, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16383, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16412, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16441, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16470, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16499, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16528, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16557, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16585, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16613, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16641, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16669, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16697, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16725, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16753, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16781, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16809, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16822, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16848, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16877, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16905, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16921, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16936, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16962, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 16979, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16994, 0x00008630 }, /* GL_MATRIX0_NV */ + { 17008, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 17024, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 17040, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 17056, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 17072, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 17088, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 17104, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 17120, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 17136, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 17152, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 17168, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 17183, 0x00008631 }, /* GL_MATRIX1_NV */ + { 17197, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 17213, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17229, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17245, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17261, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17277, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17293, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17309, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17325, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17341, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17357, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17372, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17386, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17402, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17418, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17433, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17447, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17462, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17476, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17491, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17505, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17520, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17534, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17549, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17563, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17578, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17593, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17619, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17653, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17684, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17717, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17748, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17763, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17785, 0x00008008 }, /* GL_MAX */ + { 17792, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17815, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17847, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17873, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17906, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17932, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17966, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17985, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ + { 18010, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 18039, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 18071, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 18107, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 18143, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 18183, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 18209, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 18239, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18264, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18293, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18322, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18355, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18375, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18399, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18423, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18447, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18472, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18490, 0x00008008 }, /* GL_MAX_EXT */ + { 18501, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18536, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18575, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18589, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18609, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18647, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18676, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18700, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18728, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18751, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18788, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18824, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18851, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18880, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18914, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18950, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18977, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 19009, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 19045, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 19074, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 19103, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 19131, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 19169, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 19213, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19256, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19290, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19329, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19366, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19404, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19447, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19490, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19520, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19551, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19587, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19623, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19653, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19687, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19720, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ + { 19745, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19774, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19789, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ + { 19808, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19835, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19855, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19879, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19901, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19927, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19954, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19985, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 20009, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 20043, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 20063, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 20090, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 20111, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 20136, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 20161, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 20196, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 20218, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 20244, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 20266, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 20292, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20326, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20364, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20397, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20434, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20458, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20479, 0x00008007 }, /* GL_MIN */ + { 20486, 0x0000802E }, /* GL_MINMAX */ + { 20496, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20510, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20527, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20548, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20563, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20582, 0x00008007 }, /* GL_MIN_EXT */ + { 20593, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20612, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20635, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20658, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20678, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20698, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20728, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20756, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20784, 0x00001700 }, /* GL_MODELVIEW */ + { 20797, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20815, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20834, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20853, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20872, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20891, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20910, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20929, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20948, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20967, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20986, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 21005, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 21023, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 21042, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 21061, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 21080, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 21099, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 21118, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 21137, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 21156, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 21175, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 21194, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 21213, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 21231, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 21250, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 21269, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 21287, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21305, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21323, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21341, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21359, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21377, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21395, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21415, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21442, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21467, 0x00002100 }, /* GL_MODULATE */ + { 21479, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21499, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21526, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21551, 0x00000103 }, /* GL_MULT */ + { 21559, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21574, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21594, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21613, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21632, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21656, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21679, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21709, 0x00002A25 }, /* GL_N3F_V3F */ + { 21720, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21740, 0x0000150E }, /* GL_NAND */ + { 21748, 0x00002600 }, /* GL_NEAREST */ + { 21759, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21790, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21822, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21847, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21873, 0x00000200 }, /* GL_NEVER */ + { 21882, 0x00001102 }, /* GL_NICEST */ + { 21892, 0x00000000 }, /* GL_NONE */ + { 21900, 0x00001505 }, /* GL_NOOP */ + { 21908, 0x00001508 }, /* GL_NOR */ + { 21915, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21928, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21944, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21975, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 22010, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 22034, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 22057, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 22078, 0x00008511 }, /* GL_NORMAL_MAP */ + { 22092, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 22110, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 22127, 0x00000205 }, /* GL_NOTEQUAL */ + { 22139, 0x00000000 }, /* GL_NO_ERROR */ + { 22151, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 22185, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 22223, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 22255, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22297, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22327, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22367, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22398, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22427, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22455, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22485, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22502, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22528, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22544, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22579, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22601, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22616, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22635, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22665, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22686, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22714, 0x00000001 }, /* GL_ONE */ + { 22721, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22749, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22781, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22809, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22841, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22864, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22887, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22910, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22933, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22951, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22973, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22995, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 23011, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 23031, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 23051, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 23069, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 23091, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 23113, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 23129, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 23149, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 23169, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 23187, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 23209, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 23231, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 23247, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 23267, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 23287, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23308, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23327, 0x00001507 }, /* GL_OR */ + { 23333, 0x00000A01 }, /* GL_ORDER */ + { 23342, 0x0000150D }, /* GL_OR_INVERTED */ + { 23357, 0x0000150B }, /* GL_OR_REVERSE */ + { 23371, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23388, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23406, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23427, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23447, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23465, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23484, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23504, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23524, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23542, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23561, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23586, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23610, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23631, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23653, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23675, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23700, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23724, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23745, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23767, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23789, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23811, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23842, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23862, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23887, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23907, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23932, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23952, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23977, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23997, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 24022, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 24042, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 24067, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 24087, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 24112, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 24132, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 24157, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 24177, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 24202, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 24222, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 24247, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 24267, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 24292, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24310, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24331, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24360, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24393, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24418, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24441, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24472, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24507, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24534, 0x00001B00 }, /* GL_POINT */ + { 24543, 0x00000000 }, /* GL_POINTS */ + { 24553, 0x00000002 }, /* GL_POINT_BIT */ + { 24566, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24596, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24630, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24664, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24699, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24728, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24761, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24794, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24828, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24842, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24868, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24886, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24908, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24930, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24953, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24971, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24993, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 25015, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 25038, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 25058, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 25074, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 25095, 0x00008861 }, /* GL_POINT_SPRITE */ + { 25111, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 25131, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 25160, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 25179, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 25205, 0x00000701 }, /* GL_POINT_TOKEN */ + { 25220, 0x00000009 }, /* GL_POLYGON */ + { 25231, 0x00000008 }, /* GL_POLYGON_BIT */ + { 25246, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 25262, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 25285, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25310, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25333, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25356, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25380, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25404, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25422, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25445, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25464, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25487, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25504, 0x00001203 }, /* GL_POSITION */ + { 25516, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25548, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25584, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25617, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25654, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25685, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25720, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25752, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25788, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25821, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25853, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25889, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25922, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25959, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25989, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 26023, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 26054, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 26089, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 26120, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 26155, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 26187, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 26223, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 26253, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 26287, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26318, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26353, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26385, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26416, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26451, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26483, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26519, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26548, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26581, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26611, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26645, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26684, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26717, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26757, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26791, 0x00008578 }, /* GL_PREVIOUS */ + { 26803, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26819, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26835, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26852, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26873, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26894, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26927, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26959, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26982, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 27005, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 27035, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 27064, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 27092, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 27114, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 27142, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 27170, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 27192, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 27213, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 27253, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 27292, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27322, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27357, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27390, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27424, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27463, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27502, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27524, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27550, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27574, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27597, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27619, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27640, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27661, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27688, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27720, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27752, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27787, 0x00001701 }, /* GL_PROJECTION */ + { 27801, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27822, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27848, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27868, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27892, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27913, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27932, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27955, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27994, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 28032, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 28052, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 28082, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 28106, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 28126, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 28156, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 28180, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 28200, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 28233, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 28259, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 28289, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28320, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28350, 0x00002003 }, /* GL_Q */ + { 28355, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28380, 0x00000007 }, /* GL_QUADS */ + { 28389, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28433, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28481, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28498, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28512, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ + { 28542, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */ + { 28569, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28591, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28617, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */ + { 28637, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28653, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28673, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28699, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28729, 0x00008E13 }, /* GL_QUERY_WAIT_NV */ + { 28746, 0x00002002 }, /* GL_R */ + { 28751, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28763, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28796, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28811, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28831, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ + { 28859, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28891, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28915, 0x000088B8 }, /* GL_READ_ONLY */ + { 28928, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28945, 0x000088BA }, /* GL_READ_WRITE */ + { 28959, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 28977, 0x00001903 }, /* GL_RED */ + { 28984, 0x00008016 }, /* GL_REDUCE */ + { 28994, 0x00008016 }, /* GL_REDUCE_EXT */ + { 29008, 0x00000D15 }, /* GL_RED_BIAS */ + { 29020, 0x00000D52 }, /* GL_RED_BITS */ + { 29032, 0x00000D14 }, /* GL_RED_SCALE */ + { 29045, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 29063, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 29085, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 29106, 0x00001C00 }, /* GL_RENDER */ + { 29116, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 29132, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 29159, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ + { 29183, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 29211, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 29237, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 29264, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 29284, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 29311, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 29334, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 29361, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 29393, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 29429, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29454, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29478, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ + { 29506, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29535, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29557, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29583, 0x00001F01 }, /* GL_RENDERER */ + { 29595, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29610, 0x00002901 }, /* GL_REPEAT */ + { 29620, 0x00001E01 }, /* GL_REPLACE */ + { 29631, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29646, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29669, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29687, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29709, 0x00000102 }, /* GL_RETURN */ + { 29719, 0x00001907 }, /* GL_RGB */ + { 29726, 0x00008052 }, /* GL_RGB10 */ + { 29735, 0x00008059 }, /* GL_RGB10_A2 */ + { 29747, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29763, 0x00008052 }, /* GL_RGB10_EXT */ + { 29776, 0x00008053 }, /* GL_RGB12 */ + { 29785, 0x00008053 }, /* GL_RGB12_EXT */ + { 29798, 0x00008054 }, /* GL_RGB16 */ + { 29807, 0x00008054 }, /* GL_RGB16_EXT */ + { 29820, 0x0000804E }, /* GL_RGB2_EXT */ + { 29832, 0x0000804F }, /* GL_RGB4 */ + { 29840, 0x0000804F }, /* GL_RGB4_EXT */ + { 29852, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29865, 0x00008050 }, /* GL_RGB5 */ + { 29873, 0x00008057 }, /* GL_RGB5_A1 */ + { 29884, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29899, 0x00008050 }, /* GL_RGB5_EXT */ + { 29911, 0x00008051 }, /* GL_RGB8 */ + { 29919, 0x00008051 }, /* GL_RGB8_EXT */ + { 29931, 0x00001908 }, /* GL_RGBA */ + { 29939, 0x0000805A }, /* GL_RGBA12 */ + { 29949, 0x0000805A }, /* GL_RGBA12_EXT */ + { 29963, 0x0000805B }, /* GL_RGBA16 */ + { 29973, 0x0000805B }, /* GL_RGBA16_EXT */ + { 29987, 0x00008055 }, /* GL_RGBA2 */ + { 29996, 0x00008055 }, /* GL_RGBA2_EXT */ + { 30009, 0x00008056 }, /* GL_RGBA4 */ + { 30018, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 30037, 0x00008056 }, /* GL_RGBA4_EXT */ + { 30050, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 30064, 0x00008058 }, /* GL_RGBA8 */ + { 30073, 0x00008058 }, /* GL_RGBA8_EXT */ + { 30086, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 30101, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 30119, 0x00000C31 }, /* GL_RGBA_MODE */ + { 30132, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 30145, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 30159, 0x000083A0 }, /* GL_RGB_S3TC */ + { 30171, 0x00008573 }, /* GL_RGB_SCALE */ + { 30184, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 30201, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 30218, 0x00000407 }, /* GL_RIGHT */ + { 30227, 0x00002000 }, /* GL_S */ + { 30232, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 30246, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 30267, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 30281, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 30302, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 30316, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 30332, 0x000080A9 }, /* GL_SAMPLES */ + { 30343, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 30359, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 30374, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 30392, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 30414, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 30442, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30474, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30497, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30524, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30542, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30565, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30587, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30606, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30629, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30655, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30685, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30710, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30739, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30754, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30769, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30785, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30810, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30850, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30894, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 30927, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 30957, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 30989, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 31019, 0x00001C02 }, /* GL_SELECT */ + { 31029, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 31057, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 31082, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 31098, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 31125, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 31156, 0x0000150F }, /* GL_SET */ + { 31163, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 31184, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 31208, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 31223, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 31238, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 31266, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 31289, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 31319, 0x00001601 }, /* GL_SHININESS */ + { 31332, 0x00001402 }, /* GL_SHORT */ + { 31341, 0x00009119 }, /* GL_SIGNALED */ + { 31353, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 31374, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 31390, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 31410, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 31429, 0x00008C46 }, /* GL_SLUMINANCE */ + { 31443, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 31458, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31480, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31500, 0x00001D01 }, /* GL_SMOOTH */ + { 31510, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31543, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31570, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31603, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31630, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31647, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31668, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31689, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31704, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31723, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31742, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31759, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31780, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31801, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31816, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31835, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31854, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31871, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31892, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31913, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 31928, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 31947, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 31966, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 31986, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 32004, 0x00001202 }, /* GL_SPECULAR */ + { 32016, 0x00002402 }, /* GL_SPHERE_MAP */ + { 32030, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 32045, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 32063, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 32080, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 32094, 0x00008580 }, /* GL_SRC0_RGB */ + { 32106, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 32120, 0x00008581 }, /* GL_SRC1_RGB */ + { 32132, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 32146, 0x00008582 }, /* GL_SRC2_RGB */ + { 32158, 0x00000302 }, /* GL_SRC_ALPHA */ + { 32171, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 32193, 0x00000300 }, /* GL_SRC_COLOR */ + { 32206, 0x00008C40 }, /* GL_SRGB */ + { 32214, 0x00008C41 }, /* GL_SRGB8 */ + { 32223, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 32239, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 32253, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 32271, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 32290, 0x000088E6 }, /* GL_STATIC_COPY */ + { 32305, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 32324, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 32339, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 32358, 0x000088E5 }, /* GL_STATIC_READ */ + { 32373, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 32392, 0x00001802 }, /* GL_STENCIL */ + { 32403, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 32425, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 32451, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32472, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32497, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32518, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32543, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32575, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32611, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32643, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32679, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32699, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32726, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32752, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32768, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32790, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32813, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32829, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32845, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32862, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ + { 32880, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ + { 32899, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 32922, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 32944, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ + { 32962, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 32984, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ + { 33002, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 33024, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 33045, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 33072, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 33099, 0x00000B97 }, /* GL_STENCIL_REF */ + { 33114, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 33130, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 33159, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 33181, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 33202, 0x00000C33 }, /* GL_STEREO */ + { 33212, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 33236, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 33261, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 33285, 0x000088E2 }, /* GL_STREAM_COPY */ + { 33300, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 33319, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 33334, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 33353, 0x000088E1 }, /* GL_STREAM_READ */ + { 33368, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 33387, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 33404, 0x000084E7 }, /* GL_SUBTRACT */ + { 33416, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 33432, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 33450, 0x00009116 }, /* GL_SYNC_FENCE */ + { 33464, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 33478, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 33505, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 33535, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33550, 0x00002001 }, /* GL_T */ + { 33555, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33570, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33589, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33605, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33620, 0x00002A27 }, /* GL_T2F_V3F */ + { 33631, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33650, 0x00002A28 }, /* GL_T4F_V4F */ + { 33661, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33684, 0x00001702 }, /* GL_TEXTURE */ + { 33695, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33707, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33723, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33735, 0x000084CA }, /* GL_TEXTURE10 */ + { 33748, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33765, 0x000084CB }, /* GL_TEXTURE11 */ + { 33778, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33795, 0x000084CC }, /* GL_TEXTURE12 */ + { 33808, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33825, 0x000084CD }, /* GL_TEXTURE13 */ + { 33838, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33855, 0x000084CE }, /* GL_TEXTURE14 */ + { 33868, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33885, 0x000084CF }, /* GL_TEXTURE15 */ + { 33898, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33915, 0x000084D0 }, /* GL_TEXTURE16 */ + { 33928, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 33945, 0x000084D1 }, /* GL_TEXTURE17 */ + { 33958, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 33975, 0x000084D2 }, /* GL_TEXTURE18 */ + { 33988, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 34005, 0x000084D3 }, /* GL_TEXTURE19 */ + { 34018, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 34035, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 34051, 0x000084C2 }, /* GL_TEXTURE2 */ + { 34063, 0x000084D4 }, /* GL_TEXTURE20 */ + { 34076, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 34093, 0x000084D5 }, /* GL_TEXTURE21 */ + { 34106, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 34123, 0x000084D6 }, /* GL_TEXTURE22 */ + { 34136, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 34153, 0x000084D7 }, /* GL_TEXTURE23 */ + { 34166, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 34183, 0x000084D8 }, /* GL_TEXTURE24 */ + { 34196, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 34213, 0x000084D9 }, /* GL_TEXTURE25 */ + { 34226, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 34243, 0x000084DA }, /* GL_TEXTURE26 */ + { 34256, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 34273, 0x000084DB }, /* GL_TEXTURE27 */ + { 34286, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 34303, 0x000084DC }, /* GL_TEXTURE28 */ + { 34316, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 34333, 0x000084DD }, /* GL_TEXTURE29 */ + { 34346, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 34363, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 34379, 0x000084C3 }, /* GL_TEXTURE3 */ + { 34391, 0x000084DE }, /* GL_TEXTURE30 */ + { 34404, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 34421, 0x000084DF }, /* GL_TEXTURE31 */ + { 34434, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 34451, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 34467, 0x000084C4 }, /* GL_TEXTURE4 */ + { 34479, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 34495, 0x000084C5 }, /* GL_TEXTURE5 */ + { 34507, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 34523, 0x000084C6 }, /* GL_TEXTURE6 */ + { 34535, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34551, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34563, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34579, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34591, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34607, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34619, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34635, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34649, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34673, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34687, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34711, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34725, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34747, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34773, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34795, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34817, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34849, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34871, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34903, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 34925, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 34953, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 34985, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 35018, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 35050, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 35065, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 35086, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 35111, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 35129, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 35153, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 35184, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 35214, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 35244, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 35279, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 35310, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 35348, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 35375, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 35407, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 35441, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 35465, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 35493, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 35517, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35545, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35578, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35602, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35624, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35646, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35672, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35706, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35739, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35776, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35804, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35836, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35859, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35897, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 35939, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 35970, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 35998, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 36028, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 36056, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 36076, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 36100, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 36131, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 36166, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 36197, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 36232, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 36263, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 36298, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 36329, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 36364, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 36395, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 36430, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 36461, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 36496, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 36525, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 36542, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36564, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36590, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36605, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36626, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36646, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36672, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36692, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36709, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36726, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36743, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36760, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36785, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36807, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36833, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36851, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36877, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36903, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 36933, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 36960, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 36985, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 37005, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 37029, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 37056, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 37083, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 37110, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 37136, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 37166, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 37188, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 37206, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 37236, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 37264, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 37292, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 37320, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 37341, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 37360, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 37382, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 37401, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 37421, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 37451, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 37482, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 37507, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 37531, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37551, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37575, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37595, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37618, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37642, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ + { 37670, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37700, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37725, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37759, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37776, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37794, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37812, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37830, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37849, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37869, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37888, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37917, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 37934, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 37960, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 37990, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 38022, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 38052, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 38086, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 38102, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 38133, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 38168, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 38196, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 38228, 0x00000004 }, /* GL_TRIANGLES */ + { 38241, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 38257, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 38278, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 38296, 0x00000001 }, /* GL_TRUE */ + { 38304, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 38324, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 38347, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 38367, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 38388, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 38410, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 38432, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 38452, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 38473, 0x00009118 }, /* GL_UNSIGNALED */ + { 38487, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 38504, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 38531, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38554, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38570, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38597, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38618, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ + { 38643, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38667, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38698, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38722, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38750, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38773, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38791, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38821, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38847, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38877, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 38903, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 38927, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 38955, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 38983, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 39010, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 39042, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 39073, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 39087, 0x00002A20 }, /* GL_V2F */ + { 39094, 0x00002A21 }, /* GL_V3F */ + { 39101, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 39120, 0x00001F00 }, /* GL_VENDOR */ + { 39130, 0x00001F02 }, /* GL_VERSION */ + { 39141, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 39157, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 39181, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 39211, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 39242, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 39277, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 39301, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 39322, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 39345, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 39366, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 39393, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 39421, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 39449, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 39477, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 39505, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 39533, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 39561, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39588, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39615, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39642, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39669, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39696, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39723, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39750, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39777, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39804, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39842, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39884, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 39915, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 39950, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 39984, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 40022, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 40053, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 40088, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 40116, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 40148, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 40178, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 40212, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 40240, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 40272, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 40292, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 40314, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 40343, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 40364, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 40393, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 40426, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 40458, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 40485, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 40516, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 40546, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 40563, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40584, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40611, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40623, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40639, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40654, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40674, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40705, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40740, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40768, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40793, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40820, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40845, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40869, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 40888, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 40902, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 40920, 0x00001506 }, /* GL_XOR */ + { 40927, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 40946, 0x00008757 }, /* GL_YCBCR_MESA */ + { 40960, 0x00000000 }, /* GL_ZERO */ + { 40968, 0x00000D16 }, /* GL_ZOOM_X */ + { 40978, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1350] = +static const unsigned reduced_enums[1351] = { 479, /* GL_FALSE */ - 701, /* GL_LINES */ - 703, /* GL_LINE_LOOP */ - 710, /* GL_LINE_STRIP */ - 1769, /* GL_TRIANGLES */ - 1772, /* GL_TRIANGLE_STRIP */ - 1770, /* GL_TRIANGLE_FAN */ - 1285, /* GL_QUADS */ - 1289, /* GL_QUAD_STRIP */ - 1171, /* GL_POLYGON */ - 1183, /* GL_POLYGON_STIPPLE_BIT */ - 1132, /* GL_PIXEL_MODE_BIT */ - 688, /* GL_LIGHTING_BIT */ + 702, /* GL_LINES */ + 704, /* GL_LINE_LOOP */ + 711, /* GL_LINE_STRIP */ + 1770, /* GL_TRIANGLES */ + 1773, /* GL_TRIANGLE_STRIP */ + 1771, /* GL_TRIANGLE_FAN */ + 1286, /* GL_QUADS */ + 1290, /* GL_QUAD_STRIP */ + 1172, /* GL_POLYGON */ + 1184, /* GL_POLYGON_STIPPLE_BIT */ + 1133, /* GL_PIXEL_MODE_BIT */ + 689, /* GL_LIGHTING_BIT */ 509, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 720, /* GL_LOAD */ - 1348, /* GL_RETURN */ - 1004, /* GL_MULT */ + 721, /* GL_LOAD */ + 1349, /* GL_RETURN */ + 1005, /* GL_MULT */ 23, /* GL_ADD */ - 1020, /* GL_NEVER */ - 678, /* GL_LESS */ + 1021, /* GL_NEVER */ + 679, /* GL_LESS */ 469, /* GL_EQUAL */ - 677, /* GL_LEQUAL */ + 678, /* GL_LEQUAL */ 599, /* GL_GREATER */ - 1035, /* GL_NOTEQUAL */ + 1036, /* GL_NOTEQUAL */ 598, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1489, /* GL_SRC_COLOR */ - 1065, /* GL_ONE_MINUS_SRC_COLOR */ - 1487, /* GL_SRC_ALPHA */ - 1064, /* GL_ONE_MINUS_SRC_ALPHA */ + 1490, /* GL_SRC_COLOR */ + 1066, /* GL_ONE_MINUS_SRC_COLOR */ + 1488, /* GL_SRC_ALPHA */ + 1065, /* GL_ONE_MINUS_SRC_ALPHA */ 448, /* GL_DST_ALPHA */ - 1062, /* GL_ONE_MINUS_DST_ALPHA */ + 1063, /* GL_ONE_MINUS_DST_ALPHA */ 449, /* GL_DST_COLOR */ - 1063, /* GL_ONE_MINUS_DST_COLOR */ - 1488, /* GL_SRC_ALPHA_SATURATE */ + 1064, /* GL_ONE_MINUS_DST_COLOR */ + 1489, /* GL_SRC_ALPHA_SATURATE */ 586, /* GL_FRONT_LEFT */ 587, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ 583, /* GL_FRONT */ 68, /* GL_BACK */ - 676, /* GL_LEFT */ - 1390, /* GL_RIGHT */ + 677, /* GL_LEFT */ + 1391, /* GL_RIGHT */ 584, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 665, /* GL_INVALID_ENUM */ - 669, /* GL_INVALID_VALUE */ - 668, /* GL_INVALID_OPERATION */ - 1494, /* GL_STACK_OVERFLOW */ - 1495, /* GL_STACK_UNDERFLOW */ - 1090, /* GL_OUT_OF_MEMORY */ - 666, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 666, /* GL_INVALID_ENUM */ + 670, /* GL_INVALID_VALUE */ + 669, /* GL_INVALID_OPERATION */ + 1495, /* GL_STACK_OVERFLOW */ + 1496, /* GL_STACK_UNDERFLOW */ + 1091, /* GL_OUT_OF_MEMORY */ + 667, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1110, /* GL_PASS_THROUGH_TOKEN */ - 1170, /* GL_POINT_TOKEN */ - 711, /* GL_LINE_TOKEN */ - 1184, /* GL_POLYGON_TOKEN */ + 1111, /* GL_PASS_THROUGH_TOKEN */ + 1171, /* GL_POINT_TOKEN */ + 712, /* GL_LINE_TOKEN */ + 1185, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ 447, /* GL_DRAW_PIXEL_TOKEN */ 301, /* GL_COPY_PIXEL_TOKEN */ - 704, /* GL_LINE_RESET_TOKEN */ + 705, /* GL_LINE_RESET_TOKEN */ 472, /* GL_EXP */ 473, /* GL_EXP2 */ 337, /* GL_CW */ 125, /* GL_CCW */ 146, /* GL_COEFF */ - 1087, /* GL_ORDER */ + 1088, /* GL_ORDER */ 384, /* GL_DOMAIN */ 311, /* GL_CURRENT_COLOR */ 314, /* GL_CURRENT_INDEX */ @@ -3898,33 +3900,33 @@ static const unsigned reduced_enums[1350] = 328, /* GL_CURRENT_RASTER_POSITION */ 329, /* GL_CURRENT_RASTER_POSITION_VALID */ 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1163, /* GL_POINT_SMOOTH */ - 1152, /* GL_POINT_SIZE */ - 1162, /* GL_POINT_SIZE_RANGE */ - 1153, /* GL_POINT_SIZE_GRANULARITY */ - 705, /* GL_LINE_SMOOTH */ - 712, /* GL_LINE_WIDTH */ - 714, /* GL_LINE_WIDTH_RANGE */ - 713, /* GL_LINE_WIDTH_GRANULARITY */ - 707, /* GL_LINE_STIPPLE */ - 708, /* GL_LINE_STIPPLE_PATTERN */ - 709, /* GL_LINE_STIPPLE_REPEAT */ - 719, /* GL_LIST_MODE */ - 885, /* GL_MAX_LIST_NESTING */ - 716, /* GL_LIST_BASE */ - 718, /* GL_LIST_INDEX */ - 1173, /* GL_POLYGON_MODE */ - 1180, /* GL_POLYGON_SMOOTH */ - 1182, /* GL_POLYGON_STIPPLE */ + 1164, /* GL_POINT_SMOOTH */ + 1153, /* GL_POINT_SIZE */ + 1163, /* GL_POINT_SIZE_RANGE */ + 1154, /* GL_POINT_SIZE_GRANULARITY */ + 706, /* GL_LINE_SMOOTH */ + 713, /* GL_LINE_WIDTH */ + 715, /* GL_LINE_WIDTH_RANGE */ + 714, /* GL_LINE_WIDTH_GRANULARITY */ + 708, /* GL_LINE_STIPPLE */ + 709, /* GL_LINE_STIPPLE_PATTERN */ + 710, /* GL_LINE_STIPPLE_REPEAT */ + 720, /* GL_LIST_MODE */ + 886, /* GL_MAX_LIST_NESTING */ + 717, /* GL_LIST_BASE */ + 719, /* GL_LIST_INDEX */ + 1174, /* GL_POLYGON_MODE */ + 1181, /* GL_POLYGON_SMOOTH */ + 1183, /* GL_POLYGON_STIPPLE */ 458, /* GL_EDGE_FLAG */ 304, /* GL_CULL_FACE */ 305, /* GL_CULL_FACE_MODE */ 585, /* GL_FRONT_FACE */ - 687, /* GL_LIGHTING */ - 692, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 693, /* GL_LIGHT_MODEL_TWO_SIDE */ - 689, /* GL_LIGHT_MODEL_AMBIENT */ - 1436, /* GL_SHADE_MODEL */ + 688, /* GL_LIGHTING */ + 693, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 694, /* GL_LIGHT_MODEL_TWO_SIDE */ + 690, /* GL_LIGHT_MODEL_AMBIENT */ + 1437, /* GL_SHADE_MODEL */ 193, /* GL_COLOR_MATERIAL_FACE */ 194, /* GL_COLOR_MATERIAL_PARAMETER */ 192, /* GL_COLOR_MATERIAL */ @@ -3941,24 +3943,24 @@ static const unsigned reduced_enums[1350] = 358, /* GL_DEPTH_CLEAR_VALUE */ 369, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1534, /* GL_STENCIL_TEST */ - 1518, /* GL_STENCIL_CLEAR_VALUE */ - 1520, /* GL_STENCIL_FUNC */ - 1536, /* GL_STENCIL_VALUE_MASK */ - 1519, /* GL_STENCIL_FAIL */ - 1531, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1532, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1533, /* GL_STENCIL_REF */ - 1537, /* GL_STENCIL_WRITEMASK */ - 853, /* GL_MATRIX_MODE */ - 1025, /* GL_NORMALIZE */ - 1864, /* GL_VIEWPORT */ - 999, /* GL_MODELVIEW_STACK_DEPTH */ - 1263, /* GL_PROJECTION_STACK_DEPTH */ - 1744, /* GL_TEXTURE_STACK_DEPTH */ - 997, /* GL_MODELVIEW_MATRIX */ - 1262, /* GL_PROJECTION_MATRIX */ - 1727, /* GL_TEXTURE_MATRIX */ + 1535, /* GL_STENCIL_TEST */ + 1519, /* GL_STENCIL_CLEAR_VALUE */ + 1521, /* GL_STENCIL_FUNC */ + 1537, /* GL_STENCIL_VALUE_MASK */ + 1520, /* GL_STENCIL_FAIL */ + 1532, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1533, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1534, /* GL_STENCIL_REF */ + 1538, /* GL_STENCIL_WRITEMASK */ + 854, /* GL_MATRIX_MODE */ + 1026, /* GL_NORMALIZE */ + 1865, /* GL_VIEWPORT */ + 1000, /* GL_MODELVIEW_STACK_DEPTH */ + 1264, /* GL_PROJECTION_STACK_DEPTH */ + 1745, /* GL_TEXTURE_STACK_DEPTH */ + 998, /* GL_MODELVIEW_MATRIX */ + 1263, /* GL_PROJECTION_MATRIX */ + 1728, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ @@ -3968,72 +3970,72 @@ static const unsigned reduced_enums[1350] = 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 722, /* GL_LOGIC_OP_MODE */ - 639, /* GL_INDEX_LOGIC_OP */ + 723, /* GL_LOGIC_OP_MODE */ + 640, /* GL_INDEX_LOGIC_OP */ 191, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ 394, /* GL_DRAW_BUFFER */ - 1303, /* GL_READ_BUFFER */ - 1417, /* GL_SCISSOR_BOX */ - 1418, /* GL_SCISSOR_TEST */ - 638, /* GL_INDEX_CLEAR_VALUE */ - 643, /* GL_INDEX_WRITEMASK */ + 1304, /* GL_READ_BUFFER */ + 1418, /* GL_SCISSOR_BOX */ + 1419, /* GL_SCISSOR_TEST */ + 639, /* GL_INDEX_CLEAR_VALUE */ + 644, /* GL_INDEX_WRITEMASK */ 188, /* GL_COLOR_CLEAR_VALUE */ 230, /* GL_COLOR_WRITEMASK */ - 640, /* GL_INDEX_MODE */ - 1383, /* GL_RGBA_MODE */ + 641, /* GL_INDEX_MODE */ + 1384, /* GL_RGBA_MODE */ 393, /* GL_DOUBLEBUFFER */ - 1538, /* GL_STEREO */ - 1341, /* GL_RENDER_MODE */ - 1111, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1164, /* GL_POINT_SMOOTH_HINT */ - 706, /* GL_LINE_SMOOTH_HINT */ - 1181, /* GL_POLYGON_SMOOTH_HINT */ + 1539, /* GL_STEREO */ + 1342, /* GL_RENDER_MODE */ + 1112, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1165, /* GL_POINT_SMOOTH_HINT */ + 707, /* GL_LINE_SMOOTH_HINT */ + 1182, /* GL_POLYGON_SMOOTH_HINT */ 529, /* GL_FOG_HINT */ - 1708, /* GL_TEXTURE_GEN_S */ - 1709, /* GL_TEXTURE_GEN_T */ - 1707, /* GL_TEXTURE_GEN_R */ - 1706, /* GL_TEXTURE_GEN_Q */ - 1124, /* GL_PIXEL_MAP_I_TO_I */ - 1130, /* GL_PIXEL_MAP_S_TO_S */ - 1126, /* GL_PIXEL_MAP_I_TO_R */ - 1122, /* GL_PIXEL_MAP_I_TO_G */ - 1120, /* GL_PIXEL_MAP_I_TO_B */ - 1118, /* GL_PIXEL_MAP_I_TO_A */ - 1128, /* GL_PIXEL_MAP_R_TO_R */ - 1116, /* GL_PIXEL_MAP_G_TO_G */ - 1114, /* GL_PIXEL_MAP_B_TO_B */ - 1112, /* GL_PIXEL_MAP_A_TO_A */ - 1125, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1131, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1127, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1123, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1121, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1119, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1129, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1117, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1115, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1113, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1781, /* GL_UNPACK_SWAP_BYTES */ - 1776, /* GL_UNPACK_LSB_FIRST */ - 1777, /* GL_UNPACK_ROW_LENGTH */ - 1780, /* GL_UNPACK_SKIP_ROWS */ - 1779, /* GL_UNPACK_SKIP_PIXELS */ - 1774, /* GL_UNPACK_ALIGNMENT */ - 1099, /* GL_PACK_SWAP_BYTES */ - 1094, /* GL_PACK_LSB_FIRST */ - 1095, /* GL_PACK_ROW_LENGTH */ - 1098, /* GL_PACK_SKIP_ROWS */ - 1097, /* GL_PACK_SKIP_PIXELS */ - 1091, /* GL_PACK_ALIGNMENT */ - 800, /* GL_MAP_COLOR */ - 805, /* GL_MAP_STENCIL */ - 642, /* GL_INDEX_SHIFT */ - 641, /* GL_INDEX_OFFSET */ - 1317, /* GL_RED_SCALE */ - 1315, /* GL_RED_BIAS */ - 1882, /* GL_ZOOM_X */ - 1883, /* GL_ZOOM_Y */ + 1709, /* GL_TEXTURE_GEN_S */ + 1710, /* GL_TEXTURE_GEN_T */ + 1708, /* GL_TEXTURE_GEN_R */ + 1707, /* GL_TEXTURE_GEN_Q */ + 1125, /* GL_PIXEL_MAP_I_TO_I */ + 1131, /* GL_PIXEL_MAP_S_TO_S */ + 1127, /* GL_PIXEL_MAP_I_TO_R */ + 1123, /* GL_PIXEL_MAP_I_TO_G */ + 1121, /* GL_PIXEL_MAP_I_TO_B */ + 1119, /* GL_PIXEL_MAP_I_TO_A */ + 1129, /* GL_PIXEL_MAP_R_TO_R */ + 1117, /* GL_PIXEL_MAP_G_TO_G */ + 1115, /* GL_PIXEL_MAP_B_TO_B */ + 1113, /* GL_PIXEL_MAP_A_TO_A */ + 1126, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1132, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1128, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1124, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1122, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1120, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1130, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1118, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1116, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1114, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1782, /* GL_UNPACK_SWAP_BYTES */ + 1777, /* GL_UNPACK_LSB_FIRST */ + 1778, /* GL_UNPACK_ROW_LENGTH */ + 1781, /* GL_UNPACK_SKIP_ROWS */ + 1780, /* GL_UNPACK_SKIP_PIXELS */ + 1775, /* GL_UNPACK_ALIGNMENT */ + 1100, /* GL_PACK_SWAP_BYTES */ + 1095, /* GL_PACK_LSB_FIRST */ + 1096, /* GL_PACK_ROW_LENGTH */ + 1099, /* GL_PACK_SKIP_ROWS */ + 1098, /* GL_PACK_SKIP_PIXELS */ + 1092, /* GL_PACK_ALIGNMENT */ + 801, /* GL_MAP_COLOR */ + 806, /* GL_MAP_STENCIL */ + 643, /* GL_INDEX_SHIFT */ + 642, /* GL_INDEX_OFFSET */ + 1318, /* GL_RED_SCALE */ + 1316, /* GL_RED_BIAS */ + 1883, /* GL_ZOOM_X */ + 1884, /* GL_ZOOM_Y */ 603, /* GL_GREEN_SCALE */ 601, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ @@ -4042,375 +4044,376 @@ static const unsigned reduced_enums[1350] = 40, /* GL_ALPHA_BIAS */ 371, /* GL_DEPTH_SCALE */ 351, /* GL_DEPTH_BIAS */ - 880, /* GL_MAX_EVAL_ORDER */ - 884, /* GL_MAX_LIGHTS */ - 862, /* GL_MAX_CLIP_PLANES */ - 932, /* GL_MAX_TEXTURE_SIZE */ - 890, /* GL_MAX_PIXEL_MAP_TABLE */ - 858, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 887, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 888, /* GL_MAX_NAME_STACK_DEPTH */ - 916, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 933, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 947, /* GL_MAX_VIEWPORT_DIMS */ - 859, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1548, /* GL_SUBPIXEL_BITS */ - 637, /* GL_INDEX_BITS */ - 1316, /* GL_RED_BITS */ + 881, /* GL_MAX_EVAL_ORDER */ + 885, /* GL_MAX_LIGHTS */ + 863, /* GL_MAX_CLIP_PLANES */ + 933, /* GL_MAX_TEXTURE_SIZE */ + 891, /* GL_MAX_PIXEL_MAP_TABLE */ + 859, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 888, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 889, /* GL_MAX_NAME_STACK_DEPTH */ + 917, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 934, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 948, /* GL_MAX_VIEWPORT_DIMS */ + 860, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1549, /* GL_SUBPIXEL_BITS */ + 638, /* GL_INDEX_BITS */ + 1317, /* GL_RED_BITS */ 602, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ 352, /* GL_DEPTH_BITS */ - 1516, /* GL_STENCIL_BITS */ + 1517, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1013, /* GL_NAME_STACK_DEPTH */ + 1014, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 746, /* GL_MAP1_COLOR_4 */ - 749, /* GL_MAP1_INDEX */ - 750, /* GL_MAP1_NORMAL */ - 751, /* GL_MAP1_TEXTURE_COORD_1 */ - 752, /* GL_MAP1_TEXTURE_COORD_2 */ - 753, /* GL_MAP1_TEXTURE_COORD_3 */ - 754, /* GL_MAP1_TEXTURE_COORD_4 */ - 755, /* GL_MAP1_VERTEX_3 */ - 756, /* GL_MAP1_VERTEX_4 */ - 773, /* GL_MAP2_COLOR_4 */ - 776, /* GL_MAP2_INDEX */ - 777, /* GL_MAP2_NORMAL */ - 778, /* GL_MAP2_TEXTURE_COORD_1 */ - 779, /* GL_MAP2_TEXTURE_COORD_2 */ - 780, /* GL_MAP2_TEXTURE_COORD_3 */ - 781, /* GL_MAP2_TEXTURE_COORD_4 */ - 782, /* GL_MAP2_VERTEX_3 */ - 783, /* GL_MAP2_VERTEX_4 */ - 747, /* GL_MAP1_GRID_DOMAIN */ - 748, /* GL_MAP1_GRID_SEGMENTS */ - 774, /* GL_MAP2_GRID_DOMAIN */ - 775, /* GL_MAP2_GRID_SEGMENTS */ - 1631, /* GL_TEXTURE_1D */ - 1633, /* GL_TEXTURE_2D */ + 747, /* GL_MAP1_COLOR_4 */ + 750, /* GL_MAP1_INDEX */ + 751, /* GL_MAP1_NORMAL */ + 752, /* GL_MAP1_TEXTURE_COORD_1 */ + 753, /* GL_MAP1_TEXTURE_COORD_2 */ + 754, /* GL_MAP1_TEXTURE_COORD_3 */ + 755, /* GL_MAP1_TEXTURE_COORD_4 */ + 756, /* GL_MAP1_VERTEX_3 */ + 757, /* GL_MAP1_VERTEX_4 */ + 774, /* GL_MAP2_COLOR_4 */ + 777, /* GL_MAP2_INDEX */ + 778, /* GL_MAP2_NORMAL */ + 779, /* GL_MAP2_TEXTURE_COORD_1 */ + 780, /* GL_MAP2_TEXTURE_COORD_2 */ + 781, /* GL_MAP2_TEXTURE_COORD_3 */ + 782, /* GL_MAP2_TEXTURE_COORD_4 */ + 783, /* GL_MAP2_VERTEX_3 */ + 784, /* GL_MAP2_VERTEX_4 */ + 748, /* GL_MAP1_GRID_DOMAIN */ + 749, /* GL_MAP1_GRID_SEGMENTS */ + 775, /* GL_MAP2_GRID_DOMAIN */ + 776, /* GL_MAP2_GRID_SEGMENTS */ + 1632, /* GL_TEXTURE_1D */ + 1634, /* GL_TEXTURE_2D */ 482, /* GL_FEEDBACK_BUFFER_POINTER */ 483, /* GL_FEEDBACK_BUFFER_SIZE */ 484, /* GL_FEEDBACK_BUFFER_TYPE */ - 1427, /* GL_SELECTION_BUFFER_POINTER */ - 1428, /* GL_SELECTION_BUFFER_SIZE */ - 1750, /* GL_TEXTURE_WIDTH */ - 1713, /* GL_TEXTURE_HEIGHT */ - 1668, /* GL_TEXTURE_COMPONENTS */ - 1652, /* GL_TEXTURE_BORDER_COLOR */ - 1651, /* GL_TEXTURE_BORDER */ + 1428, /* GL_SELECTION_BUFFER_POINTER */ + 1429, /* GL_SELECTION_BUFFER_SIZE */ + 1751, /* GL_TEXTURE_WIDTH */ + 1714, /* GL_TEXTURE_HEIGHT */ + 1669, /* GL_TEXTURE_COMPONENTS */ + 1653, /* GL_TEXTURE_BORDER_COLOR */ + 1652, /* GL_TEXTURE_BORDER */ 385, /* GL_DONT_CARE */ 480, /* GL_FASTEST */ - 1021, /* GL_NICEST */ + 1022, /* GL_NICEST */ 48, /* GL_AMBIENT */ 382, /* GL_DIFFUSE */ - 1476, /* GL_SPECULAR */ - 1185, /* GL_POSITION */ - 1479, /* GL_SPOT_DIRECTION */ - 1480, /* GL_SPOT_EXPONENT */ - 1478, /* GL_SPOT_CUTOFF */ + 1477, /* GL_SPECULAR */ + 1186, /* GL_POSITION */ + 1480, /* GL_SPOT_DIRECTION */ + 1481, /* GL_SPOT_EXPONENT */ + 1479, /* GL_SPOT_CUTOFF */ 275, /* GL_CONSTANT_ATTENUATION */ - 696, /* GL_LINEAR_ATTENUATION */ - 1284, /* GL_QUADRATIC_ATTENUATION */ + 697, /* GL_LINEAR_ATTENUATION */ + 1285, /* GL_QUADRATIC_ATTENUATION */ 244, /* GL_COMPILE */ 245, /* GL_COMPILE_AND_EXECUTE */ 120, /* GL_BYTE */ - 1783, /* GL_UNSIGNED_BYTE */ - 1441, /* GL_SHORT */ - 1795, /* GL_UNSIGNED_SHORT */ - 645, /* GL_INT */ - 1786, /* GL_UNSIGNED_INT */ + 1784, /* GL_UNSIGNED_BYTE */ + 1442, /* GL_SHORT */ + 1796, /* GL_UNSIGNED_SHORT */ + 646, /* GL_INT */ + 1787, /* GL_UNSIGNED_INT */ 489, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ 392, /* GL_DOUBLE */ + 604, /* GL_HALF_FLOAT */ 132, /* GL_CLEAR */ 50, /* GL_AND */ 52, /* GL_AND_REVERSE */ 299, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1023, /* GL_NOOP */ - 1878, /* GL_XOR */ - 1086, /* GL_OR */ - 1024, /* GL_NOR */ + 1024, /* GL_NOOP */ + 1879, /* GL_XOR */ + 1087, /* GL_OR */ + 1025, /* GL_NOR */ 470, /* GL_EQUIV */ - 672, /* GL_INVERT */ - 1089, /* GL_OR_REVERSE */ + 673, /* GL_INVERT */ + 1090, /* GL_OR_REVERSE */ 300, /* GL_COPY_INVERTED */ - 1088, /* GL_OR_INVERTED */ - 1014, /* GL_NAND */ - 1432, /* GL_SET */ + 1089, /* GL_OR_INVERTED */ + 1015, /* GL_NAND */ + 1433, /* GL_SET */ 467, /* GL_EMISSION */ - 1440, /* GL_SHININESS */ + 1441, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ 190, /* GL_COLOR_INDEXES */ - 964, /* GL_MODELVIEW */ - 1261, /* GL_PROJECTION */ - 1566, /* GL_TEXTURE */ + 965, /* GL_MODELVIEW */ + 1262, /* GL_PROJECTION */ + 1567, /* GL_TEXTURE */ 147, /* GL_COLOR */ 346, /* GL_DEPTH */ - 1502, /* GL_STENCIL */ + 1503, /* GL_STENCIL */ 189, /* GL_COLOR_INDEX */ - 1521, /* GL_STENCIL_INDEX */ + 1522, /* GL_STENCIL_INDEX */ 359, /* GL_DEPTH_COMPONENT */ - 1312, /* GL_RED */ + 1313, /* GL_RED */ 600, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1349, /* GL_RGB */ - 1368, /* GL_RGBA */ - 724, /* GL_LUMINANCE */ - 745, /* GL_LUMINANCE_ALPHA */ + 1350, /* GL_RGB */ + 1369, /* GL_RGBA */ + 725, /* GL_LUMINANCE */ + 746, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1141, /* GL_POINT */ - 694, /* GL_LINE */ + 1142, /* GL_POINT */ + 695, /* GL_LINE */ 485, /* GL_FILL */ - 1321, /* GL_RENDER */ + 1322, /* GL_RENDER */ 481, /* GL_FEEDBACK */ - 1426, /* GL_SELECT */ + 1427, /* GL_SELECT */ 488, /* GL_FLAT */ - 1451, /* GL_SMOOTH */ - 673, /* GL_KEEP */ - 1343, /* GL_REPLACE */ - 627, /* GL_INCR */ + 1452, /* GL_SMOOTH */ + 674, /* GL_KEEP */ + 1344, /* GL_REPLACE */ + 628, /* GL_INCR */ 342, /* GL_DECR */ - 1810, /* GL_VENDOR */ - 1340, /* GL_RENDERER */ - 1811, /* GL_VERSION */ + 1811, /* GL_VENDOR */ + 1341, /* GL_RENDERER */ + 1812, /* GL_VERSION */ 474, /* GL_EXTENSIONS */ - 1391, /* GL_S */ - 1557, /* GL_T */ - 1300, /* GL_R */ - 1283, /* GL_Q */ - 1000, /* GL_MODULATE */ + 1392, /* GL_S */ + 1558, /* GL_T */ + 1301, /* GL_R */ + 1284, /* GL_Q */ + 1001, /* GL_MODULATE */ 341, /* GL_DECAL */ - 1703, /* GL_TEXTURE_ENV_MODE */ - 1702, /* GL_TEXTURE_ENV_COLOR */ - 1701, /* GL_TEXTURE_ENV */ + 1704, /* GL_TEXTURE_ENV_MODE */ + 1703, /* GL_TEXTURE_ENV_COLOR */ + 1702, /* GL_TEXTURE_ENV */ 475, /* GL_EYE_LINEAR */ - 1047, /* GL_OBJECT_LINEAR */ - 1477, /* GL_SPHERE_MAP */ - 1705, /* GL_TEXTURE_GEN_MODE */ - 1049, /* GL_OBJECT_PLANE */ + 1048, /* GL_OBJECT_LINEAR */ + 1478, /* GL_SPHERE_MAP */ + 1706, /* GL_TEXTURE_GEN_MODE */ + 1050, /* GL_OBJECT_PLANE */ 476, /* GL_EYE_PLANE */ - 1015, /* GL_NEAREST */ - 695, /* GL_LINEAR */ - 1019, /* GL_NEAREST_MIPMAP_NEAREST */ - 700, /* GL_LINEAR_MIPMAP_NEAREST */ - 1018, /* GL_NEAREST_MIPMAP_LINEAR */ - 699, /* GL_LINEAR_MIPMAP_LINEAR */ - 1726, /* GL_TEXTURE_MAG_FILTER */ - 1734, /* GL_TEXTURE_MIN_FILTER */ - 1752, /* GL_TEXTURE_WRAP_S */ - 1753, /* GL_TEXTURE_WRAP_T */ + 1016, /* GL_NEAREST */ + 696, /* GL_LINEAR */ + 1020, /* GL_NEAREST_MIPMAP_NEAREST */ + 701, /* GL_LINEAR_MIPMAP_NEAREST */ + 1019, /* GL_NEAREST_MIPMAP_LINEAR */ + 700, /* GL_LINEAR_MIPMAP_LINEAR */ + 1727, /* GL_TEXTURE_MAG_FILTER */ + 1735, /* GL_TEXTURE_MIN_FILTER */ + 1753, /* GL_TEXTURE_WRAP_S */ + 1754, /* GL_TEXTURE_WRAP_T */ 126, /* GL_CLAMP */ - 1342, /* GL_REPEAT */ - 1179, /* GL_POLYGON_OFFSET_UNITS */ - 1178, /* GL_POLYGON_OFFSET_POINT */ - 1177, /* GL_POLYGON_OFFSET_LINE */ - 1301, /* GL_R3_G3_B2 */ - 1807, /* GL_V2F */ - 1808, /* GL_V3F */ + 1343, /* GL_REPEAT */ + 1180, /* GL_POLYGON_OFFSET_UNITS */ + 1179, /* GL_POLYGON_OFFSET_POINT */ + 1178, /* GL_POLYGON_OFFSET_LINE */ + 1302, /* GL_R3_G3_B2 */ + 1808, /* GL_V2F */ + 1809, /* GL_V3F */ 123, /* GL_C4UB_V2F */ 124, /* GL_C4UB_V3F */ 121, /* GL_C3F_V3F */ - 1012, /* GL_N3F_V3F */ + 1013, /* GL_N3F_V3F */ 122, /* GL_C4F_N3F_V3F */ - 1562, /* GL_T2F_V3F */ - 1564, /* GL_T4F_V4F */ - 1560, /* GL_T2F_C4UB_V3F */ - 1558, /* GL_T2F_C3F_V3F */ - 1561, /* GL_T2F_N3F_V3F */ - 1559, /* GL_T2F_C4F_N3F_V3F */ - 1563, /* GL_T4F_C4F_N3F_V4F */ + 1563, /* GL_T2F_V3F */ + 1565, /* GL_T4F_V4F */ + 1561, /* GL_T2F_C4UB_V3F */ + 1559, /* GL_T2F_C3F_V3F */ + 1562, /* GL_T2F_N3F_V3F */ + 1560, /* GL_T2F_C4F_N3F_V3F */ + 1564, /* GL_T4F_C4F_N3F_V4F */ 139, /* GL_CLIP_PLANE0 */ 140, /* GL_CLIP_PLANE1 */ 141, /* GL_CLIP_PLANE2 */ 142, /* GL_CLIP_PLANE3 */ 143, /* GL_CLIP_PLANE4 */ 144, /* GL_CLIP_PLANE5 */ - 679, /* GL_LIGHT0 */ - 680, /* GL_LIGHT1 */ - 681, /* GL_LIGHT2 */ - 682, /* GL_LIGHT3 */ - 683, /* GL_LIGHT4 */ - 684, /* GL_LIGHT5 */ - 685, /* GL_LIGHT6 */ - 686, /* GL_LIGHT7 */ - 604, /* GL_HINT_BIT */ + 680, /* GL_LIGHT0 */ + 681, /* GL_LIGHT1 */ + 682, /* GL_LIGHT2 */ + 683, /* GL_LIGHT3 */ + 684, /* GL_LIGHT4 */ + 685, /* GL_LIGHT5 */ + 686, /* GL_LIGHT6 */ + 687, /* GL_LIGHT7 */ + 605, /* GL_HINT_BIT */ 277, /* GL_CONSTANT_COLOR */ - 1060, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 1061, /* GL_ONE_MINUS_CONSTANT_COLOR */ 272, /* GL_CONSTANT_ALPHA */ - 1058, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1059, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ 588, /* GL_FUNC_ADD */ - 948, /* GL_MIN */ - 855, /* GL_MAX */ + 949, /* GL_MIN */ + 856, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ 592, /* GL_FUNC_SUBTRACT */ 590, /* GL_FUNC_REVERSE_SUBTRACT */ 280, /* GL_CONVOLUTION_1D */ 281, /* GL_CONVOLUTION_2D */ - 1429, /* GL_SEPARABLE_2D */ + 1430, /* GL_SEPARABLE_2D */ 284, /* GL_CONVOLUTION_BORDER_MODE */ 288, /* GL_CONVOLUTION_FILTER_SCALE */ 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1313, /* GL_REDUCE */ + 1314, /* GL_REDUCE */ 290, /* GL_CONVOLUTION_FORMAT */ 294, /* GL_CONVOLUTION_WIDTH */ 292, /* GL_CONVOLUTION_HEIGHT */ - 871, /* GL_MAX_CONVOLUTION_WIDTH */ - 869, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1218, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1214, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1209, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1205, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1216, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1212, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1207, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1203, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 605, /* GL_HISTOGRAM */ - 1267, /* GL_PROXY_HISTOGRAM */ - 621, /* GL_HISTOGRAM_WIDTH */ - 611, /* GL_HISTOGRAM_FORMAT */ - 617, /* GL_HISTOGRAM_RED_SIZE */ - 613, /* GL_HISTOGRAM_GREEN_SIZE */ - 608, /* GL_HISTOGRAM_BLUE_SIZE */ - 606, /* GL_HISTOGRAM_ALPHA_SIZE */ - 615, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 619, /* GL_HISTOGRAM_SINK */ - 949, /* GL_MINMAX */ - 951, /* GL_MINMAX_FORMAT */ - 953, /* GL_MINMAX_SINK */ - 1565, /* GL_TABLE_TOO_LARGE_EXT */ - 1785, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1797, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1799, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1792, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1787, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1176, /* GL_POLYGON_OFFSET_FILL */ - 1175, /* GL_POLYGON_OFFSET_FACTOR */ - 1174, /* GL_POLYGON_OFFSET_BIAS */ - 1346, /* GL_RESCALE_NORMAL */ + 872, /* GL_MAX_CONVOLUTION_WIDTH */ + 870, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1219, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1215, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1210, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1206, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1217, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1213, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1208, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1204, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 606, /* GL_HISTOGRAM */ + 1268, /* GL_PROXY_HISTOGRAM */ + 622, /* GL_HISTOGRAM_WIDTH */ + 612, /* GL_HISTOGRAM_FORMAT */ + 618, /* GL_HISTOGRAM_RED_SIZE */ + 614, /* GL_HISTOGRAM_GREEN_SIZE */ + 609, /* GL_HISTOGRAM_BLUE_SIZE */ + 607, /* GL_HISTOGRAM_ALPHA_SIZE */ + 616, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 620, /* GL_HISTOGRAM_SINK */ + 950, /* GL_MINMAX */ + 952, /* GL_MINMAX_FORMAT */ + 954, /* GL_MINMAX_SINK */ + 1566, /* GL_TABLE_TOO_LARGE_EXT */ + 1786, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1798, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1800, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1793, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1788, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1177, /* GL_POLYGON_OFFSET_FILL */ + 1176, /* GL_POLYGON_OFFSET_FACTOR */ + 1175, /* GL_POLYGON_OFFSET_BIAS */ + 1347, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 735, /* GL_LUMINANCE4 */ - 741, /* GL_LUMINANCE8 */ - 725, /* GL_LUMINANCE12 */ - 731, /* GL_LUMINANCE16 */ - 736, /* GL_LUMINANCE4_ALPHA4 */ - 739, /* GL_LUMINANCE6_ALPHA2 */ - 742, /* GL_LUMINANCE8_ALPHA8 */ - 728, /* GL_LUMINANCE12_ALPHA4 */ - 726, /* GL_LUMINANCE12_ALPHA12 */ - 732, /* GL_LUMINANCE16_ALPHA16 */ - 646, /* GL_INTENSITY */ - 651, /* GL_INTENSITY4 */ - 653, /* GL_INTENSITY8 */ - 647, /* GL_INTENSITY12 */ - 649, /* GL_INTENSITY16 */ - 1358, /* GL_RGB2_EXT */ - 1359, /* GL_RGB4 */ - 1362, /* GL_RGB5 */ - 1366, /* GL_RGB8 */ - 1350, /* GL_RGB10 */ - 1354, /* GL_RGB12 */ - 1356, /* GL_RGB16 */ - 1373, /* GL_RGBA2 */ - 1375, /* GL_RGBA4 */ - 1363, /* GL_RGB5_A1 */ - 1379, /* GL_RGBA8 */ - 1351, /* GL_RGB10_A2 */ - 1369, /* GL_RGBA12 */ - 1371, /* GL_RGBA16 */ - 1741, /* GL_TEXTURE_RED_SIZE */ - 1711, /* GL_TEXTURE_GREEN_SIZE */ - 1649, /* GL_TEXTURE_BLUE_SIZE */ - 1636, /* GL_TEXTURE_ALPHA_SIZE */ - 1724, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1715, /* GL_TEXTURE_INTENSITY_SIZE */ - 1344, /* GL_REPLACE_EXT */ - 1271, /* GL_PROXY_TEXTURE_1D */ - 1274, /* GL_PROXY_TEXTURE_2D */ - 1748, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1736, /* GL_TEXTURE_PRIORITY */ - 1743, /* GL_TEXTURE_RESIDENT */ - 1639, /* GL_TEXTURE_BINDING_1D */ - 1641, /* GL_TEXTURE_BINDING_2D */ - 1643, /* GL_TEXTURE_BINDING_3D */ - 1096, /* GL_PACK_SKIP_IMAGES */ - 1092, /* GL_PACK_IMAGE_HEIGHT */ - 1778, /* GL_UNPACK_SKIP_IMAGES */ - 1775, /* GL_UNPACK_IMAGE_HEIGHT */ - 1635, /* GL_TEXTURE_3D */ - 1277, /* GL_PROXY_TEXTURE_3D */ - 1698, /* GL_TEXTURE_DEPTH */ - 1751, /* GL_TEXTURE_WRAP_R */ - 856, /* GL_MAX_3D_TEXTURE_SIZE */ - 1812, /* GL_VERTEX_ARRAY */ - 1026, /* GL_NORMAL_ARRAY */ + 736, /* GL_LUMINANCE4 */ + 742, /* GL_LUMINANCE8 */ + 726, /* GL_LUMINANCE12 */ + 732, /* GL_LUMINANCE16 */ + 737, /* GL_LUMINANCE4_ALPHA4 */ + 740, /* GL_LUMINANCE6_ALPHA2 */ + 743, /* GL_LUMINANCE8_ALPHA8 */ + 729, /* GL_LUMINANCE12_ALPHA4 */ + 727, /* GL_LUMINANCE12_ALPHA12 */ + 733, /* GL_LUMINANCE16_ALPHA16 */ + 647, /* GL_INTENSITY */ + 652, /* GL_INTENSITY4 */ + 654, /* GL_INTENSITY8 */ + 648, /* GL_INTENSITY12 */ + 650, /* GL_INTENSITY16 */ + 1359, /* GL_RGB2_EXT */ + 1360, /* GL_RGB4 */ + 1363, /* GL_RGB5 */ + 1367, /* GL_RGB8 */ + 1351, /* GL_RGB10 */ + 1355, /* GL_RGB12 */ + 1357, /* GL_RGB16 */ + 1374, /* GL_RGBA2 */ + 1376, /* GL_RGBA4 */ + 1364, /* GL_RGB5_A1 */ + 1380, /* GL_RGBA8 */ + 1352, /* GL_RGB10_A2 */ + 1370, /* GL_RGBA12 */ + 1372, /* GL_RGBA16 */ + 1742, /* GL_TEXTURE_RED_SIZE */ + 1712, /* GL_TEXTURE_GREEN_SIZE */ + 1650, /* GL_TEXTURE_BLUE_SIZE */ + 1637, /* GL_TEXTURE_ALPHA_SIZE */ + 1725, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1716, /* GL_TEXTURE_INTENSITY_SIZE */ + 1345, /* GL_REPLACE_EXT */ + 1272, /* GL_PROXY_TEXTURE_1D */ + 1275, /* GL_PROXY_TEXTURE_2D */ + 1749, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1737, /* GL_TEXTURE_PRIORITY */ + 1744, /* GL_TEXTURE_RESIDENT */ + 1640, /* GL_TEXTURE_BINDING_1D */ + 1642, /* GL_TEXTURE_BINDING_2D */ + 1644, /* GL_TEXTURE_BINDING_3D */ + 1097, /* GL_PACK_SKIP_IMAGES */ + 1093, /* GL_PACK_IMAGE_HEIGHT */ + 1779, /* GL_UNPACK_SKIP_IMAGES */ + 1776, /* GL_UNPACK_IMAGE_HEIGHT */ + 1636, /* GL_TEXTURE_3D */ + 1278, /* GL_PROXY_TEXTURE_3D */ + 1699, /* GL_TEXTURE_DEPTH */ + 1752, /* GL_TEXTURE_WRAP_R */ + 857, /* GL_MAX_3D_TEXTURE_SIZE */ + 1813, /* GL_VERTEX_ARRAY */ + 1027, /* GL_NORMAL_ARRAY */ 148, /* GL_COLOR_ARRAY */ - 631, /* GL_INDEX_ARRAY */ - 1676, /* GL_TEXTURE_COORD_ARRAY */ + 632, /* GL_INDEX_ARRAY */ + 1677, /* GL_TEXTURE_COORD_ARRAY */ 459, /* GL_EDGE_FLAG_ARRAY */ - 1818, /* GL_VERTEX_ARRAY_SIZE */ - 1820, /* GL_VERTEX_ARRAY_TYPE */ - 1819, /* GL_VERTEX_ARRAY_STRIDE */ - 1031, /* GL_NORMAL_ARRAY_TYPE */ - 1030, /* GL_NORMAL_ARRAY_STRIDE */ + 1819, /* GL_VERTEX_ARRAY_SIZE */ + 1821, /* GL_VERTEX_ARRAY_TYPE */ + 1820, /* GL_VERTEX_ARRAY_STRIDE */ + 1032, /* GL_NORMAL_ARRAY_TYPE */ + 1031, /* GL_NORMAL_ARRAY_STRIDE */ 152, /* GL_COLOR_ARRAY_SIZE */ 154, /* GL_COLOR_ARRAY_TYPE */ 153, /* GL_COLOR_ARRAY_STRIDE */ - 636, /* GL_INDEX_ARRAY_TYPE */ - 635, /* GL_INDEX_ARRAY_STRIDE */ - 1680, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1682, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1681, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 637, /* GL_INDEX_ARRAY_TYPE */ + 636, /* GL_INDEX_ARRAY_STRIDE */ + 1681, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1683, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1682, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ 463, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1817, /* GL_VERTEX_ARRAY_POINTER */ - 1029, /* GL_NORMAL_ARRAY_POINTER */ + 1818, /* GL_VERTEX_ARRAY_POINTER */ + 1030, /* GL_NORMAL_ARRAY_POINTER */ 151, /* GL_COLOR_ARRAY_POINTER */ - 634, /* GL_INDEX_ARRAY_POINTER */ - 1679, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 635, /* GL_INDEX_ARRAY_POINTER */ + 1680, /* GL_TEXTURE_COORD_ARRAY_POINTER */ 462, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 1005, /* GL_MULTISAMPLE */ - 1403, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1405, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1410, /* GL_SAMPLE_COVERAGE */ - 1407, /* GL_SAMPLE_BUFFERS */ - 1398, /* GL_SAMPLES */ - 1414, /* GL_SAMPLE_COVERAGE_VALUE */ - 1412, /* GL_SAMPLE_COVERAGE_INVERT */ + 1006, /* GL_MULTISAMPLE */ + 1404, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1406, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1411, /* GL_SAMPLE_COVERAGE */ + 1408, /* GL_SAMPLE_BUFFERS */ + 1399, /* GL_SAMPLES */ + 1415, /* GL_SAMPLE_COVERAGE_VALUE */ + 1413, /* GL_SAMPLE_COVERAGE_INVERT */ 195, /* GL_COLOR_MATRIX */ 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 865, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1201, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1197, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1192, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1188, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1199, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1195, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1190, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1186, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1659, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1278, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1661, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 866, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1202, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1198, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1193, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1189, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1200, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1196, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1191, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1187, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1660, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1279, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1662, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ 201, /* GL_COLOR_TABLE */ - 1211, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1194, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1266, /* GL_PROXY_COLOR_TABLE */ - 1270, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1269, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1212, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1195, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1267, /* GL_PROXY_COLOR_TABLE */ + 1271, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1270, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 225, /* GL_COLOR_TABLE_SCALE */ 205, /* GL_COLOR_TABLE_BIAS */ 210, /* GL_COLOR_TABLE_FORMAT */ @@ -4423,62 +4426,62 @@ static const unsigned reduced_enums[1350] = 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 879, /* GL_MAX_ELEMENTS_VERTICES */ - 878, /* GL_MAX_ELEMENTS_INDICES */ - 1714, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 880, /* GL_MAX_ELEMENTS_VERTICES */ + 879, /* GL_MAX_ELEMENTS_INDICES */ + 1715, /* GL_TEXTURE_INDEX_SIZE_EXT */ 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1158, /* GL_POINT_SIZE_MIN */ - 1154, /* GL_POINT_SIZE_MAX */ - 1148, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1144, /* GL_POINT_DISTANCE_ATTENUATION */ + 1159, /* GL_POINT_SIZE_MIN */ + 1155, /* GL_POINT_SIZE_MAX */ + 1149, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1145, /* GL_POINT_DISTANCE_ATTENUATION */ 127, /* GL_CLAMP_TO_BORDER */ 130, /* GL_CLAMP_TO_EDGE */ - 1735, /* GL_TEXTURE_MIN_LOD */ - 1733, /* GL_TEXTURE_MAX_LOD */ - 1638, /* GL_TEXTURE_BASE_LEVEL */ - 1732, /* GL_TEXTURE_MAX_LEVEL */ - 624, /* GL_IGNORE_BORDER_HP */ + 1736, /* GL_TEXTURE_MIN_LOD */ + 1734, /* GL_TEXTURE_MAX_LOD */ + 1639, /* GL_TEXTURE_BASE_LEVEL */ + 1733, /* GL_TEXTURE_MAX_LEVEL */ + 625, /* GL_IGNORE_BORDER_HP */ 276, /* GL_CONSTANT_BORDER_HP */ - 1345, /* GL_REPLICATE_BORDER_HP */ + 1346, /* GL_REPLICATE_BORDER_HP */ 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1055, /* GL_OCCLUSION_TEST_HP */ - 1056, /* GL_OCCLUSION_TEST_RESULT_HP */ - 697, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1653, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1655, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1657, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1658, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1656, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1654, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 860, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 861, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1221, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1223, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1220, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1222, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1722, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1723, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1721, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 1056, /* GL_OCCLUSION_TEST_HP */ + 1057, /* GL_OCCLUSION_TEST_RESULT_HP */ + 698, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1654, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1656, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1658, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1659, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1657, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1655, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 861, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 862, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1222, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1224, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1221, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1223, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1723, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1724, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1722, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ 594, /* GL_GENERATE_MIPMAP */ 595, /* GL_GENERATE_MIPMAP_HINT */ 532, /* GL_FOG_OFFSET_SGIX */ 533, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1667, /* GL_TEXTURE_COMPARE_SGIX */ - 1666, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1718, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1710, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 1668, /* GL_TEXTURE_COMPARE_SGIX */ + 1667, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1719, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1711, /* GL_TEXTURE_GEQUAL_R_SGIX */ 360, /* GL_DEPTH_COMPONENT16 */ 363, /* GL_DEPTH_COMPONENT24 */ 366, /* GL_DEPTH_COMPONENT32 */ 306, /* GL_CULL_VERTEX_EXT */ 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1875, /* GL_WRAP_BORDER_SUN */ - 1660, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 690, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1444, /* GL_SINGLE_COLOR */ - 1430, /* GL_SEPARATE_SPECULAR_COLOR */ - 1439, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 1876, /* GL_WRAP_BORDER_SUN */ + 1661, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 691, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1445, /* GL_SINGLE_COLOR */ + 1431, /* GL_SEPARATE_SPECULAR_COLOR */ + 1440, /* GL_SHARED_TEXTURE_PALETTE_EXT */ 543, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ 544, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ 551, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ @@ -4490,31 +4493,31 @@ static const unsigned reduced_enums[1350] = 564, /* GL_FRAMEBUFFER_DEFAULT */ 580, /* GL_FRAMEBUFFER_UNDEFINED */ 373, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 630, /* GL_INDEX */ - 1784, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1800, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1801, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1798, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1796, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1793, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1791, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1730, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1731, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1729, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 956, /* GL_MIRRORED_REPEAT */ - 1386, /* GL_RGB_S3TC */ - 1361, /* GL_RGB4_S3TC */ - 1384, /* GL_RGBA_S3TC */ - 1378, /* GL_RGBA4_S3TC */ - 1382, /* GL_RGBA_DXT5_S3TC */ - 1376, /* GL_RGBA4_DXT5_S3TC */ + 631, /* GL_INDEX */ + 1785, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1801, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1802, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1799, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1797, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1794, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1792, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1731, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1732, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1730, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 957, /* GL_MIRRORED_REPEAT */ + 1387, /* GL_RGB_S3TC */ + 1362, /* GL_RGB4_S3TC */ + 1385, /* GL_RGBA_S3TC */ + 1379, /* GL_RGBA4_S3TC */ + 1383, /* GL_RGBA_DXT5_S3TC */ + 1377, /* GL_RGBA4_DXT5_S3TC */ 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1017, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1016, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 698, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 1018, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1017, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 699, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ 519, /* GL_FOG_COORDINATE_SOURCE */ 511, /* GL_FOG_COORD */ 535, /* GL_FRAGMENT_DEPTH */ @@ -4525,278 +4528,278 @@ static const unsigned reduced_enums[1350] = 513, /* GL_FOG_COORDINATE_ARRAY */ 199, /* GL_COLOR_SUM */ 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1423, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1425, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1424, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1422, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1419, /* GL_SECONDARY_COLOR_ARRAY */ + 1424, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1426, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1425, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1423, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1420, /* GL_SECONDARY_COLOR_ARRAY */ 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1567, /* GL_TEXTURE0 */ - 1569, /* GL_TEXTURE1 */ - 1591, /* GL_TEXTURE2 */ - 1613, /* GL_TEXTURE3 */ - 1619, /* GL_TEXTURE4 */ - 1621, /* GL_TEXTURE5 */ - 1623, /* GL_TEXTURE6 */ - 1625, /* GL_TEXTURE7 */ - 1627, /* GL_TEXTURE8 */ - 1629, /* GL_TEXTURE9 */ - 1570, /* GL_TEXTURE10 */ - 1572, /* GL_TEXTURE11 */ - 1574, /* GL_TEXTURE12 */ - 1576, /* GL_TEXTURE13 */ - 1578, /* GL_TEXTURE14 */ - 1580, /* GL_TEXTURE15 */ - 1582, /* GL_TEXTURE16 */ - 1584, /* GL_TEXTURE17 */ - 1586, /* GL_TEXTURE18 */ - 1588, /* GL_TEXTURE19 */ - 1592, /* GL_TEXTURE20 */ - 1594, /* GL_TEXTURE21 */ - 1596, /* GL_TEXTURE22 */ - 1598, /* GL_TEXTURE23 */ - 1600, /* GL_TEXTURE24 */ - 1602, /* GL_TEXTURE25 */ - 1604, /* GL_TEXTURE26 */ - 1606, /* GL_TEXTURE27 */ - 1608, /* GL_TEXTURE28 */ - 1610, /* GL_TEXTURE29 */ - 1614, /* GL_TEXTURE30 */ - 1616, /* GL_TEXTURE31 */ + 1568, /* GL_TEXTURE0 */ + 1570, /* GL_TEXTURE1 */ + 1592, /* GL_TEXTURE2 */ + 1614, /* GL_TEXTURE3 */ + 1620, /* GL_TEXTURE4 */ + 1622, /* GL_TEXTURE5 */ + 1624, /* GL_TEXTURE6 */ + 1626, /* GL_TEXTURE7 */ + 1628, /* GL_TEXTURE8 */ + 1630, /* GL_TEXTURE9 */ + 1571, /* GL_TEXTURE10 */ + 1573, /* GL_TEXTURE11 */ + 1575, /* GL_TEXTURE12 */ + 1577, /* GL_TEXTURE13 */ + 1579, /* GL_TEXTURE14 */ + 1581, /* GL_TEXTURE15 */ + 1583, /* GL_TEXTURE16 */ + 1585, /* GL_TEXTURE17 */ + 1587, /* GL_TEXTURE18 */ + 1589, /* GL_TEXTURE19 */ + 1593, /* GL_TEXTURE20 */ + 1595, /* GL_TEXTURE21 */ + 1597, /* GL_TEXTURE22 */ + 1599, /* GL_TEXTURE23 */ + 1601, /* GL_TEXTURE24 */ + 1603, /* GL_TEXTURE25 */ + 1605, /* GL_TEXTURE26 */ + 1607, /* GL_TEXTURE27 */ + 1609, /* GL_TEXTURE28 */ + 1611, /* GL_TEXTURE29 */ + 1615, /* GL_TEXTURE30 */ + 1617, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 934, /* GL_MAX_TEXTURE_UNITS */ - 1762, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1765, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1767, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1759, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1549, /* GL_SUBTRACT */ - 919, /* GL_MAX_RENDERBUFFER_SIZE */ + 935, /* GL_MAX_TEXTURE_UNITS */ + 1763, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1766, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1768, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1760, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1550, /* GL_SUBTRACT */ + 920, /* GL_MAX_RENDERBUFFER_SIZE */ 247, /* GL_COMPRESSED_ALPHA */ 251, /* GL_COMPRESSED_LUMINANCE */ 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 249, /* GL_COMPRESSED_INTENSITY */ 255, /* GL_COMPRESSED_RGB */ 256, /* GL_COMPRESSED_RGBA */ - 1674, /* GL_TEXTURE_COMPRESSION_HINT */ - 1739, /* GL_TEXTURE_RECTANGLE_ARB */ - 1646, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1281, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 917, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 1675, /* GL_TEXTURE_COMPRESSION_HINT */ + 1740, /* GL_TEXTURE_RECTANGLE_ARB */ + 1647, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1282, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 918, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ 372, /* GL_DEPTH_STENCIL */ - 1788, /* GL_UNSIGNED_INT_24_8 */ - 930, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1728, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 931, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1704, /* GL_TEXTURE_FILTER_CONTROL */ - 1719, /* GL_TEXTURE_LOD_BIAS */ + 1789, /* GL_UNSIGNED_INT_24_8 */ + 931, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1729, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 932, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1705, /* GL_TEXTURE_FILTER_CONTROL */ + 1720, /* GL_TEXTURE_LOD_BIAS */ 232, /* GL_COMBINE4 */ - 924, /* GL_MAX_SHININESS_NV */ - 925, /* GL_MAX_SPOT_EXPONENT_NV */ - 628, /* GL_INCR_WRAP */ + 925, /* GL_MAX_SHININESS_NV */ + 926, /* GL_MAX_SPOT_EXPONENT_NV */ + 629, /* GL_INCR_WRAP */ 343, /* GL_DECR_WRAP */ - 976, /* GL_MODELVIEW1_ARB */ - 1032, /* GL_NORMAL_MAP */ - 1318, /* GL_REFLECTION_MAP */ - 1683, /* GL_TEXTURE_CUBE_MAP */ - 1644, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1691, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1685, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1693, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1687, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1695, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1689, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1279, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 873, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 1011, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 977, /* GL_MODELVIEW1_ARB */ + 1033, /* GL_NORMAL_MAP */ + 1319, /* GL_REFLECTION_MAP */ + 1684, /* GL_TEXTURE_CUBE_MAP */ + 1645, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1692, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1686, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1694, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1688, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1696, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1690, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1280, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 874, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1012, /* GL_MULTISAMPLE_FILTER_HINT_NV */ 527, /* GL_FOG_DISTANCE_MODE_NV */ 478, /* GL_EYE_RADIAL_NV */ 477, /* GL_EYE_PLANE_ABSOLUTE_NV */ 231, /* GL_COMBINE */ 238, /* GL_COMBINE_RGB */ 233, /* GL_COMBINE_ALPHA */ - 1387, /* GL_RGB_SCALE */ + 1388, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 656, /* GL_INTERPOLATE */ + 657, /* GL_INTERPOLATE */ 271, /* GL_CONSTANT */ - 1227, /* GL_PRIMARY_COLOR */ - 1224, /* GL_PREVIOUS */ - 1459, /* GL_SOURCE0_RGB */ - 1465, /* GL_SOURCE1_RGB */ - 1471, /* GL_SOURCE2_RGB */ - 1475, /* GL_SOURCE3_RGB_NV */ - 1456, /* GL_SOURCE0_ALPHA */ - 1462, /* GL_SOURCE1_ALPHA */ - 1468, /* GL_SOURCE2_ALPHA */ - 1474, /* GL_SOURCE3_ALPHA_NV */ - 1069, /* GL_OPERAND0_RGB */ - 1075, /* GL_OPERAND1_RGB */ - 1081, /* GL_OPERAND2_RGB */ - 1085, /* GL_OPERAND3_RGB_NV */ - 1066, /* GL_OPERAND0_ALPHA */ - 1072, /* GL_OPERAND1_ALPHA */ - 1078, /* GL_OPERAND2_ALPHA */ - 1084, /* GL_OPERAND3_ALPHA_NV */ - 1813, /* GL_VERTEX_ARRAY_BINDING */ - 1737, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1738, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1879, /* GL_YCBCR_422_APPLE */ - 1802, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1804, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1747, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1540, /* GL_STORAGE_PRIVATE_APPLE */ - 1539, /* GL_STORAGE_CACHED_APPLE */ - 1541, /* GL_STORAGE_SHARED_APPLE */ - 1446, /* GL_SLICE_ACCUM_SUN */ - 1288, /* GL_QUAD_MESH_SUN */ - 1771, /* GL_TRIANGLE_MESH_SUN */ - 1852, /* GL_VERTEX_PROGRAM_ARB */ - 1863, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1839, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1845, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1847, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1849, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 1228, /* GL_PRIMARY_COLOR */ + 1225, /* GL_PREVIOUS */ + 1460, /* GL_SOURCE0_RGB */ + 1466, /* GL_SOURCE1_RGB */ + 1472, /* GL_SOURCE2_RGB */ + 1476, /* GL_SOURCE3_RGB_NV */ + 1457, /* GL_SOURCE0_ALPHA */ + 1463, /* GL_SOURCE1_ALPHA */ + 1469, /* GL_SOURCE2_ALPHA */ + 1475, /* GL_SOURCE3_ALPHA_NV */ + 1070, /* GL_OPERAND0_RGB */ + 1076, /* GL_OPERAND1_RGB */ + 1082, /* GL_OPERAND2_RGB */ + 1086, /* GL_OPERAND3_RGB_NV */ + 1067, /* GL_OPERAND0_ALPHA */ + 1073, /* GL_OPERAND1_ALPHA */ + 1079, /* GL_OPERAND2_ALPHA */ + 1085, /* GL_OPERAND3_ALPHA_NV */ + 1814, /* GL_VERTEX_ARRAY_BINDING */ + 1738, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1739, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1880, /* GL_YCBCR_422_APPLE */ + 1803, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1805, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1748, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1541, /* GL_STORAGE_PRIVATE_APPLE */ + 1540, /* GL_STORAGE_CACHED_APPLE */ + 1542, /* GL_STORAGE_SHARED_APPLE */ + 1447, /* GL_SLICE_ACCUM_SUN */ + 1289, /* GL_QUAD_MESH_SUN */ + 1772, /* GL_TRIANGLE_MESH_SUN */ + 1853, /* GL_VERTEX_PROGRAM_ARB */ + 1864, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1840, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1846, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1848, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1850, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1240, /* GL_PROGRAM_LENGTH_ARB */ - 1254, /* GL_PROGRAM_STRING_ARB */ - 998, /* GL_MODELVIEW_PROJECTION_NV */ - 623, /* GL_IDENTITY_NV */ - 670, /* GL_INVERSE_NV */ - 1764, /* GL_TRANSPOSE_NV */ - 671, /* GL_INVERSE_TRANSPOSE_NV */ - 903, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 902, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 809, /* GL_MATRIX0_NV */ - 821, /* GL_MATRIX1_NV */ - 833, /* GL_MATRIX2_NV */ - 837, /* GL_MATRIX3_NV */ - 839, /* GL_MATRIX4_NV */ - 841, /* GL_MATRIX5_NV */ - 843, /* GL_MATRIX6_NV */ - 845, /* GL_MATRIX7_NV */ + 1241, /* GL_PROGRAM_LENGTH_ARB */ + 1255, /* GL_PROGRAM_STRING_ARB */ + 999, /* GL_MODELVIEW_PROJECTION_NV */ + 624, /* GL_IDENTITY_NV */ + 671, /* GL_INVERSE_NV */ + 1765, /* GL_TRANSPOSE_NV */ + 672, /* GL_INVERSE_TRANSPOSE_NV */ + 904, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 903, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 810, /* GL_MATRIX0_NV */ + 822, /* GL_MATRIX1_NV */ + 834, /* GL_MATRIX2_NV */ + 838, /* GL_MATRIX3_NV */ + 840, /* GL_MATRIX4_NV */ + 842, /* GL_MATRIX5_NV */ + 844, /* GL_MATRIX6_NV */ + 846, /* GL_MATRIX7_NV */ 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 315, /* GL_CURRENT_MATRIX_ARB */ - 1855, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1858, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1252, /* GL_PROGRAM_PARAMETER_NV */ - 1843, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1256, /* GL_PROGRAM_TARGET_NV */ - 1253, /* GL_PROGRAM_RESIDENT_NV */ - 1756, /* GL_TRACK_MATRIX_NV */ - 1757, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1853, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1234, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 1856, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1859, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1253, /* GL_PROGRAM_PARAMETER_NV */ + 1844, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1257, /* GL_PROGRAM_TARGET_NV */ + 1254, /* GL_PROGRAM_RESIDENT_NV */ + 1757, /* GL_TRACK_MATRIX_NV */ + 1758, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1854, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1235, /* GL_PROGRAM_ERROR_POSITION_ARB */ 356, /* GL_DEPTH_CLAMP */ - 1821, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1828, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1829, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1830, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1831, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1832, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1833, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1834, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1835, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1836, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1822, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1823, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1824, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1825, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1826, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1827, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 764, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 765, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 766, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 767, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 768, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 769, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 770, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 771, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 772, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 763, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 791, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 792, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 793, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 794, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 795, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 796, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1233, /* GL_PROGRAM_BINDING_ARB */ - 798, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 799, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 787, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 788, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 790, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1672, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1669, /* GL_TEXTURE_COMPRESSED */ - 1037, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1822, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1829, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1830, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1831, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1832, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1833, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1834, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1835, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1836, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1837, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1823, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1824, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1825, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1826, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1828, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 766, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 767, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 768, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 769, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 770, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 771, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 772, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 773, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 793, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 794, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 795, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 796, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 797, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1234, /* GL_PROGRAM_BINDING_ARB */ + 799, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 800, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 790, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 791, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1673, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1670, /* GL_TEXTURE_COMPRESSED */ + 1038, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 946, /* GL_MAX_VERTEX_UNITS_ARB */ + 947, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1874, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1851, /* GL_VERTEX_BLEND_ARB */ + 1875, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1852, /* GL_VERTEX_BLEND_ARB */ 336, /* GL_CURRENT_WEIGHT_ARB */ - 1873, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1872, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1871, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1870, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1867, /* GL_WEIGHT_ARRAY_ARB */ + 1874, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1873, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1872, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1871, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1868, /* GL_WEIGHT_ARRAY_ARB */ 386, /* GL_DOT3_RGB */ 387, /* GL_DOT3_RGBA */ 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 1006, /* GL_MULTISAMPLE_3DFX */ - 1408, /* GL_SAMPLE_BUFFERS_3DFX */ - 1399, /* GL_SAMPLES_3DFX */ - 987, /* GL_MODELVIEW2_ARB */ - 990, /* GL_MODELVIEW3_ARB */ - 991, /* GL_MODELVIEW4_ARB */ - 992, /* GL_MODELVIEW5_ARB */ - 993, /* GL_MODELVIEW6_ARB */ - 994, /* GL_MODELVIEW7_ARB */ - 995, /* GL_MODELVIEW8_ARB */ - 996, /* GL_MODELVIEW9_ARB */ - 966, /* GL_MODELVIEW10_ARB */ - 967, /* GL_MODELVIEW11_ARB */ - 968, /* GL_MODELVIEW12_ARB */ - 969, /* GL_MODELVIEW13_ARB */ - 970, /* GL_MODELVIEW14_ARB */ - 971, /* GL_MODELVIEW15_ARB */ - 972, /* GL_MODELVIEW16_ARB */ - 973, /* GL_MODELVIEW17_ARB */ - 974, /* GL_MODELVIEW18_ARB */ - 975, /* GL_MODELVIEW19_ARB */ - 977, /* GL_MODELVIEW20_ARB */ - 978, /* GL_MODELVIEW21_ARB */ - 979, /* GL_MODELVIEW22_ARB */ - 980, /* GL_MODELVIEW23_ARB */ - 981, /* GL_MODELVIEW24_ARB */ - 982, /* GL_MODELVIEW25_ARB */ - 983, /* GL_MODELVIEW26_ARB */ - 984, /* GL_MODELVIEW27_ARB */ - 985, /* GL_MODELVIEW28_ARB */ - 986, /* GL_MODELVIEW29_ARB */ - 988, /* GL_MODELVIEW30_ARB */ - 989, /* GL_MODELVIEW31_ARB */ + 1007, /* GL_MULTISAMPLE_3DFX */ + 1409, /* GL_SAMPLE_BUFFERS_3DFX */ + 1400, /* GL_SAMPLES_3DFX */ + 988, /* GL_MODELVIEW2_ARB */ + 991, /* GL_MODELVIEW3_ARB */ + 992, /* GL_MODELVIEW4_ARB */ + 993, /* GL_MODELVIEW5_ARB */ + 994, /* GL_MODELVIEW6_ARB */ + 995, /* GL_MODELVIEW7_ARB */ + 996, /* GL_MODELVIEW8_ARB */ + 997, /* GL_MODELVIEW9_ARB */ + 967, /* GL_MODELVIEW10_ARB */ + 968, /* GL_MODELVIEW11_ARB */ + 969, /* GL_MODELVIEW12_ARB */ + 970, /* GL_MODELVIEW13_ARB */ + 971, /* GL_MODELVIEW14_ARB */ + 972, /* GL_MODELVIEW15_ARB */ + 973, /* GL_MODELVIEW16_ARB */ + 974, /* GL_MODELVIEW17_ARB */ + 975, /* GL_MODELVIEW18_ARB */ + 976, /* GL_MODELVIEW19_ARB */ + 978, /* GL_MODELVIEW20_ARB */ + 979, /* GL_MODELVIEW21_ARB */ + 980, /* GL_MODELVIEW22_ARB */ + 981, /* GL_MODELVIEW23_ARB */ + 982, /* GL_MODELVIEW24_ARB */ + 983, /* GL_MODELVIEW25_ARB */ + 984, /* GL_MODELVIEW26_ARB */ + 985, /* GL_MODELVIEW27_ARB */ + 986, /* GL_MODELVIEW28_ARB */ + 987, /* GL_MODELVIEW29_ARB */ + 989, /* GL_MODELVIEW30_ARB */ + 990, /* GL_MODELVIEW31_ARB */ 391, /* GL_DOT3_RGB_EXT */ 389, /* GL_DOT3_RGBA_EXT */ - 960, /* GL_MIRROR_CLAMP_EXT */ - 963, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 1001, /* GL_MODULATE_ADD_ATI */ - 1002, /* GL_MODULATE_SIGNED_ADD_ATI */ - 1003, /* GL_MODULATE_SUBTRACT_ATI */ - 1880, /* GL_YCBCR_MESA */ - 1093, /* GL_PACK_INVERT_MESA */ + 961, /* GL_MIRROR_CLAMP_EXT */ + 964, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 1002, /* GL_MODULATE_ADD_ATI */ + 1003, /* GL_MODULATE_SIGNED_ADD_ATI */ + 1004, /* GL_MODULATE_SUBTRACT_ATI */ + 1881, /* GL_YCBCR_MESA */ + 1094, /* GL_PACK_INVERT_MESA */ 339, /* GL_DEBUG_OBJECT_MESA */ 340, /* GL_DEBUG_PRINT_MESA */ 338, /* GL_DEBUG_ASSERT_MESA */ @@ -4810,24 +4813,24 @@ static const unsigned reduced_enums[1350] = 450, /* GL_DU8DV8_ATI */ 114, /* GL_BUMP_ENVMAP_ATI */ 118, /* GL_BUMP_TARGET_ATI */ - 1507, /* GL_STENCIL_BACK_FUNC */ - 1505, /* GL_STENCIL_BACK_FAIL */ - 1509, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1511, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 1508, /* GL_STENCIL_BACK_FUNC */ + 1506, /* GL_STENCIL_BACK_FAIL */ + 1510, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1512, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ 536, /* GL_FRAGMENT_PROGRAM_ARB */ - 1231, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1259, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1258, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1243, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1249, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1248, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 892, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 915, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 914, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 905, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 911, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 910, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 875, /* GL_MAX_DRAW_BUFFERS */ + 1232, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1260, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1259, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1244, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1250, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1249, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 893, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 916, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 915, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 906, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 912, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 911, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 876, /* GL_MAX_DRAW_BUFFERS */ 395, /* GL_DRAW_BUFFER0 */ 398, /* GL_DRAW_BUFFER1 */ 419, /* GL_DRAW_BUFFER2 */ @@ -4845,161 +4848,161 @@ static const unsigned reduced_enums[1350] = 411, /* GL_DRAW_BUFFER14 */ 414, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 854, /* GL_MATRIX_PALETTE_ARB */ - 886, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 889, /* GL_MAX_PALETTE_MATRICES_ARB */ + 855, /* GL_MATRIX_PALETTE_ARB */ + 887, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 890, /* GL_MAX_PALETTE_MATRICES_ARB */ 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 848, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 849, /* GL_MATRIX_INDEX_ARRAY_ARB */ 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 850, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 852, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 851, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 849, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1699, /* GL_TEXTURE_DEPTH_SIZE */ + 851, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 853, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 852, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 850, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1700, /* GL_TEXTURE_DEPTH_SIZE */ 379, /* GL_DEPTH_TEXTURE_MODE */ - 1664, /* GL_TEXTURE_COMPARE_MODE */ - 1662, /* GL_TEXTURE_COMPARE_FUNC */ + 1665, /* GL_TEXTURE_COMPARE_MODE */ + 1663, /* GL_TEXTURE_COMPARE_FUNC */ 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1165, /* GL_POINT_SPRITE */ + 1166, /* GL_POINT_SPRITE */ 296, /* GL_COORD_REPLACE */ - 1169, /* GL_POINT_SPRITE_R_MODE_NV */ - 1292, /* GL_QUERY_COUNTER_BITS */ + 1170, /* GL_POINT_SPRITE_R_MODE_NV */ + 1293, /* GL_QUERY_COUNTER_BITS */ 323, /* GL_CURRENT_QUERY */ - 1295, /* GL_QUERY_RESULT */ - 1297, /* GL_QUERY_RESULT_AVAILABLE */ - 940, /* GL_MAX_VERTEX_ATTRIBS */ - 1841, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 1296, /* GL_QUERY_RESULT */ + 1298, /* GL_QUERY_RESULT_AVAILABLE */ + 941, /* GL_MAX_VERTEX_ATTRIBS */ + 1842, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ 377, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 376, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 926, /* GL_MAX_TEXTURE_COORDS */ - 928, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1236, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1238, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1237, /* GL_PROGRAM_FORMAT_ARB */ - 1749, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 927, /* GL_MAX_TEXTURE_COORDS */ + 929, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1237, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1239, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1238, /* GL_PROGRAM_FORMAT_ARB */ + 1750, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ 354, /* GL_DEPTH_BOUNDS_TEST_EXT */ 353, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ 464, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ 465, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1815, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1027, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 1816, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1028, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 632, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1677, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 633, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1678, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ 460, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1420, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 1421, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ 514, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1868, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1837, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1239, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 898, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1245, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 907, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1257, /* GL_PROGRAM_TEMPORARIES_ARB */ - 913, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1247, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 909, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1251, /* GL_PROGRAM_PARAMETERS_ARB */ - 912, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1246, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 908, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1232, /* GL_PROGRAM_ATTRIBS_ARB */ - 893, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1244, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 906, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1230, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 891, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1242, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 904, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 899, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 895, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1260, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1761, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1308, /* GL_READ_ONLY */ - 1876, /* GL_WRITE_ONLY */ - 1310, /* GL_READ_WRITE */ + 1869, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1838, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1240, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 899, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1246, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 908, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1258, /* GL_PROGRAM_TEMPORARIES_ARB */ + 914, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1248, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 910, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1252, /* GL_PROGRAM_PARAMETERS_ARB */ + 913, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1247, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 909, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1233, /* GL_PROGRAM_ATTRIBS_ARB */ + 894, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1245, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 907, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1231, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 892, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1243, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 905, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 900, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 896, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1261, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1762, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1309, /* GL_READ_ONLY */ + 1877, /* GL_WRITE_ONLY */ + 1311, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1755, /* GL_TIME_ELAPSED_EXT */ - 808, /* GL_MATRIX0_ARB */ - 820, /* GL_MATRIX1_ARB */ - 832, /* GL_MATRIX2_ARB */ - 836, /* GL_MATRIX3_ARB */ - 838, /* GL_MATRIX4_ARB */ - 840, /* GL_MATRIX5_ARB */ - 842, /* GL_MATRIX6_ARB */ - 844, /* GL_MATRIX7_ARB */ - 846, /* GL_MATRIX8_ARB */ - 847, /* GL_MATRIX9_ARB */ - 810, /* GL_MATRIX10_ARB */ - 811, /* GL_MATRIX11_ARB */ - 812, /* GL_MATRIX12_ARB */ - 813, /* GL_MATRIX13_ARB */ - 814, /* GL_MATRIX14_ARB */ - 815, /* GL_MATRIX15_ARB */ - 816, /* GL_MATRIX16_ARB */ - 817, /* GL_MATRIX17_ARB */ - 818, /* GL_MATRIX18_ARB */ - 819, /* GL_MATRIX19_ARB */ - 822, /* GL_MATRIX20_ARB */ - 823, /* GL_MATRIX21_ARB */ - 824, /* GL_MATRIX22_ARB */ - 825, /* GL_MATRIX23_ARB */ - 826, /* GL_MATRIX24_ARB */ - 827, /* GL_MATRIX25_ARB */ - 828, /* GL_MATRIX26_ARB */ - 829, /* GL_MATRIX27_ARB */ - 830, /* GL_MATRIX28_ARB */ - 831, /* GL_MATRIX29_ARB */ - 834, /* GL_MATRIX30_ARB */ - 835, /* GL_MATRIX31_ARB */ - 1544, /* GL_STREAM_DRAW */ - 1546, /* GL_STREAM_READ */ - 1542, /* GL_STREAM_COPY */ - 1498, /* GL_STATIC_DRAW */ - 1500, /* GL_STATIC_READ */ - 1496, /* GL_STATIC_COPY */ + 1756, /* GL_TIME_ELAPSED_EXT */ + 809, /* GL_MATRIX0_ARB */ + 821, /* GL_MATRIX1_ARB */ + 833, /* GL_MATRIX2_ARB */ + 837, /* GL_MATRIX3_ARB */ + 839, /* GL_MATRIX4_ARB */ + 841, /* GL_MATRIX5_ARB */ + 843, /* GL_MATRIX6_ARB */ + 845, /* GL_MATRIX7_ARB */ + 847, /* GL_MATRIX8_ARB */ + 848, /* GL_MATRIX9_ARB */ + 811, /* GL_MATRIX10_ARB */ + 812, /* GL_MATRIX11_ARB */ + 813, /* GL_MATRIX12_ARB */ + 814, /* GL_MATRIX13_ARB */ + 815, /* GL_MATRIX14_ARB */ + 816, /* GL_MATRIX15_ARB */ + 817, /* GL_MATRIX16_ARB */ + 818, /* GL_MATRIX17_ARB */ + 819, /* GL_MATRIX18_ARB */ + 820, /* GL_MATRIX19_ARB */ + 823, /* GL_MATRIX20_ARB */ + 824, /* GL_MATRIX21_ARB */ + 825, /* GL_MATRIX22_ARB */ + 826, /* GL_MATRIX23_ARB */ + 827, /* GL_MATRIX24_ARB */ + 828, /* GL_MATRIX25_ARB */ + 829, /* GL_MATRIX26_ARB */ + 830, /* GL_MATRIX27_ARB */ + 831, /* GL_MATRIX28_ARB */ + 832, /* GL_MATRIX29_ARB */ + 835, /* GL_MATRIX30_ARB */ + 836, /* GL_MATRIX31_ARB */ + 1545, /* GL_STREAM_DRAW */ + 1547, /* GL_STREAM_READ */ + 1543, /* GL_STREAM_COPY */ + 1499, /* GL_STATIC_DRAW */ + 1501, /* GL_STATIC_READ */ + 1497, /* GL_STATIC_COPY */ 454, /* GL_DYNAMIC_DRAW */ 456, /* GL_DYNAMIC_READ */ 452, /* GL_DYNAMIC_COPY */ - 1133, /* GL_PIXEL_PACK_BUFFER */ - 1137, /* GL_PIXEL_UNPACK_BUFFER */ - 1134, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1138, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 1134, /* GL_PIXEL_PACK_BUFFER */ + 1138, /* GL_PIXEL_UNPACK_BUFFER */ + 1135, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1139, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ 347, /* GL_DEPTH24_STENCIL8 */ - 1745, /* GL_TEXTURE_STENCIL_SIZE */ - 1697, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 894, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 897, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 901, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 900, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 857, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1535, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1746, /* GL_TEXTURE_STENCIL_SIZE */ + 1698, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 895, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 898, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 902, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 901, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 858, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1536, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 961, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1401, /* GL_SAMPLES_PASSED */ + 962, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1402, /* GL_SAMPLES_PASSED */ 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ 537, /* GL_FRAGMENT_SHADER */ - 1861, /* GL_VERTEX_SHADER */ - 1250, /* GL_PROGRAM_OBJECT_ARB */ - 1433, /* GL_SHADER_OBJECT_ARB */ - 882, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 944, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 938, /* GL_MAX_VARYING_FLOATS */ - 942, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 867, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1053, /* GL_OBJECT_TYPE_ARB */ - 1435, /* GL_SHADER_TYPE */ + 1862, /* GL_VERTEX_SHADER */ + 1251, /* GL_PROGRAM_OBJECT_ARB */ + 1434, /* GL_SHADER_OBJECT_ARB */ + 883, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 945, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 939, /* GL_MAX_VARYING_FLOATS */ + 943, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 868, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1054, /* GL_OBJECT_TYPE_ARB */ + 1436, /* GL_SHADER_TYPE */ 502, /* GL_FLOAT_VEC2 */ 504, /* GL_FLOAT_VEC3 */ 506, /* GL_FLOAT_VEC4 */ - 659, /* GL_INT_VEC2 */ - 661, /* GL_INT_VEC3 */ - 663, /* GL_INT_VEC4 */ + 660, /* GL_INT_VEC2 */ + 662, /* GL_INT_VEC3 */ + 664, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ @@ -5007,12 +5010,12 @@ static const unsigned reduced_enums[1350] = 490, /* GL_FLOAT_MAT2 */ 494, /* GL_FLOAT_MAT3 */ 498, /* GL_FLOAT_MAT4 */ - 1392, /* GL_SAMPLER_1D */ - 1394, /* GL_SAMPLER_2D */ - 1396, /* GL_SAMPLER_3D */ - 1397, /* GL_SAMPLER_CUBE */ - 1393, /* GL_SAMPLER_1D_SHADOW */ - 1395, /* GL_SAMPLER_2D_SHADOW */ + 1393, /* GL_SAMPLER_1D */ + 1395, /* GL_SAMPLER_2D */ + 1397, /* GL_SAMPLER_3D */ + 1398, /* GL_SAMPLER_CUBE */ + 1394, /* GL_SAMPLER_1D_SHADOW */ + 1396, /* GL_SAMPLER_2D_SHADOW */ 492, /* GL_FLOAT_MAT2x3 */ 493, /* GL_FLOAT_MAT2x4 */ 496, /* GL_FLOAT_MAT3x2 */ @@ -5021,61 +5024,61 @@ static const unsigned reduced_enums[1350] = 501, /* GL_FLOAT_MAT4x3 */ 345, /* GL_DELETE_STATUS */ 246, /* GL_COMPILE_STATUS */ - 715, /* GL_LINK_STATUS */ - 1809, /* GL_VALIDATE_STATUS */ - 644, /* GL_INFO_LOG_LENGTH */ + 716, /* GL_LINK_STATUS */ + 1810, /* GL_VALIDATE_STATUS */ + 645, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1434, /* GL_SHADER_SOURCE_LENGTH */ + 1435, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ 539, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1437, /* GL_SHADING_LANGUAGE_VERSION */ + 1438, /* GL_SHADING_LANGUAGE_VERSION */ 322, /* GL_CURRENT_PROGRAM */ - 1102, /* GL_PALETTE4_RGB8_OES */ - 1104, /* GL_PALETTE4_RGBA8_OES */ - 1100, /* GL_PALETTE4_R5_G6_B5_OES */ - 1103, /* GL_PALETTE4_RGBA4_OES */ - 1101, /* GL_PALETTE4_RGB5_A1_OES */ - 1107, /* GL_PALETTE8_RGB8_OES */ - 1109, /* GL_PALETTE8_RGBA8_OES */ - 1105, /* GL_PALETTE8_R5_G6_B5_OES */ - 1108, /* GL_PALETTE8_RGBA4_OES */ - 1106, /* GL_PALETTE8_RGB5_A1_OES */ - 626, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 625, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1794, /* GL_UNSIGNED_NORMALIZED */ - 1632, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1272, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1634, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1275, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1640, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1642, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1490, /* GL_SRGB */ - 1491, /* GL_SRGB8 */ - 1493, /* GL_SRGB_ALPHA */ - 1492, /* GL_SRGB8_ALPHA8 */ - 1450, /* GL_SLUMINANCE_ALPHA */ - 1449, /* GL_SLUMINANCE8_ALPHA8 */ - 1447, /* GL_SLUMINANCE */ - 1448, /* GL_SLUMINANCE8 */ + 1103, /* GL_PALETTE4_RGB8_OES */ + 1105, /* GL_PALETTE4_RGBA8_OES */ + 1101, /* GL_PALETTE4_R5_G6_B5_OES */ + 1104, /* GL_PALETTE4_RGBA4_OES */ + 1102, /* GL_PALETTE4_RGB5_A1_OES */ + 1108, /* GL_PALETTE8_RGB8_OES */ + 1110, /* GL_PALETTE8_RGBA8_OES */ + 1106, /* GL_PALETTE8_R5_G6_B5_OES */ + 1109, /* GL_PALETTE8_RGBA4_OES */ + 1107, /* GL_PALETTE8_RGB5_A1_OES */ + 627, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 626, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1795, /* GL_UNSIGNED_NORMALIZED */ + 1633, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1273, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1635, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1276, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1641, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1643, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1491, /* GL_SRGB */ + 1492, /* GL_SRGB8 */ + 1494, /* GL_SRGB_ALPHA */ + 1493, /* GL_SRGB8_ALPHA8 */ + 1451, /* GL_SLUMINANCE_ALPHA */ + 1450, /* GL_SLUMINANCE8_ALPHA8 */ + 1448, /* GL_SLUMINANCE */ + 1449, /* GL_SLUMINANCE8 */ 267, /* GL_COMPRESSED_SRGB */ 268, /* GL_COMPRESSED_SRGB_ALPHA */ 265, /* GL_COMPRESSED_SLUMINANCE */ 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1167, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 723, /* GL_LOWER_LEFT */ - 1806, /* GL_UPPER_LEFT */ - 1513, /* GL_STENCIL_BACK_REF */ - 1514, /* GL_STENCIL_BACK_VALUE_MASK */ - 1515, /* GL_STENCIL_BACK_WRITEMASK */ + 1168, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 724, /* GL_LOWER_LEFT */ + 1807, /* GL_UPPER_LEFT */ + 1514, /* GL_STENCIL_BACK_REF */ + 1515, /* GL_STENCIL_BACK_VALUE_MASK */ + 1516, /* GL_STENCIL_BACK_WRITEMASK */ 444, /* GL_DRAW_FRAMEBUFFER_BINDING */ - 1324, /* GL_RENDERBUFFER_BINDING */ - 1304, /* GL_READ_FRAMEBUFFER */ + 1325, /* GL_RENDERBUFFER_BINDING */ + 1305, /* GL_READ_FRAMEBUFFER */ 443, /* GL_DRAW_FRAMEBUFFER */ - 1305, /* GL_READ_FRAMEBUFFER_BINDING */ - 1335, /* GL_RENDERBUFFER_SAMPLES */ + 1306, /* GL_READ_FRAMEBUFFER_BINDING */ + 1336, /* GL_RENDERBUFFER_SAMPLES */ 549, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ 547, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ 558, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ @@ -5091,7 +5094,7 @@ static const unsigned reduced_enums[1350] = 577, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ 581, /* GL_FRAMEBUFFER_UNSUPPORTED */ 579, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 863, /* GL_MAX_COLOR_ATTACHMENTS */ + 864, /* GL_MAX_COLOR_ATTACHMENTS */ 155, /* GL_COLOR_ATTACHMENT0 */ 157, /* GL_COLOR_ATTACHMENT1 */ 171, /* GL_COLOR_ATTACHMENT2 */ @@ -5109,58 +5112,58 @@ static const unsigned reduced_enums[1350] = 166, /* GL_COLOR_ATTACHMENT14 */ 168, /* GL_COLOR_ATTACHMENT15 */ 349, /* GL_DEPTH_ATTACHMENT */ - 1503, /* GL_STENCIL_ATTACHMENT */ + 1504, /* GL_STENCIL_ATTACHMENT */ 540, /* GL_FRAMEBUFFER */ - 1322, /* GL_RENDERBUFFER */ - 1338, /* GL_RENDERBUFFER_WIDTH */ - 1330, /* GL_RENDERBUFFER_HEIGHT */ - 1332, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1530, /* GL_STENCIL_INDEX_EXT */ - 1522, /* GL_STENCIL_INDEX1 */ - 1526, /* GL_STENCIL_INDEX4 */ - 1528, /* GL_STENCIL_INDEX8 */ - 1523, /* GL_STENCIL_INDEX16 */ - 1334, /* GL_RENDERBUFFER_RED_SIZE */ - 1329, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1326, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1323, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1327, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1337, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 1323, /* GL_RENDERBUFFER */ + 1339, /* GL_RENDERBUFFER_WIDTH */ + 1331, /* GL_RENDERBUFFER_HEIGHT */ + 1333, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1531, /* GL_STENCIL_INDEX_EXT */ + 1523, /* GL_STENCIL_INDEX1 */ + 1527, /* GL_STENCIL_INDEX4 */ + 1529, /* GL_STENCIL_INDEX8 */ + 1524, /* GL_STENCIL_INDEX16 */ + 1335, /* GL_RENDERBUFFER_RED_SIZE */ + 1330, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1327, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1324, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1328, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1338, /* GL_RENDERBUFFER_STENCIL_SIZE */ 575, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 921, /* GL_MAX_SAMPLES */ - 1299, /* GL_QUERY_WAIT_NV */ - 1294, /* GL_QUERY_NO_WAIT_NV */ - 1291, /* GL_QUERY_BY_REGION_WAIT_NV */ - 1290, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ - 1286, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 922, /* GL_MAX_SAMPLES */ + 1300, /* GL_QUERY_WAIT_NV */ + 1295, /* GL_QUERY_NO_WAIT_NV */ + 1292, /* GL_QUERY_BY_REGION_WAIT_NV */ + 1291, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ + 1287, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ 486, /* GL_FIRST_VERTEX_CONVENTION */ - 674, /* GL_LAST_VERTEX_CONVENTION */ - 1264, /* GL_PROVOKING_VERTEX */ + 675, /* GL_LAST_VERTEX_CONVENTION */ + 1265, /* GL_PROVOKING_VERTEX */ 302, /* GL_COPY_READ_BUFFER */ 303, /* GL_COPY_WRITE_BUFFER */ - 1385, /* GL_RGBA_SNORM */ - 1381, /* GL_RGBA8_SNORM */ - 1443, /* GL_SIGNED_NORMALIZED */ - 923, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1052, /* GL_OBJECT_TYPE */ - 1551, /* GL_SYNC_CONDITION */ - 1556, /* GL_SYNC_STATUS */ - 1553, /* GL_SYNC_FLAGS */ - 1552, /* GL_SYNC_FENCE */ - 1555, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1782, /* GL_UNSIGNALED */ - 1442, /* GL_SIGNALED */ + 1386, /* GL_RGBA_SNORM */ + 1382, /* GL_RGBA8_SNORM */ + 1444, /* GL_SIGNED_NORMALIZED */ + 924, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1053, /* GL_OBJECT_TYPE */ + 1552, /* GL_SYNC_CONDITION */ + 1557, /* GL_SYNC_STATUS */ + 1554, /* GL_SYNC_FLAGS */ + 1553, /* GL_SYNC_FENCE */ + 1556, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1783, /* GL_UNSIGNALED */ + 1443, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1754, /* GL_TIMEOUT_EXPIRED */ + 1755, /* GL_TIMEOUT_EXPIRED */ 270, /* GL_CONDITION_SATISFIED */ - 1866, /* GL_WAIT_FAILED */ + 1867, /* GL_WAIT_FAILED */ 471, /* GL_EVAL_BIT */ - 1302, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 717, /* GL_LIST_BIT */ - 1648, /* GL_TEXTURE_BIT */ - 1416, /* GL_SCISSOR_BIT */ + 1303, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 718, /* GL_LIST_BIT */ + 1649, /* GL_TEXTURE_BIT */ + 1417, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 1008, /* GL_MULTISAMPLE_BIT */ + 1009, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 5fc0b1cfde..e1320224a8 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -50,11 +50,14 @@ static const struct { { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, { OFF, "GL_ARB_draw_elements_base_vertex", F(ARB_draw_elements_base_vertex) }, + /* TODO: uncomment the following line once GLSL layout(...) support is implemented */ + /* { OFF, "GL_ARB_fragment_coord_conventions", F(ARB_fragment_coord_conventions) }, */ { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, + { OFF, "GL_ARB_half_float_vertex", F(ARB_half_float_vertex) }, { OFF, "GL_ARB_imaging", F(ARB_imaging) }, { OFF, "GL_ARB_map_buffer_range", F(ARB_map_buffer_range) }, { ON, "GL_ARB_multisample", F(ARB_multisample) }, @@ -189,6 +192,9 @@ static const struct { { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, +#if FEATURE_OES_draw_texture + { OFF, "GL_OES_draw_texture", F(OES_draw_texture) }, +#endif /* FEATURE_OES_draw_texture */ }; @@ -216,6 +222,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_framebuffer_object = GL_TRUE; #endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; + ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 7b3599f932..0e6f69f573 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -40,13 +40,10 @@ #include "framebuffer.h" #include "hash.h" #include "macros.h" -#include "mipmap.h" #include "renderbuffer.h" #include "state.h" #include "teximage.h" #include "texobj.h" -#include "texstore.h" -#include "texstate.h" /** Set this to 1 to help debug FBO incompleteness problems */ @@ -861,6 +858,9 @@ _mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) * * \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT * GL_DEPTH_STENCIL_EXT or zero if error. + * + * XXX in the future when we support red-only and red-green formats + * we'll also return GL_RED and GL_RG. */ GLenum _mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat) @@ -954,7 +954,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, /* NumSamples == 0 indicates non-multisampling */ samples = 0; } - else if (samples > ctx->Const.MaxSamples) { + else if (samples > (GLsizei) ctx->Const.MaxSamples) { /* note: driver may choose to use more samples than what's requested */ _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); return; @@ -1353,15 +1353,26 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); /* check if deleting currently bound framebuffer object */ - if (fb == ctx->DrawBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + if (ctx->Extensions.EXT_framebuffer_blit) { + /* separate draw/read binding points */ + if (fb == ctx->DrawBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + } + if (fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); + } } - if (fb == ctx->ReadBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); + else { + /* only one binding point for read/draw buffers */ + if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + } } /* remove from hash table immediately, to free the ID */ diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 5983f00e2d..d0c9c0028b 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -27,7 +27,6 @@ #include "imports.h" #include "formats.h" #include "config.h" -#include "texstore.h" /** diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index e76a790d0a..c203b046a5 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -191,6 +191,11 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) case GL_SELECTION_BUFFER_POINTER: *params = ctx->Select.Buffer; break; +#if FEATURE_point_size_array + case GL_POINT_SIZE_ARRAY_POINTER_OES: + *params = (GLvoid *) ctx->Array.ArrayObj->PointSize.Ptr; + break; +#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" ); return; diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 81d4ccf919..77544c88c6 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -57,6 +57,13 @@ #ifndef GL_FIXED #define GL_FIXED 0x140C +typedef int GLfixed; +typedef int GLclampx; +#endif + + +#ifndef GL_OES_EGL_image +typedef void *GLeglImageOES; #endif diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index fc278bb8af..81993e7063 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -37,7 +37,6 @@ #include "image.h" #include "imports.h" #include "macros.h" -#include "pixel.h" /** diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 81d0d33abb..cc63a759ec 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -25,10 +25,8 @@ #include "glheader.h" #include "context.h" -#include "depth.h" #include "lines.h" #include "macros.h" -#include "texstate.h" #include "mtypes.h" diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 7350c7a3d2..77cd1d4159 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -30,7 +30,6 @@ #include "imports.h" #include "formats.h" #include "mipmap.h" -#include "texcompress.h" #include "teximage.h" #include "texstore.h" #include "image.h" diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5227565f87..297c5ae878 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1762,6 +1762,8 @@ struct gl_fragment_program struct gl_program Base; /**< base class */ GLenum FogOption; GLboolean UsesKill; /**< shader uses KIL instruction */ + GLboolean OriginUpperLeft; + GLboolean PixelCenterInteger; }; @@ -2395,11 +2397,13 @@ struct gl_extensions GLboolean ARB_depth_clamp; GLboolean ARB_draw_buffers; GLboolean ARB_draw_elements_base_vertex; + GLboolean ARB_fragment_coord_conventions; GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; GLboolean ARB_framebuffer_object; GLboolean ARB_half_float_pixel; + GLboolean ARB_half_float_vertex; GLboolean ARB_imaging; GLboolean ARB_map_buffer_range; GLboolean ARB_multisample; @@ -2519,6 +2523,9 @@ struct gl_extensions GLboolean SGIS_texture_lod; GLboolean TDFX_texture_compression_FXT1; GLboolean S3_s3tc; +#if FEATURE_OES_draw_texture + GLboolean OES_draw_texture; +#endif /* FEATURE_OES_draw_texture */ /** The extension string */ const GLubyte *String; /** Number of supported extensions */ diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 3820ebd889..f6f9c1173a 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -32,7 +32,6 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" -#include "image.h" #include "macros.h" #include "pixel.h" #include "mtypes.h" diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c index 6a641f83f2..ec585ef0cc 100644 --- a/src/mesa/main/pixelstore.c +++ b/src/mesa/main/pixelstore.c @@ -30,10 +30,7 @@ #include "glheader.h" #include "bufferobj.h" -#include "colormac.h" #include "context.h" -#include "image.h" -#include "macros.h" #include "pixelstore.h" #include "mtypes.h" diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index dcaeccd90d..e743a2e6bd 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -32,7 +32,6 @@ #include "context.h" #include "macros.h" #include "points.h" -#include "texstate.h" #include "mtypes.h" diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 376a87a396..dcde6758c3 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -34,7 +34,6 @@ #include "context.h" #include "image.h" #include "enums.h" -#include "macros.h" #include "polygon.h" #include "mtypes.h" diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c index 0385ae8d7d..5f32a48258 100644 --- a/src/mesa/main/remap.c +++ b/src/mesa/main/remap.c @@ -45,7 +45,7 @@ #define need_MESA_remap_table -#include "remap_helper.h" +#include "main/remap_helper.h" #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) #define MAX_ENTRY_POINTS 16 diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index b5f4cde789..523f3c3ab8 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -37,14 +37,14 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); + if (width < 0 || height < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" ); return; } - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); - _mesa_set_scissor(ctx, x, y, width, height); } diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index f10e6b04b7..5e07d1d2f1 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -48,7 +48,6 @@ #include "texenvprogram.h" #include "texobj.h" #include "texstate.h" -#include "viewport.h" static void @@ -83,12 +82,6 @@ compute_max_element(struct gl_client_array *array) } else { array->_MaxElement = 0; } - /* Compute the max element we can access in the VBO without going - * out of bounds. - */ - array->_MaxElement = ((GLsizeiptrARB) array->BufferObj->Size - - (GLsizeiptrARB) array->Ptr + array->StrideB - - array->_ElementSize) / array->StrideB; } else { /* user-space array, no idea how big it is */ diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index a4f1926ab3..cff6de89ee 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -35,10 +35,7 @@ #include "colormac.h" #include "context.h" #include "formats.h" -#include "image.h" -#include "mipmap.h" #include "texcompress.h" -#include "texstore.h" /** diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 1a374e7bee..096945a643 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -35,8 +35,6 @@ #include "context.h" #include "texcompress.h" -#include "texcompress_fxt1.h" -#include "texcompress_s3tc.h" #include "texformat.h" diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index be4e03bc56..2ae839b2a6 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -210,7 +210,7 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) } -static void GLAPIENTRY +void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { GLfloat p[4]; @@ -269,7 +269,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -static void GLAPIENTRY +void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index f6924ef722..eb4626033a 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -41,8 +41,14 @@ extern void GLAPIENTRY _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); extern void GLAPIENTRY +_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); + +extern void GLAPIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); +extern void GLAPIENTRY +_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); + extern void _mesa_init_texgen_dispatch(struct _glapi_table *disp); diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index d786c41d2e..66d01c15d0 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -35,37 +35,11 @@ #include "context.h" #include "formats.h" #include "image.h" -#include "texcompress.h" #include "texgetimage.h" #include "teximage.h" -#include "texstate.h" -#if FEATURE_EXT_texture_sRGB - -/** - * Convert a float value from linear space to a - * non-linear sRGB value in [0, 255]. - * Not terribly efficient. - */ -static INLINE GLfloat -linear_to_nonlinear(GLfloat cl) -{ - /* can't have values outside [0, 1] */ - GLfloat cs; - if (cl < 0.0031308f) { - cs = 12.92f * cl; - } - else { - cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055); - } - return cs; -} - -#endif /* FEATURE_EXT_texture_sRGB */ - - /** * Can the given type represent negative values? */ @@ -233,6 +207,29 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions, } +#if FEATURE_EXT_texture_sRGB + + +/** + * Convert a float value from linear space to a + * non-linear sRGB value in [0, 255]. + * Not terribly efficient. + */ +static INLINE GLfloat +linear_to_nonlinear(GLfloat cl) +{ + /* can't have values outside [0, 1] */ + GLfloat cs; + if (cl < 0.0031308f) { + cs = 12.92f * cl; + } + else { + cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055); + } + return cs; +} + + /** * glGetTexImagefor sRGB pixels; */ @@ -284,6 +281,21 @@ get_tex_srgb(GLcontext *ctx, GLuint dimensions, } +#else /* FEATURE_EXT_texture_sRGB */ + + +static INLINE void +get_tex_srgb(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + ASSERT_NO_FEATURE(); +} + + +#endif /* FEATURE_EXT_texture_sRGB */ + + /** * glGetTexImagefor RGBA, Luminance, etc. pixels. * This is the slow way since we use texture sampling. diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b946f3c69d..da3c6f9841 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -46,7 +46,6 @@ #include "texfetch.h" #include "teximage.h" #include "texstate.h" -#include "texstore.h" #include "mtypes.h" @@ -3225,8 +3224,8 @@ compressed_subtexture_error_check2(GLcontext *ctx, GLuint dims, } if (((width == 1 || width == 2) && - (GLuint) width != texImage->Width) || - (width > texImage->Width)) { + width != (GLsizei) texImage->Width) || + (width > (GLsizei) texImage->Width)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage%uD(width=%d)", dims, width); return GL_TRUE; @@ -3234,8 +3233,8 @@ compressed_subtexture_error_check2(GLcontext *ctx, GLuint dims, if (dims >= 2) { if (((height == 1 || height == 2) && - (GLuint) height != texImage->Height) || - (height > texImage->Height)) { + height != (GLsizei) texImage->Height) || + (height > (GLsizei) texImage->Height)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage%uD(height=%d)", dims, height); return GL_TRUE; @@ -3244,8 +3243,8 @@ compressed_subtexture_error_check2(GLcontext *ctx, GLuint dims, if (dims >= 3) { if (((depth == 1 || depth == 2) && - (GLuint) depth != texImage->Depth) || - (depth > texImage->Depth)) { + depth != (GLsizei) texImage->Depth) || + (depth > (GLsizei) texImage->Depth)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage%uD(depth=%d)", dims, depth); return GL_TRUE; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 7f0a246025..9db95814d0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -38,7 +38,6 @@ #include "imports.h" #include "macros.h" #include "teximage.h" -#include "texstate.h" #include "texobj.h" #include "mtypes.h" #include "shader/prog_instruction.h" diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index d917e21e74..c4f2495018 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -33,7 +33,6 @@ #include "main/glheader.h" #include "main/colormac.h" #include "main/context.h" -#include "main/enums.h" #include "main/formats.h" #include "main/macros.h" #include "main/texcompress.h" diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index c735e18aff..2b26f651a5 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -35,11 +35,9 @@ #include "context.h" #include "enums.h" #include "macros.h" -#include "texcompress.h" #include "texobj.h" #include "teximage.h" #include "texstate.h" -#include "texenvprogram.h" #include "mtypes.h" @@ -293,7 +291,8 @@ _mesa_ActiveTextureARB(GLenum texture) _mesa_lookup_enum_by_nr(texture)); if (texUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)", + _mesa_lookup_enum_by_nr(texture)); return; } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 792c83141e..fcd0a56d76 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -263,7 +263,7 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, map[ZERO] = ZERO; map[ONE] = ONE; -/* +#if 0 _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", inFormat, _mesa_lookup_enum_by_nr(inFormat), outFormat, _mesa_lookup_enum_by_nr(outFormat), @@ -273,7 +273,7 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, map[3], map[4], map[5]); -*/ +#endif } diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index c2193074cd..0b6295d5e1 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -121,6 +121,9 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = size * sizeof(GLhalfARB); + break; #if FEATURE_fixedpt case GL_FIXED: elementSize = size * sizeof(GLfixed); @@ -174,6 +177,9 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) case GL_DOUBLE: elementSize = 3 * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = 3 * sizeof(GLhalfARB); + break; #if FEATURE_fixedpt case GL_FIXED: elementSize = 3 * sizeof(GLfixed); @@ -250,6 +256,9 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = size * sizeof(GLhalfARB); + break; #if FEATURE_fixedpt case GL_FIXED: elementSize = size * sizeof(GLfixed); @@ -285,6 +294,9 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) case GL_DOUBLE: elementSize = sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = sizeof(GLhalfARB); + break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glFogCoordPointer(type)" ); return; @@ -394,6 +406,9 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = size * sizeof(GLhalfARB); + break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glSecondaryColorPointer(type=%s)", _mesa_lookup_enum_by_nr(type)); @@ -441,6 +456,9 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = size * sizeof(GLhalfARB); + break; #if FEATURE_fixedpt case GL_FIXED: elementSize = size * sizeof(GLfixed); @@ -670,6 +688,9 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, case GL_DOUBLE: elementSize = size * sizeof(GLdouble); break; + case GL_HALF_FLOAT: + elementSize = size * sizeof(GLhalfARB); + break; #if FEATURE_fixedpt case GL_FIXED: elementSize = size * sizeof(GLfixed); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index c9eea8ab83..0dd3e5e52e 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -28,11 +28,9 @@ #include "glheader.h" #include "api_arrayelt.h" -#include "api_loopback.h" #include "context.h" #include "imports.h" #include "mtypes.h" -#include "state.h" #include "vtxfmt.h" #include "eval.h" #include "dlist.h" diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index a09be71020..bdd26b7f3a 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -54,10 +54,8 @@ having three separate program parameter arrays. #include "main/glheader.h" #include "main/imports.h" #include "main/context.h" -#include "main/macros.h" #include "main/mtypes.h" #include "arbprogparse.h" -#include "program.h" #include "programopt.h" #include "prog_parameter.h" #include "prog_statevars.h" @@ -123,6 +121,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, case OPTION_FOG_LINEAR: program->FogOption = GL_LINEAR; break; default: program->FogOption = GL_NONE; break; } + program->OriginUpperLeft = state.option.OriginUpperLeft; + program->PixelCenterInteger = state.option.PixelCenterInteger; program->UsesKill = state.fragment.UsesKill; diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index eb537cd1b9..746138071e 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -180,23 +180,24 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) } else if (prog) { /* Unbind program if necessary */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB || /* == GL_VERTEX_PROGRAM_NV */ - prog->Target == GL_VERTEX_STATE_PROGRAM_NV) { + switch (prog->Target) { + case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ + case GL_VERTEX_STATE_PROGRAM_NV: if (ctx->VertexProgram.Current && ctx->VertexProgram.Current->Base.Id == ids[i]) { /* unbind this currently bound program */ _mesa_BindProgram(prog->Target, 0); } - } - else if (prog->Target == GL_FRAGMENT_PROGRAM_NV || - prog->Target == GL_FRAGMENT_PROGRAM_ARB) { + break; + case GL_FRAGMENT_PROGRAM_NV: + case GL_FRAGMENT_PROGRAM_ARB: if (ctx->FragmentProgram.Current && ctx->FragmentProgram.Current->Base.Id == ids[i]) { /* unbind this currently bound program */ _mesa_BindProgram(prog->Target, 0); } - } - else { + break; + default: _mesa_problem(ctx, "bad target in glDeleteProgramsNV"); return; } @@ -561,6 +562,8 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, } } + + /** * Set a program env parameter register. * \note Called from the GL API dispatcher. @@ -569,10 +572,35 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, */ void GLAPIENTRY _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) + const GLfloat *params) { - _mesa_ProgramEnvParameter4fARB(target, index, params[0], params[1], - params[2], params[3]); + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); + + if (target == GL_FRAGMENT_PROGRAM_ARB + && ctx->Extensions.ARB_fragment_program) { + if (index >= ctx->Const.FragmentProgram.MaxEnvParams) { + _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter4fv(index)"); + return; + } + memcpy(ctx->FragmentProgram.Parameters[index], params, + 4 * sizeof(GLfloat)); + } + else if (target == GL_VERTEX_PROGRAM_ARB /* == GL_VERTEX_PROGRAM_NV */ + && (ctx->Extensions.ARB_vertex_program || ctx->Extensions.NV_vertex_program)) { + if (index >= ctx->Const.VertexProgram.MaxEnvParams) { + _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter4fv(index)"); + return; + } + memcpy(ctx->VertexProgram.Parameters[index], params, + 4 * sizeof(GLfloat)); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameter4fv(target)"); + return; + } } @@ -581,7 +609,6 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - GLint i; GLfloat * dest; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -612,11 +639,7 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, return; } - for ( i = 0 ; i < count ; i++ ) { - COPY_4V(dest, params); - params += 4; - dest += 4; - } + memcpy(dest, params, count * 4 * sizeof(GLfloat)); } @@ -729,8 +752,7 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - struct gl_program *prog; - GLint i; + GLfloat *dest; ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); @@ -745,7 +767,7 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); return; } - prog = &(ctx->FragmentProgram.Current->Base); + dest = ctx->FragmentProgram.Current->Base.LocalParams[index]; } else if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { @@ -753,18 +775,14 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); return; } - prog = &(ctx->VertexProgram.Current->Base); + dest = ctx->VertexProgram.Current->Base.LocalParams[index]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameters4fvEXT(target)"); return; } - for (i = 0; i < count; i++) { - ASSERT((index + i) < MAX_PROGRAM_LOCAL_PARAMS); - COPY_4V(prog->LocalParams[index + i], params); - params += 4; - } + memcpy(dest, params, count * 4 * sizeof(GLfloat)); } diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 68543ae2e1..d1af35fedb 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -1043,12 +1043,12 @@ static yyconst flex_int16_t yy_chk[1368] = */ #include "main/glheader.h" #include "main/imports.h" -#include "prog_instruction.h" -#include "prog_statevars.h" +#include "shader/prog_instruction.h" +#include "shader/prog_statevars.h" -#include "symbol_table.h" -#include "program_parser.h" -#include "program_parse.tab.h" +#include "shader/symbol_table.h" +#include "shader/program_parser.h" +#include "shader/program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index fd6cbb0f40..87f295e39a 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -515,7 +515,7 @@ _mesa_emit_nv_temp_initialization(GLcontext *ctx, struct gl_program *program) { struct prog_instruction *inst; - int i; + GLuint i; if (!ctx->Shader.EmitNVTempInitialization) return; @@ -559,7 +559,7 @@ _mesa_emit_nv_temp_initialization(GLcontext *ctx, void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) { - int i; + GLuint i; program->NumTemporaries = 0; for (i = 0; i < program->NumInstructions; i++) { diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 8574016050..baff7658d1 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -40,7 +40,6 @@ #include "main/glheader.h" #include "main/context.h" #include "main/imports.h" -#include "main/macros.h" #include "nvprogram.h" #include "nvvertparse.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 7f034520cd..5641014d2c 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -38,7 +38,6 @@ #include "main/glheader.h" #include "main/colormac.h" #include "main/context.h" -#include "program.h" #include "prog_execute.h" #include "prog_instruction.h" #include "prog_parameter.h" @@ -352,6 +351,28 @@ fetch_vector1(const struct prog_src_register *source, } +static GLuint +fetch_vector1ui(const struct prog_src_register *source, + const struct gl_program_machine *machine) +{ + const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); + GLuint result; + + ASSERT(src); + + result = src[GET_SWZ(source->Swizzle, 0)]; + + if (source->Abs) { + result = FABSF(result); + } + if (source->Negate) { + result = -result; + } + + return result; +} + + /** * Fetch texel from texture. Use partial derivatives when possible. */ @@ -996,12 +1017,12 @@ _mesa_execute_program(GLcontext * ctx, /* XXX we could probably just use pow() here */ if (a[0] > 0.0F) { if (a[1] == 0.0 && a[3] == 0.0) - result[2] = 1.0; + result[2] = 1.0F; else result[2] = (GLfloat) _mesa_pow(a[1], a[3]); } else { - result[2] = 0.0; + result[2] = 0.0F; } result[3] = 1.0F; store_vector4(inst, machine, result); @@ -1668,13 +1689,11 @@ _mesa_execute_program(GLcontext * ctx, break; case OPCODE_UP2H: /* unpack two 16-bit floats */ { - GLfloat a[4], result[4]; - fi_type fi; - GLhalfNV hx, hy; - fetch_vector1(&inst->SrcReg[0], machine, a); - fi.f = a[0]; - hx = fi.i & 0xffff; - hy = fi.i >> 16; + const GLuint raw = fetch_vector1ui(&inst->SrcReg[0], machine); + GLfloat result[4]; + GLushort hx, hy; + hx = raw & 0xffff; + hy = raw >> 16; result[0] = result[2] = _mesa_half_to_float(hx); result[1] = result[3] = _mesa_half_to_float(hy); store_vector4(inst, machine, result); @@ -1682,13 +1701,11 @@ _mesa_execute_program(GLcontext * ctx, break; case OPCODE_UP2US: /* unpack two GLushorts */ { - GLfloat a[4], result[4]; - fi_type fi; + const GLuint raw = fetch_vector1ui(&inst->SrcReg[0], machine); + GLfloat result[4]; GLushort usx, usy; - fetch_vector1(&inst->SrcReg[0], machine, a); - fi.f = a[0]; - usx = fi.i & 0xffff; - usy = fi.i >> 16; + usx = raw & 0xffff; + usy = raw >> 16; result[0] = result[2] = usx * (1.0f / 65535.0f); result[1] = result[3] = usy * (1.0f / 65535.0f); store_vector4(inst, machine, result); @@ -1696,27 +1713,23 @@ _mesa_execute_program(GLcontext * ctx, break; case OPCODE_UP4B: /* unpack four GLbytes */ { - GLfloat a[4], result[4]; - fi_type fi; - fetch_vector1(&inst->SrcReg[0], machine, a); - fi.f = a[0]; - result[0] = (((fi.i >> 0) & 0xff) - 128) / 127.0F; - result[1] = (((fi.i >> 8) & 0xff) - 128) / 127.0F; - result[2] = (((fi.i >> 16) & 0xff) - 128) / 127.0F; - result[3] = (((fi.i >> 24) & 0xff) - 128) / 127.0F; + const GLuint raw = fetch_vector1ui(&inst->SrcReg[0], machine); + GLfloat result[4]; + result[0] = (((raw >> 0) & 0xff) - 128) / 127.0F; + result[1] = (((raw >> 8) & 0xff) - 128) / 127.0F; + result[2] = (((raw >> 16) & 0xff) - 128) / 127.0F; + result[3] = (((raw >> 24) & 0xff) - 128) / 127.0F; store_vector4(inst, machine, result); } break; case OPCODE_UP4UB: /* unpack four GLubytes */ { - GLfloat a[4], result[4]; - fi_type fi; - fetch_vector1(&inst->SrcReg[0], machine, a); - fi.f = a[0]; - result[0] = ((fi.i >> 0) & 0xff) / 255.0F; - result[1] = ((fi.i >> 8) & 0xff) / 255.0F; - result[2] = ((fi.i >> 16) & 0xff) / 255.0F; - result[3] = ((fi.i >> 24) & 0xff) / 255.0F; + const GLuint raw = fetch_vector1ui(&inst->SrcReg[0], machine); + GLfloat result[4]; + result[0] = ((raw >> 0) & 0xff) / 255.0F; + result[1] = ((raw >> 8) & 0xff) / 255.0F; + result[2] = ((raw >> 16) & 0xff) / 255.0F; + result[3] = ((raw >> 24) & 0xff) / 255.0F; store_vector4(inst, machine, result); } break; diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index ce411731b2..e1ec52254c 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -459,7 +459,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) */ for (j = i + 1; j < prog->NumInstructions; j++) { struct prog_instruction *inst2 = prog->Instructions + j; - int arg; + GLuint arg; if (_mesa_is_flow_control_opcode(inst2->Opcode)) break; @@ -867,7 +867,7 @@ find_live_intervals(struct gl_program *prog, _mesa_printf("Reg[%d] live [%d, %d]:", inv->Reg, inv->Start, inv->End); if (1) { - int j; + GLuint j; for (j = 0; j < inv->Start; j++) _mesa_printf(" "); for (j = inv->Start; j <= inv->End; j++) @@ -945,7 +945,7 @@ _mesa_reallocate_registers(struct gl_program *prog) */ { GLint j; - for (j = 0; j < activeIntervals.Num; j++) { + for (j = 0; j < (GLint) activeIntervals.Num; j++) { const struct interval *inv = activeIntervals.Intervals + j; if (inv->End >= live->Start) { /* Stop now. Since the activeInterval list is sorted @@ -994,7 +994,7 @@ _mesa_reallocate_registers(struct gl_program *prog) } } - if (maxTemp + 1 < liveIntervals.Num) { + if (maxTemp + 1 < (GLint) liveIntervals.Num) { /* OK, we've reduced the number of registers needed. * Scan the program and replace all the old temporary register * indexes with the new indexes. diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 058d4bbafb..3a446fd9bb 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -31,7 +31,6 @@ #include "main/glheader.h" #include "main/context.h" -#include "main/hash.h" #include "main/imports.h" #include "main/macros.h" #include "main/mtypes.h" diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 6b8d94e661..3e86d0adad 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -580,7 +580,7 @@ _mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count) for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; if (inst->BranchTarget > 0) { - if (inst->BranchTarget > start) { + if (inst->BranchTarget > (GLint) start) { inst->BranchTarget -= count; } } diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index e2acb3c0c9..83bc5089d9 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -23,12 +23,12 @@ */ #include "main/glheader.h" #include "main/imports.h" -#include "prog_instruction.h" -#include "prog_statevars.h" +#include "shader/prog_instruction.h" +#include "shader/prog_statevars.h" -#include "symbol_table.h" -#include "program_parser.h" -#include "program_parse.tab.h" +#include "shader/symbol_table.h" +#include "shader/program_parser.h" +#include "shader/program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index b12dcee9df..2adfb40973 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -98,14 +98,14 @@ #include "main/mtypes.h" #include "main/imports.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_parameter_layout.h" -#include "prog_statevars.h" -#include "prog_instruction.h" - -#include "symbol_table.h" -#include "program_parser.h" +#include "shader/program.h" +#include "shader/prog_parameter.h" +#include "shader/prog_parameter_layout.h" +#include "shader/prog_statevars.h" +#include "shader/prog_instruction.h" + +#include "shader/symbol_table.h" +#include "shader/program_parser.h" extern void *yy_scan_string(char *); extern void yy_delete_buffer(void *); diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 5c5d8d7590..3880d54917 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -27,14 +27,14 @@ #include "main/mtypes.h" #include "main/imports.h" -#include "program.h" -#include "prog_parameter.h" -#include "prog_parameter_layout.h" -#include "prog_statevars.h" -#include "prog_instruction.h" - -#include "symbol_table.h" -#include "program_parser.h" +#include "shader/program.h" +#include "shader/prog_parameter.h" +#include "shader/prog_parameter_layout.h" +#include "shader/prog_statevars.h" +#include "shader/prog_instruction.h" + +#include "shader/symbol_table.h" +#include "shader/program_parser.h" extern void *yy_scan_string(char *); extern void yy_delete_buffer(void *); diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index 0656c5eaa8..ae98b782b7 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -216,6 +216,18 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) state->option.Shadow = 1; return 1; } + } else if (strncmp(option, "fragment_coord_", 15) == 0) { + option += 15; + if (state->ctx->Extensions.ARB_fragment_coord_conventions) { + if (strcmp(option, "origin_upper_left") == 0) { + state->option.OriginUpperLeft = 1; + return 1; + } + else if (strcmp(option, "pixel_center_integer") == 0) { + state->option.PixelCenterInteger = 1; + return 1; + } + } } } else if (strncmp(option, "NV_fragment_program", 19) == 0) { option += 19; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 69396ca2c0..730466c30f 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -209,6 +209,8 @@ struct asm_parser_state { unsigned TexRect:1; unsigned TexArray:1; unsigned NV_fragment:1; + unsigned OriginUpperLeft:1; + unsigned PixelCenterInteger:1; } option; struct { diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 453cd3964a..d53580f5f6 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -39,10 +39,8 @@ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" -#include "main/macros.h" #include "shader/program.h" #include "shader/prog_parameter.h" -#include "shader/prog_print.h" #include "shader/prog_statevars.h" #include "shader/prog_uniform.h" #include "shader/shader_api.h" @@ -957,7 +955,7 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, if (size) { GLint typeSize = sizeof_glsl_type(param->DataType); - if (param->Size > typeSize) { + if ((GLint) param->Size > typeSize) { /* This is an array. * Array elements are placed on vector[4] boundaries so they're * a multiple of four floats. We round typeSize up to next multiple @@ -1728,7 +1726,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, const GLint typeSize = sizeof_glsl_type(param->DataType); GLsizei k, i; - if (param->Size > typeSize) { + if ((GLint) param->Size > typeSize) { /* an array */ /* we'll ignore extra data below */ } @@ -1913,7 +1911,7 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, GLuint mat, row, col; GLuint src = 0; const struct gl_program_parameter * param = &program->Parameters->Parameters[index]; - const GLint slots = (param->Size + 3) / 4; + const GLuint slots = (param->Size + 3) / 4; const GLint typeSize = sizeof_glsl_type(param->DataType); GLint nr, nc; @@ -1925,7 +1923,7 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, return; } - if (param->Size <= typeSize) { + if ((GLint) param->Size <= typeSize) { /* non-array: count must be at most one; count == 0 is handled by the loop below */ if (count > 1) { _mesa_error(ctx, GL_INVALID_OPERATION, diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index e5809509c9..0a9f0b97fb 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -36,7 +36,6 @@ #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "shader/slang/slang_ir.h" -#include "shader/slang/slang_emit.h" #include "shader/slang/slang_builtin.h" diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 372a9acdd0..83098b7350 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3196,7 +3196,7 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) newOper = slang_operation_new(1); newOper->type = SLANG_OPER_LITERAL_INT; newOper->literal_size = 1; - newOper->literal[0] = iter; + newOper->literal[0] = (GLfloat) iter; /* replace instances of the loop variable with newOper */ slang_substitute(A, body, 1, &oldVar, &newOper, GL_FALSE); diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 6499cfcb2f..63d10f4597 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -40,14 +40,11 @@ #include "slang_codegen.h" #include "slang_compile.h" #include "slang_storage.h" -#include "slang_emit.h" #include "slang_log.h" #include "slang_mem.h" #include "slang_vartable.h" #include "slang_simplify.h" -#include "slang_print.h" - /* * This is a straightforward implementation of the slang front-end * compiler. Lots of error-checking functionality is missing but diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index ce3f6ab7ea..c9ecbd275b 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -38,7 +38,6 @@ #include "main/imports.h" #include "main/context.h" -#include "main/macros.h" #include "shader/program.h" #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index ed27821a95..21497b34e2 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -31,7 +31,6 @@ #include "main/imports.h" #include "main/context.h" -#include "main/hash.h" #include "main/macros.h" #include "shader/program.h" #include "shader/prog_instruction.h" diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index d7d2b4fbfd..4f6b8541c5 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -24,7 +24,6 @@ */ #include "main/imports.h" -#include "main/context.h" #include "slang_log.h" #include "slang_utility.h" diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index a4d09c75bb..12d4c2831d 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -89,6 +89,7 @@ GLAPI_SOURCES = \ main/dispatch.c \ glapi/glapi.c \ glapi/glapi_getproc.c \ + glapi/glapi_nop.c \ glapi/glthread.c MATH_SOURCES = \ diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index 43e62c29f3..1511b88dd1 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -152,14 +152,54 @@ translate_logicop(GLenum logicop) } } +/** + * Figure out if colormasks are different per rt. + */ +static GLboolean +colormask_per_rt(GLcontext *ctx) +{ + /* a bit suboptimal have to compare lots of values */ + unsigned i; + for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { + if (memcmp(ctx->Color.ColorMask[0], ctx->Color.ColorMask[i], 4)) { + return GL_TRUE; + } + } + return GL_FALSE; +} + +/** + * Figure out if blend enables are different per rt. + */ +static GLboolean +blend_per_rt(GLcontext *ctx) +{ + if (ctx->Color.BlendEnabled && + (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) { + return GL_TRUE; + } + return GL_FALSE; +} static void update_blend( struct st_context *st ) { struct pipe_blend_state *blend = &st->state.blend; + unsigned num_state = 1; + unsigned i; memset(blend, 0, sizeof(*blend)); + if (blend_per_rt(st->ctx) || colormask_per_rt(st->ctx)) { + num_state = st->ctx->Const.MaxDrawBuffers; + blend->independent_blend_enable = 1; + } + /* Note it is impossible to correctly deal with EXT_blend_logic_op and + EXT_draw_buffers2/EXT_blend_equation_separate at the same time. + These combinations would require support for per-rt logicop enables + and separate alpha/rgb logicop/blend support respectively. Neither + possible in gallium nor most hardware. Assume these combinations + don't happen. */ if (st->ctx->Color.ColorLogicOpEnabled || (st->ctx->Color.BlendEnabled && st->ctx->Color.BlendEquationRGB == GL_LOGIC_OP)) { @@ -169,30 +209,33 @@ update_blend( struct st_context *st ) } else if (st->ctx->Color.BlendEnabled) { /* blending enabled */ - blend->blend_enable = 1; - - blend->rgb_func = translate_blend(st->ctx->Color.BlendEquationRGB); - if (st->ctx->Color.BlendEquationRGB == GL_MIN || - st->ctx->Color.BlendEquationRGB == GL_MAX) { - /* Min/max are special */ - blend->rgb_src_factor = PIPE_BLENDFACTOR_ONE; - blend->rgb_dst_factor = PIPE_BLENDFACTOR_ONE; - } - else { - blend->rgb_src_factor = translate_blend(st->ctx->Color.BlendSrcRGB); - blend->rgb_dst_factor = translate_blend(st->ctx->Color.BlendDstRGB); - } + for (i = 0; i < num_state; i++) { - blend->alpha_func = translate_blend(st->ctx->Color.BlendEquationA); - if (st->ctx->Color.BlendEquationA == GL_MIN || - st->ctx->Color.BlendEquationA == GL_MAX) { - /* Min/max are special */ - blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE; - blend->alpha_dst_factor = PIPE_BLENDFACTOR_ONE; - } - else { - blend->alpha_src_factor = translate_blend(st->ctx->Color.BlendSrcA); - blend->alpha_dst_factor = translate_blend(st->ctx->Color.BlendDstA); + blend->rt[i].blend_enable = (st->ctx->Color.BlendEnabled >> i) & 0x1; + + blend->rt[i].rgb_func = translate_blend(st->ctx->Color.BlendEquationRGB); + if (st->ctx->Color.BlendEquationRGB == GL_MIN || + st->ctx->Color.BlendEquationRGB == GL_MAX) { + /* Min/max are special */ + blend->rt[i].rgb_src_factor = PIPE_BLENDFACTOR_ONE; + blend->rt[i].rgb_dst_factor = PIPE_BLENDFACTOR_ONE; + } + else { + blend->rt[i].rgb_src_factor = translate_blend(st->ctx->Color.BlendSrcRGB); + blend->rt[i].rgb_dst_factor = translate_blend(st->ctx->Color.BlendDstRGB); + } + + blend->rt[i].alpha_func = translate_blend(st->ctx->Color.BlendEquationA); + if (st->ctx->Color.BlendEquationA == GL_MIN || + st->ctx->Color.BlendEquationA == GL_MAX) { + /* Min/max are special */ + blend->rt[i].alpha_src_factor = PIPE_BLENDFACTOR_ONE; + blend->rt[i].alpha_dst_factor = PIPE_BLENDFACTOR_ONE; + } + else { + blend->rt[i].alpha_src_factor = translate_blend(st->ctx->Color.BlendSrcA); + blend->rt[i].alpha_dst_factor = translate_blend(st->ctx->Color.BlendDstA); + } } } else { @@ -200,14 +243,16 @@ update_blend( struct st_context *st ) } /* Colormask - maybe reverse these bits? */ - if (st->ctx->Color.ColorMask[0][0]) - blend->colormask |= PIPE_MASK_R; - if (st->ctx->Color.ColorMask[0][1]) - blend->colormask |= PIPE_MASK_G; - if (st->ctx->Color.ColorMask[0][2]) - blend->colormask |= PIPE_MASK_B; - if (st->ctx->Color.ColorMask[0][3]) - blend->colormask |= PIPE_MASK_A; + for (i = 0; i < num_state; i++) { + if (st->ctx->Color.ColorMask[i][0]) + blend->rt[i].colormask |= PIPE_MASK_R; + if (st->ctx->Color.ColorMask[i][1]) + blend->rt[i].colormask |= PIPE_MASK_G; + if (st->ctx->Color.ColorMask[i][2]) + blend->rt[i].colormask |= PIPE_MASK_B; + if (st->ctx->Color.ColorMask[i][3]) + blend->rt[i].colormask |= PIPE_MASK_A; + } if (st->ctx->Color.DitherFlag) blend->dither = 1; diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 8ca4335e33..8d045f2c6c 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -37,7 +37,6 @@ #include "st_public.h" #include "st_texture.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" #include "cso_cache/cso_context.h" #include "util/u_rect.h" #include "util/u_math.h" diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 6a5854e9ba..0b2e3f5381 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -43,7 +43,6 @@ #include "st_context.h" #include "st_format.h" -#include "st_program.h" #include "st_texture.h" #include "st_inlines.h" diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 7b84a86ba4..9d63f1c6ab 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -37,7 +37,6 @@ #include "st_context.h" #include "st_cb_texture.h" #include "st_atom.h" -#include "st_program.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c index 3fd59e1945..5e0c51cff0 100644 --- a/src/mesa/state_tracker/st_atom_scissor.c +++ b/src/mesa/state_tracker/st_atom_scissor.c @@ -31,6 +31,7 @@ */ +#include "main/macros.h" #include "st_context.h" #include "pipe/p_context.h" #include "st_atom.h" @@ -52,15 +53,19 @@ update_scissor( struct st_context *st ) scissor.maxy = fb->Height; if (st->ctx->Scissor.Enabled) { - if ((GLuint)st->ctx->Scissor.X > scissor.minx) + /* need to be careful here with xmax or ymax < 0 */ + GLint xmax = MAX2(0, st->ctx->Scissor.X + st->ctx->Scissor.Width); + GLint ymax = MAX2(0, st->ctx->Scissor.Y + st->ctx->Scissor.Height); + + if (st->ctx->Scissor.X > (GLint)scissor.minx) scissor.minx = st->ctx->Scissor.X; - if ((GLuint)st->ctx->Scissor.Y > scissor.miny) + if (st->ctx->Scissor.Y > (GLint)scissor.miny) scissor.miny = st->ctx->Scissor.Y; - if ((GLuint)st->ctx->Scissor.X + st->ctx->Scissor.Width < scissor.maxx) - scissor.maxx = st->ctx->Scissor.X + st->ctx->Scissor.Width; - if ((GLuint)st->ctx->Scissor.Y + st->ctx->Scissor.Height < scissor.maxy) - scissor.maxy = st->ctx->Scissor.Y + st->ctx->Scissor.Height; + if (xmax < (GLint) scissor.maxx) + scissor.maxx = xmax; + if (ymax < (GLint) scissor.maxy) + scissor.maxy = ymax; /* check for null space */ if (scissor.minx >= scissor.maxx || scissor.miny >= scissor.maxy) diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 176f3ea68d..181f88a334 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -51,7 +51,6 @@ #include "st_atom.h" #include "st_program.h" #include "st_atom_shader.h" -#include "st_mesa_to_tgsi.h" @@ -79,7 +78,7 @@ translate_fp(struct st_context *st, stfp->num_input_slots = numIn; - assert(stfp->Base.Base.NumInstructions > 1); + assert(stfp->Base.Base.NumInstructions > 0); st_translate_fragment_program(st, stfp, stfp->input_to_slot); } diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index da7b97d325..798081ec89 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -38,9 +38,7 @@ #include "st_context.h" #include "st_cb_accum.h" #include "st_cb_fbo.h" -#include "st_draw.h" #include "st_public.h" -#include "st_format.h" #include "st_texture.h" #include "st_inlines.h" #include "pipe/p_context.h" diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 1bdeaccda3..d1b35f796e 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -34,9 +34,7 @@ #include "main/image.h" #include "main/bufferobj.h" #include "main/macros.h" -#include "main/texformat.h" #include "shader/program.h" -#include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "st_context.h" @@ -44,15 +42,12 @@ #include "st_atom_constbuf.h" #include "st_program.h" #include "st_cb_bitmap.h" -#include "st_cb_program.h" -#include "st_mesa_to_tgsi.h" #include "st_texture.h" #include "st_inlines.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" -#include "util/u_tile.h" #include "util/u_draw_quad.h" #include "util/u_simple_shaders.h" #include "shader/prog_instruction.h" @@ -386,11 +381,11 @@ setup_bitmap_vertex_data(struct st_context *st, } /* put vertex data into vbuf */ - st_no_flush_pipe_buffer_write(st, - st->bitmap.vbuf, - st->bitmap.vbuf_slot * sizeof st->bitmap.vertices, - sizeof st->bitmap.vertices, - st->bitmap.vertices); + st_no_flush_pipe_buffer_write_nooverlap(st, + st->bitmap.vbuf, + st->bitmap.vbuf_slot * sizeof st->bitmap.vertices, + sizeof st->bitmap.vertices, + st->bitmap.vertices); return st->bitmap.vbuf_slot++ * sizeof st->bitmap.vertices; } diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 563615ed0d..65aa2a28ac 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -33,14 +33,10 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" -#include "main/texformat.h" #include "shader/program.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" #include "st_context.h" #include "st_texture.h" -#include "st_program.h" #include "st_cb_blit.h" #include "st_cb_fbo.h" diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 192d765f45..94693d91f3 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -42,10 +42,8 @@ #include "st_cb_accum.h" #include "st_cb_clear.h" #include "st_cb_fbo.h" -#include "st_draw.h" #include "st_program.h" #include "st_public.h" -#include "st_mesa_to_tgsi.h" #include "st_inlines.h" #include "pipe/p_context.h" @@ -53,7 +51,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "util/u_format.h" -#include "util/u_pack_color.h" #include "util/u_simple_shaders.h" #include "util/u_draw_quad.h" @@ -166,10 +163,10 @@ draw_quad(GLcontext *ctx, } /* put vertex data into vbuf */ - st_no_flush_pipe_buffer_write(st, st->clear.vbuf, - st->clear.vbuf_slot * sizeof(st->clear.vertices), - sizeof(st->clear.vertices), - st->clear.vertices); + st_no_flush_pipe_buffer_write_nooverlap(st, st->clear.vbuf, + st->clear.vbuf_slot * sizeof(st->clear.vertices), + sizeof(st->clear.vertices), + st->clear.vertices); /* draw */ util_draw_vertex_buffer(pipe, @@ -227,19 +224,19 @@ clear_with_quad(GLcontext *ctx, { struct pipe_blend_state blend; memset(&blend, 0, sizeof(blend)); - blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE; - blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE; - blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO; - blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO; + blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE; + blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE; + blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO; + blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO; if (color) { if (ctx->Color.ColorMask[0][0]) - blend.colormask |= PIPE_MASK_R; + blend.rt[0].colormask |= PIPE_MASK_R; if (ctx->Color.ColorMask[0][1]) - blend.colormask |= PIPE_MASK_G; + blend.rt[0].colormask |= PIPE_MASK_G; if (ctx->Color.ColorMask[0][2]) - blend.colormask |= PIPE_MASK_B; + blend.rt[0].colormask |= PIPE_MASK_B; if (ctx->Color.ColorMask[0][3]) - blend.colormask |= PIPE_MASK_A; + blend.rt[0].colormask |= PIPE_MASK_A; if (st->ctx->Color.DitherFlag) blend.dither = 1; } diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c index e2cd80b404..8483b93bd8 100644 --- a/src/mesa/state_tracker/st_cb_condrender.c +++ b/src/mesa/state_tracker/st_cb_condrender.c @@ -69,7 +69,7 @@ st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q, break; default: assert(0 && "bad mode in st_BeginConditionalRender"); - return; + m = PIPE_RENDER_COND_WAIT; } pipe->render_condition(pipe, stq->pq, m); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 7c664267d4..7afdc31ede 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -36,24 +36,18 @@ #include "main/macros.h" #include "main/texformat.h" #include "main/texstore.h" -#include "main/state.h" #include "shader/program.h" -#include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_atom_constbuf.h" -#include "st_draw.h" #include "st_program.h" #include "st_cb_drawpixels.h" #include "st_cb_readpixels.h" #include "st_cb_fbo.h" -#include "st_cb_texture.h" -#include "st_draw.h" #include "st_format.h" -#include "st_mesa_to_tgsi.h" #include "st_texture.h" #include "st_inlines.h" @@ -1138,6 +1132,8 @@ st_destroy_drawpix(struct st_context *st) { st_reference_fragprog(st, &st->drawpix.z_shader, NULL); st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); - st_reference_vertprog(st, &st->drawpix.vert_shaders[0], NULL); - st_reference_vertprog(st, &st->drawpix.vert_shaders[1], NULL); + if (st->drawpix.vert_shaders[0]) + free(st->drawpix.vert_shaders[0]); + if (st->drawpix.vert_shaders[1]) + free(st->drawpix.vert_shaders[1]); } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 45ce34a85f..f7350ef1e3 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -44,7 +44,6 @@ #include "pipe/p_screen.h" #include "st_context.h" #include "st_cb_fbo.h" -#include "st_cb_texture.h" #include "st_format.h" #include "st_public.h" #include "st_texture.h" diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 93f7145219..17261f8321 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -45,14 +45,11 @@ #include "vbo/vbo.h" #include "st_context.h" -#include "st_atom.h" #include "st_draw.h" #include "st_cb_feedback.h" -#include "st_cb_bufferobjects.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "cso_cache/cso_cache.h" #include "draw/draw_context.h" #include "draw/draw_pipe.h" diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 8c276f8128..5138e596a9 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -36,7 +36,6 @@ #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" #include "shader/program.h" -#include "shader/programopt.h" #include "shader/shader_api.h" #include "cso_cache/cso_context.h" diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 10629e9225..2281d10e99 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -41,7 +41,6 @@ #include "pipe/p_defines.h" #include "st_context.h" #include "st_cb_queryobj.h" -#include "st_public.h" static struct gl_query_object * diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index d82b2a2035..42a1377809 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -47,7 +47,6 @@ #include "st_draw.h" #include "draw/draw_context.h" #include "draw/draw_pipe.h" -#include "shader/prog_instruction.h" #include "vbo/vbo.h" diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 6fa7bb64f2..8eb825a6a4 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -45,10 +45,8 @@ #include "st_debug.h" #include "st_context.h" -#include "st_cb_bitmap.h" #include "st_cb_readpixels.h" #include "st_cb_fbo.h" -#include "st_format.h" #include "st_public.h" #include "st_texture.h" #include "st_inlines.h" diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c index bb931f17c4..f22c5369e4 100644 --- a/src/mesa/state_tracker/st_cb_strings.c +++ b/src/mesa/state_tracker/st_cb_strings.c @@ -33,7 +33,6 @@ #include "main/glheader.h" #include "main/macros.h" -#include "main/version.h" #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index f01053cdac..cee2452eaf 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -31,15 +31,14 @@ #include "main/convolve.h" #endif #include "main/enums.h" +#include "main/fbobject.h" #include "main/formats.h" #include "main/image.h" #include "main/imports.h" #include "main/macros.h" #include "main/mipmap.h" -#include "main/pixel.h" #include "main/texcompress.h" #include "main/texfetch.h" -#include "main/texformat.h" #include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" @@ -687,9 +686,11 @@ st_TexImage(GLcontext * ctx, { char *dst = texImage->Data; const char *src = pixels; - int i; + GLuint i, bw, bh, lines; + _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh); + lines = (height + bh - 1) / bh; - for(i = 0; i < height; ++i) + for(i = 0; i < lines; ++i) { memcpy(dst, src, srcImageStride); dst += dstRowStride; @@ -1368,33 +1369,64 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, } + +/** + * If the format of the src renderbuffer and the format of the dest + * texture are compatible (in terms of blitting), return a TGSI writemask + * to be used during the blit. + * If the src/dest are incompatible, return 0. + */ static unsigned -compatible_src_dst_formats(const struct gl_renderbuffer *src, +compatible_src_dst_formats(GLcontext *ctx, + const struct gl_renderbuffer *src, const struct gl_texture_image *dst) { - const GLenum srcFormat = _mesa_get_format_base_format(src->Format); - const GLenum dstLogicalFormat = _mesa_get_format_base_format(dst->TexFormat); + /* Get logical base formats for the src and dest. + * That is, use the user-requested formats and not the actual, device- + * chosen formats. + * For example, the user may have requested an A8 texture but the + * driver may actually be using an RGBA texture format. When we + * copy/blit to that texture, we only want to copy the Alpha channel + * and not the RGB channels. + * + * Similarly, when the src FBO was created an RGB format may have been + * requested but the driver actually chose an RGBA format. In that case, + * we don't want to copy the undefined Alpha channel to the dest texture + * (it should be 1.0). + */ + const GLenum srcFormat = _mesa_base_fbo_format(ctx, src->InternalFormat); + const GLenum dstFormat = _mesa_base_tex_format(ctx, dst->InternalFormat); - if (srcFormat == dstLogicalFormat) { + /** + * XXX when we have red-only and red/green renderbuffers we'll need + * to add more cases here (or implement a general-purpose routine that + * queries the existance of the R,G,B,A channels in the src and dest). + */ + if (srcFormat == dstFormat) { /* This is the same as matching_base_formats, which should * always pass, as it did previously. */ return TGSI_WRITEMASK_XYZW; } - else if (srcFormat == GL_RGBA && - dstLogicalFormat == GL_RGB) { - /* Add a single special case to cope with RGBA->RGB transfers, - * setting A to 1.0 to cope with situations where the RGB - * destination is actually stored as RGBA. + else if (srcFormat == GL_RGB && dstFormat == GL_RGBA) { + /* Make sure that A in the dest is 1. The actual src format + * may be RGBA and have undefined A values. + */ + return TGSI_WRITEMASK_XYZ; + } + else if (srcFormat == GL_RGBA && dstFormat == GL_RGB) { + /* Make sure that A in the dest is 1. The actual dst format + * may be RGBA and will need A=1 to provide proper alpha values + * when sampled later. */ - return TGSI_WRITEMASK_XYZ; /* A ==> 1.0 */ + return TGSI_WRITEMASK_XYZ; } else { if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s failed for src %s, dst %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(srcFormat), - _mesa_lookup_enum_by_nr(dstLogicalFormat)); + _mesa_lookup_enum_by_nr(dstFormat)); /* Otherwise fail. */ @@ -1505,7 +1537,7 @@ st_copy_texsubimage(GLcontext *ctx, matching_base_formats = (_mesa_get_format_base_format(strb->Base.Format) == _mesa_get_format_base_format(texImage->TexFormat)); - format_writemask = compatible_src_dst_formats(&strb->Base, texImage); + format_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage); if (ctx->_ImageTransferState == 0x0) { diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c index ab11c5b4fe..b29191abef 100644 --- a/src/mesa/state_tracker/st_cb_viewport.c +++ b/src/mesa/state_tracker/st_cb_viewport.c @@ -27,14 +27,11 @@ #include "main/glheader.h" #include "st_context.h" -#include "st_public.h" #include "st_cb_viewport.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" static void st_viewport(GLcontext * ctx, GLint x, GLint y, diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 45bb6b3cb7..a62ff248ce 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -27,11 +27,6 @@ #include "main/imports.h" #include "main/context.h" -#include "main/extensions.h" -#include "main/matrix.h" -#include "main/buffers.h" -#include "main/scissor.h" -#include "main/viewport.h" #include "vbo/vbo.h" #include "shader/shader_api.h" #include "glapi/glapi.h" @@ -48,7 +43,7 @@ #include "st_cb_drawpixels.h" #include "st_cb_rasterpos.h" #endif -#ifdef FEATURE_OES_draw_texture +#if FEATURE_OES_draw_texture #include "st_cb_drawtex.h" #endif #include "st_cb_fbo.h" @@ -69,7 +64,6 @@ #include "st_program.h" #include "pipe/p_context.h" #include "draw/draw_context.h" -#include "cso_cache/cso_cache.h" #include "cso_cache/cso_context.h" @@ -209,7 +203,7 @@ static void st_destroy_context_priv( struct st_context *st ) st_destroy_bitmap(st); st_destroy_drawpix(st); #endif -#ifdef FEATURE_OES_draw_texture +#if FEATURE_OES_draw_texture st_destroy_drawtex(st); #endif @@ -330,6 +324,11 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_drawpixels_functions(functions); st_init_rasterpos_functions(functions); #endif + +#if FEATURE_OES_draw_texture + st_init_drawtex_functions(functions); +#endif + st_init_fbo_functions(functions); #if FEATURE_feedback st_init_feedback_functions(functions); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 2c4943cfb0..50e98d7146 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -159,7 +159,7 @@ struct st_context /** for glDraw/CopyPixels */ struct { struct st_fragment_program *z_shader; - struct st_vertex_program *vert_shaders[2]; + void *vert_shaders[2]; /**< ureg shaders */ } drawpix; /** for glClear */ diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index b0d5b993a7..381c68474d 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -531,6 +531,9 @@ st_draw_vbo(GLcontext *ctx, GLboolean userSpace = GL_FALSE; GLboolean vertDataEdgeFlags; + /* Mesa core state should have been validated already */ + assert(ctx->NewState == 0x0); + /* Gallium probably doesn't want this in some cases. */ if (!index_bounds_valid) if (!vbo_all_varyings_in_vbos(arrays)) diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index a05d6dd06b..cdaee2a353 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -28,7 +28,6 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" -#include "shader/prog_uniform.h" #include "vbo/vbo.h" @@ -242,7 +241,7 @@ st_feedback_draw_vbo(GLcontext *ctx, mapped_constants = pipe_buffer_map(pipe->screen, st->state.constants[PIPE_SHADER_VERTEX], PIPE_BUFFER_USAGE_CPU_READ); - draw_set_mapped_constant_buffer(st->draw, PIPE_SHADER_VERTEX, + draw_set_mapped_constant_buffer(st->draw, PIPE_SHADER_VERTEX, 0, mapped_constants, st->state.constants[PIPE_SHADER_VERTEX]->size); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 35e08749df..f2a62f9b69 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -28,7 +28,6 @@ #include "main/imports.h" #include "main/context.h" -#include "main/extensions.h" #include "main/macros.h" #include "pipe/p_context.h" @@ -148,6 +147,7 @@ void st_init_extensions(struct st_context *st) * Extensions that are supported by all Gallium drivers: */ ctx->Extensions.ARB_copy_buffer = GL_TRUE; + ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multisample = GL_TRUE; @@ -168,6 +168,7 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; ctx->Extensions.EXT_framebuffer_object = GL_TRUE; + ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; @@ -187,6 +188,10 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.NV_texgen_reflection = GL_TRUE; ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; +#if FEATURE_OES_draw_texture + ctx->Extensions.OES_draw_texture = GL_TRUE; +#endif + ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; @@ -310,4 +315,14 @@ void st_init_extensions(struct st_context *st) if (st->pipe->render_condition) { ctx->Extensions.NV_conditional_render = GL_TRUE; } + + if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_ENABLE)) { + ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; + } + +#if 0 /* not yet */ + if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_FUNC)) { + ctx->Extensions.ARB_draw_buffers_blend = GL_TRUE; + } +#endif } diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index d00b67a279..3ffc2aee2a 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -35,7 +35,6 @@ #include "main/imports.h" #include "main/context.h" #include "main/texstore.h" -#include "main/texformat.h" #include "main/enums.h" #include "main/macros.h" @@ -288,6 +287,8 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) return MESA_FORMAT_XRGB8888; case PIPE_FORMAT_B8G8R8A8_UNORM: return MESA_FORMAT_ARGB8888_REV; + case PIPE_FORMAT_B8G8R8X8_UNORM: + return MESA_FORMAT_XRGB8888_REV; case PIPE_FORMAT_A1R5G5B5_UNORM: return MESA_FORMAT_ARGB1555; case PIPE_FORMAT_A4R4G4B4_UNORM: diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index a5d1ae3b03..835142e3d4 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -30,15 +30,11 @@ #include "main/buffers.h" #include "main/context.h" #include "main/framebuffer.h" -#include "main/matrix.h" #include "main/renderbuffer.h" -#include "main/scissor.h" -#include "main/viewport.h" #include "st_context.h" #include "st_cb_fbo.h" #include "st_public.h" #include "pipe/p_defines.h" -#include "pipe/p_context.h" struct st_framebuffer * diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 2c283d464a..3823a59d37 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -46,9 +46,7 @@ #include "st_debug.h" #include "st_context.h" -#include "st_draw.h" #include "st_gen_mipmap.h" -#include "st_program.h" #include "st_texture.h" #include "st_cb_texture.h" #include "st_inlines.h" diff --git a/src/mesa/state_tracker/st_inlines.h b/src/mesa/state_tracker/st_inlines.h index a41cfeb96f..dccc46f12d 100644 --- a/src/mesa/state_tracker/st_inlines.h +++ b/src/mesa/state_tracker/st_inlines.h @@ -126,6 +126,16 @@ st_no_flush_pipe_buffer_write(struct st_context *st, } static INLINE void +st_no_flush_pipe_buffer_write_nooverlap(struct st_context *st, + struct pipe_buffer *buf, + unsigned int offset, + unsigned int size, + const void * data) +{ + pipe_buffer_write_nooverlap(st->pipe->screen, buf, offset, size, data); +} + +static INLINE void st_cond_flush_pipe_buffer_read(struct st_context *st, struct pipe_buffer *buf, unsigned int offset, diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index e788008dfe..4aed2df8c3 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -34,8 +34,10 @@ #include "pipe/p_compiler.h" #include "pipe/p_shader_tokens.h" #include "pipe/p_state.h" +#include "pipe/p_context.h" #include "tgsi/tgsi_ureg.h" #include "st_mesa_to_tgsi.h" +#include "st_context.h" #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" @@ -48,6 +50,10 @@ struct label { unsigned token; }; + +/** + * Intermediate state used during shader translation. + */ struct st_translate { struct ureg_program *ureg; @@ -661,6 +667,22 @@ compile_instruction( } } +/** + * Emit the TGSI instructions to adjust the WPOS pixel center convention + */ +static void +emit_adjusted_wpos( struct st_translate *t, + const struct gl_program *program, GLfloat value) +{ + struct ureg_program *ureg = t->ureg; + struct ureg_dst wpos_temp = ureg_DECL_temporary(ureg); + struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; + + ureg_ADD(ureg, ureg_writemask(wpos_temp, TGSI_WRITEMASK_X | TGSI_WRITEMASK_Y), + wpos_input, ureg_imm1f(ureg, value)); + + t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); +} /** * Emit the TGSI instructions for inverting the WPOS y coordinate. @@ -686,12 +708,17 @@ emit_inverted_wpos( struct st_translate *t, winSizeState); struct ureg_src winsize = ureg_DECL_constant( ureg, winHeightConst ); - struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); + struct ureg_dst wpos_temp; struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; /* MOV wpos_temp, input[wpos] */ - ureg_MOV( ureg, wpos_temp, wpos_input ); + if (wpos_input.File == TGSI_FILE_TEMPORARY) + wpos_temp = ureg_dst(wpos_input); + else { + wpos_temp = ureg_DECL_temporary( ureg ); + ureg_MOV( ureg, wpos_temp, wpos_input ); + } /* SUB wpos_temp.y, winsize_const, wpos_input */ @@ -730,6 +757,7 @@ emit_face_var( struct st_translate *t, t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); } + static void emit_edgeflags( struct st_translate *t, const struct gl_program *program ) @@ -741,6 +769,7 @@ emit_edgeflags( struct st_translate *t, ureg_MOV( ureg, edge_dst, edge_src ); } + /** * Translate Mesa program to TGSI format. * \param program the program to translate @@ -758,7 +787,7 @@ emit_edgeflags( struct st_translate *t, * \param outputSemanticIndex the semantic index (ex: which texcoord) for * each output * - * \return array of translated tokens, caller's responsibility to free + * \return PIPE_OK or PIPE_ERROR_OUT_OF_MEMORY */ enum pipe_error st_translate_mesa_program( @@ -779,6 +808,7 @@ st_translate_mesa_program( { struct st_translate translate, *t; unsigned i; + enum pipe_error ret = PIPE_OK; t = &translate; memset(t, 0, sizeof *t); @@ -794,6 +824,7 @@ st_translate_mesa_program( * Declare input attributes. */ if (procType == TGSI_PROCESSOR_FRAGMENT) { + struct gl_fragment_program* fp = (struct gl_fragment_program*)program; for (i = 0; i < numInputs; i++) { t->inputs[i] = ureg_DECL_fs_input(ureg, inputSemanticName[i], @@ -805,7 +836,51 @@ st_translate_mesa_program( /* Must do this after setting up t->inputs, and before * emitting constant references, below: */ - emit_inverted_wpos( t, program ); + struct pipe_screen* pscreen = st_context(ctx)->pipe->screen; + boolean invert = FALSE; + + if (fp->OriginUpperLeft) { + if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) { + } + else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT)) { + ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT); + invert = TRUE; + } + else + assert(0); + } + else { + if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT)) + ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT); + else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) + invert = TRUE; + else + assert(0); + } + + if (fp->PixelCenterInteger) { + if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) + ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER); + else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) + emit_adjusted_wpos(t, program, invert ? 0.5f : -0.5f); + else + assert(0); + } + else { + if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) { + } + else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) { + ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER); + emit_adjusted_wpos(t, program, invert ? -0.5f : 0.5f); + } + else + assert(0); + } + + /* we invert after adjustment so that we avoid the MOV to temporary, + * and reuse the adjustment ADD instead */ + if (invert) + emit_inverted_wpos(t, program); } if (program->InputsRead & FRAG_BIT_FACE) { @@ -865,8 +940,10 @@ st_translate_mesa_program( t->constants = CALLOC( program->Parameters->NumParameters, sizeof t->constants[0] ); - if (t->constants == NULL) + if (t->constants == NULL) { + ret = PIPE_ERROR_OUT_OF_MEMORY; goto out; + } for (i = 0; i < program->Parameters->NumParameters; i++) { switch (program->Parameters->Parameters[i].Type) { @@ -920,8 +997,6 @@ st_translate_mesa_program( t->insn[t->labels[i].branch_target] ); } - return PIPE_OK; - out: FREE(t->insn); FREE(t->labels); @@ -931,7 +1006,7 @@ out: debug_printf("%s: translate error flag set\n", __FUNCTION__); } - return PIPE_ERROR_OUT_OF_MEMORY; + return ret; } diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 0827b3db9e..a8b22c548f 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -220,11 +220,11 @@ #if defined(DO_ATTRIBS) /* compute attributes at left-most fragment */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5, iy + 0.5, wPlane); + span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane); ATTRIB_LOOP_BEGIN GLuint c; for (c = 0; c < 4; c++) { - span.attrStart[attr][c] = solve_plane(ix + 0.5, iy + 0.5, attrPlane[attr][c]); + span.attrStart[attr][c] = solve_plane(ix + 0.5F, iy + 0.5F, attrPlane[attr][c]); } ATTRIB_LOOP_END #endif @@ -328,11 +328,11 @@ #if defined(DO_ATTRIBS) /* compute attributes at left-most fragment */ - span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5, wPlane); + span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5, iy + 0.5F, wPlane); ATTRIB_LOOP_BEGIN GLuint c; for (c = 0; c < 4; c++) { - span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5, attrPlane[attr][c]); + span.attrStart[attr][c] = solve_plane(ix + 1.5, iy + 0.5F, attrPlane[attr][c]); } ATTRIB_LOOP_END #endif diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index cf53f01b7c..2dd9ca6348 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -37,7 +37,7 @@ /* XXX this would have to change for accum buffers with more or less * than 16 bits per color channel. */ -#define ACCUM_SCALE16 32767.0 +#define ACCUM_SCALE16 32767.0F /* diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index 5761bb00b4..509477433a 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -146,8 +146,8 @@ _swrast_alpha_test(const GLcontext *ctx, SWspan *span) ALPHA_TEST(FixedToInt(alpha), alpha += alphaStep); } else { - const GLfloat alphaStep = span->alphaStep; - GLfloat alpha = span->alpha; + const GLfloat alphaStep = FixedToFloat(span->alphaStep); + GLfloat alpha = FixedToFloat(span->alpha); const GLfloat ref = ctx->Color.AlphaRef; ALPHA_TEST(alpha, alpha += alphaStep); } diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 353e9999d6..05da64de3a 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -82,10 +82,11 @@ apply_swizzle(GLfloat values[4], GLuint swizzle) break; case GL_SWIZZLE_STQ_DQ_ATI: /* make sure q is not 0 to avoid problems later with infinite values (texture lookup)? */ - if (q == 0.0F) q = 0.000000001; + if (q == 0.0F) + q = 0.000000001F; values[0] = s / q; values[1] = t / q; - values[2] = 1 / q; + values[2] = 1.0 / q; break; } values[3] = 0.0; @@ -171,27 +172,27 @@ apply_dst_mod(GLuint optype, GLuint mod, GLfloat * val) val[i] = 8 * val[i]; break; case GL_HALF_BIT_ATI: - val[i] = val[i] * 0.5; + val[i] = val[i] * 0.5F; break; case GL_QUARTER_BIT_ATI: - val[i] = val[i] * 0.25; + val[i] = val[i] * 0.25F; break; case GL_EIGHTH_BIT_ATI: - val[i] = val[i] * 0.125; + val[i] = val[i] * 0.125F; break; } if (has_sat) { - if (val[i] < 0.0) - val[i] = 0; - else if (val[i] > 1.0) - val[i] = 1.0; + if (val[i] < 0.0F) + val[i] = 0.0F; + else if (val[i] > 1.0F) + val[i] = 1.0F; } else { - if (val[i] < -8.0) - val[i] = -8.0; - else if (val[i] > 8.0) - val[i] = 8.0; + if (val[i] < -8.0F) + val[i] = -8.0F; + else if (val[i] > 8.0F) + val[i] = 8.0F; } } } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index f9092c215a..0d4680db9f 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -149,26 +149,26 @@ _swrast_update_polygon( GLcontext *ctx ) if (ctx->Polygon.CullFlag) { switch (ctx->Polygon.CullFaceMode) { case GL_BACK: - backface_sign = -1.0; + backface_sign = -1.0F; break; case GL_FRONT: - backface_sign = 1.0; + backface_sign = 1.0F; break; case GL_FRONT_AND_BACK: /* fallthrough */ default: - backface_sign = 0.0; + backface_sign = 0.0F; } } else { - backface_sign = 0.0; + backface_sign = 0.0F; } SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign; /* This is for front/back-face determination, but not for culling */ SWRAST_CONTEXT(ctx)->_BackfaceSign - = (ctx->Polygon.FrontFace == GL_CW) ? -1.0 : 1.0; + = (ctx->Polygon.FrontFace == GL_CW) ? -1.0F : 1.0F; } diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 0b6bb7e3ec..ac5dae2148 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -497,17 +497,24 @@ depth_test_span32( GLcontext *ctx, GLuint n, return passed; } -/* Apply ARB_depth_clamp to span of fragments. */ + + +/** + * Clamp fragment Z values to the depth near/far range (glDepthRange()). + * This is used when GL_ARB_depth_clamp/GL_DEPTH_CLAMP is turned on. + * In that case, vertexes are not clipped against the near/far planes + * so rasterization will produce fragment Z values outside the usual + * [0,1] range. + */ void _swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ) { struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_renderbuffer *rb = fb->_DepthBuffer; const GLuint count = span->end; - GLuint *zValues = span->array->z; - GLuint min, max; + GLint *zValues = (GLint *) span->array->z; /* sign change */ + GLint min, max; GLfloat min_f, max_f; - int i; + GLuint i; if (ctx->Viewport.Near < ctx->Viewport.Far) { min_f = ctx->Viewport.Near; @@ -517,15 +524,21 @@ _swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ) max_f = ctx->Viewport.Near; } - if (rb->DataType == GL_UNSIGNED_SHORT) { - CLAMPED_FLOAT_TO_USHORT(min, min_f); - CLAMPED_FLOAT_TO_USHORT(max, max_f); - } else { - assert(rb->DataType == GL_UNSIGNED_INT); - min = FLOAT_TO_UINT(min_f); - max = FLOAT_TO_UINT(max_f); - } - + /* Convert floating point values in [0,1] to device Z coordinates in + * [0, DepthMax]. + * ex: If the the Z buffer has 24 bits, DepthMax = 0xffffff. + * + * XXX this all falls apart if we have 31 or more bits of Z because + * the triangle rasterization code produces unsigned Z values. Negative + * vertex Z values come out as large fragment Z uints. + */ + min = (GLint) (min_f * fb->_DepthMaxF); + max = (GLint) (max_f * fb->_DepthMaxF); + if (max < 0) + max = 0x7fffffff; /* catch over flow for 30-bit z */ + + /* Note that we do the comparisons here using signed integers. + */ for (i = 0; i < count; i++) { if (zValues[i] < min) zValues[i] = min; diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 77ed0cfef9..0472bbf553 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -172,14 +172,14 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) /* compute (scaled) fog color */ if (span->array->ChanType == GL_UNSIGNED_BYTE) { - rFog = ctx->Fog.Color[RCOMP] * 255.0; - gFog = ctx->Fog.Color[GCOMP] * 255.0; - bFog = ctx->Fog.Color[BCOMP] * 255.0; + rFog = ctx->Fog.Color[RCOMP] * 255.0F; + gFog = ctx->Fog.Color[GCOMP] * 255.0F; + bFog = ctx->Fog.Color[BCOMP] * 255.0F; } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { - rFog = ctx->Fog.Color[RCOMP] * 65535.0; - gFog = ctx->Fog.Color[GCOMP] * 65535.0; - bFog = ctx->Fog.Color[BCOMP] * 65535.0; + rFog = ctx->Fog.Color[RCOMP] * 65535.0F; + gFog = ctx->Fog.Color[GCOMP] * 65535.0F; + bFog = ctx->Fog.Color[BCOMP] * 65535.0F; } else { rFog = ctx->Fog.Color[RCOMP]; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 9ac33a26a6..d31da4c402 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -144,12 +144,22 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, const struct gl_fragment_program *program, const SWspan *span, GLuint col) { + GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col]; + if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ _mesa_bzero(machine->Temporaries, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); } + /* ARB_fragment_coord_conventions */ + if (program->OriginUpperLeft) + wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1]; + if (!program->PixelCenterInteger) { + wpos[0] += 0.5F; + wpos[1] += 0.5F; + } + /* Setup pointer to input attributes */ machine->Attribs = span->array->attribs; @@ -162,7 +172,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, /* if running a GLSL program (not ARB_fragment_program) */ if (ctx->Shader.CurrentProgram) { /* Store front/back facing value */ - machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0 - span->facing; + machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing; } machine->CurElement = col; diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 6b955429e9..a9a704a16e 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -125,16 +125,16 @@ sprite_point(GLcontext *ctx, const SWvertex *vert) GLfloat s, r, dsdx; /* texcoord / pointcoord interpolants */ - s = 0.0; - dsdx = 1.0 / size; + s = 0.0F; + dsdx = 1.0F / size; if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) { - dtdy = 1.0 / size; - t0 = 0.5 * dtdy; + dtdy = 1.0F / size; + t0 = 0.5F * dtdy; } else { /* GL_UPPER_LEFT */ - dtdy = -1.0 / size; - t0 = 1.0 + 0.5 * dtdy; + dtdy = -1.0F / size; + t0 = 1.0F + 0.5F * dtdy; } ATTRIB_LOOP_BEGIN diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 4ea9547cd9..905cf3d550 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -645,7 +645,7 @@ interpolate_wpos(GLcontext *ctx, SWspan *span) { GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS]; GLuint i; - const GLfloat zScale = 1.0 / ctx->DrawBuffer->_DepthMaxF; + const GLfloat zScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; GLfloat w, dw; if (span->arrayMask & SPAN_XY) { @@ -1316,6 +1316,13 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) ASSERT(span->end <= MAX_WIDTH); + /* Depth bounds test */ + if (ctx->Depth.BoundsTest && fb->Visual.depthBits > 0) { + if (!_swrast_depth_bounds_test(ctx, span)) { + return; + } + } + #ifdef DEBUG /* Make sure all fragments are within window bounds */ if (span->arrayMask & SPAN_XY) { diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 594b71a03c..95e2c082ba 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -316,18 +316,18 @@ texture_combine( GLcontext *ctx, GLuint unit, GLuint n, /* (a * b) + (c * d) - 0.5 */ for (i = 0; i < n; i++) { rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] + - arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5) * scaleRGB; + arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5F) * scaleRGB; rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] + - arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5) * scaleRGB; + arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5F) * scaleRGB; rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] + - arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5) * scaleRGB; + arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5F) * scaleRGB; } } else { for (i = 0; i < n; i++) { - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * scaleRGB; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * scaleRGB; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * scaleRGB; + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5F) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5F) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5F) * scaleRGB; } } break; @@ -385,11 +385,11 @@ texture_combine( GLcontext *ctx, GLuint unit, GLuint n, case GL_MODULATE_SIGNED_ADD_ATI: for (i = 0; i < n; i++) { rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + - arg1[i][RCOMP] - 0.5) * scaleRGB; + arg1[i][RCOMP] - 0.5F) * scaleRGB; rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + - arg1[i][GCOMP] - 0.5) * scaleRGB; + arg1[i][GCOMP] - 0.5F) * scaleRGB; rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + - arg1[i][BCOMP] - 0.5) * scaleRGB; + arg1[i][BCOMP] - 0.5F) * scaleRGB; } break; case GL_MODULATE_SUBTRACT_ATI: @@ -456,7 +456,7 @@ texture_combine( GLcontext *ctx, GLuint unit, GLuint n, for (i = 0; i < n; i++) { rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + arg2[i][ACOMP] * arg3[i][ACOMP] - - 0.5) * scaleA; + 0.5F) * scaleA; } } else { diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 76b65cc755..ff7deecc39 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -445,7 +445,7 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, switch (wrapMode) { case GL_CLAMP: /* Not exactly what the spec says, but it matches NVIDIA output */ - fcol = CLAMP(coord - 0.5F, 0.0, max-1); + fcol = CLAMP(coord - 0.5F, 0.0F, max - 1); i0 = IFLOOR(fcol); i1 = i0 + 1; break; diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index c183b315b6..c01cf7d1f0 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -75,12 +75,6 @@ typedef struct { } SWvertex; -/** - * Fixed point data type. - */ -typedef int GLfixed; - - #define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0 diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 38757a0e28..812d712b07 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -108,6 +108,22 @@ convert_bgra_to_float(const struct gl_client_array *input, } } +static void +convert_half_to_float(const struct gl_client_array *input, + const GLubyte *ptr, GLfloat *fptr, + GLuint count, GLuint sz) +{ + GLuint i, j; + + for (i = 0; i < count; i++) { + GLhalfARB *in = (GLhalfARB *)ptr; + + for (j = 0; j < sz; j++) { + *fptr++ = _mesa_half_to_float(in[j]); + } + ptr += input->StrideB; + } +} /* Adjust pointer to point at first requested element, convert to * floating point, populate VB->AttribPtr[]. @@ -155,6 +171,9 @@ static void _tnl_import_array( GLcontext *ctx, case GL_DOUBLE: CONVERT(GLdouble, (GLfloat)); break; + case GL_HALF_FLOAT: + convert_half_to_float(input, ptr, fptr, count, sz); + break; default: assert(0); break; @@ -380,9 +399,12 @@ void _tnl_draw_prims( GLcontext *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); const GLuint TEST_SPLIT = 0; const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES; - GLuint max_basevertex = prim->basevertex; + GLint max_basevertex = prim->basevertex; GLuint i; + /* Mesa core state should have been validated already */ + assert(ctx->NewState == 0x0); + if (!_mesa_check_conditional_render(ctx)) return; /* don't draw */ diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index a52505b4b8..ab8ea60cf2 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -64,7 +64,7 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) for (i = 0; i < VB->Count; i++) { const GLfloat dist = FABSF(*eyeCoord); const GLfloat q = p0 + dist * (p1 + dist * p2); - const GLfloat atten = (q != 0.0) ? SQRTF(1.0 / q) : 1.0; + const GLfloat atten = (q != 0.0F) ? SQRTF(1.0F / q) : 1.0F; size[i][0] = pointSize * atten; /* clamping done in rasterization */ eyeCoord += eyeCoordStride; } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index fe4209ae57..d3955873dc 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -383,7 +383,7 @@ static void adjust_input_ptrs( GLcontext *ctx, GLint diff) struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); struct tnl_clipspace_attr *a = vtx->attr; const GLuint count = vtx->attr_count; - int j; + GLuint j; diff -= 1; for (j=0; j<count; ++j) { diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 2c82f7c9c5..88502f3d35 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -49,7 +49,7 @@ vbo_get_minmax_index(GLcontext *ctx, GLuint *min_index, GLuint *max_index) { GLuint i; - GLsizei count = prim->count; + GLuint count = prim->count; const void *indices; if (_mesa_is_bufferobj(ib->obj)) { @@ -132,7 +132,7 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, case GL_FLOAT: { GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j); - GLuint k; + GLint k; for (k = 0; k < array->Size; k++) { if (IS_INF_OR_NAN(f[k]) || f[k] >= 1.0e20 || f[k] <= -1.0e10) { @@ -443,6 +443,13 @@ recalculate_input_bindings(GLcontext *ctx) } +/** + * Examine the enabled vertex arrays to set the exec->array.inputs[] values. + * These will point to the arrays to actually use for drawing. Some will + * be user-provided arrays, other will be zero-stride const-valued arrays. + * Note that this might set the _NEW_ARRAY dirty flag so state validation + * must be done after this call. + */ static void bind_arrays(GLcontext *ctx) { @@ -484,9 +491,6 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) FLUSH_CURRENT( ctx, 0 ); - if (ctx->NewState) - _mesa_update_state( ctx ); - if (!_mesa_valid_to_render(ctx, "glDrawArrays")) { return; } @@ -542,7 +546,7 @@ dump_element_buffer(GLcontext *ctx, GLenum type) case GL_UNSIGNED_BYTE: { const GLubyte *us = (const GLubyte *) map; - GLuint i; + GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) { _mesa_printf("%02x ", us[i]); if (i % 32 == 31) @@ -554,7 +558,7 @@ dump_element_buffer(GLcontext *ctx, GLenum type) case GL_UNSIGNED_SHORT: { const GLushort *us = (const GLushort *) map; - GLuint i; + GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) { _mesa_printf("%04x ", us[i]); if (i % 16 == 15) @@ -566,7 +570,7 @@ dump_element_buffer(GLcontext *ctx, GLenum type) case GL_UNSIGNED_INT: { const GLuint *us = (const GLuint *) map; - GLuint i; + GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) { _mesa_printf("%08x ", us[i]); if (i % 8 == 7) @@ -600,18 +604,16 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, FLUSH_CURRENT( ctx, 0 ); - if (ctx->NewState) - _mesa_update_state( ctx ); - if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) { return; } + bind_arrays( ctx ); + + /* check for dirty state again */ if (ctx->NewState) _mesa_update_state( ctx ); - bind_arrays( ctx ); - ib.count = count; ib.type = type; ib.obj = ctx->Array.ElementArrayBufferObj; @@ -688,6 +690,16 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, * or we can read/write out of memory in several different places! */ + /* Catch/fix some potential user errors */ + if (type == GL_UNSIGNED_BYTE) { + start = MIN2(start, 0xff); + end = MIN2(end, 0xff); + } + else if (type == GL_UNSIGNED_SHORT) { + start = MIN2(start, 0xffff); + end = MIN2(end, 0xffff); + } + if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ warnCount++; @@ -712,8 +724,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, #ifdef DEBUG /* 'end' was out of bounds, but now let's check the actual array - * indexes to see if any of them are out of bounds. If so, warn - * and skip the draw to avoid potential segfault, etc. + * indexes to see if any of them are out of bounds. */ { GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, @@ -730,7 +741,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, ctx->Array.ElementArrayBufferObj->Name, ctx->Array.ElementArrayBufferObj->Size); } - return; } /* XXX we could also find the min index and compare to 'start' * to see if start is correct. But it's more likely to get the @@ -738,6 +748,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, */ } #endif + + /* Set 'end' to the max possible legal value */ + assert(ctx->Array.ArrayObj->_MaxElement >= 1); + end = ctx->Array.ArrayObj->_MaxElement - 1; } else if (0) { _mesa_printf("glDraw[Range]Elements{,BaseVertex}" @@ -836,16 +850,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, FLUSH_CURRENT( ctx, 0 ); - if (ctx->NewState) - _mesa_update_state( ctx ); - if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) { return; } - if (ctx->NewState) - _mesa_update_state( ctx ); - prim = _mesa_calloc(primcount * sizeof(*prim)); if (prim == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); @@ -857,6 +865,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, */ bind_arrays( ctx ); + /* check for dirty state again */ + if (ctx->NewState) + _mesa_update_state( ctx ); + switch (type) { case GL_UNSIGNED_INT: index_type_size = 4; diff --git a/src/mesa/vbo/vbo_split.c b/src/mesa/vbo/vbo_split.c index c445acca7d..ce40cbbcc3 100644 --- a/src/mesa/vbo/vbo_split.c +++ b/src/mesa/vbo/vbo_split.c @@ -108,12 +108,14 @@ void vbo_split_prims( GLcontext *ctx, vbo_draw_func draw, const struct split_limits *limits ) { - GLuint max_basevertex = prim->basevertex; + GLint max_basevertex = prim->basevertex; GLuint i; for (i = 1; i < nr_prims; i++) max_basevertex = MAX2(max_basevertex, prim[i].basevertex); + /* XXX max_basevertex is computed but not used, why? */ + if (ib) { if (limits->max_indices == 0) { /* Could traverse the indices, re-emitting vertices in turn. diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index bc83b5a0bd..8edb69bf84 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -29,7 +29,7 @@ * the symbol visibility mode to 'default'. */ -#include "../x86/assyntax.h" +#include "x86/assyntax.h" #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 # pragma GCC visibility push(default) diff --git a/src/mesa/x86/assyntax.h b/src/mesa/x86/assyntax.h index 524944f73a..de1f6a48de 100644 --- a/src/mesa/x86/assyntax.h +++ b/src/mesa/x86/assyntax.h @@ -1735,9 +1735,9 @@ SECTION _DATA public align=16 class=DATA use32 flat * If we build with gcc's -fvisibility=hidden flag, we'll need to change * the symbol visibility mode to 'default'. */ -#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) +#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # define HIDDEN(x) .hidden x -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # pragma GCC visibility push(default) # define HIDDEN(x) .hidden x #else diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 6668852514..8030fdf90b 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -26,7 +26,7 @@ * SOFTWARE. */ -#include "assyntax.h" +#include "x86/assyntax.h" #include "glapi/glapioffsets.h" #if defined(STDCALL_API) @@ -46,7 +46,7 @@ #define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX)) -#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) +#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) #define GLOBL_FN(x) GLOBL x ; .type x, function #else #define GLOBL_FN(x) GLOBL x diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S index 92b1c2d902..3886a510bb 100644 --- a/src/mesa/x86/read_rgba_span_x86.S +++ b/src/mesa/x86/read_rgba_span_x86.S @@ -31,7 +31,7 @@ */ .file "read_rgba_span_x86.S" -#if !defined(__DJGPP__) && !defined(__MINGW32__) /* this one cries for assyntax.h */ +#if !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) /* this one cries for assyntax.h */ /* Kevin F. Quinn 2nd July 2006 * Replaced data segment constants with text-segment instructions. */ @@ -671,7 +671,7 @@ _generic_read_RGBA_span_RGB565_MMX: emms #endif ret -#endif /* !defined(__DJGPP__) && !defined(__MINGW32__) */ +#endif /* !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) */ #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits |