diff options
author | Kenneth Graunke <[email protected]> | 2014-02-01 19:46:45 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-02-03 00:53:11 -0800 |
commit | e1b1f2a687c219021f65219df59f412bc86daadd (patch) | |
tree | 099b769f2306382a38177a61b07236eea9d66973 /src/mesa/main/api_validate.c | |
parent | 0354e50798d9f199c3a47b71e8c0a284bba5e8e6 (diff) |
mesa: Rename ElementArrayBufferObj to IndexBufferObj.
DirectX and most hardware documentation use the term "Index Buffer" to
refer to a buffer containing indexes into arrays of vertex data, which
allows random access to vertex data, rather than sequential access.
OpenGL uses a different term for this concept: "Element Array Buffer".
However, "Index Buffer" has become much more widespread. A quick
Google search shows 29,300 hits for "Element Array Buffer" vs.
82,300 hits for "Index Buffer."
Arguably, "Index Buffer" is clearer: an "element of an array" (or list)
usually refers to an actual item stored in the array, not the index used
to refer to it.
The terminology is also already used in Mesa: some VBO module code for
dealing with ElementArrayBufferObj names local variables "ib".
Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
's/ElementArrayBufferObj/IndexBufferObj/g'
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r-- | src/mesa/main/api_validate.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 41dfc3806e5..af469e046fc 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -180,7 +180,7 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, memset(&ib, 0, sizeof(ib)); ib.type = type; ib.ptr = indices; - ib.obj = ctx->Array.VAO->ElementArrayBufferObj; + ib.obj = ctx->Array.VAO->IndexBufferObj; vbo_get_minmax_indices(ctx, &prim, &ib, &min, &max, 1); @@ -435,10 +435,10 @@ _mesa_validate_DrawElements(struct gl_context *ctx, return GL_FALSE; /* Vertex buffer object tests */ - if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) { + if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) { + if (index_bytes(type, count) > ctx->Array.VAO->IndexBufferObj->Size) { _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); return GL_FALSE; } @@ -493,12 +493,12 @@ _mesa_validate_MultiDrawElements(struct gl_context *ctx, return GL_FALSE; /* Vertex buffer object tests */ - if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) { + if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ for (i = 0; i < primcount; i++) { if (index_bytes(type, count[i]) > - ctx->Array.VAO->ElementArrayBufferObj->Size) { + ctx->Array.VAO->IndexBufferObj->Size) { _mesa_warning(ctx, "glMultiDrawElements index out of buffer bounds"); return GL_FALSE; @@ -570,10 +570,10 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, return GL_FALSE; /* Vertex buffer object tests */ - if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) { + if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) { + if (index_bytes(type, count) > ctx->Array.VAO->IndexBufferObj->Size) { _mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds"); return GL_FALSE; } @@ -769,10 +769,10 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, return GL_FALSE; /* Vertex buffer object tests */ - if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) { + if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) { + if (index_bytes(type, count) > ctx->Array.VAO->IndexBufferObj->Size) { _mesa_warning(ctx, "glDrawElementsInstanced index out of buffer bounds"); return GL_FALSE; @@ -901,7 +901,7 @@ valid_draw_indirect_elements(struct gl_context *ctx, * If no element array buffer is bound, an INVALID_OPERATION error is * generated. */ - if (!_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) { + if (!_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s(no buffer bound to GL_ELEMENT_ARRAY_BUFFER)", name); return GL_FALSE; |