#include "vbo/vbo_attrib.h"
#include "vbo/vbo_exec.h"
#include "vbo/vbo_save.h"
-#include "main/mtypes.h"
#include "main/varray.h"
struct vbo_context {
- struct gl_vertex_array currval[VBO_ATTRIB_MAX];
- /* The array of inputs used for _DrawVAO draws. */
- struct vbo_inputs draw_arrays;
+ struct gl_vertex_buffer_binding binding;
+ struct gl_array_attributes current[VBO_ATTRIB_MAX];
struct gl_vertex_array_object *VAO;
struct vbo_exec_context exec;
struct vbo_save_context save;
-
- /* Callback into the driver. This must always succeed, the driver
- * is responsible for initiating any fallback actions required:
- */
- vbo_draw_func draw_prims;
-
- /* Optional callback for indirect draws. This allows multidraws to not be
- * broken up, as well as for the actual count to be passed in as a separate
- * indirect parameter.
- */
- vbo_indirect_draw_func draw_indirect_prims;
};
}
+static inline const struct vbo_context *
+vbo_context_const(const struct gl_context *ctx)
+{
+ return ctx->vbo_context;
+}
+
+
/**
* Array to apply the fixed function material aliasing map to
* an attribute value used in vbo processing inputs to an attribute
case GL_FLOAT:
case GL_INT:
case GL_UNSIGNED_INT:
- case GL_UNSIGNED_INT64_ARB:
return GL_FALSE;
+ case GL_UNSIGNED_INT64_ARB:
case GL_DOUBLE:
return GL_TRUE;
default:
{
const GLboolean integer = vbo_attrtype_to_integer_flag(type);
const GLboolean doubles = vbo_attrtype_to_double_flag(type);
+
+ if (doubles)
+ size /= 2;
_mesa_update_array_format(ctx, vao, attr, size, type, GL_RGBA,
GL_FALSE, integer, doubles, offset);
- /* Ptr for userspace arrays */
+ /* Ptr for userspace arrays.
+ * For updating the pointer we would need to add the vao->NewArrays flag
+ * to the VAO. But but that is done already unconditionally in
+ * _mesa_update_array_format called above.
+ */
+ assert((vao->NewArrays | ~vao->_Enabled) & VERT_BIT(attr));
vao->VertexAttrib[attr].Ptr = ADD_POINTERS(buffer_offset, offset);
}