40void GLUniformBuf::init()
44 glGenBuffers(1, &ubo_id_);
45 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
46 glBufferData(GL_UNIFORM_BUFFER,
size_in_bytes_,
nullptr, GL_DYNAMIC_DRAW);
56 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
58 glBindBuffer(GL_UNIFORM_BUFFER, 0);
72 glClearNamedBufferData(ubo_id_,
80 glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_);
81 glClearBufferData(GL_UNIFORM_BUFFER,
86 glBindBuffer(GL_UNIFORM_BUFFER, 0);
101 "Error: Trying to bind \"%s\" ubo to slot %d which is above the reported limit of %d.\n",
112 if (
data_ !=
nullptr) {
118 glBindBufferBase(GL_UNIFORM_BUFFER, slot_, ubo_id_);
131 if (
data_ !=
nullptr) {
136 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, slot, ubo_id_);
147 glBindBufferBase(GL_UNIFORM_BUFFER, slot_, 0);
static void buf_free(GLuint buf_id)
uint16_t bound_ssbo_slots
static GLint max_ubo_binds
static GLint max_ubo_size
static bool direct_state_access_support
SHADOW_TILEMAP_RES tiles_buf[] statistics_buf render_view_buf[SHADOW_VIEW_MAX] GPU_R32UI
void object_label(GLenum type, GLuint object, const char *name)
GLenum to_gl_internal_format(eGPUTextureFormat format)
GLenum to_gl_data_format(eGPUTextureFormat format)
static GLenum to_gl(const GPUAttachmentType type)