31 const bool use_instancing)
34 const uint attr_len = format->attr_len;
35 uint stride = format->stride;
37 GLuint divisor = (use_instancing) ? 1 : 0;
39 for (
uint a_idx = 0; a_idx < attr_len; a_idx++) {
42 if (format->deinterleaved) {
43 offset += ((a_idx == 0) ? 0 : format->attrs[a_idx - 1].type.size()) * v_len;
51 const GLvoid *pointer =
reinterpret_cast<const GLubyte *
>(
intptr_t(offset + v_first * stride));
58 if (input ==
nullptr || input->
location == -1) {
62 enabled_attrib |= (1 << input->
location);
64 glEnableVertexAttribArray(input->
location);
65 glVertexAttribDivisor(input->
location, divisor);
70 glVertexAttribPointer(
79 return enabled_attrib;
89 glBindVertexArray(vao);
92 for (
int v = GPU_BATCH_VBO_MAX_LEN - 1;
v > -1;
v--) {
100 if (attr_mask != 0) {
102 if (attr_mask &
mask) {
107 glEnableVertexAttribArray(a);
108 glVertexAttribFormat(a, 4, GL_FLOAT, GL_FALSE, 0);
109 glVertexAttribBinding(a, a);
116 static_cast<GLIndexBuf *
>(batch->elem)->bind();