mesa: move the ES2 check from vbo_init_tmp.h to install_vtxfmt

It's where other API checks are done.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
This commit is contained in:
Marek Olšák 2021-11-28 17:05:59 -05:00
parent 0f4891d77d
commit 8fa0332965
4 changed files with 36 additions and 21 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);