summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/upload_pass.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-05-13 17:13:31 -0700
committerKonstantin Käfer <mail@kkaefer.com>2019-05-15 11:57:43 -0700
commit3a6ff7710fcf201f82ddc2090488ef585bd8ab17 (patch)
treede380cbb7f5553282b081dce9202cbe9e502ebe5 /src/mbgl/gl/upload_pass.hpp
parentbf0998697e0893d8a56421a139c7fc4855e89fa5 (diff)
downloadqtlocation-mapboxgl-3a6ff7710fcf201f82ddc2090488ef585bd8ab17.tar.gz
[core] add gfx::UploadPass, split startRender into prepare and upload
Diffstat (limited to 'src/mbgl/gl/upload_pass.hpp')
-rw-r--r--src/mbgl/gl/upload_pass.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mbgl/gl/upload_pass.hpp b/src/mbgl/gl/upload_pass.hpp
new file mode 100644
index 0000000000..8b4f71b88d
--- /dev/null
+++ b/src/mbgl/gl/upload_pass.hpp
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <mbgl/gfx/upload_pass.hpp>
+
+namespace mbgl {
+namespace gfx {
+
+class CommandEncoder;
+
+} // namespace gfx
+
+namespace gl {
+
+class CommandEncoder;
+class Context;
+
+class UploadPass final : public gfx::UploadPass {
+public:
+ UploadPass(gl::CommandEncoder&, const char* name);
+
+private:
+ void pushDebugGroup(const char* name) override;
+ void popDebugGroup() override;
+
+public:
+ std::unique_ptr<gfx::VertexBufferResource> createVertexBufferResource(const void* data, std::size_t size, const gfx::BufferUsageType) override;
+ void updateVertexBufferResource(gfx::VertexBufferResource&, const void* data, std::size_t size) override;
+ std::unique_ptr<gfx::IndexBufferResource> createIndexBufferResource(const void* data, std::size_t size, const gfx::BufferUsageType) override;
+ void updateIndexBufferResource(gfx::IndexBufferResource&, const void* data, std::size_t size) override;
+
+public:
+ std::unique_ptr<gfx::TextureResource> createTextureResource(Size, const void* data, gfx::TexturePixelType, gfx::TextureChannelDataType) override;
+ void updateTextureResource(gfx::TextureResource&, Size, const void* data, gfx::TexturePixelType, gfx::TextureChannelDataType) override;
+ void updateTextureResourceSub(gfx::TextureResource&, const uint16_t xOffset, const uint16_t yOffset, Size, const void* data, gfx::TexturePixelType, gfx::TextureChannelDataType) override;
+
+private:
+ gl::CommandEncoder& commandEncoder;
+ const gfx::DebugGroup<gfx::CommandEncoder> debugGroup;
+};
+
+} // namespace gl
+} // namespace mbgl