#include "main/bufferobj.h"
#include "main/context.h"
#include "main/imports.h"
-#include "main/mtypes.h"
#include "main/macros.h"
#include "main/light.h"
#include "main/state.h"
{
struct vbo_context *vbo = vbo_context(ctx);
- mask &= vao->_Enabled;
+ mask &= vao->Enabled;
while (mask) {
const int i = u_bit_scan(&mask);
const struct gl_array_attributes *attrib = &vao->VertexAttrib[i];
- struct gl_vertex_array *currval = &vbo->currval[shift + i];
- const GLubyte size = attrib->Size;
- const GLenum16 type = attrib->Type;
- fi_type tmp[4];
-
- COPY_CLEAN_4V_TYPE_AS_UNION(tmp, size, *data, type);
+ struct gl_array_attributes *currval = &vbo->current[shift + i];
+ const GLubyte size = attrib->Format.Size;
+ const GLenum16 type = attrib->Format.Type;
+ fi_type tmp[8];
+ int dmul = 1;
+
+ if (type == GL_DOUBLE ||
+ type == GL_UNSIGNED_INT64_ARB)
+ dmul = 2;
+
+ if (dmul == 2)
+ memcpy(tmp, *data, size * dmul * sizeof(GLfloat));
+ else
+ COPY_CLEAN_4V_TYPE_AS_UNION(tmp, size, *data, type);
- if (type != currval->Type ||
- memcmp(currval->Ptr, tmp, 4 * sizeof(GLfloat)) != 0) {
- memcpy((fi_type*)currval->Ptr, tmp, 4 * sizeof(GLfloat));
+ if (type != currval->Format.Type ||
+ memcmp(currval->Ptr, tmp, 4 * sizeof(GLfloat) * dmul) != 0) {
+ memcpy((fi_type*)currval->Ptr, tmp, 4 * sizeof(GLfloat) * dmul);
- currval->Size = size;
- currval->_ElementSize = size * sizeof(GLfloat);
- currval->Type = type;
- currval->Integer = vbo_attrtype_to_integer_flag(type);
- currval->Doubles = vbo_attrtype_to_double_flag(type);
- currval->Normalized = GL_FALSE;
- currval->Format = GL_RGBA;
+ vbo_set_vertex_format(&currval->Format, size, type);
ctx->NewState |= state;
}
remap_vertex_store = GL_TRUE;
}
- FLUSH_CURRENT(ctx, 0);
+ FLUSH_FOR_DRAW(ctx);
if (node->prim_count > 0) {
return;
}
- /* Finally update the inputs array */
- _vbo_update_inputs(ctx, &vbo->draw_arrays);
- _mesa_set_drawing_arrays(ctx, vbo->draw_arrays.inputs);
-
assert(ctx->NewState == 0);
if (node->vertex_count > 0) {
GLuint min_index = _vbo_save_get_min_index(node);
GLuint max_index = _vbo_save_get_max_index(node);
- vbo->draw_prims(ctx,
- node->prims,
- node->prim_count,
- NULL,
- GL_TRUE,
- min_index, max_index,
- NULL, 0, NULL);
+ ctx->Driver.Draw(ctx, node->prims, node->prim_count, NULL, GL_TRUE,
+ min_index, max_index, NULL, 0, NULL);
}
}