From 0ca96f5cf6d31ba16466f60c316483baa548aa30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 14 Dec 2021 12:11:09 -0500 Subject: [PATCH] mesa,vbo: make ES wrapper functions static Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/main/es1_conversion.c | 14 ++++ src/mesa/main/texgen.c | 14 ---- src/mesa/main/texgen.h | 3 - src/mesa/vbo/vbo.h | 24 ------ src/mesa/vbo/vbo_exec_api.c | 140 ++++++++++++++++----------------- 5 files changed, 84 insertions(+), 111 deletions(-) diff --git a/src/mesa/main/es1_conversion.c b/src/mesa/main/es1_conversion.c index 5acbed10347..94ddd2ec5a0 100644 --- a/src/mesa/main/es1_conversion.c +++ b/src/mesa/main/es1_conversion.c @@ -841,6 +841,20 @@ _mesa_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params) } } +static void +_es_TexGenf(GLenum coord, GLenum pname, GLfloat param) +{ + if (coord != GL_TEXTURE_GEN_STR_OES) { + GET_CURRENT_CONTEXT(ctx); + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGen[fx](pname)" ); + return; + } + /* set S, T, and R at the same time */ + _mesa_TexGenf(GL_S, pname, param); + _mesa_TexGenf(GL_T, pname, param); + _mesa_TexGenf(GL_R, pname, param); +} + void GL_APIENTRY _mesa_TexGenxOES(GLenum coord, GLenum pname, GLfixed param) { diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index b50907df847..433d22282b5 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -368,20 +368,6 @@ _mesa_MultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param texgenfv(texunit - GL_TEXTURE0, coord, pname, p, "glMultiTexGendEXT"); } -void GLAPIENTRY -_es_TexGenf(GLenum coord, GLenum pname, GLfloat param) -{ - if (coord != GL_TEXTURE_GEN_STR_OES) { - GET_CURRENT_CONTEXT(ctx); - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGen[fx](pname)" ); - return; - } - /* set S, T, and R at the same time */ - _mesa_TexGenf(GL_S, pname, param); - _mesa_TexGenf(GL_T, pname, param); - _mesa_TexGenf(GL_R, pname, param); -} - void GLAPIENTRY _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 7a6ba62c56e..3ae5473aa65 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -70,8 +70,5 @@ _mesa_GetMultiTexGenfvEXT( GLenum texunit, GLenum coord, GLenum pname, GLfloat * void GLAPIENTRY _mesa_GetMultiTexGenivEXT( GLenum texunit, GLenum coord, GLenum pname, GLint *params ); -extern void GLAPIENTRY -_es_TexGenf(GLenum coord, GLenum pname, GLfloat param); - #endif /* TEXGEN_H */ diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 08d21ada97a..f84315526b1 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -255,30 +255,6 @@ _es_Materialfv(GLenum face, GLenum pname, const GLfloat *params); void GLAPIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param); -void GLAPIENTRY -_es_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -void GLAPIENTRY -_es_VertexAttrib1fARB(GLuint indx, GLfloat x); - -void GLAPIENTRY -_es_VertexAttrib1fvARB(GLuint indx, const GLfloat* values); - -void GLAPIENTRY -_es_VertexAttrib2fARB(GLuint indx, GLfloat x, GLfloat y); - -void GLAPIENTRY -_es_VertexAttrib2fvARB(GLuint indx, const GLfloat* values); - -void GLAPIENTRY -_es_VertexAttrib3fARB(GLuint indx, GLfloat x, GLfloat y, GLfloat z); - -void GLAPIENTRY -_es_VertexAttrib3fvARB(GLuint indx, const GLfloat* values); - -void GLAPIENTRY -_es_VertexAttrib4fvARB(GLuint indx, const GLfloat* values); - void GLAPIENTRY save_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 1e756d37834..287b9f1b30f 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -987,6 +987,76 @@ _mesa_PrimitiveRestartNV(void) } +/** + * A special version of glVertexAttrib4f that does not treat index 0 as + * VBO_ATTRIB_POS. + */ +static void +VertexAttrib4f_nopos(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + GET_CURRENT_CONTEXT(ctx); + if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTRF(VBO_ATTRIB_GENERIC0 + index, 4, x, y, z, w); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +_es_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + VertexAttrib4f_nopos(index, x, y, z, w); +} + + +static void GLAPIENTRY +_es_VertexAttrib1fARB(GLuint indx, GLfloat x) +{ + VertexAttrib4f_nopos(indx, x, 0.0f, 0.0f, 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib1fvARB(GLuint indx, const GLfloat* values) +{ + VertexAttrib4f_nopos(indx, values[0], 0.0f, 0.0f, 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib2fARB(GLuint indx, GLfloat x, GLfloat y) +{ + VertexAttrib4f_nopos(indx, x, y, 0.0f, 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib2fvARB(GLuint indx, const GLfloat* values) +{ + VertexAttrib4f_nopos(indx, values[0], values[1], 0.0f, 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib3fARB(GLuint indx, GLfloat x, GLfloat y, GLfloat z) +{ + VertexAttrib4f_nopos(indx, x, y, z, 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib3fvARB(GLuint indx, const GLfloat* values) +{ + VertexAttrib4f_nopos(indx, values[0], values[1], values[2], 1.0f); +} + + +static void GLAPIENTRY +_es_VertexAttrib4fvARB(GLuint indx, const GLfloat* values) +{ + VertexAttrib4f_nopos(indx, values[0], values[1], values[2], values[3]); +} + + void vbo_install_exec_vtxfmt(struct gl_context *ctx) { @@ -1142,73 +1212,3 @@ _es_Materialf(GLenum face, GLenum pname, GLfloat param) p[1] = p[2] = p[3] = 0.0F; _mesa_Materialfv(face, pname, p); } - - -/** - * A special version of glVertexAttrib4f that does not treat index 0 as - * VBO_ATTRIB_POS. - */ -static void -VertexAttrib4f_nopos(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - if (index < MAX_VERTEX_GENERIC_ATTRIBS) - ATTRF(VBO_ATTRIB_GENERIC0 + index, 4, x, y, z, w); - else - ERROR(GL_INVALID_VALUE); -} - -void GLAPIENTRY -_es_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - VertexAttrib4f_nopos(index, x, y, z, w); -} - - -void GLAPIENTRY -_es_VertexAttrib1fARB(GLuint indx, GLfloat x) -{ - VertexAttrib4f_nopos(indx, x, 0.0f, 0.0f, 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib1fvARB(GLuint indx, const GLfloat* values) -{ - VertexAttrib4f_nopos(indx, values[0], 0.0f, 0.0f, 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib2fARB(GLuint indx, GLfloat x, GLfloat y) -{ - VertexAttrib4f_nopos(indx, x, y, 0.0f, 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib2fvARB(GLuint indx, const GLfloat* values) -{ - VertexAttrib4f_nopos(indx, values[0], values[1], 0.0f, 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib3fARB(GLuint indx, GLfloat x, GLfloat y, GLfloat z) -{ - VertexAttrib4f_nopos(indx, x, y, z, 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib3fvARB(GLuint indx, const GLfloat* values) -{ - VertexAttrib4f_nopos(indx, values[0], values[1], values[2], 1.0f); -} - - -void GLAPIENTRY -_es_VertexAttrib4fvARB(GLuint indx, const GLfloat* values) -{ - VertexAttrib4f_nopos(indx, values[0], values[1], values[2], values[3]); -}