diff options
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/APIspecutil.py | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/api_exec.c | 52 | ||||
-rw-r--r-- | mesalib/src/mesa/main/api_loopback.c | 439 | ||||
-rw-r--r-- | mesalib/src/mesa/main/api_loopback.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/bufferobj.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/context.c | 17 | ||||
-rw-r--r-- | mesalib/src/mesa/main/context.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dlist.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dlist.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/image.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shaderapi.c | 51 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shaderapi.h | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/uniforms.c | 70 | ||||
-rw-r--r-- | mesalib/src/mesa/main/uniforms.h | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/version.c | 88 | ||||
-rw-r--r-- | mesalib/src/mesa/main/version.h | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/vtxfmt.c | 126 |
17 files changed, 496 insertions, 380 deletions
diff --git a/mesalib/src/mesa/main/APIspecutil.py b/mesalib/src/mesa/main/APIspecutil.py index 9e604bb84..3c1552809 100644 --- a/mesalib/src/mesa/main/APIspecutil.py +++ b/mesalib/src/mesa/main/APIspecutil.py @@ -189,7 +189,7 @@ def _MaxVecSize(func, param): need_conv = __aliases[func.name][1] if need_conv: print >>sys.stderr, \ - "Error: unable to dicide the max size of %s in %s" % \ + "Error: unable to decide the max size of %s in %s" % \ (param.name, func.name) return size diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index 1da041545..ddf7c7fc1 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -114,7 +114,7 @@ _mesa_create_exec_table(struct gl_context *ctx) return NULL; #if _HAVE_FULL_GL - _mesa_loopback_init_api_table( exec ); + _mesa_loopback_init_api_table(ctx, exec); #endif /* load the dispatch slots we understand */ @@ -188,7 +188,10 @@ _mesa_create_exec_table(struct gl_context *ctx) _mesa_init_dlist_dispatch(exec); } - SET_ClearDepth(exec, _mesa_ClearDepth); + if (ctx->API != API_OPENGLES2) { + SET_ClearDepth(exec, _mesa_ClearDepth); + } + if (ctx->API == API_OPENGL) { SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); @@ -196,7 +199,10 @@ _mesa_create_exec_table(struct gl_context *ctx) } SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); - SET_DepthRange(exec, _mesa_DepthRange); + + if (ctx->API != API_OPENGLES2) { + SET_DepthRange(exec, _mesa_DepthRange); + } if (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) { _mesa_init_drawpix_dispatch(exec); @@ -214,7 +220,9 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_GetClipPlane(exec, _mesa_GetClipPlane); } SET_GetBooleanv(exec, _mesa_GetBooleanv); - SET_GetDoublev(exec, _mesa_GetDoublev); + if (ctx->API != API_OPENGLES2) { + SET_GetDoublev(exec, _mesa_GetDoublev); + } SET_GetIntegerv(exec, _mesa_GetIntegerv); if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { SET_GetLightfv(exec, _mesa_GetLightfv); @@ -259,11 +267,9 @@ _mesa_create_exec_table(struct gl_context *ctx) if (ctx->API != API_OPENGLES2) { SET_PixelStoref(exec, _mesa_PixelStoref); - } - SET_PointSize(exec, _mesa_PointSize); + SET_PointSize(exec, _mesa_PointSize); - if (ctx->API != API_OPENGLES2) { SET_PolygonMode(exec, _mesa_PolygonMode); } @@ -358,8 +364,8 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate); SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); - _mesa_init_shader_dispatch(exec); - _mesa_init_shader_uniform_dispatch(exec); + _mesa_init_shader_dispatch(ctx, exec); + _mesa_init_shader_uniform_dispatch(ctx, exec); /* 2. GL_EXT_blend_color */ #if 0 @@ -422,8 +428,10 @@ _mesa_create_exec_table(struct gl_context *ctx) /* 54. GL_EXT_point_parameters */ #if _HAVE_FULL_GL - SET_PointParameterfEXT(exec, _mesa_PointParameterf); - SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); + if (ctx->API != API_OPENGLES2) { + SET_PointParameterfEXT(exec, _mesa_PointParameterf); + SET_PointParameterfvEXT(exec, _mesa_PointParameterfv); + } #endif /* 95. GL_ARB_ES2_compatibility */ @@ -450,7 +458,9 @@ _mesa_create_exec_table(struct gl_context *ctx) /* 196. GL_MESA_resize_buffers */ #if _HAVE_FULL_GL - SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); + if (_mesa_is_desktop_gl(ctx)) { + SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA); + } #endif /* 197. GL_MESA_window_pos */ @@ -521,8 +531,10 @@ _mesa_create_exec_table(struct gl_context *ctx) /* 262. GL_NV_point_sprite */ #if _HAVE_FULL_GL - SET_PointParameteriNV(exec, _mesa_PointParameteri); - SET_PointParameterivNV(exec, _mesa_PointParameteriv); + if (_mesa_is_desktop_gl(ctx)) { + SET_PointParameteriNV(exec, _mesa_PointParameteri); + SET_PointParameterivNV(exec, _mesa_PointParameteriv); + } #endif /* 268. GL_EXT_stencil_two_side */ @@ -662,11 +674,11 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB); SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB); + SET_GetProgramivARB(exec, _mesa_GetProgramivARB); SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB); } - SET_GetProgramivARB(exec, _mesa_GetProgramivARB); /* ARB 28. GL_ARB_vertex_buffer_object */ _mesa_init_bufferobj_dispatch(ctx, exec); @@ -862,10 +874,12 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_TexStorage1D(exec, _mesa_TexStorage1D); SET_TextureStorage1DEXT(exec, _mesa_TextureStorage1DEXT); } - SET_TexStorage2D(exec, _mesa_TexStorage2D); - SET_TexStorage3D(exec, _mesa_TexStorage3D); - SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT); - SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT); + if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { + SET_TexStorage2D(exec, _mesa_TexStorage2D); + SET_TexStorage3D(exec, _mesa_TexStorage3D); + SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT); + SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT); + } if (ctx->API != API_OPENGLES2) { _mesa_init_sampler_object_dispatch(exec); diff --git a/mesalib/src/mesa/main/api_loopback.c b/mesalib/src/mesa/main/api_loopback.c index a5fbe8ebf..330eb22f7 100644 --- a/mesalib/src/mesa/main/api_loopback.c +++ b/mesalib/src/mesa/main/api_loopback.c @@ -1499,221 +1499,228 @@ loopback_VertexAttribI4usv(GLuint index, const GLushort *v) * listed in vtxfmt.h. */ void -_mesa_loopback_init_api_table( struct _glapi_table *dest ) -{ - SET_Color3b(dest, loopback_Color3b_f); - SET_Color3d(dest, loopback_Color3d_f); - SET_Color3i(dest, loopback_Color3i_f); - SET_Color3s(dest, loopback_Color3s_f); - SET_Color3ui(dest, loopback_Color3ui_f); - SET_Color3us(dest, loopback_Color3us_f); - SET_Color3ub(dest, loopback_Color3ub_f); - SET_Color4b(dest, loopback_Color4b_f); - SET_Color4d(dest, loopback_Color4d_f); - SET_Color4i(dest, loopback_Color4i_f); - SET_Color4s(dest, loopback_Color4s_f); - SET_Color4ui(dest, loopback_Color4ui_f); - SET_Color4us(dest, loopback_Color4us_f); - SET_Color4ub(dest, loopback_Color4ub_f); - SET_Color3bv(dest, loopback_Color3bv_f); - SET_Color3dv(dest, loopback_Color3dv_f); - SET_Color3iv(dest, loopback_Color3iv_f); - SET_Color3sv(dest, loopback_Color3sv_f); - SET_Color3uiv(dest, loopback_Color3uiv_f); - SET_Color3usv(dest, loopback_Color3usv_f); - SET_Color3ubv(dest, loopback_Color3ubv_f); - SET_Color4bv(dest, loopback_Color4bv_f); - SET_Color4dv(dest, loopback_Color4dv_f); - SET_Color4iv(dest, loopback_Color4iv_f); - SET_Color4sv(dest, loopback_Color4sv_f); - SET_Color4uiv(dest, loopback_Color4uiv_f); - SET_Color4usv(dest, loopback_Color4usv_f); - SET_Color4ubv(dest, loopback_Color4ubv_f); - - SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f); - SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f); - SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f); - SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f); - SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f); - SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f); - SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f); - SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f); - SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f); - SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f); - SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f); - SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); - SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); - SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); +_mesa_loopback_init_api_table(const struct gl_context *ctx, + struct _glapi_table *dest) +{ + if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { + SET_Color3b(dest, loopback_Color3b_f); + SET_Color3d(dest, loopback_Color3d_f); + SET_Color3i(dest, loopback_Color3i_f); + SET_Color3s(dest, loopback_Color3s_f); + SET_Color3ui(dest, loopback_Color3ui_f); + SET_Color3us(dest, loopback_Color3us_f); + SET_Color3ub(dest, loopback_Color3ub_f); + SET_Color4b(dest, loopback_Color4b_f); + SET_Color4d(dest, loopback_Color4d_f); + SET_Color4i(dest, loopback_Color4i_f); + SET_Color4s(dest, loopback_Color4s_f); + SET_Color4ui(dest, loopback_Color4ui_f); + SET_Color4us(dest, loopback_Color4us_f); + SET_Color4ub(dest, loopback_Color4ub_f); + SET_Color3bv(dest, loopback_Color3bv_f); + SET_Color3dv(dest, loopback_Color3dv_f); + SET_Color3iv(dest, loopback_Color3iv_f); + SET_Color3sv(dest, loopback_Color3sv_f); + SET_Color3uiv(dest, loopback_Color3uiv_f); + SET_Color3usv(dest, loopback_Color3usv_f); + SET_Color3ubv(dest, loopback_Color3ubv_f); + SET_Color4bv(dest, loopback_Color4bv_f); + SET_Color4dv(dest, loopback_Color4dv_f); + SET_Color4iv(dest, loopback_Color4iv_f); + SET_Color4sv(dest, loopback_Color4sv_f); + SET_Color4uiv(dest, loopback_Color4uiv_f); + SET_Color4usv(dest, loopback_Color4usv_f); + SET_Color4ubv(dest, loopback_Color4ubv_f); + + SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f); + SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f); + SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f); + SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f); + SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f); + SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f); + SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f); + SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f); + SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f); + SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f); + SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f); + SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); + SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); + SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); - SET_EdgeFlagv(dest, loopback_EdgeFlagv); - - SET_Indexd(dest, loopback_Indexd); - SET_Indexi(dest, loopback_Indexi); - SET_Indexs(dest, loopback_Indexs); - SET_Indexub(dest, loopback_Indexub); - SET_Indexdv(dest, loopback_Indexdv); - SET_Indexiv(dest, loopback_Indexiv); - SET_Indexsv(dest, loopback_Indexsv); - SET_Indexubv(dest, loopback_Indexubv); - SET_Normal3b(dest, loopback_Normal3b); - SET_Normal3d(dest, loopback_Normal3d); - SET_Normal3i(dest, loopback_Normal3i); - SET_Normal3s(dest, loopback_Normal3s); - SET_Normal3bv(dest, loopback_Normal3bv); - SET_Normal3dv(dest, loopback_Normal3dv); - SET_Normal3iv(dest, loopback_Normal3iv); - SET_Normal3sv(dest, loopback_Normal3sv); - SET_TexCoord1d(dest, loopback_TexCoord1d); - SET_TexCoord1i(dest, loopback_TexCoord1i); - SET_TexCoord1s(dest, loopback_TexCoord1s); - SET_TexCoord2d(dest, loopback_TexCoord2d); - SET_TexCoord2s(dest, loopback_TexCoord2s); - SET_TexCoord2i(dest, loopback_TexCoord2i); - SET_TexCoord3d(dest, loopback_TexCoord3d); - SET_TexCoord3i(dest, loopback_TexCoord3i); - SET_TexCoord3s(dest, loopback_TexCoord3s); - SET_TexCoord4d(dest, loopback_TexCoord4d); - SET_TexCoord4i(dest, loopback_TexCoord4i); - SET_TexCoord4s(dest, loopback_TexCoord4s); - SET_TexCoord1dv(dest, loopback_TexCoord1dv); - SET_TexCoord1iv(dest, loopback_TexCoord1iv); - SET_TexCoord1sv(dest, loopback_TexCoord1sv); - SET_TexCoord2dv(dest, loopback_TexCoord2dv); - SET_TexCoord2iv(dest, loopback_TexCoord2iv); - SET_TexCoord2sv(dest, loopback_TexCoord2sv); - SET_TexCoord3dv(dest, loopback_TexCoord3dv); - SET_TexCoord3iv(dest, loopback_TexCoord3iv); - SET_TexCoord3sv(dest, loopback_TexCoord3sv); - SET_TexCoord4dv(dest, loopback_TexCoord4dv); - SET_TexCoord4iv(dest, loopback_TexCoord4iv); - SET_TexCoord4sv(dest, loopback_TexCoord4sv); - SET_Vertex2d(dest, loopback_Vertex2d); - SET_Vertex2i(dest, loopback_Vertex2i); - SET_Vertex2s(dest, loopback_Vertex2s); - SET_Vertex3d(dest, loopback_Vertex3d); - SET_Vertex3i(dest, loopback_Vertex3i); - SET_Vertex3s(dest, loopback_Vertex3s); - SET_Vertex4d(dest, loopback_Vertex4d); - SET_Vertex4i(dest, loopback_Vertex4i); - SET_Vertex4s(dest, loopback_Vertex4s); - SET_Vertex2dv(dest, loopback_Vertex2dv); - SET_Vertex2iv(dest, loopback_Vertex2iv); - SET_Vertex2sv(dest, loopback_Vertex2sv); - SET_Vertex3dv(dest, loopback_Vertex3dv); - SET_Vertex3iv(dest, loopback_Vertex3iv); - SET_Vertex3sv(dest, loopback_Vertex3sv); - SET_Vertex4dv(dest, loopback_Vertex4dv); - SET_Vertex4iv(dest, loopback_Vertex4iv); - SET_Vertex4sv(dest, loopback_Vertex4sv); - SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB); - SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB); - SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB); - SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB); - SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB); - SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB); - SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB); - SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB); - SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB); - SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB); - SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB); - SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB); - SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB); - SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB); - SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB); - SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB); - SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB); - SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB); - SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB); - SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB); - SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB); - SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB); - SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB); - SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB); - SET_EvalCoord2dv(dest, loopback_EvalCoord2dv); - SET_EvalCoord2fv(dest, loopback_EvalCoord2fv); - SET_EvalCoord2d(dest, loopback_EvalCoord2d); - SET_EvalCoord1dv(dest, loopback_EvalCoord1dv); - SET_EvalCoord1fv(dest, loopback_EvalCoord1fv); - SET_EvalCoord1d(dest, loopback_EvalCoord1d); - SET_Materialf(dest, loopback_Materialf); - SET_Materiali(dest, loopback_Materiali); - SET_Materialiv(dest, loopback_Materialiv); - SET_Rectd(dest, loopback_Rectd); - SET_Rectdv(dest, loopback_Rectdv); - SET_Rectfv(dest, loopback_Rectfv); - SET_Recti(dest, loopback_Recti); - SET_Rectiv(dest, loopback_Rectiv); - SET_Rects(dest, loopback_Rects); - SET_Rectsv(dest, loopback_Rectsv); - SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); - SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); - - SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); - SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); - SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); - SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV); - SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV); - SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV); - SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV); - SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV); - SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV); - SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV); - SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV); - SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV); - SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV); - SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV); - SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV); - SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV); - SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV); - SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV); - SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV); - SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV); - SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV); - SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV); - SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV); - SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV); - SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV); - SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV); - SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV); - SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV); - SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); - SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); - SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); - - SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB); - SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB); - SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB); - SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB); - SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB); - SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB); - SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB); - SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB); - SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB); - SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB); - SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB); - SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB); - SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB); - SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB); - SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB); - SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB); - SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB); - SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB); - SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB); - SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB); - SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB); - SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB); - SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB); - SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB); - SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB); - SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB); - SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); - SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); - - /* GL_EXT_gpu_shader4, GL 3.0 */ - SET_VertexAttribI1ivEXT(dest, loopback_VertexAttribI1iv); - SET_VertexAttribI1uivEXT(dest, loopback_VertexAttribI1uiv); - SET_VertexAttribI4bvEXT(dest, loopback_VertexAttribI4bv); - SET_VertexAttribI4svEXT(dest, loopback_VertexAttribI4sv); - SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv); - SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv); + SET_EdgeFlagv(dest, loopback_EdgeFlagv); + + SET_Indexd(dest, loopback_Indexd); + SET_Indexi(dest, loopback_Indexi); + SET_Indexs(dest, loopback_Indexs); + SET_Indexub(dest, loopback_Indexub); + SET_Indexdv(dest, loopback_Indexdv); + SET_Indexiv(dest, loopback_Indexiv); + SET_Indexsv(dest, loopback_Indexsv); + SET_Indexubv(dest, loopback_Indexubv); + SET_Normal3b(dest, loopback_Normal3b); + SET_Normal3d(dest, loopback_Normal3d); + SET_Normal3i(dest, loopback_Normal3i); + SET_Normal3s(dest, loopback_Normal3s); + SET_Normal3bv(dest, loopback_Normal3bv); + SET_Normal3dv(dest, loopback_Normal3dv); + SET_Normal3iv(dest, loopback_Normal3iv); + SET_Normal3sv(dest, loopback_Normal3sv); + SET_TexCoord1d(dest, loopback_TexCoord1d); + SET_TexCoord1i(dest, loopback_TexCoord1i); + SET_TexCoord1s(dest, loopback_TexCoord1s); + SET_TexCoord2d(dest, loopback_TexCoord2d); + SET_TexCoord2s(dest, loopback_TexCoord2s); + SET_TexCoord2i(dest, loopback_TexCoord2i); + SET_TexCoord3d(dest, loopback_TexCoord3d); + SET_TexCoord3i(dest, loopback_TexCoord3i); + SET_TexCoord3s(dest, loopback_TexCoord3s); + SET_TexCoord4d(dest, loopback_TexCoord4d); + SET_TexCoord4i(dest, loopback_TexCoord4i); + SET_TexCoord4s(dest, loopback_TexCoord4s); + SET_TexCoord1dv(dest, loopback_TexCoord1dv); + SET_TexCoord1iv(dest, loopback_TexCoord1iv); + SET_TexCoord1sv(dest, loopback_TexCoord1sv); + SET_TexCoord2dv(dest, loopback_TexCoord2dv); + SET_TexCoord2iv(dest, loopback_TexCoord2iv); + SET_TexCoord2sv(dest, loopback_TexCoord2sv); + SET_TexCoord3dv(dest, loopback_TexCoord3dv); + SET_TexCoord3iv(dest, loopback_TexCoord3iv); + SET_TexCoord3sv(dest, loopback_TexCoord3sv); + SET_TexCoord4dv(dest, loopback_TexCoord4dv); + SET_TexCoord4iv(dest, loopback_TexCoord4iv); + SET_TexCoord4sv(dest, loopback_TexCoord4sv); + SET_Vertex2d(dest, loopback_Vertex2d); + SET_Vertex2i(dest, loopback_Vertex2i); + SET_Vertex2s(dest, loopback_Vertex2s); + SET_Vertex3d(dest, loopback_Vertex3d); + SET_Vertex3i(dest, loopback_Vertex3i); + SET_Vertex3s(dest, loopback_Vertex3s); + SET_Vertex4d(dest, loopback_Vertex4d); + SET_Vertex4i(dest, loopback_Vertex4i); + SET_Vertex4s(dest, loopback_Vertex4s); + SET_Vertex2dv(dest, loopback_Vertex2dv); + SET_Vertex2iv(dest, loopback_Vertex2iv); + SET_Vertex2sv(dest, loopback_Vertex2sv); + SET_Vertex3dv(dest, loopback_Vertex3dv); + SET_Vertex3iv(dest, loopback_Vertex3iv); + SET_Vertex3sv(dest, loopback_Vertex3sv); + SET_Vertex4dv(dest, loopback_Vertex4dv); + SET_Vertex4iv(dest, loopback_Vertex4iv); + SET_Vertex4sv(dest, loopback_Vertex4sv); + SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB); + SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB); + SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB); + SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB); + SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB); + SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB); + SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB); + SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB); + SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB); + SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB); + SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB); + SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB); + SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB); + SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB); + SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB); + SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB); + SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB); + SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB); + SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB); + SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB); + SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB); + SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB); + SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB); + SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB); + SET_EvalCoord2dv(dest, loopback_EvalCoord2dv); + SET_EvalCoord2fv(dest, loopback_EvalCoord2fv); + SET_EvalCoord2d(dest, loopback_EvalCoord2d); + SET_EvalCoord1dv(dest, loopback_EvalCoord1dv); + SET_EvalCoord1fv(dest, loopback_EvalCoord1fv); + SET_EvalCoord1d(dest, loopback_EvalCoord1d); + SET_Materialf(dest, loopback_Materialf); + SET_Materiali(dest, loopback_Materiali); + SET_Materialiv(dest, loopback_Materialiv); + SET_Rectd(dest, loopback_Rectd); + SET_Rectdv(dest, loopback_Rectdv); + SET_Rectfv(dest, loopback_Rectfv); + SET_Recti(dest, loopback_Recti); + SET_Rectiv(dest, loopback_Rectiv); + SET_Rects(dest, loopback_Rects); + SET_Rectsv(dest, loopback_Rectsv); + SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); + SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); + } + + if (ctx->API == API_OPENGL) { + SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); + SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); + SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); + SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV); + SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV); + SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV); + SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV); + SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV); + SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV); + SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV); + SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV); + SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV); + SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV); + SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV); + SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV); + SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV); + SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV); + SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV); + SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV); + SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV); + SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV); + SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV); + SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV); + SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV); + SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV); + SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV); + SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV); + SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV); + SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); + SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); + SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); + } + + if (ctx->API != API_OPENGLES2) { + SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB); + SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB); + SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB); + SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB); + SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB); + SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB); + SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB); + SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB); + SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB); + SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB); + SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB); + SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB); + SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB); + SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB); + SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB); + SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB); + SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB); + SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB); + SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB); + SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB); + SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB); + SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB); + SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB); + SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB); + SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB); + SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); + SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB); + SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); + + /* GL_EXT_gpu_shader4, GL 3.0 */ + SET_VertexAttribI1ivEXT(dest, loopback_VertexAttribI1iv); + SET_VertexAttribI1uivEXT(dest, loopback_VertexAttribI1uiv); + SET_VertexAttribI4bvEXT(dest, loopback_VertexAttribI4bv); + SET_VertexAttribI4svEXT(dest, loopback_VertexAttribI4sv); + SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv); + SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv); + } } diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h index a99c30962..3e43286d2 100644 --- a/mesalib/src/mesa/main/api_loopback.h +++ b/mesalib/src/mesa/main/api_loopback.h @@ -32,6 +32,8 @@ struct _glapi_table; -extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); +extern void +_mesa_loopback_init_api_table(const struct gl_context *ctx, + struct _glapi_table *dest); #endif /* API_LOOPBACK_H */ diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index 0fc27e4ba..d9afe37a0 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -2332,7 +2332,9 @@ _mesa_init_bufferobj_dispatch(struct gl_context *ctx, struct _glapi_table *disp) SET_GenBuffersARB(disp, _mesa_GenBuffersARB); SET_GetBufferParameterivARB(disp, _mesa_GetBufferParameterivARB); SET_GetBufferPointervARB(disp, _mesa_GetBufferPointervARB); - SET_GetBufferSubDataARB(disp, _mesa_GetBufferSubDataARB); + if (ctx->API != API_OPENGLES2) { + SET_GetBufferSubDataARB(disp, _mesa_GetBufferSubDataARB); + } SET_IsBufferARB(disp, _mesa_IsBufferARB); SET_MapBufferARB(disp, _mesa_MapBufferARB); SET_UnmapBufferARB(disp, _mesa_UnmapBufferARB); diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index abce52e58..c50504d19 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -797,8 +797,8 @@ init_attrib_groups(struct gl_context *ctx) /* Miscellaneous */ ctx->NewState = _NEW_ALL; ctx->NewDriverState = ~0; - ctx->ErrorValue = (GLenum) GL_NO_ERROR; - ctx->ResetStatus = (GLenum) GL_NO_ERROR; + ctx->ErrorValue = GL_NO_ERROR; + ctx->ResetStatus = GL_NO_ERROR; ctx->varying_vp_inputs = VERT_BIT_ALL; return GL_TRUE; @@ -832,8 +832,8 @@ update_default_objects(struct gl_context *ctx) * This helps prevents a segfault when someone calls a GL function without * first checking if the extension's supported. */ -static int -generic_nop(void) +int +_mesa_generic_nop(void) { GET_CURRENT_CONTEXT(ctx); _mesa_error(ctx, GL_INVALID_OPERATION, @@ -865,7 +865,7 @@ _mesa_alloc_dispatch_table(int size) _glapi_proc *entry = (_glapi_proc *) table; GLint i; for (i = 0; i < numEntries; i++) { - entry[i] = (_glapi_proc) generic_nop; + entry[i] = (_glapi_proc) _mesa_generic_nop; } } return table; @@ -921,6 +921,10 @@ _mesa_initialize_context(struct gl_context *ctx, ctx->WinSysDrawBuffer = NULL; ctx->WinSysReadBuffer = NULL; + if (_mesa_is_desktop_gl(ctx)) { + _mesa_override_gl_version(ctx); + } + /* misc one-time initializations */ one_time_init(ctx); @@ -995,7 +999,7 @@ _mesa_initialize_context(struct gl_context *ctx, switch (ctx->API) { case API_OPENGL: - ctx->Save = _mesa_create_save_table(); + ctx->Save = _mesa_create_save_table(ctx); if (!ctx->Save) { _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); free(ctx->Exec); @@ -1003,6 +1007,7 @@ _mesa_initialize_context(struct gl_context *ctx, } _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); + /* fall-through */ case API_OPENGL_CORE: break; case API_OPENGLES: diff --git a/mesalib/src/mesa/main/context.h b/mesalib/src/mesa/main/context.h index e2387521f..f0b4471b1 100644 --- a/mesalib/src/mesa/main/context.h +++ b/mesalib/src/mesa/main/context.h @@ -179,6 +179,8 @@ _mesa_finish(struct gl_context *ctx); extern void _mesa_flush(struct gl_context *ctx); +extern int +_mesa_generic_nop(void); extern void GLAPIENTRY _mesa_Finish( void ); diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index b663e364c..99519120a 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -9875,7 +9875,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ struct _glapi_table * -_mesa_create_save_table(void) +_mesa_create_save_table(const struct gl_context *ctx) { struct _glapi_table *table; @@ -9883,7 +9883,7 @@ _mesa_create_save_table(void) if (table == NULL) return NULL; - _mesa_loopback_init_api_table(table); + _mesa_loopback_init_api_table(ctx, table); /* GL 1.0 */ SET_Accum(table, save_Accum); @@ -10410,7 +10410,7 @@ _mesa_create_save_table(void) SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT); /* GL_ARB_shader_objects */ - _mesa_init_shader_dispatch(table); /* Plug in glCreate/Delete/Get, etc */ + _mesa_init_shader_dispatch(ctx, table); /* Plug in glCreate/Delete/Get, etc */ SET_UseProgramObjectARB(table, save_UseProgramObjectARB); SET_Uniform1fARB(table, save_Uniform1fARB); SET_Uniform2fARB(table, save_Uniform2fARB); diff --git a/mesalib/src/mesa/main/dlist.h b/mesalib/src/mesa/main/dlist.h index 992a089f1..137245161 100644 --- a/mesalib/src/mesa/main/dlist.h +++ b/mesalib/src/mesa/main/dlist.h @@ -61,7 +61,7 @@ extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dl extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); -extern struct _glapi_table *_mesa_create_save_table(void); +extern struct _glapi_table *_mesa_create_save_table(const struct gl_context *); extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt); diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c index 91b720373..52804bd8b 100644 --- a/mesalib/src/mesa/main/image.c +++ b/mesalib/src/mesa/main/image.c @@ -822,7 +822,7 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1, /* chop off [0, t] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX0 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; /* flipped??? */ + bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; *srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias); } else if (*dstX1 < minValue) { @@ -832,7 +832,7 @@ clip_left_or_bottom(GLint *srcX0, GLint *srcX1, /* chop off [0, t] part */ ASSERT(t >= 0.0 && t <= 1.0); *dstX1 = minValue; - bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F; + bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F; *srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias); } } diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index c2ec1fa42..6ee41f2b6 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -1686,25 +1686,29 @@ _mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string) * Plug in shader-related functions into API dispatch table. */ void -_mesa_init_shader_dispatch(struct _glapi_table *exec) +_mesa_init_shader_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec) { #if FEATURE_GL /* GL_ARB_vertex/fragment_shader */ - SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); - SET_GetHandleARB(exec, _mesa_GetHandleARB); - SET_DetachObjectARB(exec, _mesa_DetachObjectARB); - SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); + if (ctx->API != API_OPENGLES2) { + SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); + SET_GetHandleARB(exec, _mesa_GetHandleARB); + SET_DetachObjectARB(exec, _mesa_DetachObjectARB); + SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); + SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); + SET_AttachObjectARB(exec, _mesa_AttachObjectARB); + SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); + SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); + SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); + SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); + } + SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB); SET_CompileShaderARB(exec, _mesa_CompileShaderARB); - SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); - SET_AttachObjectARB(exec, _mesa_AttachObjectARB); SET_LinkProgramARB(exec, _mesa_LinkProgramARB); SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB); SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB); - SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); - SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); - SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); - SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB); /* OpenGL 2.0 */ @@ -1727,23 +1731,32 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec) SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB); SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB); - SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB); + if (ctx->API != API_OPENGLES2) { + SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB); - SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT); - SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT); - SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT); + SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT); + SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT); + SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT); + } /* GL_EXT_gpu_shader4 / GL 3.0 */ - SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation); - SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation); + if (ctx->API != API_OPENGLES2) { + SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation); + } + if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) { + SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation); + } /* GL_ARB_ES2_compatibility */ SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler); SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat); + SET_ShaderBinary(exec, _mesa_ShaderBinary); /* GL_ARB_blend_func_extended */ - SET_BindFragDataLocationIndexed(exec, _mesa_BindFragDataLocationIndexed); - SET_GetFragDataIndex(exec, _mesa_GetFragDataIndex); + if (ctx->API != API_OPENGLES2) { + SET_BindFragDataLocationIndexed(exec, _mesa_BindFragDataLocationIndexed); + SET_GetFragDataIndex(exec, _mesa_GetFragDataIndex); + } #endif /* FEATURE_GL */ } diff --git a/mesalib/src/mesa/main/shaderapi.h b/mesalib/src/mesa/main/shaderapi.h index 00c7d7f2a..d6382e04a 100644 --- a/mesalib/src/mesa/main/shaderapi.h +++ b/mesalib/src/mesa/main/shaderapi.h @@ -51,7 +51,8 @@ _mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg, const char *caller); extern void -_mesa_init_shader_dispatch(struct _glapi_table *exec); +_mesa_init_shader_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec); extern unsigned _mesa_count_active_attribs(struct gl_shader_program *shProg); diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c index 04cf0a2b0..39fac1534 100644 --- a/mesalib/src/mesa/main/uniforms.c +++ b/mesalib/src/mesa/main/uniforms.c @@ -804,7 +804,8 @@ _mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex, * Plug in shader uniform-related functions into API dispatch table. */ void -_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec) +_mesa_init_shader_uniform_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec) { #if FEATURE_GL SET_Uniform1fARB(exec, _mesa_Uniform1fARB); @@ -833,38 +834,39 @@ _mesa_init_shader_uniform_dispatch(struct _glapi_table *exec) SET_GetUniformivARB(exec, _mesa_GetUniformivARB); /* OpenGL 2.1 */ - SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv); - SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv); - SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv); - SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv); - SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv); - SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv); - - /* OpenGL 3.0 */ - SET_Uniform1uiEXT(exec, _mesa_Uniform1ui); - SET_Uniform2uiEXT(exec, _mesa_Uniform2ui); - SET_Uniform3uiEXT(exec, _mesa_Uniform3ui); - SET_Uniform4uiEXT(exec, _mesa_Uniform4ui); - SET_Uniform1uivEXT(exec, _mesa_Uniform1uiv); - SET_Uniform2uivEXT(exec, _mesa_Uniform2uiv); - SET_Uniform3uivEXT(exec, _mesa_Uniform3uiv); - SET_Uniform4uivEXT(exec, _mesa_Uniform4uiv); - SET_GetUniformuivEXT(exec, _mesa_GetUniformuiv); - - /* GL_ARB_robustness */ - SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB); - SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB); - SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB); - SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */ - - /* GL_ARB_uniform_buffer_object / GL 3.1 */ - SET_GetUniformBlockIndex(exec, _mesa_GetUniformBlockIndex); - SET_GetUniformIndices(exec, _mesa_GetUniformIndices); - SET_GetActiveUniformsiv(exec, _mesa_GetActiveUniformsiv); - SET_GetActiveUniformBlockiv(exec, _mesa_GetActiveUniformBlockiv); - SET_GetActiveUniformBlockName(exec, _mesa_GetActiveUniformBlockName); - SET_GetActiveUniformName(exec, _mesa_GetActiveUniformName); - SET_UniformBlockBinding(exec, _mesa_UniformBlockBinding); - + if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) { + SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv); + SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv); + SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv); + SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv); + SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv); + SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv); + + /* OpenGL 3.0 */ + SET_Uniform1uiEXT(exec, _mesa_Uniform1ui); + SET_Uniform2uiEXT(exec, _mesa_Uniform2ui); + SET_Uniform3uiEXT(exec, _mesa_Uniform3ui); + SET_Uniform4uiEXT(exec, _mesa_Uniform4ui); + SET_Uniform1uivEXT(exec, _mesa_Uniform1uiv); + SET_Uniform2uivEXT(exec, _mesa_Uniform2uiv); + SET_Uniform3uivEXT(exec, _mesa_Uniform3uiv); + SET_Uniform4uivEXT(exec, _mesa_Uniform4uiv); + SET_GetUniformuivEXT(exec, _mesa_GetUniformuiv); + + /* GL_ARB_robustness */ + SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB); + SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB); + SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB); + SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */ + + /* GL_ARB_uniform_buffer_object / GL 3.1 */ + SET_GetUniformBlockIndex(exec, _mesa_GetUniformBlockIndex); + SET_GetUniformIndices(exec, _mesa_GetUniformIndices); + SET_GetActiveUniformsiv(exec, _mesa_GetActiveUniformsiv); + SET_GetActiveUniformBlockiv(exec, _mesa_GetActiveUniformBlockiv); + SET_GetActiveUniformBlockName(exec, _mesa_GetActiveUniformBlockName); + SET_GetActiveUniformName(exec, _mesa_GetActiveUniformName); + SET_UniformBlockBinding(exec, _mesa_UniformBlockBinding); + } #endif /* FEATURE_GL */ } diff --git a/mesalib/src/mesa/main/uniforms.h b/mesalib/src/mesa/main/uniforms.h index e84964c6f..3fe7d4402 100644 --- a/mesalib/src/mesa/main/uniforms.h +++ b/mesalib/src/mesa/main/uniforms.h @@ -227,7 +227,8 @@ _mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg, char *errMsg, size_t errMsgLength); extern void -_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec); +_mesa_init_shader_uniform_dispatch(const struct gl_context *ctx, + struct _glapi_table *exec); extern const struct gl_program_parameter * get_uniform_parameter(struct gl_shader_program *shProg, GLint index); diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index 55638a807..5778792a6 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -28,30 +28,25 @@ #include "git_sha1.h" /** - * Override the context's GL version if the environment variable - * MESA_GL_VERSION_OVERRIDE is set. Valid values of MESA_GL_VERSION_OVERRIDE - * are point-separated version numbers, such as "3.0". + * Scans 'string' to see if it ends with 'ending'. */ -static void -override_version(struct gl_context *ctx) +static GLboolean +check_for_ending(const char *string, const char *ending) { - const char *env_var = "MESA_GL_VERSION_OVERRIDE"; - const char *version; - int n; - int major, minor; + int len1, len2; - version = getenv(env_var); - if (!version) { - return; - } + len1 = strlen(string); + len2 = strlen(ending); - n = sscanf(version, "%u.%u", &major, &minor); - if (n != 2) { - fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version); - return; + if (len2 > len1) { + return GL_FALSE; } - ctx->Version = major * 10 + minor; + if (strcmp(string + (len1 - len2), ending) == 0) { + return GL_TRUE; + } else { + return GL_FALSE; + } } /** @@ -65,13 +60,64 @@ create_version_string(struct gl_context *ctx, const char *prefix) ctx->VersionString = malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, - "%s%u.%u Mesa " MESA_VERSION_STRING + "%s%u.%u%s Mesa " MESA_VERSION_STRING #ifdef MESA_GIT_SHA1 " (" MESA_GIT_SHA1 ")" #endif , prefix, - ctx->Version / 10, ctx->Version % 10); + ctx->Version / 10, ctx->Version % 10, + (ctx->API == API_OPENGL_CORE) ? " (Core Profile)" : "" + ); + } +} + +/** + * Override the context's version and/or API type if the + * environment variable MESA_GL_VERSION_OVERRIDE is set. + * + * Example uses of MESA_GL_VERSION_OVERRIDE: + * + * 2.1: select a compatibility (non-Core) profile with GL version 2.1 + * 3.0: select a compatibility (non-Core) profile with GL version 3.0 + * 3.0FC: select a Core+Forward Compatible profile with GL version 3.0 + * 3.1: select a Core profile with GL version 3.1 + * 3.1FC: select a Core+Forward Compatible profile with GL version 3.1 + */ +void +_mesa_override_gl_version(struct gl_context *ctx) +{ + const char *env_var = "MESA_GL_VERSION_OVERRIDE"; + const char *version; + int n; + int major, minor; + GLboolean fc_suffix; + + version = getenv(env_var); + if (!version) { + return; + } + + fc_suffix = check_for_ending(version, "FC"); + + n = sscanf(version, "%u.%u", &major, &minor); + if (n != 2) { + fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version); + } else { + ctx->Version = major * 10 + minor; + if (ctx->Version < 30 && fc_suffix) { + fprintf(stderr, "error: invalid value for %s: %s\n", env_var, version); + } else { + if (ctx->Version >= 30 && fc_suffix) { + ctx->API = API_OPENGL_CORE; + ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; + } else if (ctx->Version >= 31) { + ctx->API = API_OPENGL_CORE; + } else { + ctx->API = API_OPENGL; + } + create_version_string(ctx, ""); + } } } @@ -242,8 +288,6 @@ compute_version(struct gl_context *ctx) ctx->Version = major * 10 + minor; - override_version(ctx); - create_version_string(ctx, ""); } diff --git a/mesalib/src/mesa/main/version.h b/mesalib/src/mesa/main/version.h index f0ba6f267..1aab37d69 100644 --- a/mesalib/src/mesa/main/version.h +++ b/mesalib/src/mesa/main/version.h @@ -46,6 +46,9 @@ extern void _mesa_compute_version(struct gl_context *ctx); extern void +_mesa_override_gl_version(struct gl_context *ctx); + +extern void _mesa_override_glsl_version(struct gl_context *ctx); #endif /* VERSION_H */ diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c index 725ac2047..aa6cf286a 100644 --- a/mesalib/src/mesa/main/vtxfmt.c +++ b/mesalib/src/mesa/main/vtxfmt.c @@ -46,7 +46,7 @@ static void install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, const GLvertexformat *vfmt) { - if (ctx->API != API_OPENGL_CORE) { + if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { _mesa_install_arrayelt_vtxfmt(tab, vfmt); SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); @@ -59,7 +59,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, _mesa_install_eval_vtxfmt(tab, vfmt); } - if (ctx->API != API_OPENGL_CORE) { + if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -95,9 +95,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, if (ctx->API == API_OPENGL) { _mesa_install_dlist_vtxfmt(tab, vfmt); /* glCallList / glCallLists */ - } - if (ctx->API != API_OPENGL_CORE) { SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_PrimitiveRestartNV(tab, vfmt->PrimitiveRestartNV); @@ -107,33 +105,48 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_DrawArrays(tab, vfmt->DrawArrays); SET_DrawElements(tab, vfmt->DrawElements); - SET_DrawRangeElements(tab, vfmt->DrawRangeElements); + if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) { + SET_DrawRangeElements(tab, vfmt->DrawRangeElements); + } + SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); - SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); - SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); - SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); - SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced); - SET_DrawArraysInstancedBaseInstance(tab, vfmt->DrawArraysInstancedBaseInstance); - SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced); - SET_DrawElementsInstancedBaseInstance(tab, vfmt->DrawElementsInstancedBaseInstance); - SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex); - SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance); - SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback); - SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream); - SET_DrawTransformFeedbackInstanced(tab, - vfmt->DrawTransformFeedbackInstanced); - SET_DrawTransformFeedbackStreamInstanced(tab, - vfmt->DrawTransformFeedbackStreamInstanced); + + if (ctx->API != API_OPENGLES2) { + SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); + SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); + SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); + SET_DrawArraysInstancedBaseInstance(tab, vfmt->DrawArraysInstancedBaseInstance); + SET_DrawElementsInstancedBaseInstance(tab, vfmt->DrawElementsInstancedBaseInstance); + SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex); + SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance); + } + + if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) { + SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced); + SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced); + } + + if (ctx->API != API_OPENGLES2) { + SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback); + SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream); + SET_DrawTransformFeedbackInstanced(tab, + vfmt->DrawTransformFeedbackInstanced); + SET_DrawTransformFeedbackStreamInstanced(tab, + vfmt->DrawTransformFeedbackStreamInstanced); + } /* GL_NV_vertex_program */ - SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); - SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); - SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); - SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV); - SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV); - SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV); - SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV); - SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); + if (ctx->API == API_OPENGL) { + SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); + SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); + SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); + SET_VertexAttrib2fvNV(tab, vfmt->VertexAttrib2fvNV); + SET_VertexAttrib3fNV(tab, vfmt->VertexAttrib3fNV); + SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV); + SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV); + SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); + } + SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB); SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB); SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB); @@ -144,23 +157,28 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB); /* GL_EXT_gpu_shader4 / OpenGL 3.0 */ - SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i); - SET_VertexAttribI2iEXT(tab, vfmt->VertexAttribI2i); - SET_VertexAttribI3iEXT(tab, vfmt->VertexAttribI3i); - SET_VertexAttribI4iEXT(tab, vfmt->VertexAttribI4i); - SET_VertexAttribI2ivEXT(tab, vfmt->VertexAttribI2iv); - SET_VertexAttribI3ivEXT(tab, vfmt->VertexAttribI3iv); - SET_VertexAttribI4ivEXT(tab, vfmt->VertexAttribI4iv); - - SET_VertexAttribI1uiEXT(tab, vfmt->VertexAttribI1ui); - SET_VertexAttribI2uiEXT(tab, vfmt->VertexAttribI2ui); - SET_VertexAttribI3uiEXT(tab, vfmt->VertexAttribI3ui); - SET_VertexAttribI4uiEXT(tab, vfmt->VertexAttribI4ui); - SET_VertexAttribI2uivEXT(tab, vfmt->VertexAttribI2uiv); - SET_VertexAttribI3uivEXT(tab, vfmt->VertexAttribI3uiv); - SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv); - - if (ctx->API != API_OPENGL_CORE) { + if (ctx->API != API_OPENGLES2) { + SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i); + SET_VertexAttribI2iEXT(tab, vfmt->VertexAttribI2i); + SET_VertexAttribI3iEXT(tab, vfmt->VertexAttribI3i); + SET_VertexAttribI2ivEXT(tab, vfmt->VertexAttribI2iv); + SET_VertexAttribI3ivEXT(tab, vfmt->VertexAttribI3iv); + + SET_VertexAttribI1uiEXT(tab, vfmt->VertexAttribI1ui); + SET_VertexAttribI2uiEXT(tab, vfmt->VertexAttribI2ui); + SET_VertexAttribI3uiEXT(tab, vfmt->VertexAttribI3ui); + SET_VertexAttribI2uivEXT(tab, vfmt->VertexAttribI2uiv); + SET_VertexAttribI3uivEXT(tab, vfmt->VertexAttribI3uiv); + } + + if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) { + SET_VertexAttribI4iEXT(tab, vfmt->VertexAttribI4i); + SET_VertexAttribI4ivEXT(tab, vfmt->VertexAttribI4iv); + SET_VertexAttribI4uiEXT(tab, vfmt->VertexAttribI4ui); + SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv); + } + + if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { /* GL_ARB_vertex_type_10_10_10_2_rev / GL 3.3 */ SET_VertexP2ui(tab, vfmt->VertexP2ui); SET_VertexP2uiv(tab, vfmt->VertexP2uiv); @@ -199,15 +217,17 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_SecondaryColorP3uiv(tab, vfmt->SecondaryColorP3uiv); } - SET_VertexAttribP1ui(tab, vfmt->VertexAttribP1ui); - SET_VertexAttribP2ui(tab, vfmt->VertexAttribP2ui); - SET_VertexAttribP3ui(tab, vfmt->VertexAttribP3ui); - SET_VertexAttribP4ui(tab, vfmt->VertexAttribP4ui); + if (ctx->API != API_OPENGLES2) { + SET_VertexAttribP1ui(tab, vfmt->VertexAttribP1ui); + SET_VertexAttribP2ui(tab, vfmt->VertexAttribP2ui); + SET_VertexAttribP3ui(tab, vfmt->VertexAttribP3ui); + SET_VertexAttribP4ui(tab, vfmt->VertexAttribP4ui); - SET_VertexAttribP1uiv(tab, vfmt->VertexAttribP1uiv); - SET_VertexAttribP2uiv(tab, vfmt->VertexAttribP2uiv); - SET_VertexAttribP3uiv(tab, vfmt->VertexAttribP3uiv); - SET_VertexAttribP4uiv(tab, vfmt->VertexAttribP4uiv); + SET_VertexAttribP1uiv(tab, vfmt->VertexAttribP1uiv); + SET_VertexAttribP2uiv(tab, vfmt->VertexAttribP2uiv); + SET_VertexAttribP3uiv(tab, vfmt->VertexAttribP3uiv); + SET_VertexAttribP4uiv(tab, vfmt->VertexAttribP4uiv); + } } |