31 const bool use_instancing)
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].size) * v_len;
51 const GLvoid *pointer = (
const GLubyte *)
intptr_t(offset + v_first * stride);
58 if (input ==
nullptr || input->
location == -1) {
62 enabled_attrib |= (1 << input->
location);
67 for (
int i = 0; i < a->
comp_len / 4; i++) {
68 glEnableVertexAttribArray(input->
location + i);
69 glVertexAttribDivisor(input->
location + i, divisor);
70 glVertexAttribPointer(
71 input->
location + i, 4, type, GL_FALSE, stride, (
const GLubyte *)pointer + i * 16);
75 glEnableVertexAttribArray(input->
location);
76 glVertexAttribDivisor(input->
location, divisor);
81 glVertexAttribPointer(input->
location, a->
comp_len, type, GL_FALSE, stride, pointer);
84 glVertexAttribPointer(input->
location, a->
comp_len, type, GL_TRUE, stride, pointer);
93 return enabled_attrib;
99 const int base_instance)
104 glBindVertexArray(vao);
123 if (
batch->resource_id_buf) {
125 int component_len = 1;
126 if (input ==
nullptr) {
128 input =
interface->attr_get(
"vertex_in_drw_ResourceID");
133 glEnableVertexAttribArray(input->
location);
134 glVertexAttribDivisor(input->
location, 1);
135 glVertexAttribIPointer(
137 attr_mask &= ~(1 << input->
location);
141 if (attr_mask != 0) {
143 if (attr_mask &
mask) {
148 glEnableVertexAttribArray(a);
149 glVertexAttribFormat(a, 4, GL_FLOAT, GL_FALSE, 0);
150 glVertexAttribBinding(a, a);