GLuint EnvMode; /* unit[0] only */
/** MESA_META_VERTEX */
- struct gl_array_object *ArrayObj;
+ struct gl_array_object *VAO;
struct gl_buffer_object *ArrayBufferObj;
/** MESA_META_VIEWPORT */
*/
struct blit_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
GLuint DepthFP;
GLuint ShaderProg;
*/
struct clear_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
GLuint ShaderProg;
GLint ColorLocation;
*/
struct copypix_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
};
*/
struct drawpix_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint StencilFP; /**< Fragment program for drawing stencil images */
GLuint DepthFP; /**< Fragment program for drawing depth images */
*/
struct bitmap_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
struct temp_texture Tex; /**< separate texture from other meta ops */
};
*/
struct gen_mipmap_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
GLuint FBO;
GLuint Sampler;
*/
struct decompress_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO, FBO, RBO, Sampler;
GLint Width, Height;
};
*/
struct drawtex_state
{
- GLuint ArrayObj;
+ GLuint VAO;
GLuint VBO;
};
if (state & MESA_META_VERTEX) {
/* save vertex array object state */
- _mesa_reference_array_object(ctx, &save->ArrayObj,
- ctx->Array.ArrayObj);
+ _mesa_reference_array_object(ctx, &save->VAO,
+ ctx->Array.VAO);
_mesa_reference_buffer_object(ctx, &save->ArrayBufferObj,
ctx->Array.ArrayBufferObj);
/* set some default state? */
_mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, NULL);
/* restore vertex array object */
- _mesa_BindVertexArray(save->ArrayObj->Name);
- _mesa_reference_array_object(ctx, &save->ArrayObj, NULL);
+ _mesa_BindVertexArray(save->VAO->Name);
+ _mesa_reference_array_object(ctx, &save->VAO, NULL);
}
if (state & MESA_META_VIEWPORT) {
};
struct vertex verts[4];
- if (blit->ArrayObj == 0) {
+ if (blit->VAO == 0) {
/* one-time setup */
/* create vertex array object */
- _mesa_GenVertexArrays(1, &blit->ArrayObj);
- _mesa_BindVertexArray(blit->ArrayObj);
+ _mesa_GenVertexArrays(1, &blit->VAO);
+ _mesa_BindVertexArray(blit->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &blit->VBO);
assert(_mesa_is_desktop_gl(ctx) || texture_2d);
/* Check if already initialized */
- if (blit->ArrayObj == 0) {
+ if (blit->VAO == 0) {
/* create vertex array object */
- _mesa_GenVertexArrays(1, &blit->ArrayObj);
- _mesa_BindVertexArray(blit->ArrayObj);
+ _mesa_GenVertexArrays(1, &blit->VAO);
+ _mesa_BindVertexArray(blit->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &blit->VBO);
setup_ff_blit_framebuffer(&ctx->Meta->Blit);
}
- _mesa_BindVertexArray(blit->ArrayObj);
+ _mesa_BindVertexArray(blit->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, blit->VBO);
_mesa_GenSamplers(1, &sampler);
setup_ff_blit_framebuffer(blit);
}
- _mesa_BindVertexArray(blit->ArrayObj);
+ _mesa_BindVertexArray(blit->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, blit->VBO);
/* Continue with "normal" approach which involves copying the src rect
static void
meta_glsl_blit_cleanup(struct blit_state *blit)
{
- if (blit->ArrayObj) {
- _mesa_DeleteVertexArrays(1, &blit->ArrayObj);
- blit->ArrayObj = 0;
+ if (blit->VAO) {
+ _mesa_DeleteVertexArrays(1, &blit->VAO);
+ blit->VAO = 0;
_mesa_DeleteBuffers(1, &blit->VBO);
blit->VBO = 0;
}
_mesa_meta_begin(ctx, metaSave);
- if (clear->ArrayObj == 0) {
+ if (clear->VAO == 0) {
/* one-time setup */
/* create vertex array object */
- _mesa_GenVertexArrays(1, &clear->ArrayObj);
- _mesa_BindVertexArray(clear->ArrayObj);
+ _mesa_GenVertexArrays(1, &clear->VAO);
+ _mesa_BindVertexArray(clear->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &clear->VBO);
_mesa_EnableClientState(GL_COLOR_ARRAY);
}
else {
- _mesa_BindVertexArray(clear->ArrayObj);
+ _mesa_BindVertexArray(clear->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, clear->VBO);
}
GLuint vs, gs = 0, fs;
bool has_integer_textures;
- if (clear->ArrayObj != 0)
+ if (clear->VAO != 0)
return;
/* create vertex array object */
- _mesa_GenVertexArrays(1, &clear->ArrayObj);
- _mesa_BindVertexArray(clear->ArrayObj);
+ _mesa_GenVertexArrays(1, &clear->VAO);
+ _mesa_BindVertexArray(clear->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &clear->VBO);
static void
meta_glsl_clear_cleanup(struct clear_state *clear)
{
- if (clear->ArrayObj == 0)
+ if (clear->VAO == 0)
return;
- _mesa_DeleteVertexArrays(1, &clear->ArrayObj);
- clear->ArrayObj = 0;
+ _mesa_DeleteVertexArrays(1, &clear->VAO);
+ clear->VAO = 0;
_mesa_DeleteBuffers(1, &clear->VBO);
clear->VBO = 0;
_mesa_DeleteObjectARB(clear->ShaderProg);
ctx->Color.ClearColor.f);
}
- _mesa_BindVertexArray(clear->ArrayObj);
+ _mesa_BindVertexArray(clear->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, clear->VBO);
/* GL_COLOR_BUFFER_BIT */
MESA_META_VERTEX |
MESA_META_VIEWPORT));
- if (copypix->ArrayObj == 0) {
+ if (copypix->VAO == 0) {
/* one-time setup */
/* create vertex array object */
- _mesa_GenVertexArrays(1, ©pix->ArrayObj);
- _mesa_BindVertexArray(copypix->ArrayObj);
+ _mesa_GenVertexArrays(1, ©pix->VAO);
+ _mesa_BindVertexArray(copypix->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, ©pix->VBO);
_mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY);
}
else {
- _mesa_BindVertexArray(copypix->ArrayObj);
+ _mesa_BindVertexArray(copypix->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, copypix->VBO);
}
static void
meta_drawpix_cleanup(struct drawpix_state *drawpix)
{
- if (drawpix->ArrayObj != 0) {
- _mesa_DeleteVertexArrays(1, &drawpix->ArrayObj);
- drawpix->ArrayObj = 0;
+ if (drawpix->VAO != 0) {
+ _mesa_DeleteVertexArrays(1, &drawpix->VAO);
+ drawpix->VAO = 0;
}
if (drawpix->StencilFP != 0) {
verts[3].t = tex->Ttop;
}
- if (drawpix->ArrayObj == 0) {
+ if (drawpix->VAO == 0) {
/* one-time setup: create vertex array object */
- _mesa_GenVertexArrays(1, &drawpix->ArrayObj);
+ _mesa_GenVertexArrays(1, &drawpix->VAO);
}
- _mesa_BindVertexArray(drawpix->ArrayObj);
+ _mesa_BindVertexArray(drawpix->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &vbo);
MESA_META_VERTEX |
MESA_META_VIEWPORT));
- if (bitmap->ArrayObj == 0) {
+ if (bitmap->VAO == 0) {
/* one-time setup */
/* create vertex array object */
- _mesa_GenVertexArrays(1, &bitmap->ArrayObj);
- _mesa_BindVertexArray(bitmap->ArrayObj);
+ _mesa_GenVertexArrays(1, &bitmap->VAO);
+ _mesa_BindVertexArray(bitmap->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &bitmap->VBO);
_mesa_EnableClientState(GL_COLOR_ARRAY);
}
else {
- _mesa_BindVertexArray(bitmap->ArrayObj);
+ _mesa_BindVertexArray(bitmap->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, bitmap->VBO);
}
GLfloat x, y, tex[3];
};
- if (mipmap->ArrayObj == 0) {
+ if (mipmap->VAO == 0) {
/* one-time setup */
/* create vertex array object */
- _mesa_GenVertexArrays(1, &mipmap->ArrayObj);
- _mesa_BindVertexArray(mipmap->ArrayObj);
+ _mesa_GenVertexArrays(1, &mipmap->VAO);
+ _mesa_BindVertexArray(mipmap->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &mipmap->VBO);
void *mem_ctx;
/* Check if already initialized */
- if (mipmap->ArrayObj == 0) {
+ if (mipmap->VAO == 0) {
/* create vertex array object */
- _mesa_GenVertexArrays(1, &mipmap->ArrayObj);
- _mesa_BindVertexArray(mipmap->ArrayObj);
+ _mesa_GenVertexArrays(1, &mipmap->VAO);
+ _mesa_BindVertexArray(mipmap->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &mipmap->VBO);
static void
meta_glsl_generate_mipmap_cleanup(struct gen_mipmap_state *mipmap)
{
- if (mipmap->ArrayObj == 0)
+ if (mipmap->VAO == 0)
return;
- _mesa_DeleteVertexArrays(1, &mipmap->ArrayObj);
- mipmap->ArrayObj = 0;
+ _mesa_DeleteVertexArrays(1, &mipmap->VAO);
+ mipmap->VAO = 0;
_mesa_DeleteBuffers(1, &mipmap->VBO);
mipmap->VBO = 0;
_mesa_set_enable(ctx, target, GL_TRUE);
}
- _mesa_BindVertexArray(mipmap->ArrayObj);
+ _mesa_BindVertexArray(mipmap->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, mipmap->VBO);
samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
_mesa_DeleteRenderbuffers(1, &decompress->RBO);
}
- if (decompress->ArrayObj != 0) {
- _mesa_DeleteVertexArrays(1, &decompress->ArrayObj);
+ if (decompress->VAO != 0) {
+ _mesa_DeleteVertexArrays(1, &decompress->VAO);
_mesa_DeleteBuffers(1, &decompress->VBO);
}
}
/* setup VBO data */
- if (decompress->ArrayObj == 0) {
+ if (decompress->VAO == 0) {
/* create vertex array object */
- _mesa_GenVertexArrays(1, &decompress->ArrayObj);
- _mesa_BindVertexArray(decompress->ArrayObj);
+ _mesa_GenVertexArrays(1, &decompress->VAO);
+ _mesa_BindVertexArray(decompress->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &decompress->VBO);
_mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY);
}
else {
- _mesa_BindVertexArray(decompress->ArrayObj);
+ _mesa_BindVertexArray(decompress->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, decompress->VBO);
}
MESA_META_VERTEX |
MESA_META_VIEWPORT));
- if (drawtex->ArrayObj == 0) {
+ if (drawtex->VAO == 0) {
/* one-time setup */
GLint active_texture;
/* create vertex array object */
- _mesa_GenVertexArrays(1, &drawtex->ArrayObj);
- _mesa_BindVertexArray(drawtex->ArrayObj);
+ _mesa_GenVertexArrays(1, &drawtex->VAO);
+ _mesa_BindVertexArray(drawtex->VAO);
/* create vertex array buffer */
_mesa_GenBuffers(1, &drawtex->VBO);
_mesa_ClientActiveTexture(GL_TEXTURE0 + active_texture);
}
else {
- _mesa_BindVertexArray(drawtex->ArrayObj);
+ _mesa_BindVertexArray(drawtex->VAO);
_mesa_BindBuffer(GL_ARRAY_BUFFER_ARB, drawtex->VBO);
}
static inline void
update_derived_client_arrays(struct gl_context *ctx)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
if (arrayObj->NewArrays) {
_mesa_update_array_object_client_arrays(ctx, arrayObj);
AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */
AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */
GLuint i;
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
actx->nr_vbos = 0;
case API_OPENGLES2:
/* For ES2, we can draw if any vertex array is enabled (and we
* should always have a vertex program/shader). */
- if (ctx->Array.ArrayObj->_Enabled == 0x0 || !ctx->VertexProgram._Current)
+ if (ctx->Array.VAO->_Enabled == 0x0 || !ctx->VertexProgram._Current)
return GL_FALSE;
break;
case API_OPENGLES:
/* For OpenGL ES, only draw if we have vertex positions
*/
- if (!ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled)
+ if (!ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Enabled)
return GL_FALSE;
break;
/* Draw if we have vertex positions (GL_VERTEX_ARRAY or generic
* array [0]).
*/
- return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled ||
- ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled);
+ return (ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Enabled ||
+ ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled);
}
}
break;
memset(&ib, 0, sizeof(ib));
ib.type = type;
ib.ptr = indices;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
vbo_get_minmax_indices(ctx, &prim, &ib, &min, &max, 1);
if ((int)(min + basevertex) < 0 ||
- max + basevertex >= ctx->Array.ArrayObj->_MaxElement) {
+ max + basevertex >= ctx->Array.VAO->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
_mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)",
- max, ctx->Array.ArrayObj->_MaxElement);
+ max, ctx->Array.VAO->_MaxElement);
return GL_FALSE;
}
return GL_FALSE;
/* Vertex buffer object tests */
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
/* use indices in the buffer object */
/* make sure count doesn't go outside buffer bounds */
- if (index_bytes(type, count) > ctx->Array.ArrayObj->ElementArrayBufferObj->Size) {
+ if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) {
_mesa_warning(ctx, "glDrawElements index out of buffer bounds");
return GL_FALSE;
}
return GL_FALSE;
/* Vertex buffer object tests */
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
/* 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.ArrayObj->ElementArrayBufferObj->Size) {
+ ctx->Array.VAO->ElementArrayBufferObj->Size) {
_mesa_warning(ctx,
"glMultiDrawElements index out of buffer bounds");
return GL_FALSE;
return GL_FALSE;
/* Vertex buffer object tests */
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
/* use indices in the buffer object */
/* make sure count doesn't go outside buffer bounds */
- if (index_bytes(type, count) > ctx->Array.ArrayObj->ElementArrayBufferObj->Size) {
+ if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) {
_mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds");
return GL_FALSE;
}
return GL_FALSE;
if (ctx->Const.CheckArrayBounds) {
- if (start + count > (GLint) ctx->Array.ArrayObj->_MaxElement)
+ if (start + count > (GLint) ctx->Array.VAO->_MaxElement)
return GL_FALSE;
}
return GL_FALSE;
if (ctx->Const.CheckArrayBounds) {
- if (first + count > (GLint) ctx->Array.ArrayObj->_MaxElement)
+ if (first + count > (GLint) ctx->Array.VAO->_MaxElement)
return GL_FALSE;
}
return GL_FALSE;
/* Vertex buffer object tests */
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
/* use indices in the buffer object */
/* make sure count doesn't go outside buffer bounds */
- if (index_bytes(type, count) > ctx->Array.ArrayObj->ElementArrayBufferObj->Size) {
+ if (index_bytes(type, count) > ctx->Array.VAO->ElementArrayBufferObj->Size) {
_mesa_warning(ctx,
"glDrawElementsInstanced index out of buffer bounds");
return GL_FALSE;
* If no element array buffer is bound, an INVALID_OPERATION error is
* generated.
*/
- if (!_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (!_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(no buffer bound to GL_ELEMENT_ARRAY_BUFFER)", name);
return GL_FALSE;
static void
bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
{
- struct gl_array_object * const oldObj = ctx->Array.ArrayObj;
+ struct gl_array_object * const oldObj = ctx->Array.VAO;
struct gl_array_object *newObj = NULL;
ASSERT(oldObj != NULL);
/* The spec says there is no array object named 0, but we use
* one internally because it simplifies things.
*/
- newObj = ctx->Array.DefaultArrayObj;
+ newObj = ctx->Array.DefaultVAO;
}
else {
/* non-default array object */
}
ctx->NewState |= _NEW_ARRAY;
- _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj);
+ _mesa_reference_array_object(ctx, &ctx->Array.VAO, newObj);
/* Pass BindVertexArray call to device driver */
if (ctx->Driver.BindArrayObject && newObj)
* for that object reverts to zero and the default vertex array
* becomes current."
*/
- if ( obj == ctx->Array.ArrayObj ) {
+ if ( obj == ctx->Array.VAO ) {
_mesa_BindVertexArray(0);
}
/* skip RebindArrays */
if (!vbo_deleted)
- copy_array_object(ctx, dest->ArrayObj, src->ArrayObj);
+ copy_array_object(ctx, dest->VAO, src->VAO);
/* skip ArrayBufferObj */
/* skip ElementArrayBufferObj */
{
/* Set the Name, needed for restore, but do never overwrite.
* Needs to match value in the object hash. */
- dest->ArrayObj->Name = src->ArrayObj->Name;
+ dest->VAO->Name = src->VAO->Name;
/* And copy all of the rest. */
copy_array_attrib(ctx, dest, src, false);
/* Just reference them here */
_mesa_reference_buffer_object(ctx, &dest->ArrayBufferObj,
src->ArrayBufferObj);
- _mesa_reference_buffer_object(ctx, &dest->ArrayObj->ElementArrayBufferObj,
- src->ArrayObj->ElementArrayBufferObj);
+ _mesa_reference_buffer_object(ctx, &dest->VAO->ElementArrayBufferObj,
+ src->VAO->ElementArrayBufferObj);
}
/**
* The semantics of objects created using APPLE_vertex_array_objects behave
* differently. These objects expect to be recreated by pop. Alas.
*/
- const bool arb_vao = (src->ArrayObj->Name != 0
- && src->ArrayObj->ARBsemantics);
+ const bool arb_vao = (src->VAO->Name != 0
+ && src->VAO->ARBsemantics);
- if (arb_vao && !_mesa_IsVertexArray(src->ArrayObj->Name))
+ if (arb_vao && !_mesa_IsVertexArray(src->VAO->Name))
return;
- _mesa_BindVertexArrayAPPLE(src->ArrayObj->Name);
+ _mesa_BindVertexArrayAPPLE(src->VAO->Name);
/* Restore or recreate the buffer objects by the names ... */
if (!arb_vao
}
if (!arb_vao
- || src->ArrayObj->ElementArrayBufferObj->Name == 0
- || _mesa_IsBuffer(src->ArrayObj->ElementArrayBufferObj->Name))
+ || src->VAO->ElementArrayBufferObj->Name == 0
+ || _mesa_IsBuffer(src->VAO->ElementArrayBufferObj->Name))
_mesa_BindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB,
- src->ArrayObj->ElementArrayBufferObj->Name);
+ src->VAO->ElementArrayBufferObj->Name);
}
/**
struct gl_array_attrib *attrib)
{
/* Get a non driver gl_array_object. */
- attrib->ArrayObj = CALLOC_STRUCT( gl_array_object );
+ attrib->VAO = CALLOC_STRUCT( gl_array_object );
- if (attrib->ArrayObj == NULL) {
+ if (attrib->VAO == NULL) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib");
return false;
}
- _mesa_initialize_array_object(ctx, attrib->ArrayObj, 0);
+ _mesa_initialize_array_object(ctx, attrib->VAO, 0);
return true;
}
{
/* We use a non driver array object, so don't just unref since we would
* end up using the drivers DeleteArrayObject function for deletion. */
- _mesa_delete_array_object(ctx, attrib->ArrayObj);
- attrib->ArrayObj = 0;
+ _mesa_delete_array_object(ctx, attrib->VAO);
+ attrib->VAO = 0;
_mesa_reference_buffer_object(ctx, &attrib->ArrayBufferObj, NULL);
}
case GL_ARRAY_BUFFER_ARB:
return &ctx->Array.ArrayBufferObj;
case GL_ELEMENT_ARRAY_BUFFER_ARB:
- return &ctx->Array.ArrayObj->ElementArrayBufferObj;
+ return &ctx->Array.VAO->ElementArrayBufferObj;
case GL_PIXEL_PACK_BUFFER_EXT:
return &ctx->Pack.BufferObj;
case GL_PIXEL_UNPACK_BUFFER_EXT:
#if 0
/* unfortunately, these tests are invalid during context tear-down */
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
- ASSERT(ctx->Array.ArrayObj->ElementArrayBufferObj != bufObj);
- ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj);
+ ASSERT(ctx->Array.VAO->ElementArrayBufferObj != bufObj);
+ ASSERT(ctx->Array.VAO->Vertex.BufferObj != bufObj);
#endif
ASSERT(ctx->Driver.DeleteBuffer);
for (i = 0; i < n; i++) {
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
if (bufObj) {
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
GLuint j;
ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
- _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, NULL);
- _mesa_reference_array_object(ctx, &ctx->Array.DefaultArrayObj, NULL);
+ _mesa_reference_array_object(ctx, &ctx->Array.VAO, NULL);
+ _mesa_reference_array_object(ctx, &ctx->Array.DefaultVAO, NULL);
_mesa_free_attrib_data(ctx);
_mesa_free_buffer_objects(ctx);
static void
client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
GLbitfield64 flag;
GLboolean *var;
case GL_VERTEX_ARRAY:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Enabled;
case GL_NORMAL_ARRAY:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
case GL_COLOR_ARRAY:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
case GL_INDEX_ARRAY:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->
+ return ctx->Array.VAO->
VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled;
case GL_TEXTURE_COORD_ARRAY:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->
+ return ctx->Array.VAO->
VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].Enabled;
case GL_EDGE_FLAG_ARRAY:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
case GL_FOG_COORDINATE_ARRAY_EXT:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
case GL_SECONDARY_COLOR_ARRAY_EXT:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
case GL_POINT_SIZE_ARRAY_OES:
if (ctx->API != API_OPENGLES)
goto invalid_enum_error;
- return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
+ return ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
if (ctx->Point._Attenuated)
key->point_attenuated = 1;
- if (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled)
+ if (ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled)
key->point_array = 1;
if (ctx->Texture._TexGenEnabled ||
case GL_TEXTURE_COORD_ARRAY_SIZE:
case GL_TEXTURE_COORD_ARRAY_TYPE:
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- array = &ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)];
+ array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)];
v->value_int = *(GLuint *) ((char *) array + d->offset);
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
buffer_obj = (struct gl_buffer_object **)
- ((char *) ctx->Array.ArrayObj + d->offset);
+ ((char *) ctx->Array.VAO + d->offset);
v->value_int = (*buffer_obj)->Name;
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
v->value_int =
- ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].BufferObj->Name;
+ ctx->Array.VAO->VertexBinding[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].BufferObj->Name;
break;
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- v->value_int = ctx->Array.ArrayObj->ElementArrayBufferObj->Name;
+ v->value_int = ctx->Array.VAO->ElementArrayBufferObj->Name;
break;
/* ARB_copy_buffer */
ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
break;
case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
- v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_POINT_SIZE].BufferObj->Name;
+ v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_POINT_SIZE].BufferObj->Name;
break;
case GL_FOG_COLOR:
*p = ((char *) ctx + d->offset);
return d;
case LOC_ARRAY:
- *p = ((char *) ctx->Array.ArrayObj + d->offset);
+ *p = ((char *) ctx->Array.VAO + d->offset);
return d;
case LOC_TEXUNIT:
unit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
goto invalid_enum;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
- v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
+ v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
return TYPE_INT;
case GL_VERTEX_BINDING_OFFSET:
goto invalid_enum;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
- v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
+ v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
return TYPE_INT;
case GL_VERTEX_BINDING_STRIDE:
goto invalid_enum;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
- v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
+ v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
/* ARB_shader_image_load_store */
case GL_IMAGE_BINDING_NAME: {
case GL_VERTEX_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POS].Ptr;
break;
case GL_NORMAL_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
break;
case GL_COLOR_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr;
break;
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr;
break;
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_FOG].Ptr;
break;
case GL_INDEX_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr;
break;
case GL_TEXTURE_COORD_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(clientUnit)].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_TEX(clientUnit)].Ptr;
break;
case GL_EDGE_FLAG_ARRAY_POINTER:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr;
break;
case GL_FEEDBACK_BUFFER_POINTER:
if (ctx->API != API_OPENGL_COMPAT)
case GL_POINT_SIZE_ARRAY_POINTER_OES:
if (ctx->API != API_OPENGLES)
goto invalid_pname;
- *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr;
+ *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr;
break;
case GL_DEBUG_CALLBACK_FUNCTION_ARB:
if (!_mesa_is_desktop_gl(ctx))
struct gl_array_attrib
{
/** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */
- struct gl_array_object *ArrayObj;
+ struct gl_array_object *VAO;
/** The default vertex array object */
- struct gl_array_object *DefaultArrayObj;
+ struct gl_array_object *DefaultVAO;
/** Array objects (GL_ARB/APPLE_vertex_array_object) */
struct _mesa_HashTable *Objects;
}
if (new_state & _NEW_ARRAY)
- _mesa_update_array_object_client_arrays(ctx, ctx->Array.ArrayObj);
+ _mesa_update_array_object_client_arrays(ctx, ctx->Array.VAO);
if (ctx->Const.CheckArrayBounds &&
new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) {
- _mesa_update_array_object_max_element(ctx, ctx->Array.ArrayObj);
+ _mesa_update_array_object_max_element(ctx, ctx->Array.VAO);
}
out:
new_state = ctx->NewState | new_prog_state;
ctx->NewState = 0;
ctx->Driver.UpdateState(ctx, new_state);
- ctx->Array.ArrayObj->NewArrays = 0x0;
+ ctx->Array.VAO->NewArrays = 0x0;
}
vertex_attrib_binding(struct gl_context *ctx, GLuint attribIndex,
GLuint bindingIndex)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
struct gl_vertex_attrib_array *array = &arrayObj->VertexAttrib[attribIndex];
if (array->VertexBinding != bindingIndex) {
struct gl_buffer_object *vbo,
GLintptr offset, GLsizei stride)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
struct gl_vertex_buffer_binding *binding = &arrayObj->VertexBinding[index];
if (binding->BufferObj != vbo ||
vertex_binding_divisor(struct gl_context *ctx, GLuint bindingIndex,
GLuint divisor)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
struct gl_vertex_buffer_binding *binding =
&arrayObj->VertexBinding[bindingIndex];
elementSize = _mesa_bytes_per_vertex_attrib(size, type);
assert(elementSize != -1);
- array = &ctx->Array.ArrayObj->VertexAttrib[attrib];
+ array = &ctx->Array.VAO->VertexAttrib[attrib];
array->Size = size;
array->Type = type;
array->Format = format;
array->RelativeOffset = relativeOffset;
array->_ElementSize = elementSize;
- ctx->Array.ArrayObj->NewArrays |= VERT_BIT(attrib);
+ ctx->Array.VAO->NewArrays |= VERT_BIT(attrib);
ctx->NewState |= _NEW_ARRAY;
return true;
* The check for VBOs is handled below.
*/
if (ctx->API == API_OPENGL_CORE
- && (ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj)) {
+ && (ctx->Array.VAO == ctx->Array.DefaultVAO)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(no array object bound)",
func);
return;
* to the ARRAY_BUFFER buffer object binding point (see section
* 2.9.6), and the pointer argument is not NULL."
*/
- if (ptr != NULL && ctx->Array.ArrayObj->ARBsemantics &&
+ if (ptr != NULL && ctx->Array.VAO->ARBsemantics &&
!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-VBO array)", func);
return;
vertex_attrib_binding(ctx, attrib, attrib);
/* The Stride and Ptr fields are not set by update_array_format() */
- array = &ctx->Array.ArrayObj->VertexAttrib[attrib];
+ array = &ctx->Array.VAO->VertexAttrib[attrib];
array->Stride = stride;
array->Ptr = (const GLvoid *) ptr;
return;
}
- arrayObj = ctx->Array.ArrayObj;
+ arrayObj = ctx->Array.VAO;
ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(arrayObj->_VertexAttrib));
return;
}
- arrayObj = ctx->Array.ArrayObj;
+ arrayObj = ctx->Array.VAO;
ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(arrayObj->_VertexAttrib));
get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
const char *caller)
{
- const struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ const struct gl_array_object *arrayObj = ctx->Array.VAO;
const struct gl_vertex_attrib_array *array;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
return NULL;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.ArrayObj->_VertexAttrib));
+ ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->_VertexAttrib));
FLUSH_CURRENT(ctx, 0);
return ctx->Current.Attrib[VERT_ATTRIB_GENERIC(index)];
return;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.ArrayObj->_VertexAttrib));
+ ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->_VertexAttrib));
- *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
+ *pointer = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
}
return;
}
- ASSERT(genericIndex < Elements(ctx->Array.ArrayObj->VertexAttrib));
+ ASSERT(genericIndex < Elements(ctx->Array.VAO->VertexAttrib));
/* The ARB_vertex_attrib_binding spec says:
*
GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
- const struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ const struct gl_array_object *arrayObj = ctx->Array.VAO;
struct gl_buffer_object *vbo;
ASSERT_OUTSIDE_BEGIN_END(ctx);
* is bound."
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBindVertexBuffer(No array object bound)");
return;
* - ..."
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexAttribFormat(No array object bound)");
return;
* - ..."
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexAttribIFormat(No array object bound)");
return;
* that this is an oversight.
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexAttribLFormat(No array object bound)");
return;
* is bound."
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexAttribBinding(No array object bound)");
return;
}
ASSERT(VERT_ATTRIB_GENERIC(attribIndex) <
- Elements(ctx->Array.ArrayObj->VertexAttrib));
+ Elements(ctx->Array.VAO->VertexAttrib));
vertex_attrib_binding(ctx, VERT_ATTRIB_GENERIC(attribIndex),
VERT_ATTRIB_GENERIC(bindingIndex));
* is bound."
*/
if (ctx->API == API_OPENGL_CORE &&
- ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj) {
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertexBindingDivisor(No array object bound)");
return;
void
_mesa_print_arrays(struct gl_context *ctx)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
GLuint i;
_mesa_update_array_object_max_element(ctx, arrayObj);
void
_mesa_init_varray(struct gl_context *ctx)
{
- ctx->Array.DefaultArrayObj = ctx->Driver.NewArrayObject(ctx, 0);
- _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj,
- ctx->Array.DefaultArrayObj);
+ ctx->Array.DefaultVAO = ctx->Driver.NewArrayObject(ctx, 0);
+ _mesa_reference_array_object(ctx, &ctx->Array.VAO,
+ ctx->Array.DefaultVAO);
ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */
ctx->Array.Objects = _mesa_NewHashTable();
check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
const void *elements, GLint basevertex)
{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
const void *elemMap;
GLint i, k;
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj)) {
elemMap = ctx->Driver.MapBufferRange(ctx, 0,
- ctx->Array.ArrayObj->ElementArrayBufferObj->Size,
+ ctx->Array.VAO->ElementArrayBufferObj->Size,
GL_MAP_READ_BIT,
- ctx->Array.ArrayObj->ElementArrayBufferObj);
+ ctx->Array.VAO->ElementArrayBufferObj);
elements = ADD_POINTERS(elements, elemMap);
}
}
if (_mesa_is_bufferobj(arrayObj->ElementArrayBufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, ctx->Array.ArrayObj->ElementArrayBufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Array.VAO->ElementArrayBufferObj);
}
for (k = 0; k < Elements(arrayObj->_VertexAttrib); k++) {
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ struct gl_array_object *arrayObj = ctx->Array.VAO;
int i;
printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
- struct gl_client_array *vertexAttrib = ctx->Array.ArrayObj->_VertexAttrib;
+ struct gl_client_array *vertexAttrib = ctx->Array.VAO->_VertexAttrib;
const struct gl_client_array **inputs = &exec->array.inputs[0];
GLbitfield64 const_inputs = 0x0;
GLuint i;
{
const GLvoid *map =
ctx->Driver.MapBufferRange(ctx, 0,
- ctx->Array.ArrayObj->ElementArrayBufferObj->Size,
+ ctx->Array.VAO->ElementArrayBufferObj->Size,
GL_MAP_READ_BIT,
- ctx->Array.ArrayObj->ElementArrayBufferObj);
+ ctx->Array.VAO->ElementArrayBufferObj);
switch (type) {
case GL_UNSIGNED_BYTE:
{
const GLubyte *us = (const GLubyte *) map;
GLint i;
- for (i = 0; i < ctx->Array.ArrayObj->ElementArrayBufferObj->Size; i++) {
+ for (i = 0; i < ctx->Array.VAO->ElementArrayBufferObj->Size; i++) {
printf("%02x ", us[i]);
if (i % 32 == 31)
printf("\n");
{
const GLushort *us = (const GLushort *) map;
GLint i;
- for (i = 0; i < ctx->Array.ArrayObj->ElementArrayBufferObj->Size / 2; i++) {
+ for (i = 0; i < ctx->Array.VAO->ElementArrayBufferObj->Size / 2; i++) {
printf("%04x ", us[i]);
if (i % 16 == 15)
printf("\n");
{
const GLuint *us = (const GLuint *) map;
GLint i;
- for (i = 0; i < ctx->Array.ArrayObj->ElementArrayBufferObj->Size / 4; i++) {
+ for (i = 0; i < ctx->Array.VAO->ElementArrayBufferObj->Size / 4; i++) {
printf("%08x ", us[i]);
if (i % 8 == 7)
printf("\n");
;
}
- ctx->Driver.UnmapBuffer(ctx, ctx->Array.ArrayObj->ElementArrayBufferObj);
+ ctx->Driver.UnmapBuffer(ctx, ctx->Array.VAO->ElementArrayBufferObj);
}
#endif
ib.count = count;
ib.type = type;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
ib.ptr = indices;
prim[0].begin = 1;
/* _MaxElement was computed, so we can use it.
* This path is used for drivers which need strict bounds checking.
*/
- max_element = ctx->Array.ArrayObj->_MaxElement;
+ max_element = ctx->Array.VAO->_MaxElement;
}
else {
/* Generally, hardware drivers don't need to know the buffer bounds
"(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
"base %d\n",
start, end, type, count,
- ctx->Array.ArrayObj->ElementArrayBufferObj->Name,
+ ctx->Array.VAO->ElementArrayBufferObj->Name,
basevertex);
}
* subranges of the index buffer as one large index buffer may lead to
* us reading unmapped memory.
*/
- if (!_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj))
+ if (!_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj))
fallback = GL_TRUE;
if (!fallback) {
ib.count = (max_index_ptr - min_index_ptr) / index_type_size;
ib.type = type;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
ib.ptr = (void *)min_index_ptr;
for (i = 0; i < primcount; i++) {
continue;
ib.count = count[i];
ib.type = type;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
ib.ptr = indices[i];
prim[0].begin = 1;
ib.count = 0; /* unknown */
ib.type = type;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
ib.ptr = NULL;
memset(prim, 0, sizeof(prim));
ib.count = 0; /* unknown */
ib.type = type;
- ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj;
+ ib.obj = ctx->Array.VAO->ElementArrayBufferObj;
ib.ptr = NULL;
prim[0].begin = 1;
_ae_map_vbos(ctx);
- if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj))
+ if (_mesa_is_bufferobj(ctx->Array.VAO->ElementArrayBufferObj))
indices =
- ADD_POINTERS(ctx->Array.ArrayObj->ElementArrayBufferObj->Pointer, indices);
+ ADD_POINTERS(ctx->Array.VAO->ElementArrayBufferObj->Pointer, indices);
vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK |
VBO_SAVE_PRIM_NO_CURRENT_UPDATE));