diff options
Diffstat (limited to 'lib/libGL/libmesa/generated/api_exec_es2.c')
-rw-r--r-- | lib/libGL/libmesa/generated/api_exec_es2.c | 215 |
1 files changed, 145 insertions, 70 deletions
diff --git a/lib/libGL/libmesa/generated/api_exec_es2.c b/lib/libGL/libmesa/generated/api_exec_es2.c index d28291b0e..114515b30 100644 --- a/lib/libGL/libmesa/generated/api_exec_es2.c +++ b/lib/libGL/libmesa/generated/api_exec_es2.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: GLES2.0 - * date: 2011-05-15 15:41:34 + * date: 2012-07-13 17:40:05 */ #include "GLES2/gl2.h" #include "GLES2/gl2ext.h" #include "main/mfeatures.h" +#include "main/compiler.h" +#include "main/api_exec.h" #if FEATURE_ES2 +#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 "es2api/glapi/glapitable.h" -#include "es2api/glapi/glapioffsets.h" -#include "es2api/glapi/glapidispatch.h" - -#if FEATURE_remap_table - -#if !FEATURE_GL -int driDispatchRemapTable[driDispatchRemapTable_size]; -#endif - -#define need_MESA_remap_table - -#include "es2api/main/remap_helper.h" - -void -_mesa_init_remap_table_es2(void) -{ - _mesa_do_init_remap_table(_mesa_function_pool, - driDispatchRemapTable_size, - MESA_remap_table_functions); -} - -void -_mesa_map_static_functions_es2(void) -{ -} - -#endif - -typedef void (*_glapi_proc)(void); /* generic function pointer */ - /************************************************************* * Generated functions begin here */ @@ -1768,12 +1731,52 @@ 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; case GL_DEPTH_COMPONENT: + if (format != GL_DEPTH_COMPONENT) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; case GL_DEPTH_STENCIL_OES: + if (format != GL_DEPTH_STENCIL_OES) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat); + return; + } + break; + case GL_BGRA_EXT: + if (format != GL_BGRA_EXT) { + _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); @@ -1824,6 +1827,12 @@ static void GL_APIENTRY _es_TexImage2D(GLenum target, GLint level, GLint interna return; } break; + case GL_BGRA_EXT: + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format); + return; + } + break; default: _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format); return; @@ -2113,6 +2122,12 @@ static void GL_APIENTRY _es_TexSubImage2D(GLenum target, GLint level, GLint xoff return; } break; + case GL_BGRA_EXT: + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format); + return; + } + break; default: _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format); return; @@ -2243,29 +2258,37 @@ extern void GL_APIENTRY _mesa_UseProgramObjectARB(GLuint program); extern void GL_APIENTRY _mesa_ValidateProgramARB(GLuint program); #define _es_ValidateProgram _mesa_ValidateProgramARB -extern void GL_APIENTRY _vbo_VertexAttrib1f(GLuint index, GLfloat x); -#define _es_VertexAttrib1f _vbo_VertexAttrib1f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib1f(GLuint index, GLfloat x); +#define _check_VertexAttrib1f _es_VertexAttrib1f -extern void GL_APIENTRY _vbo_VertexAttrib1fv(GLuint index, const GLfloat * v); -#define _es_VertexAttrib1fv _vbo_VertexAttrib1fv +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib1fv(GLuint index, const GLfloat * v); +#define _check_VertexAttrib1fv _es_VertexAttrib1fv -extern void GL_APIENTRY _vbo_VertexAttrib2f(GLuint index, GLfloat x, GLfloat y); -#define _es_VertexAttrib2f _vbo_VertexAttrib2f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib2f(GLuint index, GLfloat x, GLfloat y); +#define _check_VertexAttrib2f _es_VertexAttrib2f -extern void GL_APIENTRY _vbo_VertexAttrib2fv(GLuint index, const GLfloat * v); -#define _es_VertexAttrib2fv _vbo_VertexAttrib2fv +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib2fv(GLuint index, const GLfloat * v); +#define _check_VertexAttrib2fv _es_VertexAttrib2fv -extern void GL_APIENTRY _vbo_VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); -#define _es_VertexAttrib3f _vbo_VertexAttrib3f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); +#define _check_VertexAttrib3f _es_VertexAttrib3f -extern void GL_APIENTRY _vbo_VertexAttrib3fv(GLuint index, const GLfloat * v); -#define _es_VertexAttrib3fv _vbo_VertexAttrib3fv +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib3fv(GLuint index, const GLfloat * v); +#define _check_VertexAttrib3fv _es_VertexAttrib3fv -extern void GL_APIENTRY _vbo_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -#define _es_VertexAttrib4f _vbo_VertexAttrib4f +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +#define _check_VertexAttrib4f _es_VertexAttrib4f -extern void GL_APIENTRY _vbo_VertexAttrib4fv(GLuint index, const GLfloat * v); -#define _es_VertexAttrib4fv _vbo_VertexAttrib4fv +/* this function is special and is defined elsewhere */ +extern void GL_APIENTRY _es_VertexAttrib4fv(GLuint index, const GLfloat * v); +#define _check_VertexAttrib4fv _es_VertexAttrib4fv extern void GL_APIENTRY _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); static void GL_APIENTRY _es_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) @@ -2300,14 +2323,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 "es2api/main/dispatch.h" + +#define need_MESA_remap_table +#include "es2api/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 "es2api/main/dispatch.h" + +static INLINE void +init_remap_table(void) +{ +} + +#endif /* FEATURE_remap_table */ + struct _glapi_table * _mesa_create_exec_table_es2(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_AttachShader(exec, _es_AttachShader); @@ -2454,14 +2529,14 @@ _mesa_create_exec_table_es2(void) SET_UnmapBufferOES(exec, _es_UnmapBufferOES); SET_UseProgram(exec, _es_UseProgram); SET_ValidateProgram(exec, _es_ValidateProgram); - SET_VertexAttrib1f(exec, _es_VertexAttrib1f); - SET_VertexAttrib1fv(exec, _es_VertexAttrib1fv); - SET_VertexAttrib2f(exec, _es_VertexAttrib2f); - SET_VertexAttrib2fv(exec, _es_VertexAttrib2fv); - SET_VertexAttrib3f(exec, _es_VertexAttrib3f); - SET_VertexAttrib3fv(exec, _es_VertexAttrib3fv); - SET_VertexAttrib4f(exec, _es_VertexAttrib4f); - SET_VertexAttrib4fv(exec, _es_VertexAttrib4fv); + SET_VertexAttrib1f(exec, _check_VertexAttrib1f); + SET_VertexAttrib1fv(exec, _check_VertexAttrib1fv); + SET_VertexAttrib2f(exec, _check_VertexAttrib2f); + SET_VertexAttrib2fv(exec, _check_VertexAttrib2fv); + SET_VertexAttrib3f(exec, _check_VertexAttrib3f); + SET_VertexAttrib3fv(exec, _check_VertexAttrib3fv); + SET_VertexAttrib4f(exec, _check_VertexAttrib4f); + SET_VertexAttrib4fv(exec, _check_VertexAttrib4fv); SET_VertexAttribPointer(exec, _es_VertexAttribPointer); SET_Viewport(exec, _es_Viewport); |