31 const bool use_instancing)
33 uint16_t enabled_attrib = 0;
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 = (
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(
74 glVertexAttribIPointer(
input->location, a->
type.
comp_len(), type, stride, pointer);
79 return enabled_attrib;
87 uint16_t attr_mask =
interface->enabled_attr_mask_;
89 glBindVertexArray(vao);
100 if (attr_mask != 0) {
101 for (uint16_t
mask = 1, a = 0; a < 16; a++,
mask <<= 1) {
102 if (attr_mask &
mask) {
107 glEnableVertexAttribArray(a);
108 glVertexAttribFormat(a, 4, GL_FLOAT, GL_FALSE, 0);
109 glVertexAttribBinding(a, a);
125 glBindVertexArray(vao);
static constexpr int GPU_BATCH_VBO_MAX_LEN
ATTR_WARN_UNUSED_RESULT const BMVert * v
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void update_bindings(const GLuint vao, const Batch *batch, const ShaderInterface *interface)
static uint16_t vbo_bind(const ShaderInterface *interface, const GPUVertFormat *format, uint v_first, uint v_len, const bool use_instancing)
static GLenum to_gl(const GPUAttachmentType type)
GPUVertFetchMode fetch_mode() const
GPUVertCompType comp_type() const
struct GPUVertAttr::Type type