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 10:55:58 -0700
commit867555b1c9ef51fec23ce77c682cf7d5b5a23c5e (patch)
treede380cbb7f5553282b081dce9202cbe9e502ebe5 /src/mbgl/gl/upload_pass.hpp
parent1a9e93e8d5fc6fd027160b3126eab03d0809ca69 (diff)
downloadqtlocation-mapboxgl-upstream/gfx-refactor-7.tar.gz
[core] add gfx::UploadPass, split startRender into prepare and uploadupstream/gfx-refactor-7
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