aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-03-22 19:35:28 -0400
committerMarge Bot <[email protected]>2020-04-27 11:56:06 +0000
commit41671ec544dc76e7eb926910e3db69803550c3aa (patch)
tree21299ad38f796ecd4135f138cdc14194eab3c49e /src/mesa
parent00b57915414da01868ff40ecacfe61db9af0d9c5 (diff)
mesa: remove exec="dynamic" from Draw functions that are not really dynamic
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/meta.c2
-rw-r--r--src/mesa/main/draw.c185
-rw-r--r--src/mesa/main/draw.h77
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp2
4 files changed, 151 insertions, 115 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 30116721c7e..ad289a54bff 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1861,7 +1861,7 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl)
/* draw quad(s) */
if (fb->MaxNumLayers > 0) {
- _mesa_DrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, fb->MaxNumLayers);
+ _mesa_DrawArraysInstancedARB(GL_TRIANGLE_FAN, 0, 4, fb->MaxNumLayers);
} else {
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index 253e2fdbee7..686a065ffb5 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -392,8 +392,8 @@ _mesa_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
}
-static void GLAPIENTRY
-_mesa_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
+void GLAPIENTRY
+_mesa_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
@@ -428,8 +428,8 @@ _mesa_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
}
-static void GLAPIENTRY
-_mesa_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+void GLAPIENTRY
+_mesa_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
GET_CURRENT_CONTEXT(ctx);
GLfloat u, du, v, dv, v1, u1;
@@ -534,8 +534,8 @@ _mesa_DrawArrays(GLenum mode, GLint start, GLsizei count)
* display list mode).
*/
void GLAPIENTRY
-_mesa_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
- GLsizei numInstances)
+_mesa_DrawArraysInstancedARB(GLenum mode, GLint start, GLsizei count,
+ GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
@@ -569,10 +569,10 @@ _mesa_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
/**
* Called from glDrawArraysInstancedBaseInstance when in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
- GLsizei count, GLsizei numInstances,
- GLuint baseInstance)
+void GLAPIENTRY
+_mesa_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
+ GLsizei count, GLsizei numInstances,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1025,9 +1025,9 @@ _mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
/**
* Called by glDrawElementsInstanced() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices, GLsizei numInstances)
+void GLAPIENTRY
+_mesa_DrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices, GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1057,11 +1057,11 @@ _mesa_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
/**
* Called by glDrawElementsInstancedBaseVertex() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
- GLenum type, const GLvoid * indices,
- GLsizei numInstances,
- GLint basevertex)
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid * indices,
+ GLsizei numInstances,
+ GLint basevertex)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1095,12 +1095,12 @@ _mesa_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
/**
* Called by glDrawElementsInstancedBaseInstance() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLsizei numInstances,
- GLuint baseInstance)
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1134,14 +1134,14 @@ _mesa_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
/**
* Called by glDrawElementsInstancedBaseVertexBaseInstance() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
- GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLsizei numInstances,
- GLint basevertex,
- GLuint baseInstance)
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLint basevertex,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1424,8 +1424,8 @@ _mesa_DrawTransformFeedback(GLenum mode, GLuint name)
}
-static void GLAPIENTRY
-_mesa_exec_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
@@ -1439,9 +1439,9 @@ _mesa_exec_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
}
-static void GLAPIENTRY
-_mesa_exec_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
- GLsizei primcount)
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
+ GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
@@ -1455,10 +1455,10 @@ _mesa_exec_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
}
-static void GLAPIENTRY
-_mesa_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
- GLuint stream,
- GLsizei primcount)
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
+ GLuint stream,
+ GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
@@ -1525,8 +1525,8 @@ _mesa_validated_multidrawelementsindirect(struct gl_context *ctx,
* Like [Multi]DrawArrays/Elements, but they take most arguments from
* a buffer object.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
+void GLAPIENTRY
+_mesa_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1545,9 +1545,9 @@ _mesa_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
!ctx->DrawIndirectBuffer) {
DrawArraysIndirectCommand *cmd = (DrawArraysIndirectCommand *) indirect;
- _mesa_exec_DrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count,
- cmd->primCount,
- cmd->baseInstance);
+ _mesa_DrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count,
+ cmd->primCount,
+ cmd->baseInstance);
return;
}
@@ -1571,8 +1571,8 @@ _mesa_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
}
-static void GLAPIENTRY
-_mesa_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
+void GLAPIENTRY
+_mesa_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1608,11 +1608,11 @@ _mesa_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect
void *offset = (void *)
(uintptr_t)((cmd->firstIndex * _mesa_sizeof_type(type)) & 0xffffffffUL);
- _mesa_exec_DrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count,
- type, offset,
- cmd->primCount,
- cmd->baseVertex,
- cmd->baseInstance);
+ _mesa_DrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count,
+ type, offset,
+ cmd->primCount,
+ cmd->baseVertex,
+ cmd->baseInstance);
}
return;
@@ -1639,9 +1639,9 @@ _mesa_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+void GLAPIENTRY
+_mesa_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1670,9 +1670,9 @@ _mesa_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
const uint8_t *ptr = (const uint8_t *) indirect;
for (unsigned i = 0; i < primcount; i++) {
DrawArraysIndirectCommand *cmd = (DrawArraysIndirectCommand *) ptr;
- _mesa_exec_DrawArraysInstancedBaseInstance(mode, cmd->first,
- cmd->count, cmd->primCount,
- cmd->baseInstance);
+ _mesa_DrawArraysInstancedBaseInstance(mode, cmd->first,
+ cmd->count, cmd->primCount,
+ cmd->baseInstance);
if (stride == 0) {
ptr += sizeof(DrawArraysIndirectCommand);
@@ -1705,10 +1705,10 @@ _mesa_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
- const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+void GLAPIENTRY
+_mesa_MultiDrawElementsIndirect(GLenum mode, GLenum type,
+ const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1751,7 +1751,7 @@ _mesa_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
const uint8_t *ptr = (const uint8_t *) indirect;
for (unsigned i = 0; i < primcount; i++) {
- _mesa_exec_DrawElementsIndirect(mode, type, ptr);
+ _mesa_DrawElementsIndirect(mode, type, ptr);
if (stride == 0) {
ptr += sizeof(DrawElementsIndirectCommand);
@@ -1785,10 +1785,10 @@ _mesa_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawArraysIndirectCount(GLenum mode, GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount, GLsizei stride)
+void GLAPIENTRY
+_mesa_MultiDrawArraysIndirectCountARB(GLenum mode, GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1827,11 +1827,11 @@ _mesa_exec_MultiDrawArraysIndirectCount(GLenum mode, GLintptr indirect,
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawElementsIndirectCount(GLenum mode, GLenum type,
- GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount, GLsizei stride)
+void GLAPIENTRY
+_mesa_MultiDrawElementsIndirectCountARB(GLenum mode, GLenum type,
+ GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1889,8 +1889,6 @@ _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
if (ctx->API == API_OPENGL_COMPAT) {
SET_Rectf(exec, _mesa_exec_Rectf);
- SET_EvalMesh1(exec, _mesa_exec_EvalMesh1);
- SET_EvalMesh2(exec, _mesa_exec_EvalMesh2);
}
if (ctx->API != API_OPENGLES &&
@@ -1902,45 +1900,8 @@ _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawRangeElementsBaseVertex(exec,
_mesa_DrawRangeElementsBaseVertex);
- SET_DrawElementsInstancedBaseVertex(exec,
- _mesa_exec_DrawElementsInstancedBaseVertex);
}
}
-
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawArraysInstancedBaseInstance(exec,
- _mesa_exec_DrawArraysInstancedBaseInstance);
- SET_DrawElementsInstancedBaseInstance(exec,
- _mesa_exec_DrawElementsInstancedBaseInstance);
- SET_DrawElementsInstancedBaseVertexBaseInstance(exec,
- _mesa_exec_DrawElementsInstancedBaseVertexBaseInstance);
- }
-
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
- SET_DrawArraysIndirect(exec, _mesa_exec_DrawArraysIndirect);
- SET_DrawElementsIndirect(exec, _mesa_exec_DrawElementsIndirect);
- }
-
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawArraysInstancedARB(exec, _mesa_DrawArraysInstanced);
- SET_DrawElementsInstancedARB(exec, _mesa_exec_DrawElementsInstanced);
- }
-
- if (_mesa_is_desktop_gl(ctx)) {
- SET_DrawTransformFeedback(exec, _mesa_DrawTransformFeedback);
- SET_DrawTransformFeedbackStream(exec,
- _mesa_exec_DrawTransformFeedbackStream);
- SET_DrawTransformFeedbackInstanced(exec,
- _mesa_exec_DrawTransformFeedbackInstanced);
- SET_DrawTransformFeedbackStreamInstanced(exec,
- _mesa_exec_DrawTransformFeedbackStreamInstanced);
- SET_MultiDrawArraysIndirect(exec, _mesa_exec_MultiDrawArraysIndirect);
- SET_MultiDrawElementsIndirect(exec, _mesa_exec_MultiDrawElementsIndirect);
- SET_MultiDrawArraysIndirectCountARB(exec,
- _mesa_exec_MultiDrawArraysIndirectCount);
- SET_MultiDrawElementsIndirectCountARB(exec,
- _mesa_exec_MultiDrawElementsIndirectCount);
- }
}
diff --git a/src/mesa/main/draw.h b/src/mesa/main/draw.h
index d815d6d1bfd..212e70a3fd4 100644
--- a/src/mesa/main/draw.h
+++ b/src/mesa/main/draw.h
@@ -81,15 +81,88 @@ void
_mesa_initialize_exec_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec);
+void GLAPIENTRY
+_mesa_EvalMesh1(GLenum mode, GLint i1, GLint i2);
+
+void GLAPIENTRY
+_mesa_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+
+void GLAPIENTRY
+_mesa_DrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices, GLsizei numInstances);
+
+void GLAPIENTRY
+_mesa_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
+ GLsizei count, GLsizei numInstances,
+ GLuint baseInstance);
+
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid * indices,
+ GLsizei numInstances,
+ GLint basevertex);
+
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLuint baseInstance);
+
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream);
+
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
+ GLsizei primcount);
+
+void GLAPIENTRY
+_mesa_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
+ GLuint stream,
+ GLsizei primcount);
+
+void GLAPIENTRY
+_mesa_DrawArraysIndirect(GLenum mode, const GLvoid *indirect);
+
+void GLAPIENTRY
+_mesa_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect);
+
+void GLAPIENTRY
+_mesa_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride);
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsIndirect(GLenum mode, GLenum type,
+ const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride);
+
+void GLAPIENTRY
+_mesa_MultiDrawArraysIndirectCountARB(GLenum mode, GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride);
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsIndirectCountARB(GLenum mode, GLenum type,
+ GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride);
void GLAPIENTRY
_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
void GLAPIENTRY
-_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
- GLsizei primcount);
+_mesa_DrawArraysInstancedARB(GLenum mode, GLint first, GLsizei count,
+ GLsizei primcount);
+void GLAPIENTRY
+_mesa_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLint basevertex,
+ GLuint baseInstance);
void GLAPIENTRY
_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 0fe3c9c348c..6ff28309c6d 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2654,6 +2654,8 @@ const struct function gles3_functions_possible[] = {
/* EXT_EGL_image_storage */
{ "glEGLImageTargetTexStorageEXT", 30, -1 },
+ { "glDrawElementsInstancedBaseVertex", 30, -1 },
+
{ NULL, 0, -1 }
};