mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
mesa: remove _mesa_initialize_exec_dispatch from draw.c by autogenerating it
The glapi scripts are fully capable of generating this correctly for all GL APIs if we don't set exec="dynamic". exec="dynamic" should only be used for glBegin, glEnd, and all functions that are legal inside Begin/End. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
This commit is contained in:
parent
33ad9e77c5
commit
e31d8fa0ad
7 changed files with 77 additions and 100 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<category name="GL_ARB_draw_elements_base_vertex" number="62">
|
||||
|
||||
<function name="DrawElementsBaseVertex" es2="3.2" exec="dynamic" marshal="custom">
|
||||
<function name="DrawElementsBaseVertex" es2="3.2" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<param name="basevertex" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawRangeElementsBaseVertex" es2="3.2" exec="dynamic" marshal="custom">
|
||||
<function name="DrawRangeElementsBaseVertex" es2="3.2" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<param name="basevertex" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiDrawElementsBaseVertex" exec="dynamic" marshal="custom">
|
||||
<function name="MultiDrawElementsBaseVertex" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="const GLsizei *" count="primcount"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,7 @@
|
|||
<category name="GL_EXT_draw_elements_base_vertex" number="204">
|
||||
|
||||
<function name="DrawElementsBaseVertexEXT" alias="DrawElementsBaseVertex"
|
||||
es2="2.0" exec="dynamic">
|
||||
es2="2.0">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
@ -1085,7 +1085,7 @@
|
|||
</function>
|
||||
|
||||
<function name="DrawRangeElementsBaseVertexEXT" alias="DrawRangeElementsBaseVertex"
|
||||
es2="3.0" exec="dynamic">
|
||||
es2="3.0">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
|
|
@ -1096,7 +1096,7 @@
|
|||
</function>
|
||||
|
||||
<function name="MultiDrawElementsBaseVertexEXT" alias="MultiDrawElementsBaseVertex"
|
||||
es2="2.0" exec="dynamic">
|
||||
es2="2.0">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
@ -1228,7 +1228,7 @@
|
|||
<category name="GL_OES_draw_elements_base_vertex" number="219">
|
||||
|
||||
<function name="DrawElementsBaseVertexOES" alias="DrawElementsBaseVertex"
|
||||
es2="2.0" exec="dynamic">
|
||||
es2="2.0">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
@ -1237,7 +1237,7 @@
|
|||
</function>
|
||||
|
||||
<function name="DrawRangeElementsBaseVertexOES" alias="DrawRangeElementsBaseVertex"
|
||||
es2="3.0" exec="dynamic">
|
||||
es2="3.0">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
|
|
|
|||
|
|
@ -1598,53 +1598,53 @@
|
|||
<glx rop="44"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectd" vectorequiv="Rectdv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectd" vectorequiv="Rectdv" deprecated="3.1">
|
||||
<param name="x1" type="GLdouble"/>
|
||||
<param name="y1" type="GLdouble"/>
|
||||
<param name="x2" type="GLdouble"/>
|
||||
<param name="y2" type="GLdouble"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectdv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectdv" deprecated="3.1">
|
||||
<param name="v1" type="const GLdouble *" count="2"/>
|
||||
<param name="v2" type="const GLdouble *" count="2"/>
|
||||
<glx rop="45"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectf" vectorequiv="Rectfv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectf" vectorequiv="Rectfv" deprecated="3.1">
|
||||
<param name="x1" type="GLfloat"/>
|
||||
<param name="y1" type="GLfloat"/>
|
||||
<param name="x2" type="GLfloat"/>
|
||||
<param name="y2" type="GLfloat"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectfv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectfv" deprecated="3.1">
|
||||
<param name="v1" type="const GLfloat *" count="2"/>
|
||||
<param name="v2" type="const GLfloat *" count="2"/>
|
||||
<glx rop="46"/>
|
||||
</function>
|
||||
|
||||
<function name="Recti" vectorequiv="Rectiv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Recti" vectorequiv="Rectiv" deprecated="3.1">
|
||||
<param name="x1" type="GLint"/>
|
||||
<param name="y1" type="GLint"/>
|
||||
<param name="x2" type="GLint"/>
|
||||
<param name="y2" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectiv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectiv" deprecated="3.1">
|
||||
<param name="v1" type="const GLint *" count="2"/>
|
||||
<param name="v2" type="const GLint *" count="2"/>
|
||||
<glx rop="47"/>
|
||||
</function>
|
||||
|
||||
<function name="Rects" vectorequiv="Rectsv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rects" vectorequiv="Rectsv" deprecated="3.1">
|
||||
<param name="x1" type="GLshort"/>
|
||||
<param name="y1" type="GLshort"/>
|
||||
<param name="x2" type="GLshort"/>
|
||||
<param name="y2" type="GLshort"/>
|
||||
</function>
|
||||
|
||||
<function name="Rectsv" deprecated="3.1" exec="dynamic">
|
||||
<function name="Rectsv" deprecated="3.1">
|
||||
<param name="v1" type="const GLshort *" count="2"/>
|
||||
<param name="v2" type="const GLshort *" count="2"/>
|
||||
<glx rop="48"/>
|
||||
|
|
@ -3199,14 +3199,14 @@
|
|||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawArrays" es1="1.0" es2="2.0" exec="dynamic" marshal="custom">
|
||||
<function name="DrawArrays" es1="1.0" es2="2.0" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="first" type="GLint"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<glx rop="193" handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElements" es1="1.0" es2="2.0" exec="dynamic" marshal="custom">
|
||||
<function name="DrawElements" es1="1.0" es2="2.0" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
@ -3777,7 +3777,7 @@
|
|||
<glx rop="4097"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawRangeElements" es2="3.0" exec="dynamic" marshal="custom">
|
||||
<function name="DrawRangeElements" es2="3.0" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
|
|
@ -10298,14 +10298,14 @@
|
|||
</category>
|
||||
|
||||
<category name="GL_EXT_multi_draw_arrays" number="148">
|
||||
<function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" exec="dynamic" alias="MultiDrawArrays">
|
||||
<function name="MultiDrawArraysEXT" es1="1.0" es2="2.0" alias="MultiDrawArrays">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="first" type="const GLint *"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
<param name="primcount" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiDrawElementsEXT" es1="1.0" es2="2.0" exec="dynamic" marshal="custom">
|
||||
<function name="MultiDrawElementsEXT" es1="1.0" es2="2.0" marshal="custom">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="const GLsizei *" count="primcount"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
|
|
|||
|
|
@ -149,8 +149,6 @@ _mesa_initialize_exec_table(struct gl_context *ctx)
|
|||
assert(exec != NULL);
|
||||
|
||||
assert(ctx->Version > 0);
|
||||
|
||||
_mesa_initialize_exec_dispatch(ctx, exec);
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -600,8 +600,8 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
|
|||
/**
|
||||
* Execute a glRectf() function.
|
||||
*/
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
|
@ -617,46 +617,46 @@ _mesa_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
|||
}
|
||||
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
_mesa_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectdv(const GLdouble *v1, const GLdouble *v2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectdv(const GLdouble *v1, const GLdouble *v2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
_mesa_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectfv(const GLfloat *v1, const GLfloat *v2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectfv(const GLfloat *v1, const GLfloat *v2)
|
||||
{
|
||||
_mesa_exec_Rectf(v1[0], v1[1], v2[0], v2[1]);
|
||||
_mesa_Rectf(v1[0], v1[1], v2[0], v2[1]);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
_mesa_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectiv(const GLint *v1, const GLint *v2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectiv(const GLint *v1, const GLint *v2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
_mesa_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
_mesa_Rectf((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_Rectsv(const GLshort *v1, const GLshort *v2)
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectsv(const GLshort *v1, const GLshort *v2)
|
||||
{
|
||||
_mesa_exec_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
_mesa_Rectf((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -889,9 +889,9 @@ _mesa_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
|
|||
/**
|
||||
* Called from glMultiDrawArrays when in immediate mode.
|
||||
*/
|
||||
static void GLAPIENTRY
|
||||
_mesa_exec_MultiDrawArrays(GLenum mode, const GLint *first,
|
||||
const GLsizei *count, GLsizei primcount)
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiDrawArrays(GLenum mode, const GLint *first,
|
||||
const GLsizei *count, GLsizei primcount)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
|
|
@ -1598,8 +1598,8 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
|
|||
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
|
||||
const GLvoid * const *indices, GLsizei primcount)
|
||||
_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
|
||||
const GLvoid * const *indices, GLsizei primcount)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
|
|
@ -2171,49 +2171,6 @@ _mesa_MultiDrawElementsIndirectCountARB(GLenum mode, GLenum type,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the dispatch table with the VBO functions for drawing.
|
||||
*/
|
||||
void
|
||||
_mesa_initialize_exec_dispatch(const struct gl_context *ctx,
|
||||
struct _glapi_table *exec)
|
||||
{
|
||||
SET_DrawArrays(exec, _mesa_DrawArrays);
|
||||
SET_DrawElements(exec, _mesa_DrawElements);
|
||||
|
||||
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
|
||||
SET_DrawRangeElements(exec, _mesa_DrawRangeElements);
|
||||
}
|
||||
|
||||
SET_MultiDrawArrays(exec, _mesa_exec_MultiDrawArrays);
|
||||
SET_MultiDrawElementsEXT(exec, _mesa_MultiDrawElements);
|
||||
|
||||
if (ctx->API == API_OPENGL_COMPAT) {
|
||||
SET_Rectf(exec, _mesa_exec_Rectf);
|
||||
SET_Rectd(exec, _mesa_exec_Rectd);
|
||||
SET_Rectdv(exec, _mesa_exec_Rectdv);
|
||||
SET_Rectfv(exec, _mesa_exec_Rectfv);
|
||||
SET_Recti(exec, _mesa_exec_Recti);
|
||||
SET_Rectiv(exec, _mesa_exec_Rectiv);
|
||||
SET_Rects(exec, _mesa_exec_Rects);
|
||||
SET_Rectsv(exec, _mesa_exec_Rectsv);
|
||||
}
|
||||
|
||||
if (ctx->API != API_OPENGLES &&
|
||||
ctx->Extensions.ARB_draw_elements_base_vertex) {
|
||||
SET_DrawElementsBaseVertex(exec, _mesa_DrawElementsBaseVertex);
|
||||
SET_MultiDrawElementsBaseVertex(exec,
|
||||
_mesa_MultiDrawElementsBaseVertex);
|
||||
|
||||
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
|
||||
SET_DrawRangeElementsBaseVertex(exec,
|
||||
_mesa_DrawRangeElementsBaseVertex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* GL_IBM_multimode_draw_arrays */
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
|
||||
|
|
|
|||
|
|
@ -77,10 +77,6 @@ struct _mesa_index_buffer
|
|||
};
|
||||
|
||||
|
||||
void
|
||||
_mesa_initialize_exec_dispatch(const struct gl_context *ctx,
|
||||
struct _glapi_table *exec);
|
||||
|
||||
void
|
||||
_mesa_draw_gallium_fallback(struct gl_context *ctx,
|
||||
struct pipe_draw_info *info,
|
||||
|
|
@ -211,8 +207,8 @@ _mesa_MultiDrawArrays(GLenum mode, const GLint *first,
|
|||
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
|
||||
const GLvoid *const *indices, GLsizei primcount);
|
||||
_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
|
||||
const GLvoid *const *indices, GLsizei primcount);
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
|
|
@ -233,6 +229,29 @@ _mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
|
|||
GLenum type, const GLvoid * const * indices,
|
||||
GLsizei primcount, GLint modestride);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectdv(const GLdouble *v1, const GLdouble *v2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectfv(const GLfloat *v1, const GLfloat *v2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Recti(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectiv(const GLint *v1, const GLint *v2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Rectsv(const GLshort *v1, const GLshort *v2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
|
|
@ -2264,6 +2264,7 @@ const struct function gles2_functions_possible[] = {
|
|||
{ "glDrawArrays", 20, _gloffset_DrawArrays },
|
||||
{ "glDrawBuffersNV", 20, -1 },
|
||||
{ "glDrawElements", 20, _gloffset_DrawElements },
|
||||
{ "glDrawElementsBaseVertex", 20, -1 },
|
||||
{ "glEGLImageTargetRenderbufferStorageOES", 20, -1 },
|
||||
{ "glEGLImageTargetTexture2DOES", 20, -1 },
|
||||
{ "glEnable", 20, _gloffset_Enable },
|
||||
|
|
@ -2323,6 +2324,7 @@ const struct function gles2_functions_possible[] = {
|
|||
{ "glMapBufferRangeEXT", 20, -1 },
|
||||
{ "glMultiDrawArraysEXT", 20, -1 },
|
||||
{ "glMultiDrawElementsEXT", 20, -1 },
|
||||
{ "glMultiDrawElementsBaseVertex", 20, -1 },
|
||||
{ "glPixelStorei", 20, _gloffset_PixelStorei },
|
||||
{ "glPolygonOffset", 20, _gloffset_PolygonOffset },
|
||||
{ "glReadBufferNV", 20, _gloffset_ReadBuffer },
|
||||
|
|
@ -2556,6 +2558,7 @@ const struct function gles3_functions_possible[] = {
|
|||
// { "glDrawBuffers", 30, -1 },
|
||||
{ "glDrawElementsInstanced", 30, -1 },
|
||||
{ "glDrawRangeElements", 30, -1 },
|
||||
{ "glDrawRangeElementsBaseVertex", 30, -1 },
|
||||
// We check for the aliased -EXT version in GLES 2
|
||||
// { "glEndQuery", 30, -1 },
|
||||
{ "glEndTransformFeedback", 30, -1 },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue