[Mesa-dev] [PATCH 2/4] mesa: Remove flush_vertrices argument from VAO methods.
Mathias.Froehlich at gmx.net
Mathias.Froehlich at gmx.net
Thu May 17 06:37:19 UTC 2018
From: Mathias Fröhlich <mathias.froehlich at web.de>
The flush_vertices argument is now unused, remove it.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
src/mesa/drivers/common/meta.c | 32 ++++++++++-------------
src/mesa/main/bufferobj.c | 2 +-
src/mesa/main/enable.c | 4 +--
src/mesa/main/varray.c | 44 +++++++++++++++-----------------
src/mesa/main/varray.h | 8 +++---
src/mesa/state_tracker/st_cb_rasterpos.c | 4 +--
src/mesa/vbo/vbo_context.c | 2 +-
src/mesa/vbo/vbo_exec_draw.c | 6 ++---
src/mesa/vbo/vbo_save_api.c | 6 ++---
9 files changed, 51 insertions(+), 57 deletions(-)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 830d82ad49..6b1713e3b1 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -348,18 +348,18 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(0),
- *buf_obj, 0, sizeof(struct vertex), true);
+ *buf_obj, 0, sizeof(struct vertex));
_mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_GENERIC(0), true);
+ VERT_ATTRIB_GENERIC(0));
if (texcoord_size > 0) {
_mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_GENERIC(1),
texcoord_size, GL_FLOAT, GL_RGBA,
GL_FALSE, GL_FALSE, GL_FALSE,
offsetof(struct vertex, tex));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(1),
- *buf_obj, 0, sizeof(struct vertex), true);
+ *buf_obj, 0, sizeof(struct vertex));
_mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_GENERIC(1), true);
+ VERT_ATTRIB_GENERIC(1));
}
} else {
_mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_POS,
@@ -367,9 +367,8 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
- *buf_obj, 0, sizeof(struct vertex), true);
- _mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_POS, true);
+ *buf_obj, 0, sizeof(struct vertex));
+ _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS);
if (texcoord_size > 0) {
_mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_TEX(0),
@@ -377,9 +376,9 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, tex));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(0),
- *buf_obj, 0, sizeof(struct vertex), true);
+ *buf_obj, 0, sizeof(struct vertex));
_mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_TEX(0), true);
+ VERT_ATTRIB_TEX(0));
}
if (color_size > 0) {
@@ -388,9 +387,9 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, r));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_COLOR0,
- *buf_obj, 0, sizeof(struct vertex), true);
+ *buf_obj, 0, sizeof(struct vertex));
_mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_COLOR0, true);
+ VERT_ATTRIB_COLOR0);
}
}
} else {
@@ -3347,9 +3346,8 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
- drawtex->buf_obj, 0,
- sizeof(struct vertex), true);
- _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS, true);
+ drawtex->buf_obj, 0, sizeof(struct vertex));
+ _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS);
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
@@ -3359,10 +3357,8 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
GL_FALSE, GL_FALSE,
offsetof(struct vertex, st[i]));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(i),
- drawtex->buf_obj, 0,
- sizeof(struct vertex), true);
- _mesa_enable_vertex_array_attrib(ctx, array_obj,
- VERT_ATTRIB_TEX(i), true);
+ drawtex->buf_obj, 0, sizeof(struct vertex));
+ _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_TEX(i));
}
}
else {
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 068c7dd434..67f9cd0a90 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1167,7 +1167,7 @@ unbind(struct gl_context *ctx,
if (vao->BufferBinding[index].BufferObj == obj) {
_mesa_bind_vertex_buffer(ctx, vao, index, ctx->Shared->NullBufferObj,
vao->BufferBinding[index].Offset,
- vao->BufferBinding[index].Stride, true);
+ vao->BufferBinding[index].Stride);
}
}
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 84f036071a..d1b2f3a962 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -68,9 +68,9 @@ static void
vao_state(struct gl_context *ctx, gl_vert_attrib attr, GLboolean state)
{
if (state)
- _mesa_enable_vertex_array_attrib(ctx, ctx->Array.VAO, attr, true);
+ _mesa_enable_vertex_array_attrib(ctx, ctx->Array.VAO, attr);
else
- _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attr, true);
+ _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attr);
}
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 2ced74a76c..4859f16050 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -159,7 +159,7 @@ void
_mesa_vertex_attrib_binding(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
gl_vert_attrib attribIndex,
- GLuint bindingIndex, bool flush_vertices)
+ GLuint bindingIndex)
{
struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
assert(!vao->SharedAndImmutable);
@@ -192,7 +192,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
GLuint index,
struct gl_buffer_object *vbo,
- GLintptr offset, GLsizei stride, bool flush_vertices)
+ GLintptr offset, GLsizei stride)
{
assert(index < ARRAY_SIZE(vao->BufferBinding));
assert(!vao->SharedAndImmutable);
@@ -592,7 +592,7 @@ update_array(struct gl_context *ctx,
normalized, integer, doubles, 0);
/* Reset the vertex attrib binding */
- _mesa_vertex_attrib_binding(ctx, vao, attrib, attrib, true);
+ _mesa_vertex_attrib_binding(ctx, vao, attrib, attrib);
/* The Stride and Ptr fields are not set by update_array_format() */
struct gl_array_attributes *array = &vao->VertexAttrib[attrib];
@@ -608,7 +608,7 @@ update_array(struct gl_context *ctx,
GLsizei effectiveStride = stride != 0 ? stride : array->_ElementSize;
_mesa_bind_vertex_buffer(ctx, vao, attrib,
ctx->Array.ArrayBufferObj, (GLintptr) ptr,
- effectiveStride, true);
+ effectiveStride);
}
void GLAPIENTRY
@@ -1069,7 +1069,7 @@ _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
void
_mesa_enable_vertex_array_attrib(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
- gl_vert_attrib attrib, bool flush_vertices)
+ gl_vert_attrib attrib)
{
assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
assert(!vao->SharedAndImmutable);
@@ -1099,8 +1099,7 @@ enable_vertex_array_attrib(struct gl_context *ctx,
return;
}
- _mesa_enable_vertex_array_attrib(ctx, vao,
- VERT_ATTRIB_GENERIC(index), true);
+ _mesa_enable_vertex_array_attrib(ctx, vao, VERT_ATTRIB_GENERIC(index));
}
@@ -1118,7 +1117,7 @@ _mesa_EnableVertexAttribArray_no_error(GLuint index)
{
GET_CURRENT_CONTEXT(ctx);
_mesa_enable_vertex_array_attrib(ctx, ctx->Array.VAO,
- VERT_ATTRIB_GENERIC(index), true);
+ VERT_ATTRIB_GENERIC(index));
}
@@ -1148,15 +1147,14 @@ _mesa_EnableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_vertex_array_object *vao = _mesa_lookup_vao(ctx, vaobj);
- _mesa_enable_vertex_array_attrib(ctx, vao,
- VERT_ATTRIB_GENERIC(index), true);
+ _mesa_enable_vertex_array_attrib(ctx, vao, VERT_ATTRIB_GENERIC(index));
}
void
_mesa_disable_vertex_array_attrib(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
- gl_vert_attrib attrib, bool flush_vertices)
+ gl_vert_attrib attrib)
{
assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
assert(!vao->SharedAndImmutable);
@@ -1187,7 +1185,7 @@ _mesa_DisableVertexAttribArray(GLuint index)
}
const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC(index);
- _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attrib, true);
+ _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attrib);
}
@@ -1196,7 +1194,7 @@ _mesa_DisableVertexAttribArray_no_error(GLuint index)
{
GET_CURRENT_CONTEXT(ctx);
const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC(index);
- _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attrib, true);
+ _mesa_disable_vertex_array_attrib(ctx, ctx->Array.VAO, attrib);
}
@@ -1223,7 +1221,7 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index)
}
const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC(index);
- _mesa_disable_vertex_array_attrib(ctx, vao, attrib, true);
+ _mesa_disable_vertex_array_attrib(ctx, vao, attrib);
}
@@ -1233,7 +1231,7 @@ _mesa_DisableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index)
GET_CURRENT_CONTEXT(ctx);
struct gl_vertex_array_object *vao = _mesa_lookup_vao(ctx, vaobj);
const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC(index);
- _mesa_disable_vertex_array_attrib(ctx, vao, attrib, true);
+ _mesa_disable_vertex_array_attrib(ctx, vao, attrib);
}
@@ -1995,7 +1993,7 @@ _mesa_VertexAttribDivisor_no_error(GLuint index, GLuint divisor)
* VertexAttribBinding(index, index);
* VertexBindingDivisor(index, divisor);"
*/
- _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex, true);
+ _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
vertex_binding_divisor(ctx, vao, genericIndex, divisor);
}
@@ -2037,7 +2035,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
* VertexAttribBinding(index, index);
* VertexBindingDivisor(index, divisor);"
*/
- _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex, true);
+ _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
vertex_binding_divisor(ctx, vao, genericIndex, divisor);
}
@@ -2081,7 +2079,7 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
}
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(bindingIndex),
- vbo, offset, stride, true);
+ vbo, offset, stride);
}
@@ -2233,7 +2231,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx,
for (i = 0; i < count; i++)
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
- vbo, 0, 16, true);
+ vbo, 0, 16);
return;
}
@@ -2307,7 +2305,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx,
}
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
- vbo, offsets[i], strides[i], true);
+ vbo, offsets[i], strides[i]);
}
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
@@ -2637,7 +2635,7 @@ vertex_array_attrib_binding(struct gl_context *ctx,
_mesa_vertex_attrib_binding(ctx, vao,
VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex), true);
+ VERT_ATTRIB_GENERIC(bindingIndex));
}
@@ -2647,7 +2645,7 @@ _mesa_VertexAttribBinding_no_error(GLuint attribIndex, GLuint bindingIndex)
GET_CURRENT_CONTEXT(ctx);
_mesa_vertex_attrib_binding(ctx, ctx->Array.VAO,
VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex), true);
+ VERT_ATTRIB_GENERIC(bindingIndex));
}
@@ -2683,7 +2681,7 @@ _mesa_VertexArrayAttribBinding_no_error(GLuint vaobj, GLuint attribIndex,
struct gl_vertex_array_object *vao = _mesa_lookup_vao(ctx, vaobj);
_mesa_vertex_attrib_binding(ctx, vao,
VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex), true);
+ VERT_ATTRIB_GENERIC(bindingIndex));
}
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 1f01fdd5b1..a901bf9171 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -64,20 +64,20 @@ _mesa_update_array_format(struct gl_context *ctx,
extern void
_mesa_enable_vertex_array_attrib(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
- gl_vert_attrib attrib, bool flush_vertices);
+ gl_vert_attrib attrib);
extern void
_mesa_disable_vertex_array_attrib(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
- gl_vert_attrib attrib, bool flush_vertices);
+ gl_vert_attrib attrib);
extern void
_mesa_vertex_attrib_binding(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
gl_vert_attrib attribIndex,
- GLuint bindingIndex, bool flush_vertices);
+ GLuint bindingIndex);
extern void
@@ -85,7 +85,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
GLuint index,
struct gl_buffer_object *vbo,
- GLintptr offset, GLsizei stride, bool flush_vertices);
+ GLintptr offset, GLsizei stride);
extern void GLAPIENTRY
_mesa_VertexPointer_no_error(GLint size, GLenum type, GLsizei stride,
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index cf4718f8cb..13cc9a7f32 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -197,10 +197,10 @@ new_draw_rastpos_stage(struct gl_context *ctx, struct draw_context *draw)
rs->ctx = ctx;
rs->VAO = _mesa_new_vao(ctx, ~((GLuint)0));
- _mesa_vertex_attrib_binding(ctx, rs->VAO, VERT_ATTRIB_POS, 0, false);
+ _mesa_vertex_attrib_binding(ctx, rs->VAO, VERT_ATTRIB_POS, 0);
_mesa_update_array_format(ctx, rs->VAO, VERT_ATTRIB_POS, 4, GL_FLOAT,
GL_RGBA, GL_FALSE, GL_FALSE, GL_FALSE, 0);
- _mesa_enable_vertex_array_attrib(ctx, rs->VAO, 0, false);
+ _mesa_enable_vertex_array_attrib(ctx, rs->VAO, 0);
rs->prim.mode = GL_POINTS;
rs->prim.indexed = 0;
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index cc6aada861..ee2e31ab7a 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -202,7 +202,7 @@ _vbo_CreateContext(struct gl_context *ctx)
vbo->VAO = _mesa_new_vao(ctx, ~((GLuint)0));
/* The exec VAO assumes to have all arributes bound to binding 0 */
for (unsigned i = 0; i < VERT_ATTRIB_MAX; ++i)
- _mesa_vertex_attrib_binding(ctx, vbo->VAO, i, 0, false);
+ _mesa_vertex_attrib_binding(ctx, vbo->VAO, i, 0);
_math_init_eval();
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 31d7700225..342fbc6070 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -195,7 +195,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx)
GLbitfield mask = vao->_Enabled & ~vao_enabled;
while (mask) {
const int vao_attr = u_bit_scan(&mask);
- _mesa_disable_vertex_array_attrib(ctx, vao, vao_attr, false);
+ _mesa_disable_vertex_array_attrib(ctx, vao, vao_attr);
}
assert((~vao_enabled & vao->_Enabled) == 0);
@@ -203,7 +203,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx)
const GLuint stride = exec->vtx.vertex_size*sizeof(GLfloat);
assert(stride <= ctx->Const.MaxVertexAttribStride);
_mesa_bind_vertex_buffer(ctx, vao, 0, exec->vtx.bufferobj, buffer_offset,
- stride, false);
+ stride);
/* Retrieve the mapping from VBO_ATTRIB to VERT_ATTRIB space
* Note that the position/generic0 aliasing is done in the VAO.
@@ -225,7 +225,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx)
_vbo_set_attrib_format(ctx, vao, vao_attr, buffer_offset,
size, type, offset);
if ((vao->_Enabled & VERT_BIT(vao_attr)) == 0)
- _mesa_enable_vertex_array_attrib(ctx, vao, vao_attr, false);
+ _mesa_enable_vertex_array_attrib(ctx, vao, vao_attr);
/* The vao is initially created with all bindings set to 0. */
assert(vao->VertexAttrib[vao_attr].BufferBindingIndex == 0);
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 3b0c4b7751..945a0c8bff 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -499,7 +499,7 @@ update_vao(struct gl_context *ctx,
*/
/* Bind the buffer object at binding point 0 */
- _mesa_bind_vertex_buffer(ctx, *vao, 0, bo, buffer_offset, stride, false);
+ _mesa_bind_vertex_buffer(ctx, *vao, 0, bo, buffer_offset, stride);
/* Retrieve the mapping from VBO_ATTRIB to VERT_ATTRIB space
* Note that the position/generic0 aliasing is done in the VAO.
@@ -514,8 +514,8 @@ update_vao(struct gl_context *ctx,
_vbo_set_attrib_format(ctx, *vao, vao_attr, buffer_offset,
size[vbo_attr], type[vbo_attr], offset[vbo_attr]);
- _mesa_vertex_attrib_binding(ctx, *vao, vao_attr, 0, false);
- _mesa_enable_vertex_array_attrib(ctx, *vao, vao_attr, false);
+ _mesa_vertex_attrib_binding(ctx, *vao, vao_attr, 0);
+ _mesa_enable_vertex_array_attrib(ctx, *vao, vao_attr);
}
assert(vao_enabled == (*vao)->_Enabled);
assert((vao_enabled & ~(*vao)->VertexAttribBufferMask) == 0);
--
2.14.3
More information about the mesa-dev
mailing list