diff options
Diffstat (limited to 'lib/libGL/libmesa/generated/api_exec_es1.c')
-rw-r--r-- | lib/libGL/libmesa/generated/api_exec_es1.c | 196 |
1 files changed, 120 insertions, 76 deletions
diff --git a/lib/libGL/libmesa/generated/api_exec_es1.c b/lib/libGL/libmesa/generated/api_exec_es1.c index 54b3f0d62..6b8b4f8b3 100644 --- a/lib/libGL/libmesa/generated/api_exec_es1.c +++ b/lib/libGL/libmesa/generated/api_exec_es1.c @@ -1,17 +1,23 @@ /* DO NOT EDIT ************************************************* * THIS FILE AUTOMATICALLY GENERATED BY THE es_generator.py SCRIPT - * API specification file: /share/OpenBSD/xenocara/lib/libGL/libmesa/generated/../../../../dist/Mesa/src/mesa/main/APIspec.xml + * API specification file: /usr/xenocara/lib/libGL/libmesa/generated/../../../../dist/Mesa/src/mesa/main/APIspec.xml * GLES version: GLES1.1 - * date: 2011-05-15 15:41:33 + * date: 2012-07-13 17:40:03 */ #include "GLES/gl.h" #include "GLES/glext.h" #include "main/mfeatures.h" +#include "main/compiler.h" +#include "main/api_exec.h" #if FEATURE_ES1 +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GL_APIENTRYP +#endif + /* These types are needed for the Mesa veneer, but are not defined in * the standard GLES headers. @@ -23,49 +29,6 @@ typedef double GLclampd; 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 "main/remap.h" - -/* cannot include main/dispatch.h here */ -#ifdef IN_DRI_DRIVER -#define _GLAPI_USE_REMAP_TABLE -#endif -/* glapi uses GLAPIENTRY while GLES headers define GL_APIENTRY */ -#ifndef GLAPIENTRY -#define GLAPIENTRY GL_APIENTRY -#endif -#include "es1api/glapi/glapitable.h" -#include "es1api/glapi/glapioffsets.h" -#include "es1api/glapi/glapidispatch.h" - -#if FEATURE_remap_table - -#if !FEATURE_GL -int driDispatchRemapTable[driDispatchRemapTable_size]; -#endif - -#define need_MESA_remap_table - -#include "es1api/main/remap_helper.h" - -void -_mesa_init_remap_table_es1(void) -{ - _mesa_do_init_remap_table(_mesa_function_pool, - driDispatchRemapTable_size, - MESA_remap_table_functions); -} - -void -_mesa_map_static_functions_es1(void) -{ -} - -#endif - -typedef void (*_glapi_proc)(void); /* generic function pointer */ - /************************************************************* * Generated functions begin here */ @@ -586,10 +549,11 @@ static void GL_APIENTRY _es_ClipPlanex(GLenum plane, const GLfixed *equation) _mesa_ClipPlane(plane, converted_equation); } -extern void GL_APIENTRY _vbo_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#define _es_Color4f _vbo_Color4f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#define _check_Color4f _es_Color4f -extern void GL_APIENTRY _vbo_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); static void GL_APIENTRY _es_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { GLfloat converted_red; @@ -602,10 +566,10 @@ static void GL_APIENTRY _es_Color4ub(GLubyte red, GLubyte green, GLubyte blue, G converted_blue = (GLfloat) (blue / 255.0f); converted_alpha = (GLfloat) (alpha / 255.0f); - _vbo_Color4f(converted_red, converted_green, converted_blue, converted_alpha); + _es_Color4f(converted_red, converted_green, converted_blue, converted_alpha); } -extern void GL_APIENTRY _vbo_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); static void GL_APIENTRY _es_Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) { GLfloat converted_red; @@ -618,7 +582,7 @@ static void GL_APIENTRY _es_Color4x(GLfixed red, GLfixed green, GLfixed blue, GL converted_blue = (GLfloat) (blue / 65536.0f); converted_alpha = (GLfloat) (alpha / 65536.0f); - _vbo_Color4f(converted_red, converted_green, converted_blue, converted_alpha); + _es_Color4f(converted_red, converted_green, converted_blue, converted_alpha); } extern void GL_APIENTRY _mesa_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); @@ -2548,8 +2512,9 @@ static void * GL_APIENTRY _es_MapBufferOES(GLenum target, GLenum access) return _mesa_MapBufferARB(target, access); } -extern void GL_APIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param); -static void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param) +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param); +static void GL_APIENTRY _check_Materialf(GLenum face, GLenum pname, GLfloat param) { switch(face) { case GL_FRONT_AND_BACK: @@ -2566,11 +2531,12 @@ static void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param) return; } - _vbo_Materialf(face, pname, param); + _es_Materialf(face, pname, param); } -extern void GL_APIENTRY _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat * params); -static void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, const GLfloat *params) +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, const GLfloat * params); +static void GL_APIENTRY _check_Materialfv(GLenum face, GLenum pname, const GLfloat *params) { switch(face) { case GL_FRONT_AND_BACK: @@ -2592,10 +2558,10 @@ static void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, const GLfloat return; } - _vbo_Materialfv(face, pname, params); + _es_Materialfv(face, pname, params); } -extern void GL_APIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param); +extern void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param); static void GL_APIENTRY _es_Materialx(GLenum face, GLenum pname, GLfixed param) { GLfloat converted_param; @@ -2617,10 +2583,10 @@ static void GL_APIENTRY _es_Materialx(GLenum face, GLenum pname, GLfixed param) converted_param = (GLfloat) (param / 65536.0f); - _vbo_Materialf(face, pname, converted_param); + _es_Materialf(face, pname, converted_param); } -extern void GL_APIENTRY _vbo_Materialfv(GLenum face, GLenum pname, GLfloat const * params); +extern void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, GLfloat const * params); static void GL_APIENTRY _es_Materialxv(GLenum face, GLenum pname, const GLfixed *params) { register unsigned int i; @@ -2654,7 +2620,7 @@ static void GL_APIENTRY _es_Materialxv(GLenum face, GLenum pname, const GLfixed converted_params[i] = (GLfloat) (params[i] / 65536.0f); } - _vbo_Materialfv(face, pname, converted_params); + _es_Materialfv(face, pname, converted_params); } extern void GL_APIENTRY _mesa_MatrixMode(GLenum mode); @@ -2740,8 +2706,9 @@ static void GL_APIENTRY _es_MultiDrawElementsEXT(GLenum mode, const GLsizei *cou _mesa_MultiDrawElementsEXT(mode, count, type, indices, primcount); } -extern void GL_APIENTRY _vbo_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -static void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +static void GL_APIENTRY _check_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { switch(texture) { case GL_TEXTURE0: @@ -2782,10 +2749,10 @@ static void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t return; } - _vbo_MultiTexCoord4f(texture, s, t, r, q); + _es_MultiTexCoord4f(texture, s, t, r, q); } -extern void GL_APIENTRY _vbo_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +extern void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q); static void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { GLfloat converted_s; @@ -2837,13 +2804,14 @@ static void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t converted_r = (GLfloat) (r / 65536.0f); converted_q = (GLfloat) (q / 65536.0f); - _vbo_MultiTexCoord4f(texture, converted_s, converted_t, converted_r, converted_q); + _es_MultiTexCoord4f(texture, converted_s, converted_t, converted_r, converted_q); } -extern void GL_APIENTRY _vbo_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz); -#define _es_Normal3f _vbo_Normal3f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz); +#define _check_Normal3f _es_Normal3f -extern void GL_APIENTRY _vbo_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz); +extern void GL_APIENTRY _es_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz); static void GL_APIENTRY _es_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz) { GLfloat converted_nx; @@ -2854,7 +2822,7 @@ static void GL_APIENTRY _es_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz) converted_ny = (GLfloat) (ny / 65536.0f); converted_nz = (GLfloat) (nz / 65536.0f); - _vbo_Normal3f(converted_nx, converted_ny, converted_nz); + _es_Normal3f(converted_nx, converted_ny, converted_nz); } extern void GL_APIENTRY _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer); @@ -4131,10 +4099,34 @@ static void GL_APIENTRY _es_TexImage2D(GLenum target, GLint level, GLint interna } switch(internalFormat) { case GL_ALPHA: + if (format != GL_ALPHA) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; case GL_RGB: + if (format != GL_RGB) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; case GL_RGBA: + if (format != GL_RGBA) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; case GL_LUMINANCE: + if (format != GL_LUMINANCE) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; case GL_LUMINANCE_ALPHA: + if (format != GL_LUMINANCE_ALPHA) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } break; default: _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=%d)", internalFormat); @@ -4617,14 +4609,66 @@ extern void GL_APIENTRY _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei #define _es_Viewport _mesa_Viewport +#include "glapi/glapi.h" + +#if FEATURE_remap_table + +/* define esLocalRemapTable */ +#include "es1api/main/dispatch.h" + +#define need_MESA_remap_table +#include "es1api/main/remap_helper.h" + +static void +init_remap_table(void) +{ + _glthread_DECLARE_STATIC_MUTEX(mutex); + static GLboolean initialized = GL_FALSE; + const struct gl_function_pool_remap *remap = MESA_remap_table_functions; + int i; + + _glthread_LOCK_MUTEX(mutex); + if (initialized) { + _glthread_UNLOCK_MUTEX(mutex); + return; + } + + for (i = 0; i < esLocalRemapTable_size; i++) { + GLint offset; + const char *spec; + + /* sanity check */ + ASSERT(i == remap[i].remap_index); + spec = _mesa_function_pool + remap[i].pool_index; + + offset = _mesa_map_function_spec(spec); + esLocalRemapTable[i] = offset; + } + initialized = GL_TRUE; + _glthread_UNLOCK_MUTEX(mutex); +} + +#else /* FEATURE_remap_table */ + +#include "es1api/main/dispatch.h" + +static INLINE void +init_remap_table(void) +{ +} + +#endif /* FEATURE_remap_table */ + struct _glapi_table * _mesa_create_exec_table_es1(void) { struct _glapi_table *exec; - exec = _mesa_alloc_dispatch_table(sizeof *exec); + + exec = _mesa_alloc_dispatch_table(_gloffset_COUNT); if (exec == NULL) return NULL; + init_remap_table(); SET_ActiveTexture(exec, _es_ActiveTexture); SET_AlphaFunc(exec, _es_AlphaFunc); @@ -4649,7 +4693,7 @@ _mesa_create_exec_table_es1(void) SET_ClientActiveTexture(exec, _es_ClientActiveTexture); SET_ClipPlanef(exec, _es_ClipPlanef); SET_ClipPlanex(exec, _es_ClipPlanex); - SET_Color4f(exec, _es_Color4f); + SET_Color4f(exec, _check_Color4f); SET_Color4ub(exec, _es_Color4ub); SET_Color4x(exec, _es_Color4x); SET_ColorMask(exec, _es_ColorMask); @@ -4746,8 +4790,8 @@ _mesa_create_exec_table_es1(void) SET_LoadMatrixx(exec, _es_LoadMatrixx); SET_LogicOp(exec, _es_LogicOp); SET_MapBufferOES(exec, _es_MapBufferOES); - SET_Materialf(exec, _es_Materialf); - SET_Materialfv(exec, _es_Materialfv); + SET_Materialf(exec, _check_Materialf); + SET_Materialfv(exec, _check_Materialfv); SET_Materialx(exec, _es_Materialx); SET_Materialxv(exec, _es_Materialxv); SET_MatrixMode(exec, _es_MatrixMode); @@ -4755,9 +4799,9 @@ _mesa_create_exec_table_es1(void) SET_MultMatrixx(exec, _es_MultMatrixx); SET_MultiDrawArraysEXT(exec, _es_MultiDrawArraysEXT); SET_MultiDrawElementsEXT(exec, _es_MultiDrawElementsEXT); - SET_MultiTexCoord4f(exec, _es_MultiTexCoord4f); + SET_MultiTexCoord4f(exec, _check_MultiTexCoord4f); SET_MultiTexCoord4x(exec, _es_MultiTexCoord4x); - SET_Normal3f(exec, _es_Normal3f); + SET_Normal3f(exec, _check_Normal3f); SET_Normal3x(exec, _es_Normal3x); SET_NormalPointer(exec, _es_NormalPointer); SET_Orthof(exec, _es_Orthof); |