0

I have the following opengl code to bind a created buffer (I print out whenever it could be deleted), and fill it with some data.

ubo_light_block.bind();
ubo_light_block.buffer_data(size_bytes(), GL_DYNAMIC_DRAW);
ubo_light_block.unbind();

ubo_light_block.bind_buffer_range(static_cast<size_t>(0), static_cast<size_t>(0), size_bytes());

ubo_light_block.bind();

int buf;
int size;
glGetIntegerv(GL_UNIFORM_BUFFER_BINDING, &buf);
glGetBufferParameteriv(GL_UNIFORM_BUFFER, GL_BUFFER_SIZE, &size);
std::cout << size_bytes() << std::endl;
std::cout << data() << std::endl;
std::cout << buf << std::endl;
std::cout << size << std::endl;

glNamedBufferSubData(53, 0, 12800, data());

the output is:

12800
00000083222FD0C0
53
12800

And I am consistently getting "Exception thrown at 0x0000000000000000 in main.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

I don’t quite understand why? The buffer seems to be bound, my input data isn’t a nullptr, and the sizes match up? Any help or debugging suggestions appreciated.

Anonymous Asked question May 14, 2021