diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 9431c06bd53..d7cc0ecac3b 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -394,6 +394,15 @@ typedef struct { void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v ); void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v ); + /* OpenGL ES variants of the above. */ + void (GLAPIENTRYP VertexAttrib1fES)( GLuint index, GLfloat x ); + void (GLAPIENTRYP VertexAttrib1fvES)( GLuint index, const GLfloat *v ); + void (GLAPIENTRYP VertexAttrib2fES)( GLuint index, GLfloat x, GLfloat y ); + void (GLAPIENTRYP VertexAttrib2fvES)( GLuint index, const GLfloat *v ); + void (GLAPIENTRYP VertexAttrib3fES)( GLuint index, GLfloat x, GLfloat y, GLfloat z ); + void (GLAPIENTRYP VertexAttrib3fvES)( GLuint index, const GLfloat *v ); + void (GLAPIENTRYP VertexAttrib4fES)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); + void (GLAPIENTRYP VertexAttrib4fvES)( GLuint index, const GLfloat *v ); /* GL_EXT_gpu_shader4 / GL 3.0 */ void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 8adae1ec966..9a04d55e59a 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -128,7 +128,16 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV); } - if (ctx->API != API_OPENGLES) { + if (ctx->API == API_OPENGLES2) { + SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fES); + SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvES); + SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fES); + SET_VertexAttrib2fvARB(tab, vfmt->VertexAttrib2fvES); + SET_VertexAttrib3fARB(tab, vfmt->VertexAttrib3fES); + SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvES); + SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fES); + SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvES); + } else if (ctx->API != API_OPENGLES) { SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB); SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB); SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index c9c6597bca6..5d9de39e964 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -1001,7 +1001,6 @@ vbo_exec_PrimitiveRestartNV(void) static void vbo_exec_vtxfmt_init(struct vbo_exec_context *exec) { - struct gl_context *ctx = gl_context_from_vbo_exec(exec); GLvertexformat *vfmt = &exec->vtxfmt; #define NAME_AE(x) _ae_##x diff --git a/src/mesa/vbo/vbo_init_tmp.h b/src/mesa/vbo/vbo_init_tmp.h index 55295238e73..445cf3455fe 100644 --- a/src/mesa/vbo/vbo_init_tmp.h +++ b/src/mesa/vbo/vbo_init_tmp.h @@ -74,25 +74,23 @@ vfmt->Vertex3fv = NAME(Vertex3fv); vfmt->Vertex4f = NAME(Vertex4f); vfmt->Vertex4fv = NAME(Vertex4fv); -if (ctx->API == API_OPENGLES2) { - vfmt->VertexAttrib1fARB = NAME_ES(VertexAttrib1f); - vfmt->VertexAttrib1fvARB = NAME_ES(VertexAttrib1fv); - vfmt->VertexAttrib2fARB = NAME_ES(VertexAttrib2f); - vfmt->VertexAttrib2fvARB = NAME_ES(VertexAttrib2fv); - vfmt->VertexAttrib3fARB = NAME_ES(VertexAttrib3f); - vfmt->VertexAttrib3fvARB = NAME_ES(VertexAttrib3fv); - vfmt->VertexAttrib4fARB = NAME_ES(VertexAttrib4f); - vfmt->VertexAttrib4fvARB = NAME_ES(VertexAttrib4fv); -} else { - vfmt->VertexAttrib1fARB = NAME(VertexAttrib1fARB); - vfmt->VertexAttrib1fvARB = NAME(VertexAttrib1fvARB); - vfmt->VertexAttrib2fARB = NAME(VertexAttrib2fARB); - vfmt->VertexAttrib2fvARB = NAME(VertexAttrib2fvARB); - vfmt->VertexAttrib3fARB = NAME(VertexAttrib3fARB); - vfmt->VertexAttrib3fvARB = NAME(VertexAttrib3fvARB); - vfmt->VertexAttrib4fARB = NAME(VertexAttrib4fARB); - vfmt->VertexAttrib4fvARB = NAME(VertexAttrib4fvARB); -} +vfmt->VertexAttrib1fES = NAME_ES(VertexAttrib1f); +vfmt->VertexAttrib1fvES = NAME_ES(VertexAttrib1fv); +vfmt->VertexAttrib2fES = NAME_ES(VertexAttrib2f); +vfmt->VertexAttrib2fvES = NAME_ES(VertexAttrib2fv); +vfmt->VertexAttrib3fES = NAME_ES(VertexAttrib3f); +vfmt->VertexAttrib3fvES = NAME_ES(VertexAttrib3fv); +vfmt->VertexAttrib4fES = NAME_ES(VertexAttrib4f); +vfmt->VertexAttrib4fvES = NAME_ES(VertexAttrib4fv); + +vfmt->VertexAttrib1fARB = NAME(VertexAttrib1fARB); +vfmt->VertexAttrib1fvARB = NAME(VertexAttrib1fvARB); +vfmt->VertexAttrib2fARB = NAME(VertexAttrib2fARB); +vfmt->VertexAttrib2fvARB = NAME(VertexAttrib2fvARB); +vfmt->VertexAttrib3fARB = NAME(VertexAttrib3fARB); +vfmt->VertexAttrib3fvARB = NAME(VertexAttrib3fvARB); +vfmt->VertexAttrib4fARB = NAME(VertexAttrib4fARB); +vfmt->VertexAttrib4fvARB = NAME(VertexAttrib4fvARB); /* half float */ vfmt->Vertex2hNV = NAME(Vertex2hNV);