42void GLUniformBuf::init()
46 glGenBuffers(1, &ubo_id_);
47 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
48 glBufferData(GL_UNIFORM_BUFFER,
size_in_bytes_,
nullptr, GL_DYNAMIC_DRAW);
58 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
60 glBindBuffer(GL_UNIFORM_BUFFER, 0);
74 glClearNamedBufferData(ubo_id_,
82 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
83 glClearBufferData(GL_UNIFORM_BUFFER,
88 glBindBuffer(GL_UNIFORM_BUFFER, 0);
103 "Error: Trying to bind \"%s\" ubo to slot %d which is above the reported limit of %d.\n",
114 if (
data_ !=
nullptr) {
120 glBindBufferBase(GL_UNIFORM_BUFFER, slot_, ubo_id_);
133 if (
data_ !=
nullptr) {
138 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, slot, ubo_id_);
149 glBindBufferBase(GL_UNIFORM_BUFFER, slot_, 0);
size_t GPU_max_uniform_buffer_size()
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
uint16_t bound_ssbo_slots
static void buffer_free(GLuint buf_id)
static GLint max_ubo_binds
static bool direct_state_access_support
void object_label(GLenum type, GLuint object, const char *name)
GLenum to_gl_internal_format(TextureFormat format)
GLenum to_gl_data_format(TextureFormat format)
static GLenum to_gl(const GPUAttachmentType type)