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

Method UploadData

libs/drape/gpu_buffer.cpp:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void GPUBuffer::UploadData(void const * data, uint32_t elementCount)
61{
62 ASSERT(!m_isMapped, ());
63
64 uint32_t currentSize = GetCurrentSize();
65 uint8_t elementSize = GetElementSize();
66 ASSERT(GetCapacity() >= elementCount + currentSize, ("Not enough memory to upload ", elementCount, " elements"));
67 Bind();
68
69#if defined(CHECK_VBO_BOUNDS)
70 int32_t size = GLFunctions::glGetBufferParameter(glTarget(m_t), gl_const::GLBufferSize);
71 ASSERT_EQUAL(GetCapacity() * elementSize, size, ());
72 ASSERT_LESS_OR_EQUAL((elementCount + currentSize) * elementSize, size, ());
73#endif
74
75 GLFunctions::glBufferSubData(glTarget(m_t), elementCount * elementSize, data, currentSize * elementSize);
76 TBase::UploadData(elementCount);
77
78#if defined(TRACK_GPU_MEM)
79 dp::GPUMemTracker::Inst().SetUsed("VBO", m_bufferID, (currentSize + elementCount) * elementSize);
80#endif
81}
82
83void GPUBuffer::Bind()
84{

Callers

nothing calls this directly

Calls 3

ASSERTFunction · 0.85
glTargetFunction · 0.85
SetUsedMethod · 0.80

Tested by

no test coverage detected