mesa: Don't set loopback dispatch pointers for most things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a13c07f752)
This commit is contained in:
Ian Romanick 2012-09-05 14:10:23 -07:00
parent c01f896062
commit 0dc989ea5b
4 changed files with 222 additions and 213 deletions

View file

@ -129,7 +129,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
return NULL; return NULL;
#if _HAVE_FULL_GL #if _HAVE_FULL_GL
_mesa_loopback_init_api_table( exec ); _mesa_loopback_init_api_table(ctx, exec);
#endif #endif
/* load the dispatch slots we understand */ /* load the dispatch slots we understand */

View file

@ -1502,8 +1502,10 @@ loopback_VertexAttribI4usv(GLuint index, const GLushort *v)
* listed in vtxfmt.h. * listed in vtxfmt.h.
*/ */
void void
_mesa_loopback_init_api_table( struct _glapi_table *dest ) _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_Color3b(dest, loopback_Color3b_f);
SET_Color3d(dest, loopback_Color3d_f); SET_Color3d(dest, loopback_Color3d_f);
SET_Color3i(dest, loopback_Color3i_f); SET_Color3i(dest, loopback_Color3i_f);
@ -1650,7 +1652,9 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
SET_Rectsv(dest, loopback_Rectsv); SET_Rectsv(dest, loopback_Rectsv);
SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); SET_FogCoorddEXT(dest, loopback_FogCoorddEXT);
SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT);
}
if (ctx->API == API_OPENGL) {
SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV);
SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV);
SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV);
@ -1682,7 +1686,9 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV);
SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV);
SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV);
}
if (ctx->API != API_OPENGLES2) {
SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB); SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB);
SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB); SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB);
SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB); SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB);
@ -1708,8 +1714,8 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB); SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB);
SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB); SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB);
SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB); SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB);
SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB);
SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB);
SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB);
SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB);
/* GL_EXT_gpu_shader4, GL 3.0 */ /* GL_EXT_gpu_shader4, GL 3.0 */
@ -1719,6 +1725,7 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest )
SET_VertexAttribI4svEXT(dest, loopback_VertexAttribI4sv); SET_VertexAttribI4svEXT(dest, loopback_VertexAttribI4sv);
SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv); SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv);
SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv); SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv);
}
} }

View file

@ -34,7 +34,9 @@ struct _glapi_table;
#if FEATURE_beginend #if FEATURE_beginend
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);
#else /* FEATURE_beginend */ #else /* FEATURE_beginend */

View file

@ -9941,7 +9941,7 @@ _mesa_create_save_table(const struct gl_context *ctx)
if (table == NULL) if (table == NULL)
return NULL; return NULL;
_mesa_loopback_init_api_table(table); _mesa_loopback_init_api_table(ctx, table);
/* GL 1.0 */ /* GL 1.0 */
SET_Accum(table, save_Accum); SET_Accum(table, save_Accum);