| 130 | } |
| 131 | |
| 132 | void 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 | |
| 158 | void VertexArrayBuffer::Render(ref_ptr<GraphicsContext> context, bool drawAsLine) |
| 159 | { |
nothing calls this directly
no test coverage detected