summaryrefslogtreecommitdiff
path: root/src/mbgl/gfx/context.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gfx/context.hpp')
-rw-r--r--src/mbgl/gfx/context.hpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mbgl/gfx/context.hpp b/src/mbgl/gfx/context.hpp
index 118df30a26..53cd318642 100644
--- a/src/mbgl/gfx/context.hpp
+++ b/src/mbgl/gfx/context.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include <mbgl/gfx/backend.hpp>
#include <mbgl/gfx/renderbuffer.hpp>
#include <mbgl/gfx/command_encoder.hpp>
#include <mbgl/gfx/draw_scope.hpp>
@@ -17,12 +18,11 @@ class OffscreenTexture;
class Context {
protected:
- Context(ContextType type_, uint32_t maximumVertexBindingCount_)
- : backend(type_), maximumVertexBindingCount(maximumVertexBindingCount_) {
+ Context(uint32_t maximumVertexBindingCount_)
+ : maximumVertexBindingCount(maximumVertexBindingCount_) {
}
public:
- const ContextType backend;
static constexpr const uint32_t minimumRequiredVertexBindingCount = 8;
const uint32_t maximumVertexBindingCount;
bool supportsHalfFloatTextures = false;
@@ -80,11 +80,9 @@ protected:
public:
template <typename Name>
- std::unique_ptr<Program<Name>> createProgram(const ProgramParameters&);
-
-private:
- template <typename Backend, typename Name>
- std::unique_ptr<Program<Name>> createProgram(const ProgramParameters&);
+ std::unique_ptr<Program<Name>> createProgram(const ProgramParameters& programParameters) {
+ return Backend::Create<Program<Name>, const ProgramParameters&>(programParameters);
+ }
public:
virtual std::unique_ptr<CommandEncoder> createCommandEncoder() = 0;