diff options
Diffstat (limited to 'lib/libGL/libmesa')
-rw-r--r-- | lib/libGL/libmesa/Makefile | 13 | ||||
-rw-r--r-- | lib/libGL/libmesa/generated/api_exec_es1.c | 196 | ||||
-rw-r--r-- | lib/libGL/libmesa/generated/api_exec_es2.c | 215 |
3 files changed, 275 insertions, 149 deletions
diff --git a/lib/libGL/libmesa/Makefile b/lib/libGL/libmesa/Makefile index 1d2fef524..3f8a22ad0 100644 --- a/lib/libGL/libmesa/Makefile +++ b/lib/libGL/libmesa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2011/12/03 15:36:21 miod Exp $ +# $OpenBSD: Makefile,v 1.14 2012/08/17 13:58:00 mpi Exp $ MESA= ${.CURDIR}/../../../dist/Mesa/src/mesa MAPI= ${.CURDIR}/../../../dist/Mesa/src/mapi @@ -102,6 +102,7 @@ MAIN_SOURCES = \ multisample.c \ nvprogram.c \ pack.c \ + pbo.c \ pixel.c \ pixelstore.c \ pixeltransfer.c \ @@ -113,6 +114,7 @@ MAIN_SOURCES = \ readpix.c \ remap.c \ renderbuffer.c \ + samplerobj.c \ scissor.c \ shaderapi.c \ shaderobj.c \ @@ -121,10 +123,10 @@ MAIN_SOURCES = \ stencil.c \ syncobj.c \ texcompress.c \ + texcompress_rgtc.c \ texcompress_s3tc.c \ texcompress_fxt1.c \ texenv.c \ - texenvprogram.c \ texfetch.c \ texformat.c \ texgen.c \ @@ -133,9 +135,9 @@ MAIN_SOURCES = \ texobj.c \ texpal.c \ texparam.c \ - texrender.c \ texstate.c \ texstore.c \ + texturebarrier.c \ transformfeedback.c \ uniforms.c \ varray.c \ @@ -144,6 +146,9 @@ MAIN_SOURCES = \ vtxfmt.c \ $(MAIN_ES_SOURCES) +MAIN_CXX_SOURCES = \ + ff_fragment_shader.cpp + # math MATH_SOURCES= \ m_debug_clip.c \ @@ -184,6 +189,7 @@ SWRAST_SOURCES= \ s_stencil.c \ s_texcombine.c \ s_texfilter.c \ + s_texrender.c \ s_triangle.c \ s_zoom.c @@ -319,6 +325,7 @@ MESA_SOURCES = \ $(ASM_C_SOURCES) MESA_CXX_SOURCES = \ + $(MAIN_CXX_SOURCES) \ $(SHADER_CXX_SOURCES) SRCS= ${MESA_SOURCES} \ 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); 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); |