X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=pbo_frame_allocator.cpp;h=c8687025e2f2f1d5dc0d193a07035b01e272f970;hp=ea17f1259fde4076320c9ebdb37da6c714a6c5f3;hb=817fffe1ef3bd87f2387395f49487cf5255d8daf;hpb=330ca2f0052b06d91004c6ceb73cd57ab95e7fe1 diff --git a/pbo_frame_allocator.cpp b/pbo_frame_allocator.cpp index ea17f12..c868702 100644 --- a/pbo_frame_allocator.cpp +++ b/pbo_frame_allocator.cpp @@ -52,6 +52,7 @@ void PBOFrameAllocator::init_frame(size_t frame_idx, size_t frame_size, GLuint w Frame frame; frame.data = (uint8_t *)glMapBufferRange(buffer, 0, frame_size, permissions | map_bits | GL_MAP_PERSISTENT_BIT); frame.data2 = frame.data + frame_size / 2; + frame.data_copy = new uint8_t[frame_size]; check_error(); frame.size = frame_size; frame.userdata = &userdata[frame_idx]; @@ -214,6 +215,8 @@ PBOFrameAllocator::~PBOFrameAllocator() void PBOFrameAllocator::destroy_frame(Frame *frame) { + delete[] frame->data_copy; + GLuint pbo = ((Userdata *)frame->userdata)->pbo; glBindBuffer(buffer, pbo); check_error();