mesa,vbo: make ES wrapper functions static

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-12-14 12:11:09 -05:00
parent 4c91c6162b
commit 0ca96f5cf6
5 changed files with 84 additions and 111 deletions
+14
View File
@@ -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)
{
-14
View File
@@ -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 )
-3
View File
@@ -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 */
-24
View File
@@ -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);
+70 -70
View File
@@ -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]);
}