aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/vtxfmt.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-10-19 06:31:49 -0700
committerPaul Berry <[email protected]>2012-11-01 11:25:27 -0700
commita21116f87e44aabb6cb1f040dd557eac98144dd8 (patch)
tree39467657e0473af5ce2834be0375e06c2efeac67 /src/mesa/main/vtxfmt.c
parent5a1b40acf50955d727b15dc70703a19115bb3552 (diff)
dispatch: GLES1 fixes for _mesa_create_exec_table().
Currently, _mesa_create_exec_table() (in api_exec.c) is used for all APIs except GLES1. In GLES1, _mesa_create_exec_table_es1() (a code generated function) is used instead. In principle, this shouldn't be necessary. It should be possible for api_exec.c to contain the logic for populating the dispatch table for all API's. This patch paves the way for using _mesa_create_exec_table() instead of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table() (and the functions it calls) expose the correct subset of desktop GL functions for GLES1. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/vtxfmt.c')
-rw-r--r--src/mesa/main/vtxfmt.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 462cc884935..5891a523161 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -47,10 +47,13 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
const GLvertexformat *vfmt)
{
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ SET_Color4f(tab, vfmt->Color4f);
+ }
+
+ if (ctx->API == API_OPENGL) {
_mesa_install_arrayelt_vtxfmt(tab, vfmt);
SET_Color3f(tab, vfmt->Color3f);
SET_Color3fv(tab, vfmt->Color3fv);
- SET_Color4f(tab, vfmt->Color4f);
SET_Color4fv(tab, vfmt->Color4fv);
SET_EdgeFlag(tab, vfmt->EdgeFlag);
}
@@ -60,21 +63,27 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
}
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
+ SET_Materialfv(tab, vfmt->Materialfv);
+ SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB);
+ SET_Normal3f(tab, vfmt->Normal3f);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT);
SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT);
SET_Indexf(tab, vfmt->Indexf);
SET_Indexfv(tab, vfmt->Indexfv);
- SET_Materialfv(tab, vfmt->Materialfv);
SET_MultiTexCoord1fARB(tab, vfmt->MultiTexCoord1fARB);
SET_MultiTexCoord1fvARB(tab, vfmt->MultiTexCoord1fvARB);
SET_MultiTexCoord2fARB(tab, vfmt->MultiTexCoord2fARB);
SET_MultiTexCoord2fvARB(tab, vfmt->MultiTexCoord2fvARB);
SET_MultiTexCoord3fARB(tab, vfmt->MultiTexCoord3fARB);
SET_MultiTexCoord3fvARB(tab, vfmt->MultiTexCoord3fvARB);
- SET_MultiTexCoord4fARB(tab, vfmt->MultiTexCoord4fARB);
SET_MultiTexCoord4fvARB(tab, vfmt->MultiTexCoord4fvARB);
- SET_Normal3f(tab, vfmt->Normal3f);
SET_Normal3fv(tab, vfmt->Normal3fv);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT);
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT);
SET_TexCoord1f(tab, vfmt->TexCoord1f);
@@ -105,13 +114,13 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_DrawArrays(tab, vfmt->DrawArrays);
SET_DrawElements(tab, vfmt->DrawElements);
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
}
SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT);
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex);
SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex);
@@ -121,12 +130,12 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced);
SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback);
SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream);
SET_DrawTransformFeedbackInstanced(tab,
@@ -147,17 +156,19 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV);
}
- SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
- SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
- SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
- SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB);
- SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB);
- SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
- SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
- SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
+ if (ctx->API != API_OPENGLES) {
+ SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
+ SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
+ SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
+ SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvARB);
+ SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fARB);
+ SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
+ SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
+ SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
+ }
/* GL_EXT_gpu_shader4 / OpenGL 3.0 */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i);
SET_VertexAttribI2iEXT(tab, vfmt->VertexAttribI2i);
SET_VertexAttribI3iEXT(tab, vfmt->VertexAttribI3i);
@@ -171,14 +182,14 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttribI3uivEXT(tab, vfmt->VertexAttribI3uiv);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _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) {
+ if (ctx->API == API_OPENGL) {
/* GL_ARB_vertex_type_10_10_10_2_rev / GL 3.3 */
SET_VertexP2ui(tab, vfmt->VertexP2ui);
SET_VertexP2uiv(tab, vfmt->VertexP2uiv);
@@ -217,7 +228,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_SecondaryColorP3uiv(tab, vfmt->SecondaryColorP3uiv);
}
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_VertexAttribP1ui(tab, vfmt->VertexAttribP1ui);
SET_VertexAttribP2ui(tab, vfmt->VertexAttribP2ui);
SET_VertexAttribP3ui(tab, vfmt->VertexAttribP3ui);