MCPcopy Create free account
hub / github.com/comaps/comaps / Resize

Method Resize

libs/drape/gpu_buffer.cpp:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void GPUBuffer::Resize(void const * data, uint32_t elementCount)
149{
150 TBase::Resize(elementCount);
151 Bind();
152 GLFunctions::glBufferData(glTarget(m_t), GetCapacity() * GetElementSize(), data, gl_const::GLDynamicDraw);
153
154 // If we have set up data already (in glBufferData), we have to call SetDataSize.
155 if (data != nullptr)
156 SetDataSize(elementCount);
157
158#if defined(TRACK_GPU_MEM)
159 dp::GPUMemTracker & memTracker = dp::GPUMemTracker::Inst();
160 memTracker.RemoveDeallocated("VBO", m_bufferID);
161 auto const sizeInBytes = GetCapacity() * GetElementSize();
162 memTracker.AddAllocated("VBO", m_bufferID, sizeInBytes);
163 memTracker.TrackAverageAllocation(m_batcherHash, sizeInBytes);
164 if (data != nullptr)
165 dp::GPUMemTracker::Inst().SetUsed("VBO", m_bufferID, GetCurrentSize() * GetElementSize());
166#endif
167}
168} // namespace dp

Callers 6

mainFunction · 0.45
GetIndexStorageMethod · 0.45
IndexBufferMutatorMethod · 0.45
AppendIndexesMethod · 0.45
IndexStorageMethod · 0.45
OnSizeMethod · 0.45

Calls 5

glTargetFunction · 0.85
RemoveDeallocatedMethod · 0.80
AddAllocatedMethod · 0.80
SetUsedMethod · 0.80

Tested by

no test coverage detected