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

Method PreflushImpl

libs/drape/vertex_array_buffer.cpp:132–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void VertexArrayBuffer::PreflushImpl(ref_ptr<GraphicsContext> context)
133{
134 ASSERT(!m_isPreflushed, ());
135
136 // Buffers are ready, so moving them from CPU to GPU.
137 for (auto & buffer : m_staticBuffers)
138 buffer.second->MoveToGPU(context, GPUBuffer::ElementBuffer, m_batcherHash);
139
140 for (auto & buffer : m_dynamicBuffers)
141 buffer.second->MoveToGPU(context, GPUBuffer::ElementBuffer, m_batcherHash);
142
143 ASSERT(m_indexBuffer != nullptr, ());
144 m_indexBuffer->MoveToGPU(context, GPUBuffer::IndexBuffer, m_batcherHash);
145
146 // Preflush can be called on BR, where impl is not initialized.
147 // For Metal rendering this code has no meaning.
148 auto const apiVersion = context->GetApiVersion();
149 if (apiVersion == dp::ApiVersion::OpenGLES3)
150 {
151 GLFunctions::glBindBuffer(0, gl_const::GLElementArrayBuffer);
152 GLFunctions::glBindBuffer(0, gl_const::GLArrayBuffer);
153 }
154
155 m_isPreflushed = true;
156}
157
158void VertexArrayBuffer::Render(ref_ptr<GraphicsContext> context, bool drawAsLine)
159{

Callers

nothing calls this directly

Calls 3

ASSERTFunction · 0.85
MoveToGPUMethod · 0.80
GetApiVersionMethod · 0.45

Tested by

no test coverage detected